summaryrefslogtreecommitdiffstats
path: root/drivers/net/ethernet/mellanox
diff options
context:
space:
mode:
authorWei Yongjun <yongjun_wei@trendmicro.com.cn>2016-07-19 11:35:46 +0000
committerDavid S. Miller <davem@davemloft.net>2016-07-20 14:46:00 -0700
commit44fafdaa757cf251aade6c071f772ddb4e8a9885 (patch)
tree6660281d3b85f404a0ac6d62d9520bd0d9ba5381 /drivers/net/ethernet/mellanox
parent9a7bae8a12140c164082100a917ed5f856afccfc (diff)
downloadblackbird-op-linux-44fafdaa757cf251aade6c071f772ddb4e8a9885.tar.gz
blackbird-op-linux-44fafdaa757cf251aade6c071f772ddb4e8a9885.zip
net/mlx5: Use PTR_ERR_OR_ZERO() to simplify the code
Use PTR_ERR_OR_ZERO rather than if(IS_ERR(...)) + PTR_ERR. Generated by: scripts/coccinelle/api/ptr_ret.cocci Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn> Acked-by: Leon Romanovsky <leonro@mellanox.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/mellanox')
-rw-r--r--drivers/net/ethernet/mellanox/mlx5/core/fs_core.c10
1 files changed, 2 insertions, 8 deletions
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/fs_core.c b/drivers/net/ethernet/mellanox/mlx5/core/fs_core.c
index 1a377b403321..75bb8c864557 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/fs_core.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/fs_core.c
@@ -1740,10 +1740,7 @@ static int init_ingress_acl_root_ns(struct mlx5_flow_steering *steering)
/* create 1 prio*/
prio = fs_create_prio(&steering->esw_egress_root_ns->ns, 0,
MLX5_TOTAL_VPORTS(steering->dev));
- if (IS_ERR(prio))
- return PTR_ERR(prio);
- else
- return 0;
+ return PTR_ERR_OR_ZERO(prio);
}
static int init_egress_acl_root_ns(struct mlx5_flow_steering *steering)
@@ -1757,10 +1754,7 @@ static int init_egress_acl_root_ns(struct mlx5_flow_steering *steering)
/* create 1 prio*/
prio = fs_create_prio(&steering->esw_ingress_root_ns->ns, 0,
MLX5_TOTAL_VPORTS(steering->dev));
- if (IS_ERR(prio))
- return PTR_ERR(prio);
- else
- return 0;
+ return PTR_ERR_OR_ZERO(prio);
}
int mlx5_init_fs(struct mlx5_core_dev *dev)
OpenPOWER on IntegriCloud