public inbox for kernel-janitors@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] drm/gma500: remove an unneeded NULL check
@ 2017-06-28 12:41 Dan Carpenter
  2017-06-28 17:18 ` Daniel Vetter
  0 siblings, 1 reply; 2+ messages in thread
From: Dan Carpenter @ 2017-06-28 12:41 UTC (permalink / raw)
  To: Patrik Jakobsson, Kirill A. Shutemov
  Cc: David Airlie, dri-devel, kernel-janitors

"connector" is the list iterator and it can't be NULL.  It causes a
static checker warning because we dereference the iterator to get the
next item in the list.  Let's remove this check.

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

diff --git a/drivers/gpu/drm/gma500/mdfld_intel_display.c b/drivers/gpu/drm/gma500/mdfld_intel_display.c
index 63c6e08600ae..531e4450c000 100644
--- a/drivers/gpu/drm/gma500/mdfld_intel_display.c
+++ b/drivers/gpu/drm/gma500/mdfld_intel_display.c
@@ -737,11 +737,7 @@ static int mdfld_crtc_mode_set(struct drm_crtc *crtc,
 					sizeof(struct drm_display_mode));
 
 	list_for_each_entry(connector, &mode_config->connector_list, head) {
-		if (!connector)
-			continue;
-
 		encoder = connector->encoder;
-
 		if (!encoder)
 			continue;
 

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] drm/gma500: remove an unneeded NULL check
  2017-06-28 12:41 [PATCH] drm/gma500: remove an unneeded NULL check Dan Carpenter
@ 2017-06-28 17:18 ` Daniel Vetter
  0 siblings, 0 replies; 2+ messages in thread
From: Daniel Vetter @ 2017-06-28 17:18 UTC (permalink / raw)
  To: Dan Carpenter
  Cc: Patrik Jakobsson, Kirill A. Shutemov, kernel-janitors, dri-devel

On Wed, Jun 28, 2017 at 03:41:01PM +0300, Dan Carpenter wrote:
> "connector" is the list iterator and it can't be NULL.  It causes a
> static checker warning because we dereference the iterator to get the
> next item in the list.  Let's remove this check.
> 
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>

gma500 is always good for some surprises. Pushed to drm-misc-next for
4.14, thanks.
-Daniel

> 
> diff --git a/drivers/gpu/drm/gma500/mdfld_intel_display.c b/drivers/gpu/drm/gma500/mdfld_intel_display.c
> index 63c6e08600ae..531e4450c000 100644
> --- a/drivers/gpu/drm/gma500/mdfld_intel_display.c
> +++ b/drivers/gpu/drm/gma500/mdfld_intel_display.c
> @@ -737,11 +737,7 @@ static int mdfld_crtc_mode_set(struct drm_crtc *crtc,
>  					sizeof(struct drm_display_mode));
>  
>  	list_for_each_entry(connector, &mode_config->connector_list, head) {
> -		if (!connector)
> -			continue;
> -
>  		encoder = connector->encoder;
> -
>  		if (!encoder)
>  			continue;
>  
> _______________________________________________
> dri-devel mailing list
> dri-devel@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/dri-devel

-- 
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2017-06-28 17:18 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-06-28 12:41 [PATCH] drm/gma500: remove an unneeded NULL check Dan Carpenter
2017-06-28 17:18 ` Daniel Vetter

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox