fbcon: Replace FBCON_FLAGS_INIT with a boolean
authorDaniel Vetter <daniel.vetter@ffwll.ch>
Tue, 5 Apr 2022 21:03:25 +0000 (23:03 +0200)
committerDaniel Vetter <daniel.vetter@ffwll.ch>
Thu, 7 Apr 2022 14:52:13 +0000 (16:52 +0200)
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
drivers/video/fbdev/core/fbcon.c
drivers/video/fbdev/core/fbcon.h

index 7592996..81860ca 100644 (file)
@@ -775,7 +775,7 @@ static void con2fb_init_display(struct vc_data *vc, struct fb_info *info,
 
        ops->currcon = fg_console;
 
-       if (info->fbops->fb_set_par && !(ops->flags & FBCON_FLAGS_INIT)) {
+       if (info->fbops->fb_set_par && !ops->initialized) {
                ret = info->fbops->fb_set_par(info);
 
                if (ret)
@@ -784,7 +784,7 @@ static void con2fb_init_display(struct vc_data *vc, struct fb_info *info,
                                "error code %d\n", ret);
        }
 
-       ops->flags |= FBCON_FLAGS_INIT;
+       ops->initialized = true;
        ops->graphics = 0;
        fbcon_set_disp(info, &info->var, unit);
 
@@ -1103,8 +1103,7 @@ static void fbcon_init(struct vc_data *vc, int init)
         * We need to do it in fbcon_init() to prevent screen corruption.
         */
        if (con_is_visible(vc) && vc->vc_mode == KD_TEXT) {
-               if (info->fbops->fb_set_par &&
-                   !(ops->flags & FBCON_FLAGS_INIT)) {
+               if (info->fbops->fb_set_par && !ops->initialized) {
                        ret = info->fbops->fb_set_par(info);
 
                        if (ret)
@@ -1113,7 +1112,7 @@ static void fbcon_init(struct vc_data *vc, int init)
                                        "error code %d\n", ret);
                }
 
-               ops->flags |= FBCON_FLAGS_INIT;
+               ops->initialized = true;
        }
 
        ops->graphics = 0;
@@ -1186,7 +1185,7 @@ static void fbcon_deinit(struct vc_data *vc)
        if (con_is_visible(vc))
                fbcon_del_cursor_work(info);
 
-       ops->flags &= ~FBCON_FLAGS_INIT;
+       ops->initialized = false;
 finished:
 
        fbcon_free_font(p, free_font);
index 6708ca0..0eaf54a 100644 (file)
@@ -18,8 +18,6 @@
 
 #include <asm/io.h>
 
-#define FBCON_FLAGS_INIT         1
-
    /*
     *    This is the interface between the low-level console driver and the
     *    low-level frame buffer device
@@ -79,7 +77,7 @@ struct fbcon_ops {
        int    blank_state;
        int    graphics;
        int    save_graphics; /* for debug enter/leave */
-       int    flags;
+       bool   initialized;
        int    rotate;
        int    cur_rotate;
        char  *cursor_data;