On Fri, 26 Jul 2024 14:38:11 +1000 Ben Skeggs <bskeggs@xxxxxxxxxx> wrote: Reviewed-by: Zhi Wang <zhiw@xxxxxxxxxx> The patch LGTM. What was the original purpose of having this version? > This is not, and has never, been used for anything. Remove it. > > Signed-off-by: Ben Skeggs <bskeggs@xxxxxxxxxx> > --- > drivers/gpu/drm/nouveau/include/nvif/client.h | 2 -- > drivers/gpu/drm/nouveau/include/nvif/ioctl.h | 7 ------- > drivers/gpu/drm/nouveau/nvif/client.c | 20 > +------------------ drivers/gpu/drm/nouveau/nvkm/core/ioctl.c | > 13 +----------- 4 files changed, 2 insertions(+), 40 deletions(-) > > diff --git a/drivers/gpu/drm/nouveau/include/nvif/client.h > b/drivers/gpu/drm/nouveau/include/nvif/client.h index > 2c8e9bec3f79..03f1d564eb12 100644 --- > a/drivers/gpu/drm/nouveau/include/nvif/client.h +++ > b/drivers/gpu/drm/nouveau/include/nvif/client.h @@ -7,12 +7,10 @@ > struct nvif_client { > struct nvif_object object; > const struct nvif_driver *driver; > - u64 version; > }; > > int nvif_client_ctor(struct nvif_client *parent, const char *name, > struct nvif_client *); void nvif_client_dtor(struct nvif_client *); > -int nvif_client_ioctl(struct nvif_client *, void *, u32); > int nvif_client_suspend(struct nvif_client *); > int nvif_client_resume(struct nvif_client *); > > diff --git a/drivers/gpu/drm/nouveau/include/nvif/ioctl.h > b/drivers/gpu/drm/nouveau/include/nvif/ioctl.h index > 4e047bb1fc07..1e74245621e0 100644 --- > a/drivers/gpu/drm/nouveau/include/nvif/ioctl.h +++ > b/drivers/gpu/drm/nouveau/include/nvif/ioctl.h @@ -2,11 +2,8 @@ > #ifndef __NVIF_IOCTL_H__ > #define __NVIF_IOCTL_H__ > > -#define NVIF_VERSION_LATEST > 0x0000000000000100ULL - > struct nvif_ioctl_v0 { > __u8 version; > -#define NVIF_IOCTL_V0_NOP > 0x00 #define NVIF_IOCTL_V0_SCLASS > 0x01 #define NVIF_IOCTL_V0_NEW > 0x02 #define NVIF_IOCTL_V0_DEL > 0x03 @@ -28,10 +25,6 @@ struct > nvif_ioctl_v0 { __u8 data[]; /* ioctl data (below) */ > }; > > -struct nvif_ioctl_nop_v0 { > - __u64 version; > -}; > - > struct nvif_ioctl_sclass_v0 { > /* nvif_ioctl ... */ > __u8 version; > diff --git a/drivers/gpu/drm/nouveau/nvif/client.c > b/drivers/gpu/drm/nouveau/nvif/client.c index > bbfc80fcff43..fdf5054ed7d8 100644 --- > a/drivers/gpu/drm/nouveau/nvif/client.c +++ > b/drivers/gpu/drm/nouveau/nvif/client.c @@ -29,12 +29,6 @@ > #include <nvif/class.h> > #include <nvif/if0000.h> > > -int > -nvif_client_ioctl(struct nvif_client *client, void *data, u32 size) > -{ > - return client->driver->ioctl(client->object.priv, data, > size, NULL); -} > - > int > nvif_client_suspend(struct nvif_client *client) > { > @@ -58,10 +52,6 @@ int > nvif_client_ctor(struct nvif_client *parent, const char *name, > struct nvif_client *client) { > struct nvif_client_v0 args = {}; > - struct { > - struct nvif_ioctl_v0 ioctl; > - struct nvif_ioctl_nop_v0 nop; > - } nop = {}; > int ret; > > strscpy_pad(args.name, name, sizeof(args.name)); > @@ -75,13 +65,5 @@ nvif_client_ctor(struct nvif_client *parent, const > char *name, struct nvif_clien client->object.client = client; > client->object.handle = ~0; > client->driver = parent->driver; > - > - if (ret == 0) { > - ret = nvif_client_ioctl(client, &nop, sizeof(nop)); > - client->version = nop.nop.version; > - } > - > - if (ret) > - nvif_client_dtor(client); > - return ret; > + return 0; > } > diff --git a/drivers/gpu/drm/nouveau/nvkm/core/ioctl.c > b/drivers/gpu/drm/nouveau/nvkm/core/ioctl.c index > 39d5c9700867..584fc43c0d75 100644 --- > a/drivers/gpu/drm/nouveau/nvkm/core/ioctl.c +++ > b/drivers/gpu/drm/nouveau/nvkm/core/ioctl.c @@ -33,18 +33,7 @@ static > int nvkm_ioctl_nop(struct nvkm_client *client, > struct nvkm_object *object, void *data, u32 size) > { > - union { > - struct nvif_ioctl_nop_v0 v0; > - } *args = data; > - int ret = -ENOSYS; > - > - nvif_ioctl(object, "nop size %d\n", size); > - if (!(ret = nvif_unpack(ret, &data, &size, args->v0, 0, 0, > false))) { > - nvif_ioctl(object, "nop vers %lld\n", > args->v0.version); > - args->v0.version = NVIF_VERSION_LATEST; > - } > - > - return ret; > + return -ENOSYS; > } > > #include <nvif/class.h>