Mesa (master): drm/fourcc: Fix fourcc_mod_code() definition

Thierry Reding tagr at kemper.freedesktop.org
Fri Mar 9 10:49:34 UTC 2018


Module: Mesa
Branch: master
Commit: ffc85cfac0d96396390aa8414f24567231902087
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=ffc85cfac0d96396390aa8414f24567231902087

Author: Thierry Reding <treding at nvidia.com>
Date:   Tue Feb 20 15:47:25 2018 +0100

drm/fourcc: Fix fourcc_mod_code() definition

Avoid a compiler warnings when the val parameter is an expression.

This is based on commit 5843f4e02fbe86a59981e35adc6cabebee46fdc0 from
Linux v4.16-rc1.

Acked-by: Emil Velikov <emil.velikov at collabora.com>
Tested-by: Andre Heider <a.heider at gmail.com>
Signed-off-by: Thierry Reding <treding at nvidia.com>

---

 include/drm-uapi/drm_fourcc.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/include/drm-uapi/drm_fourcc.h b/include/drm-uapi/drm_fourcc.h
index 3ad838d3f9..a76ed8f9e3 100644
--- a/include/drm-uapi/drm_fourcc.h
+++ b/include/drm-uapi/drm_fourcc.h
@@ -188,7 +188,7 @@ extern "C" {
 #define DRM_FORMAT_RESERVED	      ((1ULL << 56) - 1)
 
 #define fourcc_mod_code(vendor, val) \
-	((((__u64)DRM_FORMAT_MOD_VENDOR_## vendor) << 56) | (val & 0x00ffffffffffffffULL))
+	((((__u64)DRM_FORMAT_MOD_VENDOR_## vendor) << 56) | ((val) & 0x00ffffffffffffffULL))
 
 /*
  * Format Modifier tokens:




More information about the mesa-commit mailing list