From b2d6822ecd353c4d82679d6eee081130b40eac66 Mon Sep 17 00:00:00 2001 From: Alaa Hleihel Date: Sun, 10 May 2020 14:52:24 -0400 Subject: [PATCH 051/312] [netdrv] net/mlx5: Use PTR_ERR_OR_ZERO rather than its implementation Message-id: <20200510145245.10054-62-ahleihel@redhat.com> Patchwork-id: 306602 Patchwork-instance: patchwork O-Subject: [RHEL8.3 BZ 1789378 v2 61/82] net/mlx5: Use PTR_ERR_OR_ZERO rather than its implementation Bugzilla: 1789378 RH-Acked-by: Kamal Heib RH-Acked-by: Jarod Wilson RH-Acked-by: Tony Camuso RH-Acked-by: Jonathan Toppins Bugzilla: http://bugzilla.redhat.com/1789378 Upstream: v5.4-rc1 commit a2b7189be6b5dd697c333beb91f988dfc3ca87fb Author: zhong jiang Date: Tue Sep 3 14:56:10 2019 +0800 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 Acked-by: Saeed Mahameed Signed-off-by: Saeed Mahameed Signed-off-by: Alaa Hleihel Signed-off-by: Frantisek Hrbata --- 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 9a49ae5ac4ce..ac372993c9d8 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/en_tc.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/en_tc.c @@ -988,10 +988,7 @@ mlx5e_tc_add_nic_flow(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, -- 2.13.6