Skip to content

Commit

Permalink
net: microchip: vcap api: Use ERR_CAST() in vcap_decode_rule()
Browse files Browse the repository at this point in the history
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>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Li Zetao authored and David S. Miller committed Aug 4, 2023
1 parent f702dbb commit 58e7012
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/net/ethernet/microchip/vcap/vcap_api.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 58e7012

Please sign in to comment.