From: Chris Wilson Date: Tue, 7 Nov 2017 14:53:34 +0000 (+0000) Subject: drm/i915: Silence compiler for csr_load_work_fn() X-Git-Tag: v4.19~298^2~46^2~1187 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=2f59f1b33a84447247b21be60ecf05080ce2982a;p=platform%2Fkernel%2Flinux-rpi.git drm/i915: Silence compiler for csr_load_work_fn() 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 Cc: Anusha Srivatsa Cc: Rodrigo Vivi Cc: Imre Deak Link: https://patchwork.freedesktop.org/patch/msgid/20171107145334.27154-1-chris@chris-wilson.co.uk Reviewed-by: Gabriel Krisman Bertazi Reviewed-by: Michal Wajdeczko --- diff --git a/drivers/gpu/drm/i915/intel_csr.c b/drivers/gpu/drm/i915/intel_csr.c index 3e1f86d..77d8b3d 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)