Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

fbcon: Replace FBCON_FLAGS_INIT with a boolean

It's only one flag and slightly tidier code.

Acked-by: Thomas Zimmermann <tzimmermann@suse.de>
Acked-by: Sam Ravnborg <sam@ravnborg.org>
Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
Cc: Daniel Vetter <daniel@ffwll.ch>
Cc: Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Du Cheng <ducheng2@gmail.com>
Cc: Thomas Zimmermann <tzimmermann@suse.de>
Cc: Claudio Suarez <cssk@net-c.es>
Link: https://patchwork.freedesktop.org/patch/msgid/20220405210335.3434130-8-daniel.vetter@ffwll.ch

+6 -9
+5 -6
drivers/video/fbdev/core/fbcon.c
··· 775 775 776 776 ops->currcon = fg_console; 777 777 778 - if (info->fbops->fb_set_par && !(ops->flags & FBCON_FLAGS_INIT)) { 778 + if (info->fbops->fb_set_par && !ops->initialized) { 779 779 ret = info->fbops->fb_set_par(info); 780 780 781 781 if (ret) ··· 784 784 "error code %d\n", ret); 785 785 } 786 786 787 - ops->flags |= FBCON_FLAGS_INIT; 787 + ops->initialized = true; 788 788 ops->graphics = 0; 789 789 fbcon_set_disp(info, &info->var, unit); 790 790 ··· 1103 1103 * We need to do it in fbcon_init() to prevent screen corruption. 1104 1104 */ 1105 1105 if (con_is_visible(vc) && vc->vc_mode == KD_TEXT) { 1106 - if (info->fbops->fb_set_par && 1107 - !(ops->flags & FBCON_FLAGS_INIT)) { 1106 + if (info->fbops->fb_set_par && !ops->initialized) { 1108 1107 ret = info->fbops->fb_set_par(info); 1109 1108 1110 1109 if (ret) ··· 1112 1113 "error code %d\n", ret); 1113 1114 } 1114 1115 1115 - ops->flags |= FBCON_FLAGS_INIT; 1116 + ops->initialized = true; 1116 1117 } 1117 1118 1118 1119 ops->graphics = 0; ··· 1185 1186 if (con_is_visible(vc)) 1186 1187 fbcon_del_cursor_work(info); 1187 1188 1188 - ops->flags &= ~FBCON_FLAGS_INIT; 1189 + ops->initialized = false; 1189 1190 finished: 1190 1191 1191 1192 fbcon_free_font(p, free_font);
+1 -3
drivers/video/fbdev/core/fbcon.h
··· 18 18 19 19 #include <asm/io.h> 20 20 21 - #define FBCON_FLAGS_INIT 1 22 - 23 21 /* 24 22 * This is the interface between the low-level console driver and the 25 23 * low-level frame buffer device ··· 77 79 int blank_state; 78 80 int graphics; 79 81 int save_graphics; /* for debug enter/leave */ 80 - int flags; 82 + bool initialized; 81 83 int rotate; 82 84 int cur_rotate; 83 85 char *cursor_data;