]> git.baikalelectronics.ru Git - kernel.git/commitdiff
drm/i915: Silence compiler for csr_load_work_fn()
authorChris Wilson <chris@chris-wilson.co.uk>
Tue, 7 Nov 2017 14:53:34 +0000 (14:53 +0000)
committerChris Wilson <chris@chris-wilson.co.uk>
Tue, 7 Nov 2017 17:50:10 +0000 (17:50 +0000)
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@chris-wilson.co.uk>
Cc: Anusha Srivatsa <anusha.srivatsa@intel.com>
Cc: Rodrigo Vivi <rodrigo.vivi@intel.com>
Cc: Imre Deak <imre.deak@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20171107145334.27154-1-chris@chris-wilson.co.uk
Reviewed-by: Gabriel Krisman Bertazi <krisman@collabora.co.uk>
Reviewed-by: Michal Wajdeczko <michal.wajdeczko@intel.com>
drivers/gpu/drm/i915/intel_csr.c

index 3e1f86d0c6cc2b4ec752111cfb5261963d7c2f92..77d8b3d483ca206e4fa7f4b37c3a778526ce079f 100644 (file)
@@ -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)