* [PATCH v2] net/mlx5e: Use IS_ERR() to check and simplify code
@ 2020-05-15 23:06 Tang Bin
2020-05-18 16:25 ` Saeed Mahameed
0 siblings, 1 reply; 2+ messages in thread
From: Tang Bin @ 2020-05-15 23:06 UTC (permalink / raw)
To: saeedm, davem, leon
Cc: netdev, linux-rdma, linux-kernel, Tang Bin, Zhang Shengju,
Leon Romanovsky
Use IS_ERR() and PTR_ERR() instead of PTR_ERR_OR_ZERO() to
simplify code, avoid redundant judgements.
Signed-off-by: Zhang Shengju <zhangshengju@cmss.chinamobile.com>
Signed-off-by: Tang Bin <tangbin@cmss.chinamobile.com>
Reviewed-by: Leon Romanovsky <leonro@mellanox.com>
---
Changes from v1
- fix the commit message for typo.
---
drivers/net/ethernet/mellanox/mlx5/core/en/tc_tun.c | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en/tc_tun.c b/drivers/net/ethernet/mellanox/mlx5/core/en/tc_tun.c
index af4ebd295..00e7add0b 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/en/tc_tun.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/en/tc_tun.c
@@ -93,9 +93,8 @@ static int mlx5e_route_lookup_ipv4(struct mlx5e_priv *priv,
}
rt = ip_route_output_key(dev_net(mirred_dev), fl4);
- ret = PTR_ERR_OR_ZERO(rt);
- if (ret)
- return ret;
+ if (IS_ERR(rt))
+ return PTR_ERR(rt);
if (mlx5_lag_is_multipath(mdev) && rt->rt_gw_family != AF_INET) {
ip_rt_put(rt);
--
2.20.1.windows.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH v2] net/mlx5e: Use IS_ERR() to check and simplify code
2020-05-15 23:06 [PATCH v2] net/mlx5e: Use IS_ERR() to check and simplify code Tang Bin
@ 2020-05-18 16:25 ` Saeed Mahameed
0 siblings, 0 replies; 2+ messages in thread
From: Saeed Mahameed @ 2020-05-18 16:25 UTC (permalink / raw)
To: tangbin, davem, leon
Cc: Leon Romanovsky, netdev, linux-rdma, zhangshengju, linux-kernel
On Sat, 2020-05-16 at 07:06 +0800, Tang Bin wrote:
> Use IS_ERR() and PTR_ERR() instead of PTR_ERR_OR_ZERO() to
> simplify code, avoid redundant judgements.
>
> Signed-off-by: Zhang Shengju <zhangshengju@cmss.chinamobile.com>
> Signed-off-by: Tang Bin <tangbin@cmss.chinamobile.com>
> Reviewed-by: Leon Romanovsky <leonro@mellanox.com>
> ---
> Changes from v1
> - fix the commit message for typo.
> ---
> drivers/net/ethernet/mellanox/mlx5/core/en/tc_tun.c | 5 ++---
> 1 file changed, 2 insertions(+), 3 deletions(-)
>
Applied to net-next-mlx5
Thanks,
Saeed.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2020-05-18 16:25 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-05-15 23:06 [PATCH v2] net/mlx5e: Use IS_ERR() to check and simplify code Tang Bin
2020-05-18 16:25 ` Saeed Mahameed
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.