Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1359040

Re: [PATCH] qla2xxx: avoid maybe_uninitialized warning

From James Bottomley <jejb@linux.vnet.ibm.com>
Newsgroups linux.kernel
Subject Re: [PATCH] qla2xxx: avoid maybe_uninitialized warning
Date 2016-03-16 15:30 +0100
Message-ID <rdkCu-1FX-5@gated-at.bofh.it> (permalink)
References <rd50K-7UJ-17@gated-at.bofh.it> <rd50L-7UJ-29@gated-at.bofh.it> <rdjn4-Vw-19@gated-at.bofh.it> <rdkj9-1yw-31@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On Wed, 2016-03-16 at 14:05 +0000, Himanshu Madhani wrote:
> 
> On 3/16/16, 5:59 AM, "Arnd Bergmann" <arnd@arndb.de> wrote:
> 
> > On Tuesday 15 March 2016 14:49:14 James Bottomley wrote:
> > > On Tue, 2016-03-15 at 22:40 +0100, Arnd Bergmann wrote:
> > > > 
> > > > This slightly rearranges the code to move the second if() block
> > > > into the first one, to avoid the warning while retaining the
> > > > behavior of the code.
> > > 
> > > I thought our usual policy was to ask someone to fix the compiler 
> > > when it emitted a spurious warning.
> > 
> > No, the rule is that we shouldn't blindly add initializations to
> > the variables when the compiler should have figured it out.
> > 
> > In this case, I wouldn't expect the compiler to ever see through
> > the unlikely() macro, and I'm not adding a potentially 
> > counterproductive initialization, so I see no reason not to apply
> > the patch.

OK, as long as there's a good reason why the compiler can never be
fixed to sort out this case.

> I would like to keep unlikely() macro in the code. This patch looks
> good.
> 
> Acked-By: Himanshu Madhani <himanshu.madhani@qlogic.com>

Well, OK that's good enough for me.

James

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH] qla2xxx: avoid maybe_uninitialized warning Arnd Bergmann <arnd@arndb.de> - 2016-03-15 22:50 +0100
  Re: [PATCH] qla2xxx: avoid maybe_uninitialized warning James Bottomley <jejb@linux.vnet.ibm.com> - 2016-03-15 22:50 +0100
    Re: [PATCH] qla2xxx: avoid maybe_uninitialized warning Arnd Bergmann <arnd@arndb.de> - 2016-03-16 14:10 +0100
      Re: [PATCH] qla2xxx: avoid maybe_uninitialized warning Himanshu Madhani <himanshu.madhani@qlogic.com> - 2016-03-16 15:10 +0100
        Re: [PATCH] qla2xxx: avoid maybe_uninitialized warning James Bottomley <jejb@linux.vnet.ibm.com> - 2016-03-16 15:30 +0100
  Re: [PATCH] qla2xxx: avoid maybe_uninitialized warning Tomas Henzl <thenzl@redhat.com> - 2016-03-16 16:10 +0100
    Re: [PATCH] qla2xxx: avoid maybe_uninitialized warning Tomas Henzl <thenzl@redhat.com> - 2016-03-16 16:20 +0100
    Re: [PATCH] qla2xxx: avoid maybe_uninitialized warning "Ewan D. Milne" <emilne@redhat.com> - 2016-03-16 16:50 +0100

csiph-web