Skip to content

Commit 50b1052

Browse files
hdellerdanvet
authored andcommitted
fbcon: Avoid 'cap' set but not used warning
Fix this kernel test robot warning: drivers/video/fbdev/core/fbcon.c: In function 'fbcon_init': drivers/video/fbdev/core/fbcon.c:1028:6: warning: variable 'cap' set but not used [-Wunused-but-set-variable] The cap variable is only used when CONFIG_FRAMEBUFFER_CONSOLE_LEGACY_ACCELERATION is enabled. Drop the temporary variable and use info->flags instead. Fixes: 87ab9f6 ("Revert "fbcon: Disable accelerated scrolling") Reported-by: kernel test robot <[email protected]> Signed-off-by: Helge Deller <[email protected]> Signed-off-by: Daniel Vetter <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/YgFB4xqI+As196FR@p100
1 parent 200e8e3 commit 50b1052

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

drivers/video/fbdev/core/fbcon.c

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1025,7 +1025,7 @@ static void fbcon_init(struct vc_data *vc, int init)
10251025
struct vc_data *svc = *default_mode;
10261026
struct fbcon_display *t, *p = &fb_display[vc->vc_num];
10271027
int logo = 1, new_rows, new_cols, rows, cols;
1028-
int cap, ret;
1028+
int ret;
10291029

10301030
if (WARN_ON(info_idx == -1))
10311031
return;
@@ -1034,7 +1034,6 @@ static void fbcon_init(struct vc_data *vc, int init)
10341034
con2fb_map[vc->vc_num] = info_idx;
10351035

10361036
info = registered_fb[con2fb_map[vc->vc_num]];
1037-
cap = info->flags;
10381037

10391038
if (logo_shown < 0 && console_loglevel <= CONSOLE_LOGLEVEL_QUIET)
10401039
logo_shown = FBCON_LOGO_DONTSHOW;
@@ -1137,8 +1136,8 @@ static void fbcon_init(struct vc_data *vc, int init)
11371136
ops->graphics = 0;
11381137

11391138
#ifdef CONFIG_FRAMEBUFFER_CONSOLE_LEGACY_ACCELERATION
1140-
if ((cap & FBINFO_HWACCEL_COPYAREA) &&
1141-
!(cap & FBINFO_HWACCEL_DISABLED))
1139+
if ((info->flags & FBINFO_HWACCEL_COPYAREA) &&
1140+
!(info->flags & FBINFO_HWACCEL_DISABLED))
11421141
p->scrollmode = SCROLL_MOVE;
11431142
else /* default to something safe */
11441143
p->scrollmode = SCROLL_REDRAW;

0 commit comments

Comments
 (0)