[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <20230802093156.975743-1-lizetao1@huawei.com>
Date: Wed, 2 Aug 2023 17:31:56 +0800
From: Li Zetao <lizetao1@...wei.com>
To: <lars.povlsen@...rochip.com>, <Steen.Hegelund@...rochip.com>,
<daniel.machon@...rochip.com>, <UNGLinuxDriver@...rochip.com>,
<davem@...emloft.net>, <edumazet@...gle.com>, <kuba@...nel.org>,
<pabeni@...hat.com>
CC: <lizetao1@...wei.com>, <linux-arm-kernel@...ts.infradead.org>,
<netdev@...r.kernel.org>
Subject: [PATCH net-next] net: microchip: vcap api: Use ERR_CAST() in vcap_decode_rule()
There is a warning reported by coccinelle:
./drivers/net/ethernet/microchip/vcap/vcap_api.c:2399:9-16: WARNING:
ERR_CAST can be used with ri
Use ERR_CAST instead of ERR_PTR + PTR_ERR to simplify the
conversion process.
Signed-off-by: Li Zetao <lizetao1@...wei.com>
---
drivers/net/ethernet/microchip/vcap/vcap_api.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/net/ethernet/microchip/vcap/vcap_api.c b/drivers/net/ethernet/microchip/vcap/vcap_api.c
index a418ad8e8770..a7b43f99bc80 100644
--- a/drivers/net/ethernet/microchip/vcap/vcap_api.c
+++ b/drivers/net/ethernet/microchip/vcap/vcap_api.c
@@ -2396,7 +2396,7 @@ struct vcap_rule *vcap_decode_rule(struct vcap_rule_internal *elem)
ri = vcap_dup_rule(elem, elem->state == VCAP_RS_DISABLED);
if (IS_ERR(ri))
- return ERR_PTR(PTR_ERR(ri));
+ return ERR_CAST(ri);
if (ri->state == VCAP_RS_DISABLED)
goto out;
--
2.34.1
Powered by blists - more mailing lists