lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <0ca5c54fab5dd7dd5988ae48af779570076800a6.camel@redhat.com>
Date:   Wed, 04 May 2022 13:29:18 -0400
From:   Lyude Paul <lyude@...hat.com>
To:     Guo Zhengkui <guozhengkui@...o.com>,
        Ben Skeggs <bskeggs@...hat.com>,
        Karol Herbst <kherbst@...hat.com>,
        David Airlie <airlied@...ux.ie>,
        Daniel Vetter <daniel@...ll.ch>,
        dri-devel@...ts.freedesktop.org, nouveau@...ts.freedesktop.org,
        linux-kernel@...r.kernel.org
Cc:     zhengkui_guo@...look.com
Subject: Re: [PATCH] drm/nouveau/devinit: fix returnvar.cocci warnings

Reviewed-by: Lyude Paul <lyude@...hat.com>

Will push to the appropriate branch in a little bit

On Thu, 2022-05-05 at 00:09 +0800, Guo Zhengkui wrote:
> Fix the following coccicheck warnings:
> 
> drivers/gpu/drm/nouveau/nvkm/subdev/devinit/gf100.c:71:5-12:
> Unneeded variable: "disable". Return "0ULL" on line 90.
> drivers/gpu/drm/nouveau/nvkm/subdev/devinit/gm107.c:35:5-12:
> Unneeded variable: "disable". Return "0ULL" on line 44.
> drivers/gpu/drm/nouveau/nvkm/subdev/devinit/g98.c:35:5-12:
> Unneeded variable: "disable". Return "0ULL" on line 50.
> 
> Signed-off-by: Guo Zhengkui <guozhengkui@...o.com>
> ---
>  drivers/gpu/drm/nouveau/nvkm/subdev/devinit/g98.c   | 3 +--
>  drivers/gpu/drm/nouveau/nvkm/subdev/devinit/gf100.c | 3 +--
>  drivers/gpu/drm/nouveau/nvkm/subdev/devinit/gm107.c | 3 +--
>  3 files changed, 3 insertions(+), 6 deletions(-)
> 
> diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/devinit/g98.c
> b/drivers/gpu/drm/nouveau/nvkm/subdev/devinit/g98.c
> index 05729ca19e9a..8977483a9f42 100644
> --- a/drivers/gpu/drm/nouveau/nvkm/subdev/devinit/g98.c
> +++ b/drivers/gpu/drm/nouveau/nvkm/subdev/devinit/g98.c
> @@ -32,7 +32,6 @@ g98_devinit_disable(struct nvkm_devinit *init)
>         struct nvkm_device *device = init->subdev.device;
>         u32 r001540 = nvkm_rd32(device, 0x001540);
>         u32 r00154c = nvkm_rd32(device, 0x00154c);
> -       u64 disable = 0ULL;
>  
>         if (!(r001540 & 0x40000000)) {
>                 nvkm_subdev_disable(device, NVKM_ENGINE_MSPDEC, 0);
> @@ -47,7 +46,7 @@ g98_devinit_disable(struct nvkm_devinit *init)
>         if (!(r00154c & 0x00000040))
>                 nvkm_subdev_disable(device, NVKM_ENGINE_SEC, 0);
>  
> -       return disable;
> +       return 0ULL;
>  }
>  
>  static const struct nvkm_devinit_func
> diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/devinit/gf100.c
> b/drivers/gpu/drm/nouveau/nvkm/subdev/devinit/gf100.c
> index 051cfd6a5caf..5b7cb1fe7897 100644
> --- a/drivers/gpu/drm/nouveau/nvkm/subdev/devinit/gf100.c
> +++ b/drivers/gpu/drm/nouveau/nvkm/subdev/devinit/gf100.c
> @@ -68,7 +68,6 @@ gf100_devinit_disable(struct nvkm_devinit *init)
>  {
>         struct nvkm_device *device = init->subdev.device;
>         u32 r022500 = nvkm_rd32(device, 0x022500);
> -       u64 disable = 0ULL;
>  
>         if (r022500 & 0x00000001)
>                 nvkm_subdev_disable(device, NVKM_ENGINE_DISP, 0);
> @@ -87,7 +86,7 @@ gf100_devinit_disable(struct nvkm_devinit *init)
>         if (r022500 & 0x00000200)
>                 nvkm_subdev_disable(device, NVKM_ENGINE_CE, 1);
>  
> -       return disable;
> +       return 0ULL;
>  }
>  
>  void
> diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/devinit/gm107.c
> b/drivers/gpu/drm/nouveau/nvkm/subdev/devinit/gm107.c
> index 4323732a3cb2..8955af2704c7 100644
> --- a/drivers/gpu/drm/nouveau/nvkm/subdev/devinit/gm107.c
> +++ b/drivers/gpu/drm/nouveau/nvkm/subdev/devinit/gm107.c
> @@ -32,7 +32,6 @@ gm107_devinit_disable(struct nvkm_devinit *init)
>         struct nvkm_device *device = init->subdev.device;
>         u32 r021c00 = nvkm_rd32(device, 0x021c00);
>         u32 r021c04 = nvkm_rd32(device, 0x021c04);
> -       u64 disable = 0ULL;
>  
>         if (r021c00 & 0x00000001)
>                 nvkm_subdev_disable(device, NVKM_ENGINE_CE, 0);
> @@ -41,7 +40,7 @@ gm107_devinit_disable(struct nvkm_devinit *init)
>         if (r021c04 & 0x00000001)
>                 nvkm_subdev_disable(device, NVKM_ENGINE_DISP, 0);
>  
> -       return disable;
> +       return 0ULL;
>  }
>  
>  static const struct nvkm_devinit_func

-- 
Cheers,
 Lyude Paul (she/her)
 Software Engineer at Red Hat

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ