lkml.org 
[lkml]   [2015]   [May]   [6]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: Question about the function,ni_stc_dma_channel_select_bitfield
On 06/05/15 01:22, nick wrote:
> Greetings All,
> I am wondering if in the function,ni_stc_dma_channel_select_bitfield the line:
> return 1 << channel;
> is guaranteed to be below the threshold that guarantees us to not overflow on
> a unsigned 32 integer due to bit wise shifting to the left.
> Thanks Nick
>

if (channel < 4)
return 1 << channel;

So, yes.

--
-=( Ian Abbott @ MEV Ltd. E-mail: <abbotti@mev.co.uk> )=-
-=( Web: http://www.mev.co.uk/ )=-


\
 
 \ /
  Last update: 2015-05-06 11:21    [W:0.255 / U:0.012 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site