kernel-janitors.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH -next] IB/hfi1: Remove set but not used variable 'priv'
@ 2020-05-28  7:59 YueHaibing
  2020-05-28 11:25 ` Marciniszyn, Mike
  0 siblings, 1 reply; 9+ messages in thread
From: YueHaibing @ 2020-05-28  7:59 UTC (permalink / raw)
  To: Mike Marciniszyn, Dennis Dalessandro, Doug Ledford, Jason Gunthorpe
  Cc: YueHaibing, linux-rdma, kernel-janitors

drivers/infiniband/hw/hfi1/netdev_rx.c: In function 'hfi1_netdev_free':
drivers/infiniband/hw/hfi1/netdev_rx.c:374:27: warning:
 variable 'priv' set but not used [-Wunused-but-set-variable]

It is never used, so can be removed, then null check before
kfree is unneeded.

Signed-off-by: YueHaibing <yuehaibing@huawei.com>
---
 drivers/infiniband/hw/hfi1/netdev_rx.c | 11 +++--------
 1 file changed, 3 insertions(+), 8 deletions(-)

diff --git a/drivers/infiniband/hw/hfi1/netdev_rx.c b/drivers/infiniband/hw/hfi1/netdev_rx.c
index 58af6a454761..bd6546b52159 100644
--- a/drivers/infiniband/hw/hfi1/netdev_rx.c
+++ b/drivers/infiniband/hw/hfi1/netdev_rx.c
@@ -371,14 +371,9 @@ int hfi1_netdev_alloc(struct hfi1_devdata *dd)
 
 void hfi1_netdev_free(struct hfi1_devdata *dd)
 {
-	struct hfi1_netdev_priv *priv;
-
-	if (dd->dummy_netdev) {
-		priv = hfi1_netdev_priv(dd->dummy_netdev);
-		dd_dev_info(dd, "hfi1 netdev freed\n");
-		kfree(dd->dummy_netdev);
-		dd->dummy_netdev = NULL;
-	}
+	dd_dev_info(dd, "hfi1 netdev freed\n");
+	kfree(dd->dummy_netdev);
+	dd->dummy_netdev = NULL;
 }
 
 /**

^ permalink raw reply related	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2020-06-03  0:36 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-05-28  7:59 [PATCH -next] IB/hfi1: Remove set but not used variable 'priv' YueHaibing
2020-05-28 11:25 ` Marciniszyn, Mike
2020-06-01 13:45   ` Dennis Dalessandro
2020-06-01 13:56     ` Jason Gunthorpe
2020-06-02  0:59       ` Yuehaibing
2020-06-02  6:16       ` [PATCH -next] IB/hfi1: Use free_netdev() in hfi1_netdev_free() YueHaibing
2020-06-02 15:30         ` Dennis Dalessandro
2020-06-02 18:38           ` Dan Carpenter
2020-06-03  0:36         ` Jason Gunthorpe

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).