public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: scameron@beardog.cce.hp.com
To: Jens Axboe <jaxboe@fusionio.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	scameron@beardog.cce.hp.com
Subject: Re: [GIT PULL] block drivers for 2.6.39-rc
Date: Tue, 29 Mar 2011 08:18:24 -0500	[thread overview]
Message-ID: <20110329131824.GH12760@beardog.cce.hp.com> (raw)
In-Reply-To: <4D917D5A.5040502@fusionio.com>

On Tue, Mar 29, 2011 at 08:34:02AM +0200, Jens Axboe wrote:
> On 2011-03-29 01:06, Linus Torvalds wrote:
> > On Sat, Mar 26, 2011 at 11:56 AM, Jens Axboe <jaxboe@fusionio.com> wrote:
> >> Hi Linus,
> >>
> >> This is the pull request for the block driver updates for 2.6.39. Two
> >> things here:
> >>
> >> - Big drbd update, as per usual...
> >> - cciss update.
> > 
> > Btw, that cciss thing causes a very annoying compiler warning:
> > 
> >   drivers/block/cciss.c: In function ‘dev_show_unique_id’:
> >   drivers/block/cciss.c:617:7: warning: ‘sn[0]’ may be used
> > uninitialized in this function
> >   drivers/block/cciss.c:617:7: warning: ‘sn[1]’ may be used
> > uninitialized in this function
> >   drivers/block/cciss.c:617:7: warning: ‘sn[2]’ may be used
> > uninitialized in this function
> >   drivers/block/cciss.c:617:7: warning: ‘sn[3]’ may be used
> > uninitialized in this function
> >   drivers/block/cciss.c:617:7: warning: ‘sn[4]’ may be used
> > uninitialized in this function
> >   drivers/block/cciss.c:617:7: warning: ‘sn[5]’ may be used
> > uninitialized in this function
> >   drivers/block/cciss.c:617:7: warning: ‘sn[6]’ may be used
> > uninitialized in this function
> >   drivers/block/cciss.c:617:7: warning: ‘sn[7]’ may be used
> > uninitialized in this function
> >   drivers/block/cciss.c:617:7: warning: ‘sn[8]’ may be used
> > uninitialized in this function
> >   drivers/block/cciss.c:617:7: warning: ‘sn[9]’ may be used
> > uninitialized in this function
> >   drivers/block/cciss.c:617:7: warning: ‘sn[10]’ may be used
> > uninitialized in this function
> >   drivers/block/cciss.c:617:7: warning: ‘sn[11]’ may be used
> > uninitialized in this function
> >   drivers/block/cciss.c:617:7: warning: ‘sn[12]’ may be used
> > uninitialized in this function
> >   drivers/block/cciss.c:617:7: warning: ‘sn[13]’ may be used
> > uninitialized in this function
> >   drivers/block/cciss.c:617:7: warning: ‘sn[14]’ may be used
> > uninitialized in this function
> >   drivers/block/cciss.c:617:7: warning: ‘sn[15]’ may be used
> > uninitialized in this function
> > 
> > which is because the compiler doesn't really notice that those things
> > are only used if the error return isn't being set.
> > 
> > So it's a compiler mis-feature, but the thing is, the warning could
> > easily be avoided by just writing the code more prettily.
> > 
> > Just do the memcpy() unconditionally: we know that 'drv' is a valid
> > pointer (we just loaded 'h' off it), and we're talking about a nice
> > constant 16-byte copy.
> > 
> > IOW, a patch something like the attached.
> > 
> > Untested, but it looks really obvious. Hmm?
> 
> Looks good to me. I'm curious, you get a warning in dev_show_unique_id()
> but not in dev_show_vendor() or any of the other following 4-5 functions
> written in the same style?
> 
> My gcc here does not warn for any of them. But it is very convoluted for
> what it does

Looks ok to me.

FWIW, I've also not seen warnings for any of those from gcc on several
distros (rhel5, rhel6, sles10, sles11).

The convolutedness was probably just me trying to be overly economical
though that "else" after the return and just before the snprintf is
kinda nuts.

-- steve

  reply	other threads:[~2011-03-29 13:18 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-03-26 18:56 [GIT PULL] block drivers for 2.6.39-rc Jens Axboe
2011-03-28  4:23 ` Ingo Molnar
2011-03-28  4:37   ` Linus Torvalds
2011-03-28  4:43     ` Ingo Molnar
2011-03-28  5:08     ` Stephen Rothwell
2011-03-28  6:43       ` Jens Axboe
2011-03-28  7:04         ` Stephen Rothwell
2011-03-28  7:21           ` Jens Axboe
2011-03-28 23:06 ` Linus Torvalds
2011-03-29  6:34   ` Jens Axboe
2011-03-29 13:18     ` scameron [this message]
2011-03-29 11:17 ` [sporadic crash] blk: request botched Ingo Molnar
2011-03-29 11:38   ` Jens Axboe

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=20110329131824.GH12760@beardog.cce.hp.com \
    --to=scameron@beardog.cce.hp.com \
    --cc=jaxboe@fusionio.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=torvalds@linux-foundation.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