[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <1567493770-20074-1-git-send-email-zhongjiang@huawei.com>
Date: Tue, 3 Sep 2019 14:56:10 +0800
From: zhong jiang <zhongjiang@...wei.com>
To: <davem@...emloft.net>
CC: <saeedm@...lanox.com>, <leon@...nel.org>, <netdev@...r.kernel.org>,
<linux-kernel@...r.kernel.org>, <zhongjiang@...wei.com>
Subject: [PATCH] net/mlx5: Use PTR_ERR_OR_ZERO rather than its implementation
PTR_ERR_OR_ZERO contains if(IS_ERR(...)) + PTR_ERR. It is better
to use it directly. hence just replace it.
Signed-off-by: zhong jiang <zhongjiang@...wei.com>
---
drivers/net/ethernet/mellanox/mlx5/core/en_tc.c | 5 +----
1 file changed, 1 insertion(+), 4 deletions(-)
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_tc.c b/drivers/net/ethernet/mellanox/mlx5/core/en_tc.c
index 5581a80..2e0b467 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/en_tc.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/en_tc.c
@@ -989,10 +989,7 @@ static void mlx5e_hairpin_flow_del(struct mlx5e_priv *priv,
&flow_act, dest, dest_ix);
mutex_unlock(&priv->fs.tc.t_lock);
- if (IS_ERR(flow->rule[0]))
- return PTR_ERR(flow->rule[0]);
-
- return 0;
+ return PTR_ERR_OR_ZERO(flow->rule[0]);
}
static void mlx5e_tc_del_nic_flow(struct mlx5e_priv *priv,
--
1.7.12.4
Powered by blists - more mailing lists