diff mbox

drm: rcar-du: remove an unneeded NULL check

Message ID 20170630080011.o5s7tbrcd7gob3et@mwanda (mailing list archive)
State New, archived
Headers show

Commit Message

Dan Carpenter June 30, 2017, 8 a.m. UTC
"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.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>

Comments

Laurent Pinchart June 30, 2017, 9:12 a.m. UTC | #1
Hi Dan,

Thank you for the patch.

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.
> 
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>

Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>

and taken in my tree for v4.14.

> diff --git a/drivers/gpu/drm/rcar-du/rcar_dw_hdmi.c
> b/drivers/gpu/drm/rcar-du/rcar_dw_hdmi.c index 7539626b8ebd..dc85b53d58ef
> 100644
> --- a/drivers/gpu/drm/rcar-du/rcar_dw_hdmi.c
> +++ b/drivers/gpu/drm/rcar-du/rcar_dw_hdmi.c
> @@ -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;
>  	}
diff mbox

Patch

diff --git a/drivers/gpu/drm/rcar-du/rcar_dw_hdmi.c b/drivers/gpu/drm/rcar-du/rcar_dw_hdmi.c
index 7539626b8ebd..dc85b53d58ef 100644
--- a/drivers/gpu/drm/rcar-du/rcar_dw_hdmi.c
+++ b/drivers/gpu/drm/rcar-du/rcar_dw_hdmi.c
@@ -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;
 	}