Skip to contentSkip to conversation

drm/gma500: remove an unneeded NULL check

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

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

PATCH 1/1 drm/gma500: remove an unneeded NULL check

"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.

drivers/gpu/drm/gma500/mdfld_intel_display.c +0 -4
index 63c6e08600ae..531e4450c000 100644
@@ -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;
 
#1 lore raw
Quoted 5 lines · Dan Carpenter

"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.

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

Quoted 21 lines
drivers/gpu/drm/gma500/mdfld_intel_display.c +0 -4
index 63c6e08600ae..531e4450c000 100644
@@ -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
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel

Signature · 3 lines
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch