diff mbox series

net/mlx5e: Use IS_ERR() to check and simplify code

Message ID 20200507115010.10380-1-tangbin@cmss.chinamobile.com
State Awaiting Upstream
Delegated to: David Miller
Headers show
Series net/mlx5e: Use IS_ERR() to check and simplify code | expand

Commit Message

tangbin May 7, 2020, 11:50 a.m. UTC
Use IS_ERR() and PTR_ERR() instead of PTR_ZRR_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>
---
 drivers/net/ethernet/mellanox/mlx5/core/en/tc_tun.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

Comments

Leon Romanovsky May 7, 2020, 1:40 p.m. UTC | #1
On Thu, May 07, 2020 at 07:50:10PM +0800, Tang Bin wrote:
> Use IS_ERR() and PTR_ERR() instead of PTR_ZRR_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>
> ---
>  drivers/net/ethernet/mellanox/mlx5/core/en/tc_tun.c | 5 ++---
>  1 file changed, 2 insertions(+), 3 deletions(-)
>

Thanks,
Reviewed-by: Leon Romanovsky <leonro@mellanox.com>
David Miller May 7, 2020, 8:18 p.m. UTC | #2
From: Tang Bin <tangbin@cmss.chinamobile.com>
Date: Thu,  7 May 2020 19:50:10 +0800

> Use IS_ERR() and PTR_ERR() instead of PTR_ZRR_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>

Saeed, please pick this up.

Thank you.
tangbin May 13, 2020, 9:48 a.m. UTC | #3
Hi David:

On 2020/5/8 4:18, David Miller wrote:
> From: Tang Bin <tangbin@cmss.chinamobile.com>
> Date: Thu,  7 May 2020 19:50:10 +0800
>
>> Use IS_ERR() and PTR_ERR() instead of PTR_ZRR_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>
> Saeed, please pick this up.

Does this mean the patch has been received and I just have to wait?

Thanks,

Tang Bin
Saeed Mahameed May 15, 2020, 10:28 p.m. UTC | #4
On Wed, 2020-05-13 at 17:48 +0800, Tang Bin wrote:
> Hi David:
> 
> On 2020/5/8 4:18, David Miller wrote:
> > From: Tang Bin <tangbin@cmss.chinamobile.com>
> > Date: Thu,  7 May 2020 19:50:10 +0800
> > 
> > > Use IS_ERR() and PTR_ERR() instead of PTR_ZRR_OR_ZERO()
                                            ^^^^^^^ typo
> > > to simplify code, avoid redundant judgements.
> > > 
> > > Signed-off-by: Zhang Shengju <zhangshengju@cmss.chinamobile.com>
> > > Signed-off-by: Tang Bin <tangbin@cmss.chinamobile.com>
> > Saeed, please pick this up.
> 
> Does this mean the patch has been received and I just have to wait?
> 

no, mlx5 patches normally go to net-next-mlx5 branch and usually
pulled into net-next once a week when i send my pull requests.

i will reply with "applied" when i apply this patch,
but for now please fix the typo.

Thanks,
Saeed
tangbin May 15, 2020, 10:54 p.m. UTC | #5
Hi Saeed:

On 2020/5/16 6:28, Saeed Mahameed wrote:
> On Wed, 2020-05-13 at 17:48 +0800, Tang Bin wrote:
>> Hi David:
>>
>> On 2020/5/8 4:18, David Miller wrote:
>>> From: Tang Bin <tangbin@cmss.chinamobile.com>
>>> Date: Thu,  7 May 2020 19:50:10 +0800
>>>
>>>> Use IS_ERR() and PTR_ERR() instead of PTR_ZRR_OR_ZERO()
>                                              ^^^^^^^ typo
Sorry for this mistake, sorry.
>>>> to simplify code, avoid redundant judgements.
>>>>
>>>> Signed-off-by: Zhang Shengju <zhangshengju@cmss.chinamobile.com>
>>>> Signed-off-by: Tang Bin <tangbin@cmss.chinamobile.com>
>>> Saeed, please pick this up.
>> Does this mean the patch has been received and I just have to wait?
>>
> no, mlx5 patches normally go to net-next-mlx5 branch and usually
> pulled into net-next once a week when i send my pull requests.
>
> i will reply with "applied" when i apply this patch,
> but for now please fix the typo.

Got it, I will send v2 for you.

Thanks,

Tang Bin
diff mbox series

Patch

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);