From: Johannes Weiner <hannes-kernel@saeurebad.de>
To: Andrew Morton <akpm@linux-foundation.org>
Cc: roland <devzero@web.de>, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] - fix compile warning: `found' might be used uninitialized in this function
Date: Thu, 22 Mar 2007 17:26:04 +0100 [thread overview]
Message-ID: <20070322162550.GB5591@localhost> (raw)
In-Reply-To: <20070322004540.45d8ee87.akpm@linux-foundation.org>
Hi,
On Thu, Mar 22, 2007 at 12:45:40AM -0800, Andrew Morton wrote:
> > On Thu, Mar 22, 2007 at 12:48:05AM +0100, roland wrote:
> > > fs/block_dev.c: In function `bd_claim_by_kobject':
> > > fs/block_dev.c:953: warning: `found' might be used uninitialized in this
> > > function
> >
> > found actually _is_ used uninitialized if the call to bd_claim() returns
> > anything but 0.
>
> No, it isn't.
>
> if (res || found)
> free_bd_holder(bo);
>
> `found' won't be evaluated if res!=0.
Oh, thank you very much. So this warning is another gcc false-positive?
> The code in there is irksome - it'd be nice to find some way of
> restructuring it to make it less obscure, and to kill that warning.
Functionscope or filescope? ;)
=Hannes
next prev parent reply other threads:[~2007-03-22 16:27 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-03-21 23:48 [PATCH] - fix compile warning: `found' might be used uninitialized in this function roland
2007-03-21 23:56 ` Johannes Weiner
2007-03-22 8:45 ` Andrew Morton
2007-03-22 16:26 ` Johannes Weiner [this message]
2007-03-22 17:16 ` Johannes Weiner
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=20070322162550.GB5591@localhost \
--to=hannes-kernel@saeurebad.de \
--cc=akpm@linux-foundation.org \
--cc=devzero@web.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox