提交 2d4dda78 编写于 作者: J Julia Lawall 提交者: David S. Miller

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

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

- if (!netdev_priv(...)) S
// </smpl>
Signed-off-by: NJulia Lawall <Julia.Lawall@lip6.fr>
Acked-by: NGrant Grundler <grundler@parisc-linux.org>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 c1ddf295
......@@ -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))
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册