* [PATCH] nvme-fabrics: remove some logically dead code performing redundant ret checks
@ 2016-12-09 14:59 Colin King
2016-12-20 0:54 ` James Smart
0 siblings, 1 reply; 2+ messages in thread
From: Colin King @ 2016-12-09 14:59 UTC (permalink / raw)
To: James Smart, Christoph Hellwig, Sagi Grimberg, linux-nvme; +Cc: linux-kernel
From: Colin Ian King <colin.king@canonical.com>
The check to see if ret is non-zero and return this rather than count
is redundant in two occassions. It is redundant because prior to this
check, the return code ret is already checked for a non-zero error
return value and we return from the function at that point.
Signed-off-by: Colin Ian King <colin.king@canonical.com>
---
drivers/nvme/target/fcloop.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/nvme/target/fcloop.c b/drivers/nvme/target/fcloop.c
index bcb8ebe..4e8e6a2 100644
--- a/drivers/nvme/target/fcloop.c
+++ b/drivers/nvme/target/fcloop.c
@@ -845,7 +845,7 @@ fcloop_create_remote_port(struct device *dev, struct device_attribute *attr,
rport->lport = nport->lport;
nport->rport = rport;
- return ret ? ret : count;
+ return count;
}
@@ -952,7 +952,7 @@ fcloop_create_target_port(struct device *dev, struct device_attribute *attr,
tport->lport = nport->lport;
nport->tport = tport;
- return ret ? ret : count;
+ return count;
}
--
2.10.2
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] nvme-fabrics: remove some logically dead code performing redundant ret checks
2016-12-09 14:59 [PATCH] nvme-fabrics: remove some logically dead code performing redundant ret checks Colin King
@ 2016-12-20 0:54 ` James Smart
0 siblings, 0 replies; 2+ messages in thread
From: James Smart @ 2016-12-20 0:54 UTC (permalink / raw)
To: Colin King, Christoph Hellwig, Sagi Grimberg, linux-nvme; +Cc: linux-kernel
Looks good.
-- james
Signed-off-by: James Smart <james.smart@broadcom.com>
On 12/9/2016 6:59 AM, Colin King wrote:
> From: Colin Ian King <colin.king@canonical.com>
>
> The check to see if ret is non-zero and return this rather than count
> is redundant in two occassions. It is redundant because prior to this
> check, the return code ret is already checked for a non-zero error
> return value and we return from the function at that point.
>
> Signed-off-by: Colin Ian King <colin.king@canonical.com>
> ---
> drivers/nvme/target/fcloop.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/nvme/target/fcloop.c b/drivers/nvme/target/fcloop.c
> index bcb8ebe..4e8e6a2 100644
> --- a/drivers/nvme/target/fcloop.c
> +++ b/drivers/nvme/target/fcloop.c
> @@ -845,7 +845,7 @@ fcloop_create_remote_port(struct device *dev, struct device_attribute *attr,
> rport->lport = nport->lport;
> nport->rport = rport;
>
> - return ret ? ret : count;
> + return count;
> }
>
>
> @@ -952,7 +952,7 @@ fcloop_create_target_port(struct device *dev, struct device_attribute *attr,
> tport->lport = nport->lport;
> nport->tport = tport;
>
> - return ret ? ret : count;
> + return count;
> }
>
>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2016-12-20 0:54 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-12-09 14:59 [PATCH] nvme-fabrics: remove some logically dead code performing redundant ret checks Colin King
2016-12-20 0:54 ` James Smart
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).