Skip to contentSkip to conversation

fbcon: trivial optimization for fbcon_exit

PATCH In review Wang YanQing 2 participants 2 messages Dec 27, 2013 – Jan 8, 2014

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

PATCH 1/1 fbcon: trivial optimization for fbcon_exit

Break out as soon as we find a mapped entry con2fb_map.

---
 drivers/video/console/fbcon.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/video/console/fbcon.c +3 -1
index cd8a802..f39931f 100644
@@ -3547,8 +3547,10 @@ static void fbcon_exit(void)
 			"no"));
 
 		for (j = first_fb_vc; j <= last_fb_vc; j++) {
-			if (con2fb_map[j] = i)
+			if (con2fb_map[j] = i) {
 				mapped = 1;
+				break;
+			}
 		}
 
 		if (mapped) {
Signature · 1 line
1.8.3.4.8.g69490f3.dirty
#1 lore raw
Quoted 14 lines · Wang YanQing

Break out as soon as we find a mapped entry con2fb_map.

---
 drivers/video/console/fbcon.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/video/console/fbcon.c +0 -0
index cd8a802..f39931f 100644
@@ -3547,8 +3547,10 @@ static void fbcon_exit(void)
 			"no"));

drivers/video/console/fbcon.c static void fbcon_exit(void) · line 3556

Quoted 10 lines
drivers/video/console/fbcon.c +3 -1
 
 		for (j = first_fb_vc; j <= last_fb_vc; j++) {
-			if (con2fb_map[j] == i)
+			if (con2fb_map[j] == i) {
 				mapped = 1;
+				break;
+			}
 		}
 
 		if (mapped) {

Thanks, queued for 3.14.

Tomi