summaryrefslogtreecommitdiff
path: root/drivers/gpu/drm/drm_drv.c
diff options
context:
space:
mode:
authorAndres Salomon <dilinger@collabora.co.uk>2009-11-18 01:41:23 +0300
committerDave Airlie <airlied@redhat.com>2009-11-18 03:02:49 +0300
commit156822f7175d9ceb9d7e808502d3c5de8841e047 (patch)
tree1eb79f8e11c1ce4710dcdd83210d1acb5cd95b39 /drivers/gpu/drm/drm_drv.c
parent420a457088669e055e767dfb8468909cd1799cf9 (diff)
downloadlinux-156822f7175d9ceb9d7e808502d3c5de8841e047.tar.xz
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>
Diffstat (limited to 'drivers/gpu/drm/drm_drv.c')
-rw-r--r--drivers/gpu/drm/drm_drv.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/drivers/gpu/drm/drm_drv.c b/drivers/gpu/drm/drm_drv.c
index a75ca63deea6..43297ca45f3e 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.