Re: [PATCH linux-next] RDMA/mlx4: remove NULL check before dev_{put, hold}
From: Leon Romanovsky
Date: Mon Nov 28 2022 - 07:20:38 EST
On Mon, Nov 28, 2022 at 08:00:29PM +0800, zhang.songyi@xxxxxxxxxx wrote:
> From: zhang songyi <zhang.songyi@xxxxxxxxxx>
>
> The call netdev_{put, hold} of dev_{put, hold} will check NULL,
> so there is no need to check before using dev_{put, hold}.
>
> Fix the following coccicheck warnings:
> /drivers/infiniband/hw/mlx4/main.c:1311:2-10: WARNING:
> WARNING NULL check before dev_{put, hold} functions is not needed.
>
> /drivers/infiniband/hw/mlx4/main.c:148:2-10: WARNING:
> WARNING NULL check before dev_{put, hold} functions is not needed.
>
> /drivers/infiniband/hw/mlx4/main.c:1959:3-11: WARNING:
> WARNING NULL check before dev_{put, hold} functions is not needed.
>
> /drivers/infiniband/hw/mlx4/main.c:1962:3-10: WARNING:
> WARNING NULL check before dev_{put, hold} functions is not needed.
>
> Signed-off-by: zhang songyi <zhang.songyi@xxxxxxxxxx>
> ---
> drivers/infiniband/hw/mlx4/main.c | 12 ++++--------
> 1 file changed, 4 insertions(+), 8 deletions(-)
>
The patch needs to be based on this repository:
https://git.kernel.org/pub/scm/linux/kernel/git/rdma/rdma.git/
branch: for-next
Thanks