[PATCH] m68k: dmasound __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 031eb4cd d998265f

+60 -60
+47 -47
sound/oss/dmasound/dmasound_atari.c
··· 67 67 * ++geert: split in even more functions (one per format) 68 68 */ 69 69 70 - static ssize_t ata_ct_law(const u_char *userPtr, size_t userCount, 70 + static ssize_t ata_ct_law(const u_char __user *userPtr, size_t userCount, 71 71 u_char frame[], ssize_t *frameUsed, 72 72 ssize_t frameLeft); 73 - static ssize_t ata_ct_s8(const u_char *userPtr, size_t userCount, 73 + static ssize_t ata_ct_s8(const u_char __user *userPtr, size_t userCount, 74 74 u_char frame[], ssize_t *frameUsed, 75 75 ssize_t frameLeft); 76 - static ssize_t ata_ct_u8(const u_char *userPtr, size_t userCount, 76 + static ssize_t ata_ct_u8(const u_char __user *userPtr, size_t userCount, 77 77 u_char frame[], ssize_t *frameUsed, 78 78 ssize_t frameLeft); 79 - static ssize_t ata_ct_s16be(const u_char *userPtr, size_t userCount, 79 + static ssize_t ata_ct_s16be(const u_char __user *userPtr, size_t userCount, 80 80 u_char frame[], ssize_t *frameUsed, 81 81 ssize_t frameLeft); 82 - static ssize_t ata_ct_u16be(const u_char *userPtr, size_t userCount, 82 + static ssize_t ata_ct_u16be(const u_char __user *userPtr, size_t userCount, 83 83 u_char frame[], ssize_t *frameUsed, 84 84 ssize_t frameLeft); 85 - static ssize_t ata_ct_s16le(const u_char *userPtr, size_t userCount, 85 + static ssize_t ata_ct_s16le(const u_char __user *userPtr, size_t userCount, 86 86 u_char frame[], ssize_t *frameUsed, 87 87 ssize_t frameLeft); 88 - static ssize_t ata_ct_u16le(const u_char *userPtr, size_t userCount, 88 + static ssize_t ata_ct_u16le(const u_char __user *userPtr, size_t userCount, 89 89 u_char frame[], ssize_t *frameUsed, 90 90 ssize_t frameLeft); 91 - static ssize_t ata_ctx_law(const u_char *userPtr, size_t userCount, 91 + static ssize_t ata_ctx_law(const u_char __user *userPtr, size_t userCount, 92 92 u_char frame[], ssize_t *frameUsed, 93 93 ssize_t frameLeft); 94 - static ssize_t ata_ctx_s8(const u_char *userPtr, size_t userCount, 94 + static ssize_t ata_ctx_s8(const u_char __user *userPtr, size_t userCount, 95 95 u_char frame[], ssize_t *frameUsed, 96 96 ssize_t frameLeft); 97 - static ssize_t ata_ctx_u8(const u_char *userPtr, size_t userCount, 97 + static ssize_t ata_ctx_u8(const u_char __user *userPtr, size_t userCount, 98 98 u_char frame[], ssize_t *frameUsed, 99 99 ssize_t frameLeft); 100 - static ssize_t ata_ctx_s16be(const u_char *userPtr, size_t userCount, 100 + static ssize_t ata_ctx_s16be(const u_char __user *userPtr, size_t userCount, 101 101 u_char frame[], ssize_t *frameUsed, 102 102 ssize_t frameLeft); 103 - static ssize_t ata_ctx_u16be(const u_char *userPtr, size_t userCount, 103 + static ssize_t ata_ctx_u16be(const u_char __user *userPtr, size_t userCount, 104 104 u_char frame[], ssize_t *frameUsed, 105 105 ssize_t frameLeft); 106 - static ssize_t ata_ctx_s16le(const u_char *userPtr, size_t userCount, 106 + static ssize_t ata_ctx_s16le(const u_char __user *userPtr, size_t userCount, 107 107 u_char frame[], ssize_t *frameUsed, 108 108 ssize_t frameLeft); 109 - static ssize_t ata_ctx_u16le(const u_char *userPtr, size_t userCount, 109 + static ssize_t ata_ctx_u16le(const u_char __user *userPtr, size_t userCount, 110 110 u_char frame[], ssize_t *frameUsed, 111 111 ssize_t frameLeft); 112 112 ··· 151 151 /*** Translations ************************************************************/ 152 152 153 153 154 - static ssize_t ata_ct_law(const u_char *userPtr, size_t userCount, 154 + static ssize_t ata_ct_law(const u_char __user *userPtr, size_t userCount, 155 155 u_char frame[], ssize_t *frameUsed, 156 156 ssize_t frameLeft) 157 157 { ··· 176 176 } 177 177 178 178 179 - static ssize_t ata_ct_s8(const u_char *userPtr, size_t userCount, 179 + static ssize_t ata_ct_s8(const u_char __user *userPtr, size_t userCount, 180 180 u_char frame[], ssize_t *frameUsed, 181 181 ssize_t frameLeft) 182 182 { ··· 194 194 } 195 195 196 196 197 - static ssize_t ata_ct_u8(const u_char *userPtr, size_t userCount, 197 + static ssize_t ata_ct_u8(const u_char __user *userPtr, size_t userCount, 198 198 u_char frame[], ssize_t *frameUsed, 199 199 ssize_t frameLeft) 200 200 { ··· 217 217 used = count*2; 218 218 while (count > 0) { 219 219 u_short data; 220 - if (get_user(data, (u_short *)userPtr)) 220 + if (get_user(data, (u_short __user *)userPtr)) 221 221 return -EFAULT; 222 222 userPtr += 2; 223 223 *p++ = data ^ 0x8080; ··· 229 229 } 230 230 231 231 232 - static ssize_t ata_ct_s16be(const u_char *userPtr, size_t userCount, 232 + static ssize_t ata_ct_s16be(const u_char __user *userPtr, size_t userCount, 233 233 u_char frame[], ssize_t *frameUsed, 234 234 ssize_t frameLeft) 235 235 { ··· 241 241 used = count*2; 242 242 while (count > 0) { 243 243 u_short data; 244 - if (get_user(data, (u_short *)userPtr)) 244 + if (get_user(data, (u_short __user *)userPtr)) 245 245 return -EFAULT; 246 246 userPtr += 2; 247 247 *p++ = data; ··· 261 261 } 262 262 263 263 264 - static ssize_t ata_ct_u16be(const u_char *userPtr, size_t userCount, 264 + static ssize_t ata_ct_u16be(const u_char __user *userPtr, size_t userCount, 265 265 u_char frame[], ssize_t *frameUsed, 266 266 ssize_t frameLeft) 267 267 { ··· 273 273 used = count*2; 274 274 while (count > 0) { 275 275 u_short data; 276 - if (get_user(data, (u_short *)userPtr)) 276 + if (get_user(data, (u_short __user *)userPtr)) 277 277 return -EFAULT; 278 278 userPtr += 2; 279 279 data ^= 0x8000; ··· 287 287 count = min_t(unsigned long, userCount, frameLeft)>>2; 288 288 used = count*4; 289 289 while (count > 0) { 290 - u_long data; 291 - if (get_user(data, (u_int *)userPtr)) 290 + u_int data; 291 + if (get_user(data, (u_int __user *)userPtr)) 292 292 return -EFAULT; 293 293 userPtr += 4; 294 294 *p++ = data ^ 0x80008000; ··· 300 300 } 301 301 302 302 303 - static ssize_t ata_ct_s16le(const u_char *userPtr, size_t userCount, 303 + static ssize_t ata_ct_s16le(const u_char __user *userPtr, size_t userCount, 304 304 u_char frame[], ssize_t *frameUsed, 305 305 ssize_t frameLeft) 306 306 { ··· 313 313 used = count*2; 314 314 while (count > 0) { 315 315 u_short data; 316 - if (get_user(data, (u_short *)userPtr)) 316 + if (get_user(data, (u_short __user *)userPtr)) 317 317 return -EFAULT; 318 318 userPtr += 2; 319 319 data = le2be16(data); ··· 328 328 used = count*4; 329 329 while (count > 0) { 330 330 u_long data; 331 - if (get_user(data, (u_int *)userPtr)) 331 + if (get_user(data, (u_int __user *)userPtr)) 332 332 return -EFAULT; 333 333 userPtr += 4; 334 334 data = le2be16dbl(data); ··· 341 341 } 342 342 343 343 344 - static ssize_t ata_ct_u16le(const u_char *userPtr, size_t userCount, 344 + static ssize_t ata_ct_u16le(const u_char __user *userPtr, size_t userCount, 345 345 u_char frame[], ssize_t *frameUsed, 346 346 ssize_t frameLeft) 347 347 { ··· 354 354 used = count*2; 355 355 while (count > 0) { 356 356 u_short data; 357 - if (get_user(data, (u_short *)userPtr)) 357 + if (get_user(data, (u_short __user *)userPtr)) 358 358 return -EFAULT; 359 359 userPtr += 2; 360 360 data = le2be16(data) ^ 0x8000; ··· 368 368 used = count; 369 369 while (count > 0) { 370 370 u_long data; 371 - if (get_user(data, (u_int *)userPtr)) 371 + if (get_user(data, (u_int __user *)userPtr)) 372 372 return -EFAULT; 373 373 userPtr += 4; 374 374 data = le2be16dbl(data) ^ 0x80008000; ··· 381 381 } 382 382 383 383 384 - static ssize_t ata_ctx_law(const u_char *userPtr, size_t userCount, 384 + static ssize_t ata_ctx_law(const u_char __user *userPtr, size_t userCount, 385 385 u_char frame[], ssize_t *frameUsed, 386 386 ssize_t frameLeft) 387 387 { ··· 443 443 } 444 444 445 445 446 - static ssize_t ata_ctx_s8(const u_char *userPtr, size_t userCount, 446 + static ssize_t ata_ctx_s8(const u_char __user *userPtr, size_t userCount, 447 447 u_char frame[], ssize_t *frameUsed, 448 448 ssize_t frameLeft) 449 449 { ··· 478 478 if (bal < 0) { 479 479 if (userCount < 2) 480 480 break; 481 - if (get_user(data, (u_short *)userPtr)) 481 + if (get_user(data, (u_short __user *)userPtr)) 482 482 return -EFAULT; 483 483 userPtr += 2; 484 484 userCount -= 2; ··· 497 497 } 498 498 499 499 500 - static ssize_t ata_ctx_u8(const u_char *userPtr, size_t userCount, 500 + static ssize_t ata_ctx_u8(const u_char __user *userPtr, size_t userCount, 501 501 u_char frame[], ssize_t *frameUsed, 502 502 ssize_t frameLeft) 503 503 { ··· 533 533 if (bal < 0) { 534 534 if (userCount < 2) 535 535 break; 536 - if (get_user(data, (u_short *)userPtr)) 536 + if (get_user(data, (u_short __user *)userPtr)) 537 537 return -EFAULT; 538 538 userPtr += 2; 539 539 data ^= 0x8080; ··· 553 553 } 554 554 555 555 556 - static ssize_t ata_ctx_s16be(const u_char *userPtr, size_t userCount, 556 + static ssize_t ata_ctx_s16be(const u_char __user *userPtr, size_t userCount, 557 557 u_char frame[], ssize_t *frameUsed, 558 558 ssize_t frameLeft) 559 559 { ··· 571 571 if (bal < 0) { 572 572 if (userCount < 2) 573 573 break; 574 - if (get_user(data, (u_short *)userPtr)) 574 + if (get_user(data, (u_short __user *)userPtr)) 575 575 return -EFAULT; 576 576 userPtr += 2; 577 577 userCount -= 2; ··· 590 590 if (bal < 0) { 591 591 if (userCount < 4) 592 592 break; 593 - if (get_user(data, (u_int *)userPtr)) 593 + if (get_user(data, (u_int __user *)userPtr)) 594 594 return -EFAULT; 595 595 userPtr += 4; 596 596 userCount -= 4; ··· 609 609 } 610 610 611 611 612 - static ssize_t ata_ctx_u16be(const u_char *userPtr, size_t userCount, 612 + static ssize_t ata_ctx_u16be(const u_char __user *userPtr, size_t userCount, 613 613 u_char frame[], ssize_t *frameUsed, 614 614 ssize_t frameLeft) 615 615 { ··· 627 627 if (bal < 0) { 628 628 if (userCount < 2) 629 629 break; 630 - if (get_user(data, (u_short *)userPtr)) 630 + if (get_user(data, (u_short __user *)userPtr)) 631 631 return -EFAULT; 632 632 userPtr += 2; 633 633 data ^= 0x8000; ··· 647 647 if (bal < 0) { 648 648 if (userCount < 4) 649 649 break; 650 - if (get_user(data, (u_int *)userPtr)) 650 + if (get_user(data, (u_int __user *)userPtr)) 651 651 return -EFAULT; 652 652 userPtr += 4; 653 653 data ^= 0x80008000; ··· 667 667 } 668 668 669 669 670 - static ssize_t ata_ctx_s16le(const u_char *userPtr, size_t userCount, 670 + static ssize_t ata_ctx_s16le(const u_char __user *userPtr, size_t userCount, 671 671 u_char frame[], ssize_t *frameUsed, 672 672 ssize_t frameLeft) 673 673 { ··· 685 685 if (bal < 0) { 686 686 if (userCount < 2) 687 687 break; 688 - if (get_user(data, (u_short *)userPtr)) 688 + if (get_user(data, (u_short __user *)userPtr)) 689 689 return -EFAULT; 690 690 userPtr += 2; 691 691 data = le2be16(data); ··· 705 705 if (bal < 0) { 706 706 if (userCount < 4) 707 707 break; 708 - if (get_user(data, (u_int *)userPtr)) 708 + if (get_user(data, (u_int __user *)userPtr)) 709 709 return -EFAULT; 710 710 userPtr += 4; 711 711 data = le2be16dbl(data); ··· 725 725 } 726 726 727 727 728 - static ssize_t ata_ctx_u16le(const u_char *userPtr, size_t userCount, 728 + static ssize_t ata_ctx_u16le(const u_char __user *userPtr, size_t userCount, 729 729 u_char frame[], ssize_t *frameUsed, 730 730 ssize_t frameLeft) 731 731 { ··· 743 743 if (bal < 0) { 744 744 if (userCount < 2) 745 745 break; 746 - if (get_user(data, (u_short *)userPtr)) 746 + if (get_user(data, (u_short __user *)userPtr)) 747 747 return -EFAULT; 748 748 userPtr += 2; 749 749 data = le2be16(data) ^ 0x8000; ··· 763 763 if (bal < 0) { 764 764 if (userCount < 4) 765 765 break; 766 - if (get_user(data, (u_int *)userPtr)) 766 + if (get_user(data, (u_int __user *)userPtr)) 767 767 return -EFAULT; 768 768 userPtr += 4; 769 769 data = le2be16dbl(data) ^ 0x80008000;
+4 -4
sound/oss/dmasound/dmasound_paula.c
··· 157 157 * Native format 158 158 */ 159 159 160 - static ssize_t ami_ct_s8(const u_char *userPtr, size_t userCount, 160 + static ssize_t ami_ct_s8(const u_char __user *userPtr, size_t userCount, 161 161 u_char frame[], ssize_t *frameUsed, ssize_t frameLeft) 162 162 { 163 163 ssize_t count, used; ··· 190 190 */ 191 191 192 192 #define GENERATE_AMI_CT8(funcname, convsample) \ 193 - static ssize_t funcname(const u_char *userPtr, size_t userCount, \ 193 + static ssize_t funcname(const u_char __user *userPtr, size_t userCount, \ 194 194 u_char frame[], ssize_t *frameUsed, \ 195 195 ssize_t frameLeft) \ 196 196 { \ ··· 241 241 */ 242 242 243 243 #define GENERATE_AMI_CT_16(funcname, convsample) \ 244 - static ssize_t funcname(const u_char *userPtr, size_t userCount, \ 244 + static ssize_t funcname(const u_char __user *userPtr, size_t userCount, \ 245 245 u_char frame[], ssize_t *frameUsed, \ 246 246 ssize_t frameLeft) \ 247 247 { \ 248 - const u_short *ptr = (const u_short *)userPtr; \ 248 + const u_short __user *ptr = (const u_short __user *)userPtr; \ 249 249 ssize_t count, used; \ 250 250 u_short data; \ 251 251 \
+9 -9
sound/oss/dmasound/dmasound_q40.c
··· 58 58 59 59 60 60 /* userCount, frameUsed, frameLeft == byte counts */ 61 - static ssize_t q40_ct_law(const u_char *userPtr, size_t userCount, 61 + static ssize_t q40_ct_law(const u_char __user *userPtr, size_t userCount, 62 62 u_char frame[], ssize_t *frameUsed, 63 63 ssize_t frameLeft) 64 64 { ··· 79 79 } 80 80 81 81 82 - static ssize_t q40_ct_s8(const u_char *userPtr, size_t userCount, 82 + static ssize_t q40_ct_s8(const u_char __user *userPtr, size_t userCount, 83 83 u_char frame[], ssize_t *frameUsed, 84 84 ssize_t frameLeft) 85 85 { ··· 98 98 return used; 99 99 } 100 100 101 - static ssize_t q40_ct_u8(const u_char *userPtr, size_t userCount, 101 + static ssize_t q40_ct_u8(const u_char __user *userPtr, size_t userCount, 102 102 u_char frame[], ssize_t *frameUsed, 103 103 ssize_t frameLeft) 104 104 { ··· 114 114 115 115 116 116 /* a bit too complicated to optimise right now ..*/ 117 - static ssize_t q40_ctx_law(const u_char *userPtr, size_t userCount, 117 + static ssize_t q40_ctx_law(const u_char __user *userPtr, size_t userCount, 118 118 u_char frame[], ssize_t *frameUsed, 119 119 ssize_t frameLeft) 120 120 { ··· 152 152 } 153 153 154 154 155 - static ssize_t q40_ctx_s8(const u_char *userPtr, size_t userCount, 155 + static ssize_t q40_ctx_s8(const u_char __user *userPtr, size_t userCount, 156 156 u_char frame[], ssize_t *frameUsed, 157 157 ssize_t frameLeft) 158 158 { ··· 189 189 } 190 190 191 191 192 - static ssize_t q40_ctx_u8(const u_char *userPtr, size_t userCount, 192 + static ssize_t q40_ctx_u8(const u_char __user *userPtr, size_t userCount, 193 193 u_char frame[], ssize_t *frameUsed, 194 194 ssize_t frameLeft) 195 195 { ··· 224 224 } 225 225 226 226 /* compressing versions */ 227 - static ssize_t q40_ctc_law(const u_char *userPtr, size_t userCount, 227 + static ssize_t q40_ctc_law(const u_char __user *userPtr, size_t userCount, 228 228 u_char frame[], ssize_t *frameUsed, 229 229 ssize_t frameLeft) 230 230 { ··· 265 265 } 266 266 267 267 268 - static ssize_t q40_ctc_s8(const u_char *userPtr, size_t userCount, 268 + static ssize_t q40_ctc_s8(const u_char __user *userPtr, size_t userCount, 269 269 u_char frame[], ssize_t *frameUsed, 270 270 ssize_t frameLeft) 271 271 { ··· 304 304 } 305 305 306 306 307 - static ssize_t q40_ctc_u8(const u_char *userPtr, size_t userCount, 307 + static ssize_t q40_ctc_u8(const u_char __user *userPtr, size_t userCount, 308 308 u_char frame[], ssize_t *frameUsed, 309 309 ssize_t frameLeft) 310 310 {