Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755420AbcCPNFl (ORCPT ); Wed, 16 Mar 2016 09:05:41 -0400 Received: from mout.kundenserver.de ([212.227.126.134]:62473 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755221AbcCPNFk (ORCPT ); Wed, 16 Mar 2016 09:05:40 -0400 From: Arnd Bergmann To: James Bottomley Cc: qla2xxx-upstream@qlogic.com, "Martin K. Petersen" , Nicholas Bellinger , Himanshu Madhani , Quinn Tran , Alexei Potashnik , Bart Van Assche , Swapnil Nagle , linux-scsi@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] qla2xxx: avoid maybe_uninitialized warning Date: Wed, 16 Mar 2016 13:59:49 +0100 Message-ID: <2808565.5VeioJTJAb@wuerfel> User-Agent: KMail/4.11.5 (Linux/3.16.0-10-generic; KDE/4.11.5; x86_64; ; ) In-Reply-To: <1458078554.2375.97.camel@linux.vnet.ibm.com> References: <1458078051-529344-1-git-send-email-arnd@arndb.de> <1458078554.2375.97.camel@linux.vnet.ibm.com> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" X-Provags-ID: V03:K0:9tAtWSIIeg9XbtknqCiJPptVq9WEvQd6XiMUS9dg1KfxDhPgYDJ ISq8OoufPaLlVFKxlz5/BM7xJXhsIkPc5e0U15Wr4LeUCs6RmYCqi6gRESBfWw4TW0bHoep Jdiat1Nq8OqpNgDcEVPXgMfsh9uXv3v59nrmQ/csK98X79Z9kgCAttG4p62frHQ0PtcQI19 mvKMz3IdKm7tOO4MupbfQ== X-UI-Out-Filterresults: notjunk:1;V01:K0:yoz6eJg0TkE=:cN9zuf905xTMYme5BFq/G9 FQ5nDvDYCNJZ3WK1R0yqRu/lKNZObaO5Ij7HrAZITTGMIx1SAAQhtk/8ChrwxpM5zJRKD2iQj eKUmgiBEvnBqv6sVWePh4JGJEK5qFFLlUPAFHPEHKE8G9Rz1lXjqeAwMPU23c7iGJKz7M493/ fE9sLLQpfPm0NurzqFtuTwO6YYVoA06gnqxt/eRdf3ZpwJYne8lnpnU+S6m75wERFglqRoJsK hwooxiCMLNf7Rl1pKDVACddZyyUglXxxSGr8pqqaAVhaOqkrN4XZ8rdGVTacHYGXzV+8H+5Is tCjcr4d4t+oUyt2BYHV3/1qs3X+kZ2yUbb8KSWrVXIhIFtoISTTpJCHFP4NwZk6uNsgaVoict TKVoC1ige4UbIBzSBpN7TSxJxlFri2dvt5C2UeyRwLYlEgIliubOESkIPmmr+wxcvmpYMlw3h KYyc1FLx8VQswxOzR8GKHTS0BNRmwX9cp5Rh3QoOI/75qG6t7n3q/X8sUzjssZFI3AxFh/g3m oh4k1VVr+PSC1gEkPHdYgaNe4brW/Ch1vZNceA4bUZJZyt8nChL0616QilN01uZJZBJOoZTUI Aqp+OFCIvtAeyrQ1/2aoB88cQhcsIVS1M7lKnjDb6nH9EOlG5VHxkUAqu7KJgYZAt9fDYwAoF i/9y4d2pyD0MmPj2/ldZSJdsyZnb2kCwypMi78uR74st5GjqQC0EUEjyvlWDzks246wpoQ31d zFEO/NhjmK1bAByU Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 966 Lines: 23 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. 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