net: rnpgbe: Delete a null pointer check in rnpgbe_rm_adapter()
Subsystems (4)
PATCH v3 1/1 net: rnpgbe: Delete a null pointer check in rnpgbe_rm_adapter()
From: Markus Elfring <[email protected]>
Date: Fri, 17 Jul 2026 10:20:15 +0200
The check for the pointer “mucse” was identified as redundant because the relevant address information was preserved according to calls of the functions “pci_set_drvdata” and “pci_get_drvdata”. Thus remove it.
This issue was detected by using the Coccinelle software.
See also:
Reconsidering pointer dereferences before null pointer checks (with SmPL) 2023-04-09
https://lore.kernel.org/cocci/[email protected]/
https://sympa.inria.fr/sympa/arc/cocci/2023-04/msg00021.html
---
v3:
Andrew Lunn and Julia Lawall requested an extended change description.
v2:
Andrew Lunn requested the removal of a null pointer check.
drivers/net/ethernet/mucse/rnpgbe/rnpgbe_main.c | 2 -- 1 file changed, 2 deletions(-)
drivers/net/ethernet/mucse/rnpgbe/rnpgbe_main.c +0 -2
@@ -249,8 +249,6 @@ static void rnpgbe_rm_adapter(struct pci_dev *pdev)struct net_device *netdev;int err; -if (!mucse) -return ; netdev = mucse->netdev;unregister_netdev (netdev); err =rnpgbe_send_notify (hw, false, mucse_fw_powerup);
Signature · 1 line
2.55.0
Quoted 10 lines · Markus Elfring
From: Markus Elfring <[email protected]>
Date: Fri, 17 Jul 2026 10:20:15 +0200The check for the pointer “mucse” was identified as redundant because the relevant address information was preserved according to calls of the functions “pci_set_drvdata” and “pci_get_drvdata”. Thus remove it.
This issue was detected by using the Coccinelle software.
Quoted 7 lines
See also:
Reconsidering pointer dereferences before null pointer checks (with SmPL) 2023-04-09
https://lore.kernel.org/cocci/[email protected]/
https://sympa.inria.fr/sympa/arc/cocci/2023-04/msg00021.htmlSigned-off-by Markus Elfring <[email protected]>
Andrew
Jakub Kicinski
maintainerQuoted 9 lines · On Fri, 17 Jul 2026 10:38:32 +0200 Markus Elfring wrote:
From: Markus Elfring <[email protected]>
Date: Fri, 17 Jul 2026 10:20:15 +0200The check for the pointer “mucse” was identified as redundant because the relevant address information was preserved according to calls of the functions “pci_set_drvdata” and “pci_get_drvdata”. Thus remove it.
This issue was detected by using the Coccinelle software.
pointless churn, please don't waste our time