* [PATCH 0/2] replace IS_ERR_OR_NULL by IS_ERR
@ 2016-11-16 10:43 Julia Lawall
2016-11-16 10:43 ` [PATCH 1/2] net: netcp: " Julia Lawall
2016-11-16 10:43 ` [PATCH 2/2] soc: ti: knav_qmss_queue: " Julia Lawall
0 siblings, 2 replies; 4+ messages in thread
From: Julia Lawall @ 2016-11-16 10:43 UTC (permalink / raw)
To: netdev
Cc: kernel-janitors, linux-kernel, linux-arm-kernel, Christophe JAILLET
Replace IS_ERR_OR_NULL by IS_ERR on knav_queue_open calls.
---
drivers/net/ethernet/ti/netcp_core.c | 6 +++---
drivers/soc/ti/knav_qmss_queue.c | 2 +-
2 files changed, 4 insertions(+), 4 deletions(-)
^ permalink raw reply [flat|nested] 4+ messages in thread
* [PATCH 1/2] net: netcp: replace IS_ERR_OR_NULL by IS_ERR
2016-11-16 10:43 [PATCH 0/2] replace IS_ERR_OR_NULL by IS_ERR Julia Lawall
@ 2016-11-16 10:43 ` Julia Lawall
2016-11-17 4:27 ` David Miller
2016-11-16 10:43 ` [PATCH 2/2] soc: ti: knav_qmss_queue: " Julia Lawall
1 sibling, 1 reply; 4+ messages in thread
From: Julia Lawall @ 2016-11-16 10:43 UTC (permalink / raw)
To: Wingman Kwok
Cc: kernel-janitors, Murali Karicheri, netdev, linux-kernel,
Christophe JAILLET
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: Julia Lawall <Julia.Lawall@lip6.fr>
---
The patches in this series are completely independent of each other, except
for having been made from the same specification.
drivers/net/ethernet/ti/netcp_core.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/drivers/net/ethernet/ti/netcp_core.c b/drivers/net/ethernet/ti/netcp_core.c
index 78b4c83..7981b99 100644
--- a/drivers/net/ethernet/ti/netcp_core.c
+++ b/drivers/net/ethernet/ti/netcp_core.c
@@ -1568,7 +1568,7 @@ static int netcp_setup_navigator_resources(struct net_device *ndev)
/* open Tx completion queue */
snprintf(name, sizeof(name), "tx-compl-%s", ndev->name);
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);
goto fail;
}
@@ -1588,7 +1588,7 @@ static int netcp_setup_navigator_resources(struct net_device *ndev)
/* open Rx completion queue */
snprintf(name, sizeof(name), "rx-compl-%s", ndev->name);
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);
goto fail;
}
@@ -1610,7 +1610,7 @@ static int netcp_setup_navigator_resources(struct net_device *ndev)
++i) {
snprintf(name, sizeof(name), "rx-fdq-%s-%d", ndev->name, i);
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]);
goto fail;
}
^ permalink raw reply related [flat|nested] 4+ messages in thread
* [PATCH 2/2] soc: ti: knav_qmss_queue: replace IS_ERR_OR_NULL by IS_ERR
2016-11-16 10:43 [PATCH 0/2] replace IS_ERR_OR_NULL by IS_ERR Julia Lawall
2016-11-16 10:43 ` [PATCH 1/2] net: netcp: " Julia Lawall
@ 2016-11-16 10:43 ` Julia Lawall
1 sibling, 0 replies; 4+ messages in thread
From: Julia Lawall @ 2016-11-16 10:43 UTC (permalink / raw)
To: Santosh Shilimkar
Cc: kernel-janitors, linux-kernel, linux-arm-kernel, Christophe JAILLET
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: Julia Lawall <Julia.Lawall@lip6.fr>
---
The patches in this series are completely independent of each other, except
for having been made from the same specification.
drivers/soc/ti/knav_qmss_queue.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/soc/ti/knav_qmss_queue.c b/drivers/soc/ti/knav_qmss_queue.c
index b73e353..d90df84 100644
--- a/drivers/soc/ti/knav_qmss_queue.c
+++ b/drivers/soc/ti/knav_qmss_queue.c
@@ -777,7 +777,7 @@ void *knav_pool_create(const char *name,
}
pool->queue = knav_queue_open(name, KNAV_QUEUE_GP, 0);
- if (IS_ERR_OR_NULL(pool->queue)) {
+ if (IS_ERR(pool->queue)) {
dev_err(kdev->dev,
"failed to open queue for pool(%s), error %ld\n",
name, PTR_ERR(pool->queue));
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH 1/2] net: netcp: replace IS_ERR_OR_NULL by IS_ERR
2016-11-16 10:43 ` [PATCH 1/2] net: netcp: " Julia Lawall
@ 2016-11-17 4:27 ` David Miller
0 siblings, 0 replies; 4+ messages in thread
From: David Miller @ 2016-11-17 4:27 UTC (permalink / raw)
To: Julia.Lawall
Cc: w-kwok2, kernel-janitors, m-karicheri2, netdev, linux-kernel,
christophe.jaillet
From: Julia Lawall <Julia.Lawall@lip6.fr>
Date: Wed, 16 Nov 2016 11:43:33 +0100
> 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/)
...
> Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>
Applied to net-next, thanks.
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2016-11-17 4:27 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-11-16 10:43 [PATCH 0/2] replace IS_ERR_OR_NULL by IS_ERR Julia Lawall
2016-11-16 10:43 ` [PATCH 1/2] net: netcp: " Julia Lawall
2016-11-17 4:27 ` David Miller
2016-11-16 10:43 ` [PATCH 2/2] soc: ti: knav_qmss_queue: " Julia Lawall
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).