netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net-next] net: microchip: vcap api: Use ERR_CAST() in vcap_decode_rule()
@ 2023-08-02  9:31 Li Zetao
  2023-08-02 16:48 ` Simon Horman
  2023-08-04  8:10 ` patchwork-bot+netdevbpf
  0 siblings, 2 replies; 3+ messages in thread
From: Li Zetao @ 2023-08-02  9:31 UTC (permalink / raw)
  To: lars.povlsen, Steen.Hegelund, daniel.machon, UNGLinuxDriver,
	davem, edumazet, kuba, pabeni
  Cc: lizetao1, linux-arm-kernel, netdev

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@huawei.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


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH net-next] net: microchip: vcap api: Use ERR_CAST() in vcap_decode_rule()
  2023-08-02  9:31 [PATCH net-next] net: microchip: vcap api: Use ERR_CAST() in vcap_decode_rule() Li Zetao
@ 2023-08-02 16:48 ` Simon Horman
  2023-08-04  8:10 ` patchwork-bot+netdevbpf
  1 sibling, 0 replies; 3+ messages in thread
From: Simon Horman @ 2023-08-02 16:48 UTC (permalink / raw)
  To: Li Zetao
  Cc: lars.povlsen, Steen.Hegelund, daniel.machon, UNGLinuxDriver,
	davem, edumazet, kuba, pabeni, linux-arm-kernel, netdev

On Wed, Aug 02, 2023 at 05:31:56PM +0800, Li Zetao wrote:
> 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@huawei.com>

Reviewed-by: Simon Horman <horms@kernel.org>


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH net-next] net: microchip: vcap api: Use ERR_CAST() in vcap_decode_rule()
  2023-08-02  9:31 [PATCH net-next] net: microchip: vcap api: Use ERR_CAST() in vcap_decode_rule() Li Zetao
  2023-08-02 16:48 ` Simon Horman
@ 2023-08-04  8:10 ` patchwork-bot+netdevbpf
  1 sibling, 0 replies; 3+ messages in thread
From: patchwork-bot+netdevbpf @ 2023-08-04  8:10 UTC (permalink / raw)
  To: Li Zetao
  Cc: lars.povlsen, Steen.Hegelund, daniel.machon, UNGLinuxDriver,
	davem, edumazet, kuba, pabeni, linux-arm-kernel, netdev

Hello:

This patch was applied to netdev/net-next.git (main)
by David S. Miller <davem@davemloft.net>:

On Wed, 2 Aug 2023 17:31:56 +0800 you wrote:
> 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.
> 
> [...]

Here is the summary with links:
  - [net-next] net: microchip: vcap api: Use ERR_CAST() in vcap_decode_rule()
    https://git.kernel.org/netdev/net-next/c/58e701264f15

You are awesome, thank you!
-- 
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html



^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2023-08-04  8:10 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-08-02  9:31 [PATCH net-next] net: microchip: vcap api: Use ERR_CAST() in vcap_decode_rule() Li Zetao
2023-08-02 16:48 ` Simon Horman
2023-08-04  8:10 ` patchwork-bot+netdevbpf

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