[PATCH] m68k: dsp56k __user annotations

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Cc: Roman Zippel <zippel@linux-m68k.org>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>

authored by Al Viro and committed by Linus Torvalds d85f6891 ab14caec

+16 -15
+15 -14
drivers/char/dsp56k.c
··· 165 165 return 0; 166 166 } 167 167 168 - static int dsp56k_upload(u_char *bin, int len) 168 + static int dsp56k_upload(u_char __user *bin, int len) 169 169 { 170 170 int i; 171 171 u_char *p; ··· 199 199 return 0; 200 200 } 201 201 202 - static ssize_t dsp56k_read(struct file *file, char *buf, size_t count, 202 + static ssize_t dsp56k_read(struct file *file, char __user *buf, size_t count, 203 203 loff_t *ppos) 204 204 { 205 205 struct inode *inode = file->f_dentry->d_inode; ··· 225 225 } 226 226 case 2: /* 16 bit */ 227 227 { 228 - short *data; 228 + short __user *data; 229 229 230 230 count /= 2; 231 - data = (short*) buf; 231 + data = (short __user *) buf; 232 232 handshake(count, dsp56k.maxio, dsp56k.timeout, DSP56K_RECEIVE, 233 233 put_user(dsp56k_host_interface.data.w[1], data+n++)); 234 234 return 2*n; ··· 244 244 } 245 245 case 4: /* 32 bit */ 246 246 { 247 - long *data; 247 + long __user *data; 248 248 249 249 count /= 4; 250 - data = (long*) buf; 250 + data = (long __user *) buf; 251 251 handshake(count, dsp56k.maxio, dsp56k.timeout, DSP56K_RECEIVE, 252 252 put_user(dsp56k_host_interface.data.l, data+n++)); 253 253 return 4*n; ··· 262 262 } 263 263 } 264 264 265 - static ssize_t dsp56k_write(struct file *file, const char *buf, size_t count, 265 + static ssize_t dsp56k_write(struct file *file, const char __user *buf, size_t count, 266 266 loff_t *ppos) 267 267 { 268 268 struct inode *inode = file->f_dentry->d_inode; ··· 287 287 } 288 288 case 2: /* 16 bit */ 289 289 { 290 - const short *data; 290 + const short __user *data; 291 291 292 292 count /= 2; 293 - data = (const short *)buf; 293 + data = (const short __user *)buf; 294 294 handshake(count, dsp56k.maxio, dsp56k.timeout, DSP56K_TRANSMIT, 295 295 get_user(dsp56k_host_interface.data.w[1], data+n++)); 296 296 return 2*n; ··· 306 306 } 307 307 case 4: /* 32 bit */ 308 308 { 309 - const long *data; 309 + const long __user *data; 310 310 311 311 count /= 4; 312 - data = (const long *)buf; 312 + data = (const long __user *)buf; 313 313 handshake(count, dsp56k.maxio, dsp56k.timeout, DSP56K_TRANSMIT, 314 314 get_user(dsp56k_host_interface.data.l, data+n++)); 315 315 return 4*n; ··· 328 328 unsigned int cmd, unsigned long arg) 329 329 { 330 330 int dev = iminor(inode) & 0x0f; 331 + void __user *argp = (void __user *)arg; 331 332 332 333 switch(dev) 333 334 { ··· 337 336 switch(cmd) { 338 337 case DSP56K_UPLOAD: 339 338 { 340 - char *bin; 339 + char __user *bin; 341 340 int r, len; 342 - struct dsp56k_upload *binary = (struct dsp56k_upload *) arg; 341 + struct dsp56k_upload __user *binary = argp; 343 342 344 343 if(get_user(len, &binary->len) < 0) 345 344 return -EFAULT; ··· 373 372 case DSP56K_HOST_FLAGS: 374 373 { 375 374 int dir, out, status; 376 - struct dsp56k_host_flags *hf = (struct dsp56k_host_flags*) arg; 375 + struct dsp56k_host_flags __user *hf = argp; 377 376 378 377 if(get_user(dir, &hf->dir) < 0) 379 378 return -EFAULT;
+1 -1
include/asm-m68k/dsp56k.h
··· 13 13 /* Used for uploading DSP binary code */ 14 14 struct dsp56k_upload { 15 15 int len; 16 - char *bin; 16 + char __user *bin; 17 17 }; 18 18 19 19 /* For the DSP host flags */