diff mbox

[2/5] drm: Remove dev_priv_size from struct drm_buf

Message ID 1389205912-16632-3-git-send-email-damien.lespiau@intel.com (mailing list archive)
State New, archived
Headers show

Commit Message

Lespiau, Damien Jan. 8, 2014, 6:31 p.m. UTC
This field is only used when creating a new buffer and can already be
found in the drm_driver structure, so no need to duplicate the
information for every buffer.

Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
---
 drivers/gpu/drm/drm_bufs.c | 13 ++++++-------
 include/drm/drmP.h         |  1 -
 2 files changed, 6 insertions(+), 8 deletions(-)
diff mbox

Patch

diff --git a/drivers/gpu/drm/drm_bufs.c b/drivers/gpu/drm/drm_bufs.c
index edec31f..3bf8cc5 100644
--- a/drivers/gpu/drm/drm_bufs.c
+++ b/drivers/gpu/drm/drm_bufs.c
@@ -705,8 +705,8 @@  int drm_addbufs_agp(struct drm_device * dev, struct drm_buf_desc * request)
 		buf->pending = 0;
 		buf->file_priv = NULL;
 
-		buf->dev_priv_size = dev->driver->dev_priv_size;
-		buf->dev_private = kzalloc(buf->dev_priv_size, GFP_KERNEL);
+		buf->dev_private = kzalloc(dev->driver->dev_priv_size,
+					   GFP_KERNEL);
 		if (!buf->dev_private) {
 			/* Set count correctly so we free the proper amount. */
 			entry->buf_count = count;
@@ -902,9 +902,8 @@  int drm_addbufs_pci(struct drm_device * dev, struct drm_buf_desc * request)
 			buf->pending = 0;
 			buf->file_priv = NULL;
 
-			buf->dev_priv_size = dev->driver->dev_priv_size;
-			buf->dev_private = kzalloc(buf->dev_priv_size,
-						GFP_KERNEL);
+			buf->dev_private = kzalloc(dev->driver->dev_priv_size,
+						   GFP_KERNEL);
 			if (!buf->dev_private) {
 				/* Set count correctly so we free the proper amount. */
 				entry->buf_count = count;
@@ -1066,8 +1065,8 @@  static int drm_addbufs_sg(struct drm_device * dev, struct drm_buf_desc * request
 		buf->pending = 0;
 		buf->file_priv = NULL;
 
-		buf->dev_priv_size = dev->driver->dev_priv_size;
-		buf->dev_private = kzalloc(buf->dev_priv_size, GFP_KERNEL);
+		buf->dev_private = kzalloc(dev->driver->dev_priv_size,
+					   GFP_KERNEL);
 		if (!buf->dev_private) {
 			/* Set count correctly so we free the proper amount. */
 			entry->buf_count = count;
diff --git a/include/drm/drmP.h b/include/drm/drmP.h
index 2fe9b5d..2274274 100644
--- a/include/drm/drmP.h
+++ b/include/drm/drmP.h
@@ -364,7 +364,6 @@  struct drm_buf {
 		DRM_LIST_RECLAIM = 5
 	} list;			       /**< Which list we're on */
 
-	int dev_priv_size;		 /**< Size of buffer private storage */
 	void *dev_private;		 /**< Per-buffer private storage */
 };