Commit da2b1a0a authored by Deepak R Varma's avatar Deepak R Varma Committed by Lyude Paul
Browse files

drm/nouveau/devinit: Convert function disable() to be void



The current design of callback function disable() of struct
nvkm_devinit_func is defined to return a u64 value. In its implementation
in the driver modules, the function always returns a fixed value 0. Hence
the design and implementation of this function should be enhanced to return
void instead of a fixed value. This change also eliminates untouched
return variables.

The change is identified using the returnvar.cocci Coccinelle semantic
patch script.

Signed-off-by: default avatarDeepak R Varma <drv@mailo.com>
Reviewed-by: default avatarLyude Paul <lyude@redhat.com>
Signed-off-by: default avatarLyude Paul <lyude@redhat.com>
Link: https://patchwork.freedesktop.org/patch/msgid/Y9FFoooIXjlr+UP1@ubun2204.myguest.virtualbox.org
parent 8d71c78e
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -51,7 +51,8 @@ u64
nvkm_devinit_disable(struct nvkm_devinit *init)
{
	if (init && init->func->disable)
		return init->func->disable(init);
		init->func->disable(init);

	return 0;
}

+1 −4
Original line number Diff line number Diff line
@@ -26,13 +26,12 @@
#include <subdev/bios.h>
#include <subdev/bios/init.h>

static u64
static void
g84_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_MPEG, 0);
@@ -47,8 +46,6 @@ g84_devinit_disable(struct nvkm_devinit *init)
		nvkm_subdev_disable(device, NVKM_ENGINE_BSP, 0);
	if (!(r00154c & 0x00000040))
		nvkm_subdev_disable(device, NVKM_ENGINE_CIPHER, 0);

	return disable;
}

static const struct nvkm_devinit_func
+1 −3
Original line number Diff line number Diff line
@@ -26,7 +26,7 @@
#include <subdev/bios.h>
#include <subdev/bios/init.h>

static u64
static void
g98_devinit_disable(struct nvkm_devinit *init)
{
	struct nvkm_device *device = init->subdev.device;
@@ -45,8 +45,6 @@ g98_devinit_disable(struct nvkm_devinit *init)
		nvkm_subdev_disable(device, NVKM_ENGINE_MSVLD, 0);
	if (!(r00154c & 0x00000040))
		nvkm_subdev_disable(device, NVKM_ENGINE_SEC, 0);

	return 0ULL;
}

static const struct nvkm_devinit_func
+1 −3
Original line number Diff line number Diff line
@@ -63,7 +63,7 @@ gf100_devinit_pll_set(struct nvkm_devinit *init, u32 type, u32 freq)
	return ret;
}

static u64
static void
gf100_devinit_disable(struct nvkm_devinit *init)
{
	struct nvkm_device *device = init->subdev.device;
@@ -85,8 +85,6 @@ gf100_devinit_disable(struct nvkm_devinit *init)
		nvkm_subdev_disable(device, NVKM_ENGINE_CE, 0);
	if (r022500 & 0x00000200)
		nvkm_subdev_disable(device, NVKM_ENGINE_CE, 1);

	return 0ULL;
}

void
+1 −3
Original line number Diff line number Diff line
@@ -26,7 +26,7 @@
#include <subdev/bios.h>
#include <subdev/bios/init.h>

u64
void
gm107_devinit_disable(struct nvkm_devinit *init)
{
	struct nvkm_device *device = init->subdev.device;
@@ -39,8 +39,6 @@ gm107_devinit_disable(struct nvkm_devinit *init)
		nvkm_subdev_disable(device, NVKM_ENGINE_CE, 2);
	if (r021c04 & 0x00000001)
		nvkm_subdev_disable(device, NVKM_ENGINE_DISP, 0);

	return 0ULL;
}

static const struct nvkm_devinit_func
Loading