Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

ide: endian annotations in ide-floppy.c

Signed-off-by: Harvey Harrison <harvey.harrison@gmail.com>
Cc: Al Viro <viro@ZenIV.linux.org.uk>
Cc: Borislav Petkov <petkovbb@googlemail.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>

authored by

Harvey Harrison and committed by
Bartlomiej Zolnierkiewicz
85ae98a3 68dc3575

+8 -8
+8 -8
drivers/ide/ide-floppy.c
··· 702 702 set_disk_ro(floppy->disk, floppy->wp); 703 703 page = &pc.buf[8]; 704 704 705 - transfer_rate = be16_to_cpu(*(u16 *)&pc.buf[8 + 2]); 706 - sector_size = be16_to_cpu(*(u16 *)&pc.buf[8 + 6]); 707 - cyls = be16_to_cpu(*(u16 *)&pc.buf[8 + 8]); 708 - rpm = be16_to_cpu(*(u16 *)&pc.buf[8 + 28]); 705 + transfer_rate = be16_to_cpup((__be16 *)&pc.buf[8 + 2]); 706 + sector_size = be16_to_cpup((__be16 *)&pc.buf[8 + 6]); 707 + cyls = be16_to_cpup((__be16 *)&pc.buf[8 + 8]); 708 + rpm = be16_to_cpup((__be16 *)&pc.buf[8 + 28]); 709 709 heads = pc.buf[8 + 4]; 710 710 sectors = pc.buf[8 + 5]; 711 711 ··· 780 780 for (i = 0; i < desc_cnt; i++) { 781 781 unsigned int desc_start = 4 + i*8; 782 782 783 - blocks = be32_to_cpu(*(u32 *)&pc.buf[desc_start]); 784 - length = be16_to_cpu(*(u16 *)&pc.buf[desc_start + 6]); 783 + blocks = be32_to_cpup((__be32 *)&pc.buf[desc_start]); 784 + length = be16_to_cpup((__be16 *)&pc.buf[desc_start + 6]); 785 785 786 786 debug_log("Descriptor %d: %dkB, %d blocks, %d sector size\n", 787 787 i, blocks * length / 1024, blocks, length); ··· 902 902 if (u_index >= u_array_size) 903 903 break; /* User-supplied buffer too small */ 904 904 905 - blocks = be32_to_cpu(*(u32 *)&pc.buf[desc_start]); 906 - length = be16_to_cpu(*(u16 *)&pc.buf[desc_start + 6]); 905 + blocks = be32_to_cpup((__be32 *)&pc.buf[desc_start]); 906 + length = be16_to_cpup((__be16 *)&pc.buf[desc_start + 6]); 907 907 908 908 if (put_user(blocks, argp)) 909 909 return(-EFAULT);