From: Ian Abbott <abbotti@mev.co.uk>
To: nick <xerofoify@gmail.com>
Cc: hsweeten@visionengravers.com, gregkh@linuxfoundation.org,
chase.southwood@gmail.com, ebru.akagunduz@gmail.com,
devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org
Subject: Re: Question about the function,ni_stc_dma_channel_select_bitfield
Date: Wed, 06 May 2015 10:10:51 +0100 [thread overview]
Message-ID: <5549DA9B.6030700@mev.co.uk> (raw)
In-Reply-To: <55495EA8.2090902@gmail.com>
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/ )=-
next parent reply other threads:[~2015-05-06 9:10 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <55495EA8.2090902@gmail.com>
2015-05-06 9:10 ` Ian Abbott [this message]
[not found] ` <554A1FC3.3000409@gmail.com>
2015-05-06 15:45 ` Question about the function,ni_stc_dma_channel_select_bitfield Hartley Sweeten
2015-05-06 19:09 ` Greg KH
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=5549DA9B.6030700@mev.co.uk \
--to=abbotti@mev.co.uk \
--cc=chase.southwood@gmail.com \
--cc=devel@driverdev.osuosl.org \
--cc=ebru.akagunduz@gmail.com \
--cc=gregkh@linuxfoundation.org \
--cc=hsweeten@visionengravers.com \
--cc=linux-kernel@vger.kernel.org \
--cc=xerofoify@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox