From: "Marcin Ślusarz" <marcin.slusarz@gmail.com>
To: Dave Jones <davej@redhat.com>
Cc: Andrew Morton <akpm@linux-foundation.org>,
linux-kernel@vger.kernel.org, adaplas@gmail.com
Subject: Re: [PATCH] fbcon: fix sparse warning about shadowing 'p' symbol
Date: Wed, 12 Dec 2007 20:37:28 +0100 [thread overview]
Message-ID: <20071212192446.GA8605@joi> (raw)
In-Reply-To: <20071212025032.GA21298@redhat.com>
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
next prev parent reply other threads:[~2007-12-12 19:36 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-12-09 21:34 [PATCH] fbcon: fix sparse warning about shadowing 'p' symbol Marcin Ślusarz
2007-12-12 0:57 ` Andrew Morton
2007-12-12 2:50 ` Dave Jones
2007-12-12 19:37 ` Marcin Ślusarz [this message]
2007-12-12 19:23 ` David Miller
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20071212192446.GA8605@joi \
--to=marcin.slusarz@gmail.com \
--cc=adaplas@gmail.com \
--cc=akpm@linux-foundation.org \
--cc=davej@redhat.com \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.