[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <bac3ee3b10de409b6cdf7286e0e84737e63662ee.1559764506.git.skhan@linuxfoundation.org>
Date: Wed, 5 Jun 2019 15:53:47 -0600
From: Shuah Khan <skhan@...uxfoundation.org>
To: mchehab@...nel.org, hverkuil-cisco@...all.nl,
sakari.ailus@...ux.intel.com,
niklas.soderlund+renesas@...natech.se, ezequiel@...labora.com,
paul.kocialkowski@...tlin.com
Cc: Shuah Khan <skhan@...uxfoundation.org>,
linux-media@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: [PATCH 1/2] media: v4l2-core: Shifting signed 32-bit value by 31 bits error
Fix the following cppcheck error:
Checking drivers/media/v4l2-core/v4l2-ioctl.c ...
[drivers/media/v4l2-core/v4l2-ioctl.c:1370]: (error) Shifting signed 32-bit value by 31 bits is undefined behaviour
Signed-off-by: Shuah Khan <skhan@...uxfoundation.org>
---
drivers/media/v4l2-core/v4l2-ioctl.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/media/v4l2-core/v4l2-ioctl.c b/drivers/media/v4l2-core/v4l2-ioctl.c
index 6859bdac86fe..333e387bafeb 100644
--- a/drivers/media/v4l2-core/v4l2-ioctl.c
+++ b/drivers/media/v4l2-core/v4l2-ioctl.c
@@ -1364,7 +1364,7 @@ static void v4l_fill_fmtdesc(struct v4l2_fmtdesc *fmt)
(char)((fmt->pixelformat >> 8) & 0x7f),
(char)((fmt->pixelformat >> 16) & 0x7f),
(char)((fmt->pixelformat >> 24) & 0x7f),
- (fmt->pixelformat & (1 << 31)) ? "-BE" : "");
+ (fmt->pixelformat & BIT(31)) ? "-BE" : "");
break;
}
}
--
2.17.1
Powered by blists - more mailing lists