Skip to contentSkip to conversation

drm/msm/dp: Remove redundant initialization of variable bpp

PATCH In review Colin King 2 participants 2 messages Sep 29, 2021 – Oct 1, 2021

Subsystems (4)
lore
Share & tools
lore

Colin King

author
#0 lore raw

PATCH 1/1 drm/msm/dp: Remove redundant initialization of variable bpp

From: Colin Ian King <[email protected]>

The variable bpp is being initialized with a value that is never read, it is being updated later on in both paths of an if statement. The assignment is redundant and can be removed.

Addresses-Coverity: ("Unused value")

---
 drivers/gpu/drm/msm/dp/dp_panel.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/msm/dp/dp_panel.c +1 -1
index 2181b60e1d1d..71db10c0f262 100644
@@ -234,7 +234,7 @@ u32 dp_panel_get_mode_bpp(struct dp_panel *dp_panel,
 		u32 mode_edid_bpp, u32 mode_pclk_khz)
 {
 	struct dp_panel_private *panel;
-	u32 bpp = mode_edid_bpp;
+	u32 bpp;
 
 	if (!dp_panel || !mode_edid_bpp || !mode_pclk_khz) {
 		DRM_ERROR("invalid input\n");
Signature · 1 line
2.32.0
Reviewed-by on v1 1/1
#1 lore raw
Quoted 8 lines · Colin King

From: Colin Ian King <[email protected]>

The variable bpp is being initialized with a value that is never read, it is being updated later on in both paths of an if statement. The assignment is redundant and can be removed.

Addresses-Coverity: ("Unused value")

Quoted 18 lines
---
  drivers/gpu/drm/msm/dp/dp_panel.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/msm/dp/dp_panel.c +1 -1
index 2181b60e1d1d..71db10c0f262 100644
@@ -234,7 +234,7 @@ u32 dp_panel_get_mode_bpp(struct dp_panel *dp_panel,
  		u32 mode_edid_bpp, u32 mode_pclk_khz)
  {
  	struct dp_panel_private *panel;
-	u32 bpp = mode_edid_bpp;
+	u32 bpp;
 
  	if (!dp_panel || !mode_edid_bpp || !mode_pclk_khz) {
  		DRM_ERROR("invalid input\n");
Signature · 2 lines
With best wishes
Dmitry