History

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.

Shuah Khan committed 7 years ago

Commit 5ca004d1 parent a60b42c1 file · +1 −1Browse files

Showing the changes to include/uapi/linux (1 of 1 file). Show all

Unified · Split

include/uapi/linux/media.h+1−1
@@ -146,7 +146,7 @@ struct media_device_info { · 145 unmodified lines
146#define MEDIA_ENT_FL_CONNECTOR (1 << 1)146#define MEDIA_ENT_FL_CONNECTOR (1 << 1)
147 147
148/* OR with the entity id value to find the next entity */148/* OR with the entity id value to find the next entity */
149#define MEDIA_ENT_ID_FLAG_NEXT (1 << 31)149#define MEDIA_ENT_ID_FLAG_NEXT (1U << 31)
150 150
151struct media_entity_desc {151struct media_entity_desc {
152 __u32 id;152 __u32 id;

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t