diff mbox series

[net-next,1/2] net: microchip: sparx5: Use helper function IS_ERR_OR_NULL()

Message ID 20230817071941.346590-2-ruanjinjie@huawei.com (mailing list archive)
State New, archived
Headers show
Series net: Use helper function IS_ERR_OR_NULL() | expand

Commit Message

Jinjie Ruan Aug. 17, 2023, 7:19 a.m. UTC
Use IS_ERR_OR_NULL() instead of open-coding it
to simplify the code.

Signed-off-by: Ruan Jinjie <ruanjinjie@huawei.com>
---
 drivers/net/ethernet/microchip/sparx5/sparx5_tc_flower.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/drivers/net/ethernet/microchip/sparx5/sparx5_tc_flower.c b/drivers/net/ethernet/microchip/sparx5/sparx5_tc_flower.c
index 906299ad8425..bc1b4498ed04 100644
--- a/drivers/net/ethernet/microchip/sparx5/sparx5_tc_flower.c
+++ b/drivers/net/ethernet/microchip/sparx5/sparx5_tc_flower.c
@@ -1274,7 +1274,7 @@  static int sparx5_tc_free_rule_resources(struct net_device *ndev,
 	int ret = 0;
 
 	vrule = vcap_get_rule(vctrl, rule_id);
-	if (!vrule || IS_ERR(vrule))
+	if (IS_ERR_OR_NULL(vrule))
 		return -EINVAL;
 
 	sparx5_tc_free_psfp_resources(sparx5, vrule);