drm/fourcc: Fix undefined left shift in DRM_FORMAT_BIG_ENDIAN macros
Subsystems (2)
PATCH 1/1 drm/fourcc: Fix undefined left shift in DRM_FORMAT_BIG_ENDIAN macros
1<<31 is undefined because it's a signed int and C is terrible.
Reviewed-by Eric Engestrom <[email protected]>
--- include/uapi/drm/drm_fourcc.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
include/uapi/drm/drm_fourcc.h +1 -1
@@ -69,7 +69,7 @@ extern "C" {#define fourcc_code (a, b, c, d) ((__u32)(a) | ((__u32)(b) << 8) | \ ((__u32)(c) << 16) | ((__u32)(d) << 24)) -#define DRM_FORMAT_BIG_ENDIAN (1<<31)/* format is big endian instead of little endian */ +#define DRM_FORMAT_BIG_ENDIAN (1U<<31)/* format is big endian instead of little endian */ /* Reserve 0 for the invalid format specifier */ #define DRM_FORMAT_INVALID 0
Signature · 6 lines
2.23.0 _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
Quoted 3 lines · Adam Jackson
1<<31 is undefined because it's a signed int and C is terrible.
Reviewed-by Eric Engestrom <[email protected]>
Missing teh sob.
Quoted 24 lines
--- include/uapi/drm/drm_fourcc.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)include/uapi/drm/drm_fourcc.h +1
-1@@ -69,7 +69,7 @@ extern "C" {#define fourcc_code (a, b, c, d) ((__u32)(a) | ((__u32)(b) << 8) | \ ((__u32)(c) << 16) | ((__u32)(d) << 24)) -#define DRM_FORMAT_BIG_ENDIAN (1<<31)/* format is big endian instead of little endian */ +#define DRM_FORMAT_BIG_ENDIAN (1U<<31)/* format is big endian instead of little endian */ /* Reserve 0 for the invalid format specifier */ #define DRM_FORMAT_INVALID 0Signature · 6 lines
2.23.0 _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
Signature · 6 lines
Ville Syrjälä Intel _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
PATCH 1/1 drm/fourcc: Fix undefined left shift in DRM_FORMAT_BIG_ENDIAN macros
1<<31 is undefined because it's a signed int and C is terrible.
Reviewed-by Eric Engestrom <[email protected]>
Signed-off-by Adam Jackson <[email protected]>
--- include/uapi/drm/drm_fourcc.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
include/uapi/drm/drm_fourcc.h +1 -1
@@ -69,7 +69,7 @@ extern "C" {#define fourcc_code (a, b, c, d) ((__u32)(a) | ((__u32)(b) << 8) | \ ((__u32)(c) << 16) | ((__u32)(d) << 24)) -#define DRM_FORMAT_BIG_ENDIAN (1<<31)/* format is big endian instead of little endian */ +#define DRM_FORMAT_BIG_ENDIAN (1U<<31)/* format is big endian instead of little endian */ /* Reserve 0 for the invalid format specifier */ #define DRM_FORMAT_INVALID 0
Signature · 6 lines
2.23.0 _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
Quoted 4 lines · Adam Jackson
1<<31 is undefined because it's a signed int and C is terrible.
Reviewed-by Eric Engestrom <[email protected]>Signed-off-by Adam Jackson <[email protected]>
Thanks. Pushed to drm-misc-next.
Quoted 24 lines
--- include/uapi/drm/drm_fourcc.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)include/uapi/drm/drm_fourcc.h +1
-1@@ -69,7 +69,7 @@ extern "C" {#define fourcc_code (a, b, c, d) ((__u32)(a) | ((__u32)(b) << 8) | \ ((__u32)(c) << 16) | ((__u32)(d) << 24)) -#define DRM_FORMAT_BIG_ENDIAN (1<<31)/* format is big endian instead of little endian */ +#define DRM_FORMAT_BIG_ENDIAN (1U<<31)/* format is big endian instead of little endian */ /* Reserve 0 for the invalid format specifier */ #define DRM_FORMAT_INVALID 0Signature · 6 lines
2.23.0 _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
Signature · 6 lines
Ville Syrjälä Intel _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel