diff mbox

drm/i915/dp: Silence static checkers for n_entries

Message ID 20180504152318.23625-1-chris@chris-wilson.co.uk (mailing list archive)
State New, archived
Headers show

Commit Message

Chris Wilson May 4, 2018, 3:23 p.m. UTC
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@oracle.com>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Rodrigo Vivi <rodrigo.vivi@intel.com>
Cc: Dan Carpenter <dan.carpenter@oracle.com>
---
 drivers/gpu/drm/i915/intel_ddi.c | 2 ++
 1 file changed, 2 insertions(+)
diff mbox

Patch

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;
 		}