lkml.org 
[lkml]   [2014]   [Jul]   [1]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 6/6] thermal: Add Tegra SOCTHERM thermal management driver
On 27/06/14 11:11, Mikko Perttunen wrote:
> + /* Sign extend from 6 bits to 32 bits */
> + shifted_cp = (s32)((val & 0x1f) | ((val & 0x20) ? 0xffffffe0 : 0x0));
> + val = ((val & (0x1f << 21)) >> 21);
> + /* Sign extend from 5 bits to 32 bits */
> + shifted_ft = (s32)((val & 0xf) | ((val & 0x10) ? 0xfffffff0 : 0x0));

There's sign_extend32 in bitops.h


\
 
 \ /
  Last update: 2014-07-02 02:21    [W:0.098 / U:0.756 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site