drm: kill more unused DRM macros
authorAndres Salomon <dilinger@collabora.co.uk>
Tue, 17 Nov 2009 22:41:23 +0000 (14:41 -0800)
committerDave Airlie <airlied@redhat.com>
Wed, 18 Nov 2009 00:02:49 +0000 (10:02 +1000)
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
include/drm/drmP.h

index a75ca63deea65c09d5b5b0d46265daf9482157fe..43297ca45f3e77dcb7d7a72474505b4603c6a908 100644 (file)
@@ -365,6 +365,18 @@ static void __exit drm_core_exit(void)
 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
  *
index 4977fa9038d9f5d06e90e0b8e0ff28e7a42f2aa0..1b72a526ba64e2055d32a2b40fb5369018115322 100644 (file)
@@ -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.
@@ -286,18 +275,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.
  *