summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorShuah Khan <skhan@linuxfoundation.org>2019-06-12 20:56:52 -0400
committerMauro Carvalho Chehab <mchehab+samsung@kernel.org>2019-06-21 16:45:59 -0400
commitff3c65cb81157b7259250a1f68ddf13a43923ecb (patch)
tree9f720bb851a34731c84b5ead7e7cd9d9fee82921
parent5ca004d11bfa4f5705b2761b6de29f81914cf3fe (diff)
media: videodev2.h: Fix shifting signed 32-bit value by 31 bits problem
Fix v4l2_fourcc define to use "U" cast to avoid shifting signed 32-bit value by 31 bits problem. This isn't a problem for kernel builds with gcc. This could be problem since this header is part of public API which could be included for builds using compilers that don't handle this condition safely resulting in undefined behavior. Signed-off-by: Shuah Khan <skhan@linuxfoundation.org> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
-rw-r--r--include/uapi/linux/videodev2.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/include/uapi/linux/videodev2.h b/include/uapi/linux/videodev2.h
index 1050a75fb7ef..9d9705ceda76 100644
--- a/include/uapi/linux/videodev2.h
+++ b/include/uapi/linux/videodev2.h
@@ -80,7 +80,7 @@
/* Four-character-code (FOURCC) */
#define v4l2_fourcc(a, b, c, d)\
((__u32)(a) | ((__u32)(b) << 8) | ((__u32)(c) << 16) | ((__u32)(d) << 24))
-#define v4l2_fourcc_be(a, b, c, d) (v4l2_fourcc(a, b, c, d) | (1 << 31))
+#define v4l2_fourcc_be(a, b, c, d) (v4l2_fourcc(a, b, c, d) | (1U << 31))
/*
* E N U M S