2021-08-21 02:15:53

by CGEL

[permalink] [raw]
Subject: [PATCH linux-next] drm/nouveau/mmu: drop unneeded assignment in the nvkm_uvmm_mthd_page()

From: Luo penghao <[email protected]>

In order to keep the code style consistency of the whole file,
the 'ret' assignments should be deleted.

The clang_analyzer complains as follows:

drivers/gpu/drm/nouveau/nvkm/subdev/mmu/uvmm.c:317:8:warning:
Although the value storedto 'ret' is used in the enclosing expression,
the value is never actually read from 'ret'.

Reported-by: Zeal Robot <[email protected]>
Signed-off-by: Luo penghao <[email protected]>
---
drivers/gpu/drm/nouveau/nvkm/subdev/mmu/uvmm.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/mmu/uvmm.c b/drivers/gpu/drm/nouveau/nvkm/subdev/mmu/uvmm.c
index c43b824..d9f8e11 100644
--- a/drivers/gpu/drm/nouveau/nvkm/subdev/mmu/uvmm.c
+++ b/drivers/gpu/drm/nouveau/nvkm/subdev/mmu/uvmm.c
@@ -314,7 +314,7 @@ nvkm_uvmm_mthd_page(struct nvkm_uvmm *uvmm, void *argv, u32 argc)
page = uvmm->vmm->func->page;
for (nr = 0; page[nr].shift; nr++);

- if (!(ret = nvif_unpack(ret, &argv, &argc, args->v0, 0, 0, false))) {
+ if (!(nvif_unpack(ret, &argv, &argc, args->v0, 0, 0, false))) {
if ((index = args->v0.index) >= nr)
return -EINVAL;
type = page[index].type;
--
2.15.2



2021-09-28 11:16:43

by Karol Herbst

[permalink] [raw]
Subject: Re: [PATCH linux-next] drm/nouveau/mmu: drop unneeded assignment in the nvkm_uvmm_mthd_page()

Reviewed-by: Karol Herbst <[email protected]>

On Sat, Aug 21, 2021 at 10:46 AM CGEL <[email protected]> wrote:
>
> From: Luo penghao <[email protected]>
>
> In order to keep the code style consistency of the whole file,
> the 'ret' assignments should be deleted.
>
> The clang_analyzer complains as follows:
>
> drivers/gpu/drm/nouveau/nvkm/subdev/mmu/uvmm.c:317:8:warning:
> Although the value storedto 'ret' is used in the enclosing expression,
> the value is never actually read from 'ret'.
>
> Reported-by: Zeal Robot <[email protected]>
> Signed-off-by: Luo penghao <[email protected]>
> ---
> drivers/gpu/drm/nouveau/nvkm/subdev/mmu/uvmm.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/mmu/uvmm.c b/drivers/gpu/drm/nouveau/nvkm/subdev/mmu/uvmm.c
> index c43b824..d9f8e11 100644
> --- a/drivers/gpu/drm/nouveau/nvkm/subdev/mmu/uvmm.c
> +++ b/drivers/gpu/drm/nouveau/nvkm/subdev/mmu/uvmm.c
> @@ -314,7 +314,7 @@ nvkm_uvmm_mthd_page(struct nvkm_uvmm *uvmm, void *argv, u32 argc)
> page = uvmm->vmm->func->page;
> for (nr = 0; page[nr].shift; nr++);
>
> - if (!(ret = nvif_unpack(ret, &argv, &argc, args->v0, 0, 0, false))) {
> + if (!(nvif_unpack(ret, &argv, &argc, args->v0, 0, 0, false))) {
> if ((index = args->v0.index) >= nr)
> return -EINVAL;
> type = page[index].type;
> --
> 2.15.2
>
>