浏览代码

Input: cyttsp4 - silence shift wrap warning

"*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@oracle.com>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Dan Carpenter 12 年之前
父节点
当前提交
0fb82ec026
共有 1 个文件被更改,包括 1 次插入1 次删除
  1. 1 1
      drivers/input/touchscreen/cyttsp4_core.c

+ 1 - 1
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)
 static int cyttsp4_bits_2_bytes(unsigned int nbits, size_t *max)
 {
 {
-	*max = 1 << nbits;
+	*max = 1UL << nbits;
 	return (nbits + 7) / 8;
 	return (nbits + 7) / 8;
 }
 }