Skip to contentSkip to conversation

drm/fb-helper: Remove unnecessary list empty check in drm_fb_helper_debug_enter()

PATCH Applied Liu Ying 2 participants 2 messages Jun 19, 2014

Subsystems (2)
lore
Share & tools
lore

Liu Ying

author
#0 lore raw

PATCH 1/1 drm/fb-helper: Remove unnecessary list empty check in drm_fb_helper_debug_enter()

The following list empty check is unnecessary because we would still do nothing real and return 'val' if my_list is empty.

if (list_empty(&my_list))

	return val;
list_for_each_entry(pos, &my_list, member) {
	...
}

return val;

This patch removes the unnecessary check in drm_fb_helper_debug_enter().

---
 drivers/gpu/drm/drm_fb_helper.c |    3 ---
 1 file changed, 3 deletions(-)
drivers/gpu/drm/drm_fb_helper.c +0 -3
index d5d8cea..eb77a2f 100644
@@ -199,9 +199,6 @@ int drm_fb_helper_debug_enter(struct fb_info *info)
 	struct drm_crtc_helper_funcs *funcs;
 	int i;
 
-	if (list_empty(&kernel_fb_helper_list))
-		return false;
-
 	list_for_each_entry(helper, &kernel_fb_helper_list, kernel_fb_list) {
 		for (i = 0; i < helper->crtc_count; i++) {
 			struct drm_mode_set *mode_set =
Signature · 1 line
1.7.9.5
#1 lore raw
Quoted 10 lines · Liu Ying

The following list empty check is unnecessary because we would still do nothing real and return 'val' if my_list is empty.

if (list_empty(&my_list))

	return val;
list_for_each_entry(pos, &my_list, member) {
	...
}
Quoted 5 lines

return val;

This patch removes the unnecessary check in drm_fb_helper_debug_enter().

Merged into my core-stuff branch, will send a pull to Dave for 3.17. -Daniel

Quoted 21 lines
---
 drivers/gpu/drm/drm_fb_helper.c |    3 ---
 1 file changed, 3 deletions(-)
drivers/gpu/drm/drm_fb_helper.c +0 -3
index d5d8cea..eb77a2f 100644
@@ -199,9 +199,6 @@ int drm_fb_helper_debug_enter(struct fb_info *info)
 	struct drm_crtc_helper_funcs *funcs;
 	int i;
 
-	if (list_empty(&kernel_fb_helper_list))
-		return false;
-
 	list_for_each_entry(helper, &kernel_fb_helper_list, kernel_fb_list) {
 		for (i = 0; i < helper->crtc_count; i++) {
 			struct drm_mode_set *mode_set =
Signature · 1 line
1.7.9.5
Signature · 3 lines
Daniel Vetter
Software Engineer, Intel Corporation
+41 (0) 79 365 57 48 - http://blog.ffwll.ch