[PATCH] m68k: amifb __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 3728d254 d85f6891

+17 -17
+17 -17
drivers/video/amifb.c
··· 1166 1166 static void ami_init_display(void); 1167 1167 static void ami_do_blank(void); 1168 1168 static int ami_get_fix_cursorinfo(struct fb_fix_cursorinfo *fix); 1169 - static int ami_get_var_cursorinfo(struct fb_var_cursorinfo *var, u_char *data); 1170 - static int ami_set_var_cursorinfo(struct fb_var_cursorinfo *var, u_char *data); 1169 + static int ami_get_var_cursorinfo(struct fb_var_cursorinfo *var, u_char __user *data); 1170 + static int ami_set_var_cursorinfo(struct fb_var_cursorinfo *var, u_char __user *data); 1171 1171 static int ami_get_cursorstate(struct fb_cursorstate *state); 1172 1172 static int ami_set_cursorstate(struct fb_cursorstate *state); 1173 1173 static void ami_set_sprite(void); ··· 2181 2181 struct fb_var_cursorinfo var; 2182 2182 struct fb_cursorstate state; 2183 2183 } crsr; 2184 + void __user *argp = (void __user *)arg; 2184 2185 int i; 2185 2186 2186 2187 switch (cmd) { ··· 2189 2188 i = ami_get_fix_cursorinfo(&crsr.fix); 2190 2189 if (i) 2191 2190 return i; 2192 - return copy_to_user((void *)arg, &crsr.fix, 2191 + return copy_to_user(argp, &crsr.fix, 2193 2192 sizeof(crsr.fix)) ? -EFAULT : 0; 2194 2193 2195 2194 case FBIOGET_VCURSORINFO: 2196 2195 i = ami_get_var_cursorinfo(&crsr.var, 2197 - ((struct fb_var_cursorinfo *)arg)->data); 2196 + ((struct fb_var_cursorinfo __user *)arg)->data); 2198 2197 if (i) 2199 2198 return i; 2200 - return copy_to_user((void *)arg, &crsr.var, 2199 + return copy_to_user(argp, &crsr.var, 2201 2200 sizeof(crsr.var)) ? -EFAULT : 0; 2202 2201 2203 2202 case FBIOPUT_VCURSORINFO: 2204 - if (copy_from_user(&crsr.var, (void *)arg, 2205 - sizeof(crsr.var))) 2203 + if (copy_from_user(&crsr.var, argp, sizeof(crsr.var))) 2206 2204 return -EFAULT; 2207 2205 return ami_set_var_cursorinfo(&crsr.var, 2208 - ((struct fb_var_cursorinfo *)arg)->data); 2206 + ((struct fb_var_cursorinfo __user *)arg)->data); 2209 2207 2210 2208 case FBIOGET_CURSORSTATE: 2211 2209 i = ami_get_cursorstate(&crsr.state); 2212 2210 if (i) 2213 2211 return i; 2214 - return copy_to_user((void *)arg, &crsr.state, 2212 + return copy_to_user(argp, &crsr.state, 2215 2213 sizeof(crsr.state)) ? -EFAULT : 0; 2216 2214 2217 2215 case FBIOPUT_CURSORSTATE: 2218 - if (copy_from_user(&crsr.state, (void *)arg, 2216 + if (copy_from_user(&crsr.state, argp, 2219 2217 sizeof(crsr.state))) 2220 2218 return -EFAULT; 2221 2219 return ami_set_cursorstate(&crsr.state); ··· 3327 3327 return 0; 3328 3328 } 3329 3329 3330 - static int ami_get_var_cursorinfo(struct fb_var_cursorinfo *var, u_char *data) 3330 + static int ami_get_var_cursorinfo(struct fb_var_cursorinfo *var, u_char __user *data) 3331 3331 { 3332 3332 struct amifb_par *par = &currentpar; 3333 3333 register u_short *lspr, *sspr; ··· 3349 3349 var->yspot = par->crsr.spot_y; 3350 3350 if (size > var->height*var->width) 3351 3351 return -ENAMETOOLONG; 3352 - if (!access_ok(VERIFY_WRITE, (void *)data, size)) 3352 + if (!access_ok(VERIFY_WRITE, data, size)) 3353 3353 return -EFAULT; 3354 3354 delta = 1<<par->crsr.fmode; 3355 3355 lspr = lofsprite + (delta<<1); 3356 3356 if (par->bplcon0 & BPC0_LACE) 3357 3357 sspr = shfsprite + (delta<<1); 3358 3358 else 3359 - sspr = 0; 3359 + sspr = NULL; 3360 3360 for (height = (short)var->height-1; height >= 0; height--) { 3361 3361 bits = 0; words = delta; datawords = 0; 3362 3362 for (width = (short)var->width-1; width >= 0; width--) { ··· 3402 3402 return 0; 3403 3403 } 3404 3404 3405 - static int ami_set_var_cursorinfo(struct fb_var_cursorinfo *var, u_char *data) 3405 + static int ami_set_var_cursorinfo(struct fb_var_cursorinfo *var, u_char __user *data) 3406 3406 { 3407 3407 struct amifb_par *par = &currentpar; 3408 3408 register u_short *lspr, *sspr; ··· 3429 3429 return -EINVAL; 3430 3430 if (!var->height) 3431 3431 return -EINVAL; 3432 - if (!access_ok(VERIFY_READ, (void *)data, var->width*var->height)) 3432 + if (!access_ok(VERIFY_READ, data, var->width*var->height)) 3433 3433 return -EFAULT; 3434 3434 delta = 1<<fmode; 3435 3435 lofsprite = shfsprite = (u_short *)spritememory; ··· 3444 3444 if (((var->height+2)<<fmode<<2) > SPRITEMEMSIZE) 3445 3445 return -EINVAL; 3446 3446 memset(lspr, 0, (var->height+2)<<fmode<<2); 3447 - sspr = 0; 3447 + sspr = NULL; 3448 3448 } 3449 3449 for (height = (short)var->height-1; height >= 0; height--) { 3450 3450 bits = 16; words = delta; datawords = 0; 3451 3451 for (width = (short)var->width-1; width >= 0; width--) { 3452 3452 unsigned long tdata = 0; 3453 - get_user(tdata, (char *)data); 3453 + get_user(tdata, data); 3454 3454 data++; 3455 3455 #ifdef __mc68000__ 3456 3456 asm volatile (