All of lore.kernel.org
 help / color / mirror / Atom feed
From: Dave Hansen <haveblue@us.ibm.com>
To: Mathieu Desnoyers <mathieu.desnoyers@polymtl.ca>
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 12:38:15 -0700	[thread overview]
Message-ID: <1193859495.6271.21.camel@localhost> (raw)
In-Reply-To: <20071031020830.GA1176@Krystal>

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?

-- Dave


  reply	other threads:[~2007-10-31 19:38 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 [this message]
2007-10-31 20:19     ` Mathieu Desnoyers

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=1193859495.6271.21.camel@localhost \
    --to=haveblue@us.ibm.com \
    --cc=akpm@linux-foundation.org \
    --cc=hch@lst.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mathieu.desnoyers@polymtl.ca \
    /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.