Skip to contentSkip to conversation

drm: rcar-du: remove an unneeded NULL check

PATCH In review Dan Carpenter 2 participants 2 messages Jun 30, 2017

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 drm: rcar-du: remove an unneeded NULL check

"params" can't be NULL here. The next lines assume that we either hit the break statement of "params->mpixelclock == ~0UL". The inconsistent NULL checking makes static checkers complain. I've just removed the test.

drivers/gpu/drm/rcar-du/rcar_dw_hdmi.c +1 -1
index 7539626b8ebd..dc85b53d58ef 100644
@@ -45,7 +45,7 @@ static int rcar_hdmi_phy_configure(struct dw_hdmi *hdmi,
 {
 	const struct rcar_hdmi_phy_params *params = rcar_hdmi_phy_params;
 
-	for (; params && params->mpixelclock != ~0UL; ++params) {
+	for (; params->mpixelclock != ~0UL; ++params) {
 		if (mpixelclock <= params->mpixelclock)
 			break;
 	}
Reviewed-by on v1 1/1
#1 lore raw

Hi Dan,

Thank you for the patch.

Quoted 6 lines · On Friday 30 Jun 2017 11:00:12 Dan Carpenter wrote:

"params" can't be NULL here. The next lines assume that we either hit the break statement of "params->mpixelclock == ~0UL". The inconsistent NULL checking makes static checkers complain. I've just removed the test.

and taken in my tree for v4.14.

Quoted 14 lines
(quoted diff) +0 -0

b/drivers/gpu/drm/rcar-du/rcar_dw_hdmi.c index 7539626b8ebd..dc85b53d58ef 100644

drivers/gpu/drm/rcar-du/rcar_dw_hdmi.c +1 -1
@@ -45,7 +45,7 @@ static int rcar_hdmi_phy_configure(struct dw_hdmi *hdmi,
 {
 	const struct rcar_hdmi_phy_params *params = rcar_hdmi_phy_params;
 
-	for (; params && params->mpixelclock != ~0UL; ++params) {
+	for (; params->mpixelclock != ~0UL; ++params) {
 		if (mpixelclock <= params->mpixelclock)
 			break;
 	}
Signature · 3 lines
Regards,

Laurent Pinchart