2018-01-09 15:55:50

by Colin King

[permalink] [raw]
Subject: [PATCH][next] IB/mlx5: remove redundant assignment of mdev

From: Colin Ian King <[email protected]>

The initial assignment to mdev is redundant as mdev is re-assigned
later and the first assigned value is never read. Remove this
redundant assignment.

Cleans up clang warning:
drivers/infiniband/hw/mlx5/main.c:359:24: warning: Value stored
to 'mdev' during its initialization is never read

Signed-off-by: Colin Ian King <[email protected]>
---
drivers/infiniband/hw/mlx5/main.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/infiniband/hw/mlx5/main.c b/drivers/infiniband/hw/mlx5/main.c
index 5d6fba986fa5..91e6b42798e5 100644
--- a/drivers/infiniband/hw/mlx5/main.c
+++ b/drivers/infiniband/hw/mlx5/main.c
@@ -356,7 +356,7 @@ static int mlx5_query_port_roce(struct ib_device *device, u8 port_num,
struct ib_port_attr *props)
{
struct mlx5_ib_dev *dev = to_mdev(device);
- struct mlx5_core_dev *mdev = dev->mdev;
+ struct mlx5_core_dev *mdev;
struct net_device *ndev, *upper;
enum ib_mtu ndev_ib_mtu;
bool put_mdev = true;
--
2.15.1


2018-01-10 07:40:17

by Leon Romanovsky

[permalink] [raw]
Subject: Re: [PATCH][next] IB/mlx5: remove redundant assignment of mdev

On Tue, Jan 09, 2018 at 03:55:43PM +0000, Colin King wrote:
> From: Colin Ian King <[email protected]>
>
> The initial assignment to mdev is redundant as mdev is re-assigned
> later and the first assigned value is never read. Remove this
> redundant assignment.
>
> Cleans up clang warning:
> drivers/infiniband/hw/mlx5/main.c:359:24: warning: Value stored
> to 'mdev' during its initialization is never read
>
> Signed-off-by: Colin Ian King <[email protected]>
> ---
> drivers/infiniband/hw/mlx5/main.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>

Thanks,
Acked-by: Leon Romanovsky <[email protected]>


Attachments:
(No filename) (635.00 B)
signature.asc (833.00 B)
Download all attachments

2018-01-10 21:53:46

by Doug Ledford

[permalink] [raw]
Subject: Re: [PATCH][next] IB/mlx5: remove redundant assignment of mdev

On Wed, 2018-01-10 at 09:40 +0200, Leon Romanovsky wrote:
> On Tue, Jan 09, 2018 at 03:55:43PM +0000, Colin King wrote:
> > From: Colin Ian King <[email protected]>
> >
> > The initial assignment to mdev is redundant as mdev is re-assigned
> > later and the first assigned value is never read. Remove this
> > redundant assignment.
> >
> > Cleans up clang warning:
> > drivers/infiniband/hw/mlx5/main.c:359:24: warning: Value stored
> > to 'mdev' during its initialization is never read
> >
> > Signed-off-by: Colin Ian King <[email protected]>
> > ---
> > drivers/infiniband/hw/mlx5/main.c | 2 +-
> > 1 file changed, 1 insertion(+), 1 deletion(-)
> >
>
> Thanks,
> Acked-by: Leon Romanovsky <[email protected]>

Thanks, applied to for-next.

--
Doug Ledford <[email protected]>
GPG KeyID: B826A3330E572FDD
Key fingerprint = AE6B 1BDA 122B 23B4 265B 1274 B826 A333 0E57 2FDD


Attachments:
signature.asc (833.00 B)
This is a digitally signed message part