Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934594AbcCNPZj (ORCPT ); Mon, 14 Mar 2016 11:25:39 -0400 Received: from mout.kundenserver.de ([217.72.192.73]:58135 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S934513AbcCNPZh (ORCPT ); Mon, 14 Mar 2016 11:25:37 -0400 From: Arnd Bergmann To: Hannes Reinecke Cc: martin.petersen@oracle.com, James.Bottomley@hansenpartnership.com, James Smart , Dick Kennedy , "James E.J. Bottomley" , linux-scsi@vger.kernel.org, linux-kernel@vger.kernel.org, Hannes Reinecke , Sebastian Herbszt Subject: Re: [PATCH 2/3] lpfc: fix misleading indentation Date: Mon, 14 Mar 2016 16:25:09 +0100 Message-ID: <13330994.pIJCLN5xX1@wuerfel> User-Agent: KMail/4.11.5 (Linux/3.16.0-10-generic; KDE/4.11.5; x86_64; ; ) In-Reply-To: <56E6D69E.1050008@suse.de> References: <1457965789-3373916-1-git-send-email-arnd@arndb.de> <1457965789-3373916-3-git-send-email-arnd@arndb.de> <56E6D69E.1050008@suse.de> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" X-Provags-ID: V03:K0:pXDugDeRvdRP8XBTw3cEbTL+tTPMke9qTRqbzb4hrvqY5Gt+6y4 HMToyITFlwhurotKF6Xs6RjbdW7eAVjNx2Z4xKeLl6DmniFb00Gz8Lr0/807pwNVBwMqId0 OW8q8yW+PI3MCo8iF1xDvvviyEFJdXwLvnLUgpDX/+76URqxu0r1h2VEX1lFoulehGZ8mrh I57m0/KZSeZ4eoOiK7SOw== X-UI-Out-Filterresults: notjunk:1;V01:K0:OJXsBV0LKW8=:BXEDeIw+0no/JBPlmmzvUR vo5+3jfyGhUDCvMifGeHdEvzpgPBe0Uu9rhCdh2g2xDBH6mhCNhbDOahilZoNkmTgGBGqalSU CAZlrJK3azmU8fF88P9RTtsDBQ0gRsxudOkoIQ0da5LuhZyIdoSn58EivwSCm+BZTFlgeEv5H w14tQifZxORTdJvf+uvvXXk5CBrGhf69aQJIieVbAGVBvH521E8aafTUOcOE84suZHTTSYWyP WoOF6dh9ro+xbtBbZPfbVanZY0o4E1oVvxc+IW29jbSXomAYymrImj1dZV7FpN8/0aC7CQzPl TVKu0VO672FhN0XG/4Q9EyhiQMWSBk/NSNbasRp5/u7PJnKnVywQKja1DFE3+LSSZguzxm+vc lkX0GGaQPi7cDqaDO/9LiQ93qWRUdCk03riJ9iEDPJMEzWxGc02snDbP7RsHwb2XbwUmUxcGW cp+L6DEFjgufiPoJDoqlWSBScQDczVJ1rUA/UhGHWOQr2rjSIKNSdyEWie6sATp9YjlwPPVBu ysUz4oPWarz3ZknKHCvu4aQADXg6ClLGBQpZvV9lFNDOggmUMCOeTqqBCs+LgXhOjVNFsDGCe XZU3Vce/XpYBvRMUahGvhl3tnMoPKxnNvYAUBffPyG+K5MKsKkC83uFEOB9YSNNp07cFv0ipS GFDBiH3juC9eHrTIVW2AkIjs4QAWMRm26gT4OCZ9u3wyIIfHU4ggCP3Ynk7Qm2lbiN1nOvAXF 0dZL3XrrHkWHV37C Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1191 Lines: 38 On Monday 14 March 2016 16:19:58 Hannes Reinecke wrote: > > vports = lpfc_create_vport_work_array(phba); > > - if (vports != NULL) > > + if (vports != NULL) { > > for (i = 0; i <= phba->max_vports && vports[i] != NULL; i++) { > > struct Scsi_Host *shost; > > shost = lpfc_shost_from_vport(vports[i]); > > @@ -2877,7 +2877,8 @@ lpfc_online(struct lpfc_hba *phba) > > } > > spin_unlock_irq(shost->host_lock); > > } > > - lpfc_destroy_vport_work_array(phba, vports); > > + } > > + lpfc_destroy_vport_work_array(phba, vports); > > > > lpfc_unblock_mgmt_io(phba); > > return 0; > > > Nope. > > vports is only valid from within the indentation block, so it should > be moved into it. > > Well, every other user of the function also looks like vports = lpfc_create_vport_work_array(phba); if (vports != NULL) { do_something(vports); } lpfc_destroy_vport_work_array(phba, vports); and lpfc_destroy_vport_work_array() does nothing if its argument is NULL. I still think my patch is the correct fix for the warning. Arnd