Skip to contentSkip to conversation

can: xilinx_can: remove redundent netif_napi_del from xcan_remove

PATCH In review Dongliang Mu 2 participants 5 messages Oct 17, 2021 – Oct 19, 2021

Subsystems (5)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 can: xilinx_can: remove redundent netif_napi_del from xcan_remove

Since netif_napi_del is already done in the free_candev, so we remove this redundent netif_napi_del invocation. In addition, this patch can match the operations in the xcan_probe and xcan_remove functions.

---
 drivers/net/can/xilinx_can.c | 1 -
 1 file changed, 1 deletion(-)
drivers/net/can/xilinx_can.c +0 -1
index 3b883e607d8b..60a3fb369058 100644
@@ -1848,7 +1848,6 @@ static int xcan_remove(struct platform_device *pdev)
 
 	unregister_candev(ndev);
 	pm_runtime_disable(&pdev->dev);
-	netif_napi_del(&priv->napi);
 	free_candev(ndev);
 
 	return 0;
Signature · 1 line
2.25.1
#1 lore raw
Quoted 2 lines · Dongliang Mu

Since netif_napi_del is already done in the free_candev, so we remove this redundent netif_napi_del invocation. In addition, this patch can

       ^^^^^^^^^

redundant, fixed (also in subject)

Quoted 3 lines

match the operations in the xcan_probe and xcan_remove functions.

Applied to linux-can-next/testing

regards,
Marc

Signature · 4 lines
Pengutronix e.K.                 | Marc Kleine-Budde           |
Embedded Linux                   | https://www.pengutronix.de  |
Vertretung West/Dortmund         | Phone: +49-231-2826-924     |
Amtsgericht Hildesheim, HRA 2686 | Fax:   +49-5121-206917-5555 |
#2 lore raw
Quoted 6 lines · Marc Kleine-Budde
Quoted 2 lines · Dongliang Mu

Since netif_napi_del is already done in the free_candev, so we remove this redundent netif_napi_del invocation. In addition, this patch can

       ^^^^^^^^^

redundant, fixed (also in subject)

:\ Sorry about this typo.

Quoted 14 lines
Quoted 3 lines

match the operations in the xcan_probe and xcan_remove functions.

Applied to linux-can-next/testing

regards,
Marc

--

Pengutronix e.K.                 | Marc Kleine-Budde           |
Embedded Linux                   | https://www.pengutronix.de  |
Vertretung West/Dortmund         | Phone: +49-231-2826-924     |
Amtsgericht Hildesheim, HRA 2686 | Fax:   +49-5121-206917-5555 |
#3 lore raw
In reply to Dongliang Mu
Quoted 14 lines · Dongliang Mu

Since netif_napi_del is already done in the free_candev, so we remove this redundent netif_napi_del invocation. In addition, this patch can match the operations in the xcan_probe and xcan_remove functions.

---
 drivers/net/can/xilinx_can.c | 1 -
 1 file changed, 1 deletion(-)
drivers/net/can/xilinx_can.c +0 -0
index 3b883e607d8b..60a3fb369058 100644

drivers/net/can/xilinx_can.c static int xcan_remove(struct platform_device *pdev) · line 1853

Quoted 7 lines
drivers/net/can/xilinx_can.c +0 -1
@@ -1848,7 +1848,6 @@ static int xcan_remove(struct platform_device *pdev)
 
 	unregister_candev(ndev);
 	pm_runtime_disable(&pdev->dev);
-	netif_napi_del(&priv->napi);
 	free_candev(ndev);
 
 	return 0;

Fixed the following error:

| drivers/net/can/xilinx_can.c: In function ‘xcan_remove’:
| drivers/net/can/xilinx_can.c:1847:20: error: unused variable ‘priv’ [-Werror=unused-variable]
|  1847 |  struct xcan_priv *priv = netdev_priv(ndev);
|       |                    ^~~~

regards,
Marc

Signature · 4 lines
Pengutronix e.K.                 | Marc Kleine-Budde           |
Embedded Linux                   | https://www.pengutronix.de  |
Vertretung West/Dortmund         | Phone: +49-231-2826-924     |
Amtsgericht Hildesheim, HRA 2686 | Fax:   +49-5121-206917-5555 |
#4 lore raw
Quoted 22 lines · Marc Kleine-Budde
Quoted 20 lines · Dongliang Mu

Since netif_napi_del is already done in the free_candev, so we remove this redundent netif_napi_del invocation. In addition, this patch can match the operations in the xcan_probe and xcan_remove functions.

---
 drivers/net/can/xilinx_can.c | 1 -
 1 file changed, 1 deletion(-)
drivers/net/can/xilinx_can.c +0 -1
index 3b883e607d8b..60a3fb369058 100644
@@ -1848,7 +1848,6 @@ static int xcan_remove(struct platform_device *pdev)
 
      unregister_candev(ndev);
      pm_runtime_disable(&pdev->dev);
-     netif_napi_del(&priv->napi);
      free_candev(ndev);
 
Quoted 8 lines

drivers/net/can/xilinx_can.c static int xcan_remove(struct platform_device *pdev) · line 1853

Quoted 1 line
drivers/net/can/xilinx_can.c +0 -0
      return 0;

Fixed the following error:

| drivers/net/can/xilinx_can.c: In function ‘xcan_remove’:
| drivers/net/can/xilinx_can.c:1847:20: error: unused variable ‘priv’ [-Werror=unused-variable]
|  1847 |  struct xcan_priv *priv = netdev_priv(ndev);
|       |                    ^~~~

For now, xilinx_can already enables "-Werror" proposed by Linus?

That's my problem. Sorry for that.

Quoted 9 lines

regards,
Marc

--

Pengutronix e.K.                 | Marc Kleine-Budde           |
Embedded Linux                   | https://www.pengutronix.de  |
Vertretung West/Dortmund         | Phone: +49-231-2826-924     |
Amtsgericht Hildesheim, HRA 2686 | Fax:   +49-5121-206917-5555 |