From: Mathieu Desnoyers <mathieu.desnoyers@polymtl.ca>
To: Dave Hansen <haveblue@us.ibm.com>
Cc: Andrew Morton <akpm@linux-foundation.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
Christoph Hellwig <hch@lst.de>
Subject: Re: fix marker warnings
Date: Wed, 31 Oct 2007 16:19:52 -0400 [thread overview]
Message-ID: <20071031201952.GA17235@Krystal> (raw)
In-Reply-To: <1193859495.6271.21.camel@localhost>
* Dave Hansen (haveblue@us.ibm.com) wrote:
> On Tue, 2007-10-30 at 22:08 -0400, Mathieu Desnoyers wrote:
> > * Dave Hansen (haveblue@us.ibm.com) wrote:
> > > I'm seeing these in the latest git:
> > >
> > > kernel/marker.c: In function `marker_probe_unregister':
> > > kernel/marker.c:355: warning: `probe_module' might be used uninitialized in this function
> > > kernel/marker.c: In function `marker_probe_unregister_private_data':
> > > kernel/marker.c:389: warning: `probe_module' might be used uninitialized in this function
> > > kernel/marker.c:392: warning: `entry' might be used uninitialized in this function
> > >
> > > It's due to gcc not detecting that the need_update condition is actually
> > > constant, and will never call marker_update_probes() on an uninitialized
> > > probe_module.
> > >
> > > However, that need_update bit is all due to dropping the mutex before
> > > calling marker_update_probes(). As far as I can tell, every call to
> > > marker_update_probes() has this lock dropping behavior just before
> > > calling it. So, let's just hold the locks over the
> > > marker_update_probes() and document that it needs to have a lock taken
> > > instead.
> > >
> > > This removes code overall. Untested except for a quick compile.
> > > Consider it just a style suggestion. :)
> > >
> >
> > Ok, just ran it and it seems good. It did not appear as trivial during
> > development because locking was is a different order until recently.
> >
> > I wonder what gcc version you are using though, because mine does not
> > warn about anything. I wonder if it is really necessary to "fix" false
> > gcc warnings like this. Let's take it as a cleanup.
>
> dave@kernel:~$ gcc -v
> Reading specs from /usr/lib/gcc-lib/x86_64-linux-gnu/3.3.6/specs
> Configured with: ../src/configure -v --enable-languages=c,c++
> --prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info
> --with-gxx-include-dir=/usr/include/c++/3.3 --enable-shared
> --enable-__cxa_atexit --with-system-zlib --enable-nls
> --without-included-gettext --enable-clocale=gnu --enable-debug
> --disable-multilib x86_64-linux-gnu
> Thread model: posix
> gcc version 3.3.6 (Ubuntu 1:3.3.6-15ubuntu1)
>
>
> > Acked-by: Mathieu Desnoyers <mathieu.desnoyers@polymtl.ca>
>
> Do you have any other patches with which you would like to forward this
> one? Or, shall I send it upstream on its own?
>
For the marker infrastructure itself, that's the only one. I think
sending it to Andrew Morton is the correct approach.
Mathieu
> -- Dave
>
--
Mathieu Desnoyers
Computer Engineering Ph.D. Student, Ecole Polytechnique de Montreal
OpenPGP key fingerprint: 8CD5 52C3 8E3C 4140 715F BA06 3F25 A8FE 3BAE 9A68
prev parent reply other threads:[~2007-10-31 20:20 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-10-30 20:05 fix marker warnings Dave Hansen
2007-10-31 2:08 ` Mathieu Desnoyers
2007-10-31 19:38 ` Dave Hansen
2007-10-31 20:19 ` Mathieu Desnoyers [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=20071031201952.GA17235@Krystal \
--to=mathieu.desnoyers@polymtl.ca \
--cc=akpm@linux-foundation.org \
--cc=haveblue@us.ibm.com \
--cc=hch@lst.de \
--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.