Re: [PATCH net-next v3] net/mlx5e: Remove NULL check before dev_{put, hold}
From: Leon Romanovsky
Date: Tue Apr 04 2023 - 12:44:40 EST
On Tue, Apr 04, 2023 at 03:29:32PM +0800, Yang Li wrote:
> ./drivers/net/ethernet/mellanox/mlx5/core/en/tc_tun.c:35:2-9: WARNING: NULL check before dev_{put, hold} functions is not needed.
> ./drivers/net/ethernet/mellanox/mlx5/core/en/tc_tun.c:72:2-10: WARNING: NULL check before dev_{put, hold} functions is not needed.
> ./drivers/net/ethernet/mellanox/mlx5/core/en/tc_tun.c:80:2-9: WARNING: NULL check before dev_{put, hold} functions is not needed.
> ./drivers/net/ethernet/mellanox/mlx5/core/en/tc_tun_encap.c:35:2-9: WARNING: NULL check before dev_{put, hold} functions is not needed.
> ./drivers/net/ethernet/mellanox/mlx5/core/en/tc_tun_encap.c:734:2-9: WARNING: NULL check before dev_{put, hold} functions is not needed.
> ./drivers/net/ethernet/mellanox/mlx5/core/en/tc_tun_encap.c:769:2-9: WARNING: NULL check before dev_{put, hold} functions is not needed.
> ./drivers/net/ethernet/mellanox/mlx5/core/lag/lag.c:1450:2-10: WARNING: NULL check before dev_{put, hold} functions is not needed.
>
> Reported-by: Abaci Robot <abaci@xxxxxxxxxxxxxxxxx>
> Link: https://bugzilla.openanolis.cn/show_bug.cgi?id=4667
> Signed-off-by: Yang Li <yang.lee@xxxxxxxxxxxxxxxxx>
> ---
>
> change in v3:
> --According to Leon's suggestion, do this cleanup for whole driver.
>
> drivers/net/ethernet/mellanox/mlx5/core/en/tc_tun.c | 9 +++------
> .../net/ethernet/mellanox/mlx5/core/en/tc_tun_encap.c | 10 +++-------
> drivers/net/ethernet/mellanox/mlx5/core/lag/lag.c | 3 +--
> 3 files changed, 7 insertions(+), 15 deletions(-)
>
Thanks,
Reviewed-by: Leon Romanovsky <leonro@xxxxxxxxxx>