[PATCH] video/fbdev/core: Mark debug-only variable as __maybe_unused

Peilin Ye yepeilin.cs at gmail.com
Sun Nov 1 10:09:05 UTC 2020


Hi Sam,

On Sun, Nov 01, 2020 at 10:47:18AM +0100, Sam Ravnborg wrote:
> Hi Thomas.
> 
> On Wed, Oct 21, 2020 at 02:15:12PM +0200, Thomas Zimmermann wrote:
> > Compiling fbcon.c gives
> > 
> > ../drivers/video/fbdev/core/fbcon.c: In function 'fbcon_exit':
> > ../drivers/video/fbdev/core/fbcon.c:3358:7: warning: variable 'pending' set but not used [-Wunused-but-set-variable]
> >  3358 |   int pending = 0;
> >       |       ^~~~~~~
> > 
> > The variable pending is only used for fbcon debugging. It's unused
> > otherwise. Mark it accordingly.
> > 
> > Signed-off-by: Thomas Zimmermann <tzimmermann at suse.de>
> 
> A better fix would be to replace the few uses of DPRINTK() with
> pr_dbg(). pr_info() is alread in use.
> 
> ofc, the next step would be to replace all prink() with their pr_
> counterparts.
> 
> Peilin, maybe this is one for your nice cleanups in fbcon?

Sure, I will send a patch replacing all printk() except DPRINTK(). Thank
you for the suggestion!

Peilin



More information about the dri-devel mailing list