drm/nouveau/devinit: fix returnvar.cocci warnings
authorGuo Zhengkui <guozhengkui@vivo.com>
Wed, 4 May 2022 16:09:29 +0000 (00:09 +0800)
committerLyude Paul <lyude@redhat.com>
Wed, 4 May 2022 17:30:08 +0000 (13:30 -0400)
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@vivo.com>
Reviewed-by: Lyude Paul <lyude@redhat.com>
Signed-off-by: Lyude Paul <lyude@redhat.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20220504161003.9245-1-guozhengkui@vivo.com
drivers/gpu/drm/nouveau/nvkm/subdev/devinit/g98.c
drivers/gpu/drm/nouveau/nvkm/subdev/devinit/gf100.c
drivers/gpu/drm/nouveau/nvkm/subdev/devinit/gm107.c

index 05729ca19e9a7e591202051d8c75bbcb93143396..8977483a9f42d86aacb82f0d19cb3b1ed5fc3964 100644 (file)
@@ -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
index 051cfd6a5caf5ce82bd55cc8f52bc21bfd541516..5b7cb1fe7897bcb785254a2e353e25eb1714490d 100644 (file)
@@ -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
index 4323732a3cb22897b3ec035e4cfe7081847c1fb0..8955af2704c77dd7a0d80d9442cc308a1f89e2f2 100644 (file)
@@ -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