From: Julia Lawall Date: Thu, 2 Jan 2014 16:28:49 +0000 (+0100) Subject: net: tulip: delete useless tests on netdev_priv X-Git-Tag: MMI-PSA29.97-13-9~12877^2~310 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=2d4dda781fc1e9c929a1f699119b91eddbcf475c;p=GitHub%2FMotorolaMobilityLLC%2Fkernel-slsi.git net: tulip: delete useless tests on netdev_priv 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/) // @@ statement S; @@ - if (!netdev_priv(...)) S // Signed-off-by: Julia Lawall Acked-by: Grant Grundler Signed-off-by: David S. Miller --- diff --git a/drivers/net/ethernet/dec/tulip/uli526x.c b/drivers/net/ethernet/dec/tulip/uli526x.c index a5397b130724..aa4ee385091f 100644 --- a/drivers/net/ethernet/dec/tulip/uli526x.c +++ b/drivers/net/ethernet/dec/tulip/uli526x.c @@ -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)) @@ -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))