lkml.org 
[lkml]   [2007]   [Dec]   [12]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] fbcon: fix sparse warning about shadowing 'p' symbol
On Tue, Dec 11, 2007 at 09:50:32PM -0500, Dave Jones wrote:
> On Tue, Dec 11, 2007 at 04:57:00PM -0800, Andrew Morton wrote:
>
> > > --- a/drivers/video/console/fbcon.c
> > > +++ b/drivers/video/console/fbcon.c
> > > @@ -2795,7 +2795,7 @@ static int fbcon_scrolldelta(struct vc_data *vc, int lines)
> > > {
> > > struct fb_info *info = registered_fb[con2fb_map[fg_console]];
> > > struct fbcon_ops *ops = info->fbcon_par;
> > > - struct display *p = &fb_display[fg_console];
> > > + struct display *disp = &fb_display[fg_console];
> >
> > We have a global symbol called "p"? That would be bad. Where is it?
>
> in the same function.
> We have quite a few shadow warnings in that file.
>
> drivers/video/console/fbcon.c:337:25: warning: symbol '_x' shadows an earlier one
> drivers/video/console/fbcon.c:337:25: originally declared here
> drivers/video/console/fbcon.c:337:25: warning: symbol '_x' shadows an earlier one
> drivers/video/console/fbcon.c:337:25: originally declared here
> drivers/video/console/fbcon.c:337:25: warning: symbol '_y' shadows an earlier one
> drivers/video/console/fbcon.c:337:25: originally declared here
That's from max(A, max(B, C)) and max is defined as:
#define max(x,y) ({ \
typeof(x) _x = (x); \
typeof(y) _y = (y); \
(void) (&_x == &_y); \
_x > _y ? _x : _y; })

Don't know how to fix it without making the code look uglier...

> drivers/video/console/fbcon.c:3336:6: warning: symbol 'rotate' shadows an earlier one
> drivers/video/console/fbcon.c:150:12: originally declared here
> drivers/video/console/fbcon.c:3361:6: warning: symbol 'rotate' shadows an earlier one
> drivers/video/console/fbcon.c:150:12: originally declared here
> drivers/video/console/fbcon.c:3385:6: warning: symbol 'rotate' shadows an earlier one
> drivers/video/console/fbcon.c:150:12: originally declared here
That's fixed in another patch.

Marcin


\
 
 \ /
  Last update: 2007-12-12 20:39    [W:1.291 / U:0.016 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site