[PATCH] gpu: drm: nouveau: nvif: device: Remove unused function

Rickard Strandqvist rickard_strandqvist at spectrumdigital.se
Sun Jan 11 05:53:28 PST 2015


Remove the function nvif_device_new() that is not used anywhere.

This was partially found by using a static code analysis program called cppcheck.

Signed-off-by: Rickard Strandqvist <rickard_strandqvist at spectrumdigital.se>
---
 drivers/gpu/drm/nouveau/nvif/device.c |   18 ------------------
 drivers/gpu/drm/nouveau/nvif/device.h |    2 --
 2 files changed, 20 deletions(-)

diff --git a/drivers/gpu/drm/nouveau/nvif/device.c b/drivers/gpu/drm/nouveau/nvif/device.c
index f477579..8522aa9 100644
--- a/drivers/gpu/drm/nouveau/nvif/device.c
+++ b/drivers/gpu/drm/nouveau/nvif/device.c
@@ -53,24 +53,6 @@ nvif_device_del(struct nvif_device *device)
 	kfree(device);
 }
 
-int
-nvif_device_new(struct nvif_object *parent, u32 handle, u32 oclass,
-		void *data, u32 size, struct nvif_device **pdevice)
-{
-	struct nvif_device *device = kzalloc(sizeof(*device), GFP_KERNEL);
-	if (device) {
-		int ret = nvif_device_init(parent, nvif_device_del, handle,
-					   oclass, data, size, device);
-		if (ret) {
-			kfree(device);
-			device = NULL;
-		}
-		*pdevice = device;
-		return ret;
-	}
-	return -ENOMEM;
-}
-
 void
 nvif_device_ref(struct nvif_device *device, struct nvif_device **pdevice)
 {
diff --git a/drivers/gpu/drm/nouveau/nvif/device.h b/drivers/gpu/drm/nouveau/nvif/device.h
index 43180f9..8440848 100644
--- a/drivers/gpu/drm/nouveau/nvif/device.h
+++ b/drivers/gpu/drm/nouveau/nvif/device.h
@@ -22,8 +22,6 @@ int  nvif_device_init(struct nvif_object *, void (*dtor)(struct nvif_device *),
 		      u32 handle, u32 oclass, void *, u32,
 		      struct nvif_device *);
 void nvif_device_fini(struct nvif_device *);
-int  nvif_device_new(struct nvif_object *, u32 handle, u32 oclass,
-		     void *, u32, struct nvif_device **);
 void nvif_device_ref(struct nvif_device *, struct nvif_device **);
 
 /*XXX*/
-- 
1.7.10.4



More information about the dri-devel mailing list