From: Ian Abbott <abbotti@mev.co.uk>
To: Geliang Tang <geliangtang@163.com>,
hsweeten@visionengravers.com, gregkh@linuxfoundation.org
Cc: devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] staging: comedi: fix sparse warning in ni_mio_common.c
Date: Sat, 20 Jun 2015 13:44:31 +0100 [thread overview]
Message-ID: <5585602F.60808@mev.co.uk> (raw)
In-Reply-To: <1434818854-19017-1-git-send-email-geliangtang@163.com>
On 20/06/15 17:47, Geliang Tang wrote:
> This patch fixes the following sparse warning:
>
> drivers/staging/comedi/drivers/ni_mio_common.c:573:26: warning: shift
> too big (4294967295) for type int
>
> Signed-off-by: Geliang Tang <geliangtang@163.com>
> ---
> drivers/staging/comedi/drivers/ni_mio_common.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/staging/comedi/drivers/ni_mio_common.c b/drivers/staging/comedi/drivers/ni_mio_common.c
> index 6cc304a..420f752 100644
> --- a/drivers/staging/comedi/drivers/ni_mio_common.c
> +++ b/drivers/staging/comedi/drivers/ni_mio_common.c
> @@ -570,7 +570,7 @@ static inline void ni_set_bitfield(struct comedi_device *dev, int reg,
> static inline unsigned ni_stc_dma_channel_select_bitfield(unsigned channel)
> {
> if (channel < 4)
> - return 1 << channel;
> + return 1 << (channel & 0x03);
> if (channel == 4)
> return 0x3;
> if (channel == 5)
>
Surely that's a false positive sparse warning?
--
-=( Ian Abbott @ MEV Ltd. E-mail: <abbotti@mev.co.uk> )=-
-=( Web: http://www.mev.co.uk/ )=-
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
Please read the FAQ at http://www.tux.org/lkml/
next prev parent reply other threads:[~2015-06-20 12:44 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-06-20 16:47 [PATCH] staging: comedi: fix sparse warning in ni_mio_common.c Geliang Tang
2015-06-20 12:44 ` Ian Abbott [this message]
2015-06-20 14:48 ` 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=5585602F.60808@mev.co.uk \
--to=abbotti@mev.co.uk \
--cc=devel@driverdev.osuosl.org \
--cc=geliangtang@163.com \
--cc=gregkh@linuxfoundation.org \
--cc=hsweeten@visionengravers.com \
--cc=linux-kernel@vger.kernel.org \
/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