Re: [patch 1/3] Input: cyttsp4 - silence shift wrap warning

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, Jul 03, 2013 at 12:40:19AM +0300, Dan Carpenter wrote:
> "*max" is a size_t (long) type but "1" is an int so static checkers
> complain that the shift could wrap.
> 
> Signed-off-by: Dan Carpenter <dan.carpenter@xxxxxxxxxx>

Applied all 3, thank you Dan.

> 
> diff --git a/drivers/input/touchscreen/cyttsp4_core.c b/drivers/input/touchscreen/cyttsp4_core.c
> index 963da05..7aa4a34 100644
> --- a/drivers/input/touchscreen/cyttsp4_core.c
> +++ b/drivers/input/touchscreen/cyttsp4_core.c
> @@ -153,7 +153,7 @@ static int cyttsp4_hw_reset(struct cyttsp4 *cd)
>   */
>  static int cyttsp4_bits_2_bytes(unsigned int nbits, size_t *max)
>  {
> -	*max = 1 << nbits;
> +	*max = 1UL << nbits;
>  	return (nbits + 7) / 8;
>  }
>  

-- 
Dmitry
--
To unsubscribe from this list: send the line "unsubscribe linux-input" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux Media Devel]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Linux Wireless Networking]     [Linux Omap]

  Powered by Linux