Commit 5ca004d1 authored by Shuah Khan's avatar Shuah Khan Committed by Mauro Carvalho Chehab

media: media.h: Fix shifting signed 32-bit value by 31 bits problem

Fix MEDIA_ENT_ID_FLAG_NEXT 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: default avatarShuah Khan <skhan@linuxfoundation.org>
Signed-off-by: default avatarHans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab+samsung@kernel.org>
parent a60b42c9
...@@ -146,7 +146,7 @@ struct media_device_info { ...@@ -146,7 +146,7 @@ struct media_device_info {
#define MEDIA_ENT_FL_CONNECTOR (1 << 1) #define MEDIA_ENT_FL_CONNECTOR (1 << 1)
/* OR with the entity id value to find the next entity */ /* OR with the entity id value to find the next entity */
#define MEDIA_ENT_ID_FLAG_NEXT (1 << 31) #define MEDIA_ENT_ID_FLAG_NEXT (1U << 31)
struct media_entity_desc { struct media_entity_desc {
__u32 id; __u32 id;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment