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>
This commit is contained in:
parent
9a7bae8a12
commit
44fafdaa75
1 changed files with 2 additions and 8 deletions
|
@ -1740,10 +1740,7 @@ static int init_ingress_acl_root_ns(struct mlx5_flow_steering *steering)
|
||||||
/* create 1 prio*/
|
/* create 1 prio*/
|
||||||
prio = fs_create_prio(&steering->esw_egress_root_ns->ns, 0,
|
prio = fs_create_prio(&steering->esw_egress_root_ns->ns, 0,
|
||||||
MLX5_TOTAL_VPORTS(steering->dev));
|
MLX5_TOTAL_VPORTS(steering->dev));
|
||||||
if (IS_ERR(prio))
|
return PTR_ERR_OR_ZERO(prio);
|
||||||
return PTR_ERR(prio);
|
|
||||||
else
|
|
||||||
return 0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static int init_egress_acl_root_ns(struct mlx5_flow_steering *steering)
|
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*/
|
/* create 1 prio*/
|
||||||
prio = fs_create_prio(&steering->esw_ingress_root_ns->ns, 0,
|
prio = fs_create_prio(&steering->esw_ingress_root_ns->ns, 0,
|
||||||
MLX5_TOTAL_VPORTS(steering->dev));
|
MLX5_TOTAL_VPORTS(steering->dev));
|
||||||
if (IS_ERR(prio))
|
return PTR_ERR_OR_ZERO(prio);
|
||||||
return PTR_ERR(prio);
|
|
||||||
else
|
|
||||||
return 0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
int mlx5_init_fs(struct mlx5_core_dev *dev)
|
int mlx5_init_fs(struct mlx5_core_dev *dev)
|
||||||
|
|
Loading…
Reference in a new issue