Commit d01eb808 authored by Julia Lawall's avatar Julia Lawall Committed by David S. Miller

net: netcp: replace IS_ERR_OR_NULL by IS_ERR

knav_queue_open always returns an ERR_PTR value, never NULL.  This can be
confirmed by unfolding the function calls and conforms to the function's
documentation.  Thus, replace IS_ERR_OR_NULL by IS_ERR in error checks.

The change is made using the following semantic patch:
(http://coccinelle.lip6.fr/)

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

x = knav_queue_open(...);
if (
-   IS_ERR_OR_NULL
+   IS_ERR
    (x)) S
// </smpl>
Signed-off-by: default avatarJulia Lawall <Julia.Lawall@lip6.fr>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 7fda702f
...@@ -1568,7 +1568,7 @@ static int netcp_setup_navigator_resources(struct net_device *ndev) ...@@ -1568,7 +1568,7 @@ static int netcp_setup_navigator_resources(struct net_device *ndev)
/* open Tx completion queue */ /* open Tx completion queue */
snprintf(name, sizeof(name), "tx-compl-%s", ndev->name); snprintf(name, sizeof(name), "tx-compl-%s", ndev->name);
netcp->tx_compl_q = knav_queue_open(name, netcp->tx_compl_qid, 0); netcp->tx_compl_q = knav_queue_open(name, netcp->tx_compl_qid, 0);
if (IS_ERR_OR_NULL(netcp->tx_compl_q)) { if (IS_ERR(netcp->tx_compl_q)) {
ret = PTR_ERR(netcp->tx_compl_q); ret = PTR_ERR(netcp->tx_compl_q);
goto fail; goto fail;
} }
...@@ -1588,7 +1588,7 @@ static int netcp_setup_navigator_resources(struct net_device *ndev) ...@@ -1588,7 +1588,7 @@ static int netcp_setup_navigator_resources(struct net_device *ndev)
/* open Rx completion queue */ /* open Rx completion queue */
snprintf(name, sizeof(name), "rx-compl-%s", ndev->name); snprintf(name, sizeof(name), "rx-compl-%s", ndev->name);
netcp->rx_queue = knav_queue_open(name, netcp->rx_queue_id, 0); netcp->rx_queue = knav_queue_open(name, netcp->rx_queue_id, 0);
if (IS_ERR_OR_NULL(netcp->rx_queue)) { if (IS_ERR(netcp->rx_queue)) {
ret = PTR_ERR(netcp->rx_queue); ret = PTR_ERR(netcp->rx_queue);
goto fail; goto fail;
} }
...@@ -1610,7 +1610,7 @@ static int netcp_setup_navigator_resources(struct net_device *ndev) ...@@ -1610,7 +1610,7 @@ static int netcp_setup_navigator_resources(struct net_device *ndev)
++i) { ++i) {
snprintf(name, sizeof(name), "rx-fdq-%s-%d", ndev->name, i); snprintf(name, sizeof(name), "rx-fdq-%s-%d", ndev->name, i);
netcp->rx_fdq[i] = knav_queue_open(name, KNAV_QUEUE_GP, 0); netcp->rx_fdq[i] = knav_queue_open(name, KNAV_QUEUE_GP, 0);
if (IS_ERR_OR_NULL(netcp->rx_fdq[i])) { if (IS_ERR(netcp->rx_fdq[i])) {
ret = PTR_ERR(netcp->rx_fdq[i]); ret = PTR_ERR(netcp->rx_fdq[i]);
goto fail; goto fail;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment