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.carpen...@oracle.com>
Signed-off-by: Chris Wilson <ch...@chris-wilson.co.uk>
Cc: Rodrigo Vivi <rodrigo.v...@intel.com>
Cc: Dan Carpenter <dan.carpen...@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

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

Reply via email to