2019-08-18 18:54:56

by Colin King

[permalink] [raw]
Subject: [PATCH] NTB: ntb_transport: remove redundant assignment to rc

From: Colin Ian King <[email protected]>

Variable rc is initialized to a value that is never read and it
is re-assigned later. The initialization is redundant and can be
removed.

Addresses-Coverity: ("Unused value")
Signed-off-by: Colin Ian King <[email protected]>
---
drivers/ntb/ntb_transport.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/ntb/ntb_transport.c b/drivers/ntb/ntb_transport.c
index 40c90ca10729..00a5d5764993 100644
--- a/drivers/ntb/ntb_transport.c
+++ b/drivers/ntb/ntb_transport.c
@@ -292,7 +292,7 @@ static int ntb_transport_bus_match(struct device *dev,
static int ntb_transport_bus_probe(struct device *dev)
{
const struct ntb_transport_client *client;
- int rc = -EINVAL;
+ int rc;

get_device(dev);

--
2.20.1


2019-09-10 17:05:00

by Jon Mason

[permalink] [raw]
Subject: Re: [PATCH] NTB: ntb_transport: remove redundant assignment to rc

On Sun, Aug 18, 2019 at 7:53 PM Colin King <[email protected]> wrote:
>
> From: Colin Ian King <[email protected]>
>
> Variable rc is initialized to a value that is never read and it
> is re-assigned later. The initialization is redundant and can be
> removed.

Applied to ntb-next, thanks

> Addresses-Coverity: ("Unused value")
> Signed-off-by: Colin Ian King <[email protected]>
> ---
> drivers/ntb/ntb_transport.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/ntb/ntb_transport.c b/drivers/ntb/ntb_transport.c
> index 40c90ca10729..00a5d5764993 100644
> --- a/drivers/ntb/ntb_transport.c
> +++ b/drivers/ntb/ntb_transport.c
> @@ -292,7 +292,7 @@ static int ntb_transport_bus_match(struct device *dev,
> static int ntb_transport_bus_probe(struct device *dev)
> {
> const struct ntb_transport_client *client;
> - int rc = -EINVAL;
> + int rc;
>
> get_device(dev);
>
> --
> 2.20.1
>