diff options
author | Dave Airlie <airlied@starflyer.(none)> | 2005-09-25 00:28:13 -0400 |
---|---|---|
committer | Dave Airlie <airlied@linux.ie> | 2005-09-25 00:28:13 -0400 |
commit | b5e89ed53ed8d24f83ba1941c07382af00ed238e (patch) | |
tree | 747bae7a565f88a2e1d5974776eeb054a932c505 /drivers/char/drm/r128_ioc32.c | |
parent | 99a2657a29e2d623c3568cd86b27cac13fb63140 (diff) |
drm: lindent the drm directory.
I've been threatening this for a while, so no point hanging around.
This lindents the DRM code which was always really bad in tabbing department.
I've also fixed some misnamed files in comments and removed some trailing
whitespace.
Signed-off-by: Dave Airlie <airlied@linux.ie>
Diffstat (limited to 'drivers/char/drm/r128_ioc32.c')
-rw-r--r-- | drivers/char/drm/r128_ioc32.c | 35 |
1 files changed, 19 insertions, 16 deletions
diff --git a/drivers/char/drm/r128_ioc32.c b/drivers/char/drm/r128_ioc32.c index 60598ef9475a..1e2e367b8b82 100644 --- a/drivers/char/drm/r128_ioc32.c +++ b/drivers/char/drm/r128_ioc32.c | |||
@@ -65,10 +65,10 @@ static int compat_r128_init(struct file *file, unsigned int cmd, | |||
65 | { | 65 | { |
66 | drm_r128_init32_t init32; | 66 | drm_r128_init32_t init32; |
67 | drm_r128_init_t __user *init; | 67 | drm_r128_init_t __user *init; |
68 | 68 | ||
69 | if (copy_from_user(&init32, (void __user *)arg, sizeof(init32))) | 69 | if (copy_from_user(&init32, (void __user *)arg, sizeof(init32))) |
70 | return -EFAULT; | 70 | return -EFAULT; |
71 | 71 | ||
72 | init = compat_alloc_user_space(sizeof(*init)); | 72 | init = compat_alloc_user_space(sizeof(*init)); |
73 | if (!access_ok(VERIFY_WRITE, init, sizeof(*init)) | 73 | if (!access_ok(VERIFY_WRITE, init, sizeof(*init)) |
74 | || __put_user(init32.func, &init->func) | 74 | || __put_user(init32.func, &init->func) |
@@ -92,14 +92,14 @@ static int compat_r128_init(struct file *file, unsigned int cmd, | |||
92 | || __put_user(init32.ring_offset, &init->ring_offset) | 92 | || __put_user(init32.ring_offset, &init->ring_offset) |
93 | || __put_user(init32.ring_rptr_offset, &init->ring_rptr_offset) | 93 | || __put_user(init32.ring_rptr_offset, &init->ring_rptr_offset) |
94 | || __put_user(init32.buffers_offset, &init->buffers_offset) | 94 | || __put_user(init32.buffers_offset, &init->buffers_offset) |
95 | || __put_user(init32.agp_textures_offset, &init->agp_textures_offset)) | 95 | || __put_user(init32.agp_textures_offset, |
96 | &init->agp_textures_offset)) | ||
96 | return -EFAULT; | 97 | return -EFAULT; |
97 | 98 | ||
98 | return drm_ioctl(file->f_dentry->d_inode, file, | 99 | return drm_ioctl(file->f_dentry->d_inode, file, |
99 | DRM_IOCTL_R128_INIT, (unsigned long)init); | 100 | DRM_IOCTL_R128_INIT, (unsigned long)init); |
100 | } | 101 | } |
101 | 102 | ||
102 | |||
103 | typedef struct drm_r128_depth32 { | 103 | typedef struct drm_r128_depth32 { |
104 | int func; | 104 | int func; |
105 | int n; | 105 | int n; |
@@ -124,13 +124,15 @@ static int compat_r128_depth(struct file *file, unsigned int cmd, | |||
124 | || __put_user(depth32.n, &depth->n) | 124 | || __put_user(depth32.n, &depth->n) |
125 | || __put_user((int __user *)(unsigned long)depth32.x, &depth->x) | 125 | || __put_user((int __user *)(unsigned long)depth32.x, &depth->x) |
126 | || __put_user((int __user *)(unsigned long)depth32.y, &depth->y) | 126 | || __put_user((int __user *)(unsigned long)depth32.y, &depth->y) |
127 | || __put_user((unsigned int __user *)(unsigned long)depth32.buffer, &depth->buffer) | 127 | || __put_user((unsigned int __user *)(unsigned long)depth32.buffer, |
128 | || __put_user((unsigned char __user *)(unsigned long)depth32.mask, &depth->mask)) | 128 | &depth->buffer) |
129 | || __put_user((unsigned char __user *)(unsigned long)depth32.mask, | ||
130 | &depth->mask)) | ||
129 | return -EFAULT; | 131 | return -EFAULT; |
130 | 132 | ||
131 | return drm_ioctl(file->f_dentry->d_inode, file, | 133 | return drm_ioctl(file->f_dentry->d_inode, file, |
132 | DRM_IOCTL_R128_DEPTH, (unsigned long)depth); | 134 | DRM_IOCTL_R128_DEPTH, (unsigned long)depth); |
133 | 135 | ||
134 | } | 136 | } |
135 | 137 | ||
136 | typedef struct drm_r128_stipple32 { | 138 | typedef struct drm_r128_stipple32 { |
@@ -148,7 +150,8 @@ static int compat_r128_stipple(struct file *file, unsigned int cmd, | |||
148 | 150 | ||
149 | stipple = compat_alloc_user_space(sizeof(*stipple)); | 151 | stipple = compat_alloc_user_space(sizeof(*stipple)); |
150 | if (!access_ok(VERIFY_WRITE, stipple, sizeof(*stipple)) | 152 | if (!access_ok(VERIFY_WRITE, stipple, sizeof(*stipple)) |
151 | || __put_user((unsigned int __user *)(unsigned long)stipple32.mask, &stipple->mask)) | 153 | || __put_user((unsigned int __user *)(unsigned long)stipple32.mask, |
154 | &stipple->mask)) | ||
152 | return -EFAULT; | 155 | return -EFAULT; |
153 | 156 | ||
154 | return drm_ioctl(file->f_dentry->d_inode, file, | 157 | return drm_ioctl(file->f_dentry->d_inode, file, |
@@ -172,9 +175,10 @@ static int compat_r128_getparam(struct file *file, unsigned int cmd, | |||
172 | getparam = compat_alloc_user_space(sizeof(*getparam)); | 175 | getparam = compat_alloc_user_space(sizeof(*getparam)); |
173 | if (!access_ok(VERIFY_WRITE, getparam, sizeof(*getparam)) | 176 | if (!access_ok(VERIFY_WRITE, getparam, sizeof(*getparam)) |
174 | || __put_user(getparam32.param, &getparam->param) | 177 | || __put_user(getparam32.param, &getparam->param) |
175 | || __put_user((void __user *)(unsigned long)getparam32.value, &getparam->value)) | 178 | || __put_user((void __user *)(unsigned long)getparam32.value, |
179 | &getparam->value)) | ||
176 | return -EFAULT; | 180 | return -EFAULT; |
177 | 181 | ||
178 | return drm_ioctl(file->f_dentry->d_inode, file, | 182 | return drm_ioctl(file->f_dentry->d_inode, file, |
179 | DRM_IOCTL_R128_GETPARAM, (unsigned long)getparam); | 183 | DRM_IOCTL_R128_GETPARAM, (unsigned long)getparam); |
180 | } | 184 | } |
@@ -195,8 +199,7 @@ drm_ioctl_compat_t *r128_compat_ioctls[] = { | |||
195 | * \param arg user argument. | 199 | * \param arg user argument. |
196 | * \return zero on success or negative number on failure. | 200 | * \return zero on success or negative number on failure. |
197 | */ | 201 | */ |
198 | long r128_compat_ioctl(struct file *filp, unsigned int cmd, | 202 | long r128_compat_ioctl(struct file *filp, unsigned int cmd, unsigned long arg) |
199 | unsigned long arg) | ||
200 | { | 203 | { |
201 | unsigned int nr = DRM_IOCTL_NR(cmd); | 204 | unsigned int nr = DRM_IOCTL_NR(cmd); |
202 | drm_ioctl_compat_t *fn = NULL; | 205 | drm_ioctl_compat_t *fn = NULL; |
@@ -210,7 +213,7 @@ long r128_compat_ioctl(struct file *filp, unsigned int cmd, | |||
210 | 213 | ||
211 | lock_kernel(); /* XXX for now */ | 214 | lock_kernel(); /* XXX for now */ |
212 | if (fn != NULL) | 215 | if (fn != NULL) |
213 | ret = (*fn)(filp, cmd, arg); | 216 | ret = (*fn) (filp, cmd, arg); |
214 | else | 217 | else |
215 | ret = drm_ioctl(filp->f_dentry->d_inode, filp, cmd, arg); | 218 | ret = drm_ioctl(filp->f_dentry->d_inode, filp, cmd, arg); |
216 | unlock_kernel(); | 219 | unlock_kernel(); |