public inbox for linux-scsi@vger.kernel.org
 help / color / mirror / Atom feed
From: Himanshu Madhani <himanshu.madhani@qlogic.com>
To: Arnd Bergmann <arnd@arndb.de>, James Bottomley <jejb@linux.vnet.ibm.com>
Cc: Dept-Eng QLA2xxx Upstream <qla2xxx-upstream@qlogic.com>,
	"Martin K. Petersen" <martin.petersen@oracle.com>,
	Nicholas Bellinger <nab@linux-iscsi.org>,
	Quinn Tran <quinn.tran@qlogic.com>,
	Alexei Potashnik <alexei@purestorage.com>,
	Bart Van Assche <bart.vanassche@sandisk.com>,
	Swapnil Nagle <swapnil.nagle@purestorage.com>,
	linux-scsi <linux-scsi@vger.kernel.org>,
	linux-kernel <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] qla2xxx: avoid maybe_uninitialized warning
Date: Wed, 16 Mar 2016 14:05:07 +0000	[thread overview]
Message-ID: <D30EB4C2.DE792%himanshu.madhani@qlogic.com> (raw)
In-Reply-To: <2808565.5VeioJTJAb@wuerfel>

[-- Attachment #1: Type: text/plain, Size: 1220 bytes --]



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.

I would like to keep unlikely() macro in the code. This patch looks good.

Acked-By: Himanshu Madhani <himanshu.madhani@qlogic.com>

>
>Making it easier for the compiler to figure out what is going
>on should also lead to slightly better object code. If you think
>my patch makes it less readable, an alternative would be to remove
>the 'unlikely', which also gets rid of the warning.
>
>	Arnd


[-- Attachment #2: winmail.dat --]
[-- Type: application/ms-tnef, Size: 4603 bytes --]

  reply	other threads:[~2016-03-16 14:05 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-03-15 21:40 [PATCH] qla2xxx: avoid maybe_uninitialized warning Arnd Bergmann
2016-03-15 21:49 ` James Bottomley
2016-03-16 12:59   ` Arnd Bergmann
2016-03-16 14:05     ` Himanshu Madhani [this message]
2016-03-16 14:24       ` James Bottomley
2016-03-16 15:03 ` Tomas Henzl
2016-03-16 15:11   ` Tomas Henzl
2016-03-16 15:47   ` Ewan D. Milne
2016-03-18 19:26 ` Martin K. Petersen

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=D30EB4C2.DE792%himanshu.madhani@qlogic.com \
    --to=himanshu.madhani@qlogic.com \
    --cc=alexei@purestorage.com \
    --cc=arnd@arndb.de \
    --cc=bart.vanassche@sandisk.com \
    --cc=jejb@linux.vnet.ibm.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-scsi@vger.kernel.org \
    --cc=martin.petersen@oracle.com \
    --cc=nab@linux-iscsi.org \
    --cc=qla2xxx-upstream@qlogic.com \
    --cc=quinn.tran@qlogic.com \
    --cc=swapnil.nagle@purestorage.com \
    /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