Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755959AbcCOLJN (ORCPT ); Tue, 15 Mar 2016 07:09:13 -0400 Received: from mail-lb0-f182.google.com ([209.85.217.182]:34396 "EHLO mail-lb0-f182.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754777AbcCOLJE (ORCPT ); Tue, 15 Mar 2016 07:09:04 -0400 From: Sumit Saxena References: <1457965789-3373916-1-git-send-email-arnd@arndb.de> <1457965789-3373916-4-git-send-email-arnd@arndb.de> In-Reply-To: <1457965789-3373916-4-git-send-email-arnd@arndb.de> MIME-Version: 1.0 X-Mailer: Microsoft Outlook 14.0 Thread-Index: AQITCpeGgItQSgl+HcoOJYf2sBgufgH6JvFmnsdvhTA= Date: Tue, 15 Mar 2016 16:38:57 +0530 Message-ID: <474b70a333b44b94018745134c3340d2@mail.gmail.com> Subject: RE: [PATCH 3/3] megaraid_sas: add missing curly braces in ioctl handler To: Arnd Bergmann , martin.petersen@oracle.com, James.Bottomley@hansenpartnership.com, Kashyap Desai , Sumit Saxena , Uday Lingala , "James E.J. Bottomley" Cc: linux-scsi@vger.kernel.org, linux-kernel@vger.kernel.org, Tomas Henzl , Bjorn Helgaas , megaraidlinux.pdl@avagotech.com Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2029 Lines: 67 > -----Original Message----- > From: Arnd Bergmann [mailto:arnd@arndb.de] > Sent: Monday, March 14, 2016 8:00 PM > To: martin.petersen@oracle.com; James.Bottomley@HansenPartnership.com; > Kashyap Desai; Sumit Saxena; Uday Lingala; James E.J. Bottomley > Cc: linux-scsi@vger.kernel.org; linux-kernel@vger.kernel.org; Arnd Bergmann; > Tomas Henzl; Bjorn Helgaas; megaraidlinux.pdl@avagotech.com > Subject: [PATCH 3/3] megaraid_sas: add missing curly braces in ioctl handler > > gcc-6 found a dubious indentation in the megasas_mgmt_fw_ioctl > function: > > drivers/scsi/megaraid/megaraid_sas_base.c: In function > 'megasas_mgmt_fw_ioctl': > drivers/scsi/megaraid/megaraid_sas_base.c:6658:4: warning: statement is > indented as if it were guarded by... [-Wmisleading-indentation] > kbuff_arr[i] = NULL; > ^~~~~~~~~ > drivers/scsi/megaraid/megaraid_sas_base.c:6653:3: note: ...this 'if' clause, but > it is not > if (kbuff_arr[i]) > ^~ > > The code is actually correct, as there is no downside in clearing a NULL pointer > again. > > This clarifies the code and avoids the warning by adding extra curly braces. > > Signed-off-by: Arnd Bergmann > Fixes: 90dc9d98f01b ("megaraid_sas : MFI MPT linked list corruption fix") > --- > drivers/scsi/megaraid/megaraid_sas_base.c | 3 ++- > 1 file changed, 2 insertions(+), 1 deletion(-) > > diff --git a/drivers/scsi/megaraid/megaraid_sas_base.c > b/drivers/scsi/megaraid/megaraid_sas_base.c > index 5c08568ccfbf..2627200d4f82 100644 > --- a/drivers/scsi/megaraid/megaraid_sas_base.c > +++ b/drivers/scsi/megaraid/megaraid_sas_base.c > @@ -6650,12 +6650,13 @@ out: > } > > for (i = 0; i < ioc->sge_count; i++) { > - if (kbuff_arr[i]) > + if (kbuff_arr[i]) { > dma_free_coherent(&instance->pdev->dev, > le32_to_cpu(kern_sge32[i].length), > kbuff_arr[i], > > le32_to_cpu(kern_sge32[i].phys_addr)); > kbuff_arr[i] = NULL; > + } > } > > megasas_return_cmd(instance, cmd); Acked-by: Sumit Saxena > -- > 2.7.0