[Intel-gfx] [PATCH] drm/i915: Silence compiler for csr_load_work_fn()

Chris Wilson chris at chris-wilson.co.uk
Tue Nov 7 14:53:34 UTC 2017


gcc-4.7 is not very smart and can not tell that "si" is guarded by size
being 0. So it complains,

drivers/gpu/drm/i915/intel_csr.c: In function ‘csr_load_work_fn’:
drivers/gpu/drm/i915/intel_csr.c:204:3: warning: ‘si’ may be used uninitialized in this function [-Wmaybe-uninitialized]
drivers/gpu/drm/i915/intel_csr.c:190:30: note: ‘si’ was declared in

Give in and mark si as NULL.

Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>
Cc: Anusha Srivatsa <anusha.srivatsa at intel.com>
Cc: Rodrigo Vivi <rodrigo.vivi at intel.com>
Cc: Imre Deak <imre.deak at intel.com>
---
 drivers/gpu/drm/i915/intel_csr.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/gpu/drm/i915/intel_csr.c b/drivers/gpu/drm/i915/intel_csr.c
index 3e1f86d0c6cc..77d8b3d483ca 100644
--- a/drivers/gpu/drm/i915/intel_csr.c
+++ b/drivers/gpu/drm/i915/intel_csr.c
@@ -198,6 +198,7 @@ intel_get_stepping_info(struct drm_i915_private *dev_priv)
 		si = bxt_stepping_info;
 	} else {
 		size = 0;
+		si = NULL;
 	}
 
 	if (INTEL_REVID(dev_priv) < size)
-- 
2.15.0



More information about the Intel-gfx mailing list