[Intel-xe] [PATCH 2/3] drm/i915: Fix uninitialized variable warning

Michał Winiarski michal.winiarski at intel.com
Wed Oct 18 11:58:25 UTC 2023


When used with Xe, "val" uses as function argument name clashes with
"val" used inside iosys_map_* macro causing the build to fail with:

drivers/gpu/drm/i915/display/intel_dsb.c:87:46: error: variable 'val' is uninitialized when used within its own initialization [-Werror,-Wuninitialized]

Signed-off-by: Michał Winiarski <michal.winiarski at intel.com>
---
 drivers/gpu/drm/i915/display/intel_dsb.c | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/drivers/gpu/drm/i915/display/intel_dsb.c b/drivers/gpu/drm/i915/display/intel_dsb.c
index 796b1b36dc598..8d89c8f700d68 100644
--- a/drivers/gpu/drm/i915/display/intel_dsb.c
+++ b/drivers/gpu/drm/i915/display/intel_dsb.c
@@ -79,12 +79,12 @@ static u32 dsb_ggtt_offset(struct intel_dsb *dsb)
 #endif
 }
 
-static void dsb_write(struct intel_dsb *dsb, u32 idx, u32 val)
+static void dsb_write(struct intel_dsb *dsb, u32 idx, u32 value)
 {
 #ifdef I915
-	dsb->cmd_buf[idx] = val;
+	dsb->cmd_buf[idx] = value;
 #else
-	iosys_map_wr(&dsb->obj->vmap, idx * 4, u32, val);
+	iosys_map_wr(&dsb->obj->vmap, idx * 4, u32, value);
 #endif
 }
 
@@ -97,12 +97,12 @@ static u32 dsb_read(struct intel_dsb *dsb, u32 idx)
 #endif
 }
 
-static void dsb_memset(struct intel_dsb *dsb, u32 idx, u32 val, u32 sz)
+static void dsb_memset(struct intel_dsb *dsb, u32 idx, u32 value, u32 sz)
 {
 #ifdef I915
-	memset(&dsb->cmd_buf[idx], val, sz);
+	memset(&dsb->cmd_buf[idx], value, sz);
 #else
-	iosys_map_memset(&dsb->obj->vmap, idx * 4, val, sz);
+	iosys_map_memset(&dsb->obj->vmap, idx * 4, value, sz);
 #endif
 }
 
-- 
2.42.0



More information about the Intel-xe mailing list