Skip to content

Commit

Permalink
net: tulip: delete useless tests on netdev_priv
Browse files Browse the repository at this point in the history
Netdev_priv performs an addition, not a pointer dereference, so it seems
quite unlikely that its result would ever be NULL.

A semantic patch that makes this change is as follows:
(http://coccinelle.lip6.fr/)

// <smpl>
@@
statement S;
@@

- if (!netdev_priv(...)) S
// </smpl>

Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>
Acked-by: Grant Grundler <grundler@parisc-linux.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Julia Lawall authored and David S. Miller committed Jan 4, 2014
1 parent c1ddf29 commit 2d4dda7
Showing 1 changed file with 0 additions and 6 deletions.
6 changes: 0 additions & 6 deletions drivers/net/ethernet/dec/tulip/uli526x.c
Original file line number Diff line number Diff line change
Expand Up @@ -1192,9 +1192,6 @@ static int uli526x_suspend(struct pci_dev *pdev, pm_message_t state)

ULI526X_DBUG(0, "uli526x_suspend", 0);

if (!netdev_priv(dev))
return 0;

pci_save_state(pdev);

if (!netif_running(dev))
Expand Down Expand Up @@ -1228,9 +1225,6 @@ static int uli526x_resume(struct pci_dev *pdev)

ULI526X_DBUG(0, "uli526x_resume", 0);

if (!netdev_priv(dev))
return 0;

pci_restore_state(pdev);

if (!netif_running(dev))
Expand Down

0 comments on commit 2d4dda7

Please sign in to comment.