* [PATCH] fbcon: Avoid 'cap' set but not used warning
@ 2022-02-07 15:59 Helge Deller
2022-02-08 13:44 ` Daniel Vetter
0 siblings, 1 reply; 3+ messages in thread
From: Helge Deller @ 2022-02-07 15:59 UTC (permalink / raw)
To: linux-fbdev, dri-devel, Daniel Vetter
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: 87ab9f6b7417 ("Revert "fbcon: Disable accelerated scrolling")
Reported-by: kernel test robot <lkp@intel.com>
Signed-off-by: Helge Deller <deller@gmx.de>
diff --git a/drivers/video/fbdev/core/fbcon.c b/drivers/video/fbdev/core/fbcon.c
index f36829eeb5a9..2fc1b80a26ad 100644
--- a/drivers/video/fbdev/core/fbcon.c
+++ b/drivers/video/fbdev/core/fbcon.c
@@ -1025,7 +1025,7 @@ static void fbcon_init(struct vc_data *vc, int init)
struct vc_data *svc = *default_mode;
struct fbcon_display *t, *p = &fb_display[vc->vc_num];
int logo = 1, new_rows, new_cols, rows, cols;
- int cap, ret;
+ int ret;
if (WARN_ON(info_idx == -1))
return;
@@ -1034,7 +1034,6 @@ static void fbcon_init(struct vc_data *vc, int init)
con2fb_map[vc->vc_num] = info_idx;
info = registered_fb[con2fb_map[vc->vc_num]];
- cap = info->flags;
if (logo_shown < 0 && console_loglevel <= CONSOLE_LOGLEVEL_QUIET)
logo_shown = FBCON_LOGO_DONTSHOW;
@@ -1137,8 +1136,8 @@ static void fbcon_init(struct vc_data *vc, int init)
ops->graphics = 0;
#ifdef CONFIG_FRAMEBUFFER_CONSOLE_LEGACY_ACCELERATION
- if ((cap & FBINFO_HWACCEL_COPYAREA) &&
- !(cap & FBINFO_HWACCEL_DISABLED))
+ if ((info->flags & FBINFO_HWACCEL_COPYAREA) &&
+ !(info->flags & FBINFO_HWACCEL_DISABLED))
p->scrollmode = SCROLL_MOVE;
else /* default to something safe */
p->scrollmode = SCROLL_REDRAW;
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] fbcon: Avoid 'cap' set but not used warning
2022-02-07 15:59 [PATCH] fbcon: Avoid 'cap' set but not used warning Helge Deller
@ 2022-02-08 13:44 ` Daniel Vetter
2022-02-08 16:23 ` Helge Deller
0 siblings, 1 reply; 3+ messages in thread
From: Daniel Vetter @ 2022-02-08 13:44 UTC (permalink / raw)
To: Helge Deller; +Cc: linux-fbdev, dri-devel, Daniel Vetter
On Mon, Feb 07, 2022 at 04:59:31PM +0100, Helge Deller wrote:
> 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: 87ab9f6b7417 ("Revert "fbcon: Disable accelerated scrolling")
> Reported-by: kernel test robot <lkp@intel.com>
> Signed-off-by: Helge Deller <deller@gmx.de>
Applied to drm-misc-fixes.
btw I think would still make sense to grab drm-misc commit rights for you,
so you can push stuff like this directly.
Thanks, Daniel
>
> diff --git a/drivers/video/fbdev/core/fbcon.c b/drivers/video/fbdev/core/fbcon.c
> index f36829eeb5a9..2fc1b80a26ad 100644
> --- a/drivers/video/fbdev/core/fbcon.c
> +++ b/drivers/video/fbdev/core/fbcon.c
> @@ -1025,7 +1025,7 @@ static void fbcon_init(struct vc_data *vc, int init)
> struct vc_data *svc = *default_mode;
> struct fbcon_display *t, *p = &fb_display[vc->vc_num];
> int logo = 1, new_rows, new_cols, rows, cols;
> - int cap, ret;
> + int ret;
>
> if (WARN_ON(info_idx == -1))
> return;
> @@ -1034,7 +1034,6 @@ static void fbcon_init(struct vc_data *vc, int init)
> con2fb_map[vc->vc_num] = info_idx;
>
> info = registered_fb[con2fb_map[vc->vc_num]];
> - cap = info->flags;
>
> if (logo_shown < 0 && console_loglevel <= CONSOLE_LOGLEVEL_QUIET)
> logo_shown = FBCON_LOGO_DONTSHOW;
> @@ -1137,8 +1136,8 @@ static void fbcon_init(struct vc_data *vc, int init)
> ops->graphics = 0;
>
> #ifdef CONFIG_FRAMEBUFFER_CONSOLE_LEGACY_ACCELERATION
> - if ((cap & FBINFO_HWACCEL_COPYAREA) &&
> - !(cap & FBINFO_HWACCEL_DISABLED))
> + if ((info->flags & FBINFO_HWACCEL_COPYAREA) &&
> + !(info->flags & FBINFO_HWACCEL_DISABLED))
> p->scrollmode = SCROLL_MOVE;
> else /* default to something safe */
> p->scrollmode = SCROLL_REDRAW;
--
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] fbcon: Avoid 'cap' set but not used warning
2022-02-08 13:44 ` Daniel Vetter
@ 2022-02-08 16:23 ` Helge Deller
0 siblings, 0 replies; 3+ messages in thread
From: Helge Deller @ 2022-02-08 16:23 UTC (permalink / raw)
To: Daniel Vetter; +Cc: linux-fbdev, dri-devel
On 2/8/22 14:44, Daniel Vetter wrote:
> On Mon, Feb 07, 2022 at 04:59:31PM +0100, Helge Deller wrote:
>> 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: 87ab9f6b7417 ("Revert "fbcon: Disable accelerated scrolling")
>> Reported-by: kernel test robot <lkp@intel.com>
>> Signed-off-by: Helge Deller <deller@gmx.de>
>
> Applied to drm-misc-fixes.
Thanks!
> btw I think would still make sense to grab drm-misc commit rights for you,
> so you can push stuff like this directly.
Yes, for such trivial patches to e.g. fbcon it makes sense to have git-push rights.
I've just created a ticket for this:
https://gitlab.freedesktop.org/freedesktop/freedesktop/-/issues/417
Thanks!
Helge
> Thanks, Daniel
>
>>
>> diff --git a/drivers/video/fbdev/core/fbcon.c b/drivers/video/fbdev/core/fbcon.c
>> index f36829eeb5a9..2fc1b80a26ad 100644
>> --- a/drivers/video/fbdev/core/fbcon.c
>> +++ b/drivers/video/fbdev/core/fbcon.c
>> @@ -1025,7 +1025,7 @@ static void fbcon_init(struct vc_data *vc, int init)
>> struct vc_data *svc = *default_mode;
>> struct fbcon_display *t, *p = &fb_display[vc->vc_num];
>> int logo = 1, new_rows, new_cols, rows, cols;
>> - int cap, ret;
>> + int ret;
>>
>> if (WARN_ON(info_idx == -1))
>> return;
>> @@ -1034,7 +1034,6 @@ static void fbcon_init(struct vc_data *vc, int init)
>> con2fb_map[vc->vc_num] = info_idx;
>>
>> info = registered_fb[con2fb_map[vc->vc_num]];
>> - cap = info->flags;
>>
>> if (logo_shown < 0 && console_loglevel <= CONSOLE_LOGLEVEL_QUIET)
>> logo_shown = FBCON_LOGO_DONTSHOW;
>> @@ -1137,8 +1136,8 @@ static void fbcon_init(struct vc_data *vc, int init)
>> ops->graphics = 0;
>>
>> #ifdef CONFIG_FRAMEBUFFER_CONSOLE_LEGACY_ACCELERATION
>> - if ((cap & FBINFO_HWACCEL_COPYAREA) &&
>> - !(cap & FBINFO_HWACCEL_DISABLED))
>> + if ((info->flags & FBINFO_HWACCEL_COPYAREA) &&
>> + !(info->flags & FBINFO_HWACCEL_DISABLED))
>> p->scrollmode = SCROLL_MOVE;
>> else /* default to something safe */
>> p->scrollmode = SCROLL_REDRAW;
>
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2022-02-08 16:23 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-02-07 15:59 [PATCH] fbcon: Avoid 'cap' set but not used warning Helge Deller
2022-02-08 13:44 ` Daniel Vetter
2022-02-08 16:23 ` Helge Deller
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox