[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <F5D084D6342F9B479C34599BB0A03E4D01284E742E@AVMB1.qlogic.org>
Date: Mon, 19 May 2014 16:07:52 +0000
From: Saurav Kashyap <saurav.kashyap@...gic.com>
To: Julia Lawall <Julia.Lawall@...6.fr>,
Dept-Eng QLA2xxx Upstream <qla2xxx-upstream@...gic.com>
CC: "kernel-janitors@...r.kernel.org" <kernel-janitors@...r.kernel.org>,
"James E.J. Bottomley" <JBottomley@...allels.com>,
linux-scsi <linux-scsi@...r.kernel.org>,
linux-kernel <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH 2/13 v2] [SCSI] qla2xxx: make return of 0 explicit
Hi Julia,
Status is already set to 0 at the beginning of the function, I think
we should just "return status" here to be consistent with the rest of
the function.
==========
diff --git a/drivers/scsi/qla2xxx/qla_init.c
b/drivers/scsi/qla2xxx/qla_init.c
index 76af6b6..e339833 100644
--- a/drivers/scsi/qla2xxx/qla_init.c
+++ b/drivers/scsi/qla2xxx/qla_init.c
@@ -4587,7 +4587,6 @@ qla2x00_abort_isp(scsi_qla_host_t *vha)
if (unlikely(pci_channel_offline(ha->pdev) &&
ha->flags.pci_channel_io_perm_failure)) {
clear_bit(ISP_ABORT_RETRY, &vha->dpc_flags);
- status = 0;
return status;
}
=========
Thanks,
~Saurav
>From: Julia Lawall <Julia.Lawall@...6.fr>
>
>Delete unnecessary use of a local variable to immediately return 0.
>
>A simplified version of the semantic patch that fixes this problem is as
>follows: (http://coccinelle.lip6.fr/)
>
>// <smpl>
>@r exists@
>local idexpression ret;
>expression e;
>position p;
>@@
>
>-ret = 0;
>... when != ret = e
>return
>- ret
>+ 0
> ;
>// </smpl>
>
>Signed-off-by: Julia Lawall <Julia.Lawall@...6.fr>
>
>---
>Changed subject line, which was not appreciated by some spam filters.
>
> drivers/scsi/qla2xxx/qla_init.c | 3 +--
> 1 file changed, 1 insertion(+), 2 deletions(-)
>
>diff --git a/drivers/scsi/qla2xxx/qla_init.c
>b/drivers/scsi/qla2xxx/qla_init.c
>index 38aeb54..a63f9b6 100644
>--- a/drivers/scsi/qla2xxx/qla_init.c
>+++ b/drivers/scsi/qla2xxx/qla_init.c
>@@ -4593,8 +4593,7 @@ qla2x00_abort_isp(scsi_qla_host_t *vha)
> if (unlikely(pci_channel_offline(ha->pdev) &&
> ha->flags.pci_channel_io_perm_failure)) {
> clear_bit(ISP_ABORT_RETRY, &vha->dpc_flags);
>- status = 0;
>- return status;
>+ return 0;
> }
>
> ha->isp_ops->get_flash_version(vha, req->ring);
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists