[PATCH] fbcon: trivial optimization for fbcon_exit

Subsystems: console subsystem, framebuffer layer, the rest

STALE4626d

2 messages, 2 authors, 2014-01-08 · open the first message on its own page

[PATCH] fbcon: trivial optimization for fbcon_exit

From: Wang YanQing <udknight@gmail.com>
Date: 2013-12-27 02:40:24

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

Signed-off-by: Wang YanQing <udknight@gmail.com>
---
 drivers/video/console/fbcon.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/drivers/video/console/fbcon.c b/drivers/video/console/fbcon.c
index cd8a802..f39931f 100644
--- a/drivers/video/console/fbcon.c
+++ b/drivers/video/console/fbcon.c
@@ -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) {
-- 
1.8.3.4.8.g69490f3.dirty

Re: [PATCH] fbcon: trivial optimization for fbcon_exit

From: Tomi Valkeinen <hidden>
Date: 2014-01-08 09:48:28

On 2013-12-27 04:39, Wang YanQing wrote:
quoted hunk
Break out as soon as we find a mapped entry con2fb_map.

Signed-off-by: Wang YanQing <udknight@gmail.com>
---
 drivers/video/console/fbcon.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/drivers/video/console/fbcon.c b/drivers/video/console/fbcon.c
index cd8a802..f39931f 100644
--- a/drivers/video/console/fbcon.c
+++ b/drivers/video/console/fbcon.c
@@ -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) {
Thanks, queued for 3.14.

 Tomi

Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help