lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <5585602F.60808@mev.co.uk>
Date:	Sat, 20 Jun 2015 13:44:31 +0100
From:	Ian Abbott <abbotti@....co.uk>
To:	Geliang Tang <geliangtang@....com>, hsweeten@...ionengravers.com,
	gregkh@...uxfoundation.org
CC:	devel@...verdev.osuosl.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] staging: comedi: fix sparse warning in ni_mio_common.c

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@....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@....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/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ