From: Matthew Wilcox <matthew@wil.cx>
To: kernel-janitors@vger.kernel.org
Subject: Re: Fix sparse warning
Date: Fri, 23 Oct 2009 11:51:42 +0000 [thread overview]
Message-ID: <20091023115141.GC19566@parisc-linux.org> (raw)
In-Reply-To: <4ADCD559.9080807@sysvalve.homelinux.net>
On Fri, Oct 23, 2009 at 01:38:15PM +0200, Ingo Molnar wrote:
> * Matthew Wilcox <matthew@wil.cx> wrote:
> > and you changed it so that the boot_trace_call is now file-scope. Now
> > sparse rightfully warns about the shadow definitions in do_initcalls
> > and do_pre_smp_initcalls.
>
> Doh, right you are!
>
> Unfortunately the discussion was not Cc:-ed to lkml so i couldnt review
> the original patch and i assumed it moved the static back into function
> scope.
>
> The right fix would be to rename the variables to not be colliding. (if
> we used -Wshadow like tools/perf/ does we'd have gotten this warning
> from GCC too btw) Does the patch do that? Could we please Cc: patches to
> lkml?
There wasn't a patch ... it was a question about the right way to fix
something: http://marc.info/?l=kernel-janitors&m\x125598851800338&w=2
I agree with you that we should add -Wshadow to the CFLAGS, rather than
requiring sparse to find these problems.
If you're dead-set on not moving this statis variable back to
function-scope, then it needs to be renamed; and probably best to rename
all of 'msgbuf', 'call' and 'ret' to have the same prefix.
--
Matthew Wilcox Intel Open Source Technology Centre
"Bill, look, we understand that you're interested in selling us this
operating system, but compare it to ours. We can't possibly take such
a retrograde step."
prev parent reply other threads:[~2009-10-23 11:51 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-10-19 21:08 Fix sparse warning
2009-10-19 21:35 `
2009-10-20 6:48 ` Matthew Wilcox
2009-10-20 7:24 ` walter harms
2009-10-20 22:02 `
2009-10-20 22:08 `
2009-10-20 22:24 ` Matthew Wilcox
2009-10-21 11:37 ` Ingo Molnar
2009-10-21 21:18 `
2009-10-23 7:59 ` Ingo Molnar
2009-10-23 11:14 ` Matthew Wilcox
2009-10-23 11:38 ` Ingo Molnar
2009-10-23 11:51 ` Matthew Wilcox [this message]
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=20091023115141.GC19566@parisc-linux.org \
--to=matthew@wil.cx \
--cc=kernel-janitors@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.