[PATCH] drm/i915/dp: Silence static checkers for n_entries

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxxx>
Signed-off-by: Chris Wilson <chris@xxxxxxxxxxxxxxxxxx>
Cc: Rodrigo Vivi <rodrigo.vivi@xxxxxxxxx>
Cc: Dan Carpenter <dan.carpenter@xxxxxxxxxx>
---
 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@xxxxxxxxxxxxxxxxxxxxx
https://lists.freedesktop.org/mailman/listinfo/intel-gfx




[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]
  Powered by Linux