drm: kill more unused DRM macros

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Linux Kernel Mailing List
Date: Thursday, December 10, 2009 - 11:59 pm

Gitweb:     http://git.kernel.org/linus/156822f7175d9ceb9d7e808502d3c5de8841e047
Commit:     156822f7175d9ceb9d7e808502d3c5de8841e047
Parent:     420a457088669e055e767dfb8468909cd1799cf9
Author:     Andres Salomon <dilinger@collabora.co.uk>
AuthorDate: Tue Nov 17 14:41:23 2009 -0800
Committer:  Dave Airlie <airlied@redhat.com>
CommitDate: Wed Nov 18 10:02:49 2009 +1000

    drm: kill more unused DRM macros
    
    There are a few more macros in drmP.h that are unused; DRM_GET_PRIV_SAREA,
    DRM_ARRAY_SIZE, and DRM_WAITCOUNT can go away completely.
    
    Unfortunately, DRM_COPY is still used in one place, but we can at least
    move it to where it's used.  It's an awful looking macro..
    
    [akpm: fix overeagerness]
    Signed-off-by: Andres Salomon <dilinger@collabora.co.uk>
    Cc: Dave Airlie <airlied@linux.ie>
    Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
    Signed-off-by: Dave Airlie <airlied@redhat.com>
---
 drivers/gpu/drm/drm_drv.c |   12 ++++++++++++
 include/drm/drmP.h        |   23 -----------------------
 2 files changed, 12 insertions(+), 23 deletions(-)

diff --git a/drivers/gpu/drm/drm_drv.c b/drivers/gpu/drm/drm_drv.c
index a75ca63..43297ca 100644
--- a/drivers/gpu/drm/drm_drv.c
+++ b/drivers/gpu/drm/drm_drv.c
@@ -366,6 +366,18 @@ module_init(drm_core_init);
 module_exit(drm_core_exit);
 
 /**
+ * Copy and IOCTL return string to user space
+ */
+#define DRM_COPY(name, value)                                         \
+	len = strlen(value);                                          \
+	if (len > name##_len) len = name##_len;                       \
+	name##_len = strlen(value);                                   \
+	if (len && name) {                                            \
+		if (copy_to_user(name, value, len))                   \
+			return -EFAULT;                               \
+	}
+
+/**
  * Get version information
  *
  * \param inode device inode.
diff --git a/include/drm/drmP.h b/include/drm/drmP.h
index 4977fa9..1b72a52 100644
--- a/include/drm/drmP.h
+++ b/include/drm/drmP.h
@@ -255,19 +255,8 @@ extern void drm_ut_debug_printk(unsigned int request_level,
 
 #define DRM_LEFTCOUNT(x) (((x)->rp + (x)->count - (x)->wp) % ((x)->count + 1))
 #define DRM_BUFCOUNT(x) ((x)->count - DRM_LEFTCOUNT(x))
-#define DRM_WAITCOUNT(dev,idx) DRM_BUFCOUNT(&dev->queuelist[idx]->waitlist)
 
 #define DRM_IF_VERSION(maj, min) (maj << 16 | min)
-/**
- * Get the private SAREA mapping.
- *
- * \param _dev DRM device.
- * \param _ctx context number.
- * \param _map output mapping.
- */
-#define DRM_GET_PRIV_SAREA(_dev, _ctx, _map) do {	\
-	(_map) = (_dev)->context_sareas[_ctx];		\
-} while(0)
 
 /**
  * Test that the hardware lock is held by the caller, returning otherwise.
@@ -287,18 +276,6 @@ do {										\
 } while (0)
 
 /**
- * Copy and IOCTL return string to user space
- */
-#define DRM_COPY( name, value )						\
-	len = strlen( value );						\
-	if ( len > name##_len ) len = name##_len;			\
-	name##_len = strlen( value );					\
-	if ( len && name ) {						\
-		if ( copy_to_user( name, value, len ) )			\
-			return -EFAULT;					\
-	}
-
-/**
  * Ioctl function type.
  *
  * \param inode device inode.
--
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
drm: kill more unused DRM macros, Linux Kernel Mailing ..., (Thu Dec 10, 11:59 pm)