net/mlx5: Use PTR_ERR_OR_ZERO rather than its implementation
authorzhong jiang <zhongjiang@huawei.com>
Tue, 3 Sep 2019 06:56:10 +0000 (14:56 +0800)
committerSaeed Mahameed <saeedm@mellanox.com>
Thu, 5 Sep 2019 21:44:41 +0000 (14:44 -0700)
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@huawei.com>
Acked-by: Saeed Mahameed <saeedm@mellanox.com>
Signed-off-by: Saeed Mahameed <saeedm@mellanox.com>
drivers/net/ethernet/mellanox/mlx5/core/en_tc.c

index 98d1f7a..da7555f 100644 (file)
@@ -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,