[PATCH 1/8] drm/i915/dp: Silence static checkers for n_entries
Chris Wilson
chris at chris-wilson.co.uk
Fri May 4 17:00:25 UTC 2018
Smatch warns that n_entries isn't always set, so copy'n'paste the common
response used in the other setup paths to silence gcc. The advantage of
fixing it in situ (rather than use a zero initialiser) is that the
analysers are quite capable of then spotting the absence.
Reported-by: Dan Carpenter <dan.carpenter at oracle.com>
Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>
Cc: Rodrigo Vivi <rodrigo.vivi at intel.com>
Cc: Dan Carpenter <dan.carpenter at oracle.com>
---
drivers/gpu/drm/i915/intel_ddi.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/drivers/gpu/drm/i915/intel_ddi.c b/drivers/gpu/drm/i915/intel_ddi.c
index 8225d223f452..31f781bb73ca 100644
--- a/drivers/gpu/drm/i915/intel_ddi.c
+++ b/drivers/gpu/drm/i915/intel_ddi.c
@@ -888,6 +888,7 @@ icl_get_combo_buf_trans(struct drm_i915_private *dev_priv, enum port port,
*n_entries = ARRAY_SIZE(icl_combo_phy_ddi_translations_edp_1_05V);
return icl_combo_phy_ddi_translations_edp_1_05V;
default:
+ *n_entries = 1; /* shut up gcc */
MISSING_CASE(voltage);
return NULL;
}
@@ -903,6 +904,7 @@ icl_get_combo_buf_trans(struct drm_i915_private *dev_priv, enum port port,
*n_entries = ARRAY_SIZE(icl_combo_phy_ddi_translations_dp_hdmi_1_05V);
return icl_combo_phy_ddi_translations_dp_hdmi_1_05V;
default:
+ *n_entries = 1; /* shut up gcc */
MISSING_CASE(voltage);
return NULL;
}
--
2.17.0
More information about the Intel-gfx-trybot
mailing list