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

drivers/block: use get_unaligned_* helpers

Signed-off-by: Harvey Harrison <harvey.harrison@gmail.com>
Cc: Ed L. Cashin <ecashin@coraid.com>
Cc: Jens Axboe <jens.axboe@oracle.com>
Cc: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>

authored by

Harvey Harrison and committed by
Linus Torvalds
f885f8d1 6510d419

+14 -14
+12 -12
drivers/block/aoe/aoecmd.c
··· 668 668 u16 n; 669 669 670 670 /* word 83: command set supported */ 671 - n = le16_to_cpu(get_unaligned((__le16 *) &id[83<<1])); 671 + n = get_unaligned_le16(&id[83 << 1]); 672 672 673 673 /* word 86: command set/feature enabled */ 674 - n |= le16_to_cpu(get_unaligned((__le16 *) &id[86<<1])); 674 + n |= get_unaligned_le16(&id[86 << 1]); 675 675 676 676 if (n & (1<<10)) { /* bit 10: LBA 48 */ 677 677 d->flags |= DEVFL_EXT; 678 678 679 679 /* word 100: number lba48 sectors */ 680 - ssize = le64_to_cpu(get_unaligned((__le64 *) &id[100<<1])); 680 + ssize = get_unaligned_le64(&id[100 << 1]); 681 681 682 682 /* set as in ide-disk.c:init_idedisk_capacity */ 683 683 d->geo.cylinders = ssize; ··· 688 688 d->flags &= ~DEVFL_EXT; 689 689 690 690 /* number lba28 sectors */ 691 - ssize = le32_to_cpu(get_unaligned((__le32 *) &id[60<<1])); 691 + ssize = get_unaligned_le32(&id[60 << 1]); 692 692 693 693 /* NOTE: obsolete in ATA 6 */ 694 - d->geo.cylinders = le16_to_cpu(get_unaligned((__le16 *) &id[54<<1])); 695 - d->geo.heads = le16_to_cpu(get_unaligned((__le16 *) &id[55<<1])); 696 - d->geo.sectors = le16_to_cpu(get_unaligned((__le16 *) &id[56<<1])); 694 + d->geo.cylinders = get_unaligned_le16(&id[54 << 1]); 695 + d->geo.heads = get_unaligned_le16(&id[55 << 1]); 696 + d->geo.sectors = get_unaligned_le16(&id[56 << 1]); 697 697 } 698 698 699 699 if (d->ssize != ssize) ··· 779 779 u16 aoemajor; 780 780 781 781 hin = (struct aoe_hdr *) skb_mac_header(skb); 782 - aoemajor = be16_to_cpu(get_unaligned(&hin->major)); 782 + aoemajor = get_unaligned_be16(&hin->major); 783 783 d = aoedev_by_aoeaddr(aoemajor, hin->minor); 784 784 if (d == NULL) { 785 785 snprintf(ebuf, sizeof ebuf, "aoecmd_ata_rsp: ata response " ··· 791 791 792 792 spin_lock_irqsave(&d->lock, flags); 793 793 794 - n = be32_to_cpu(get_unaligned(&hin->tag)); 794 + n = get_unaligned_be32(&hin->tag); 795 795 t = gettgt(d, hin->src); 796 796 if (t == NULL) { 797 797 printk(KERN_INFO "aoe: can't find target e%ld.%d:%012llx\n", ··· 806 806 snprintf(ebuf, sizeof ebuf, 807 807 "%15s e%d.%d tag=%08x@%08lx\n", 808 808 "unexpected rsp", 809 - be16_to_cpu(get_unaligned(&hin->major)), 809 + get_unaligned_be16(&hin->major), 810 810 hin->minor, 811 - be32_to_cpu(get_unaligned(&hin->tag)), 811 + get_unaligned_be32(&hin->tag), 812 812 jiffies); 813 813 aoechr_error(ebuf); 814 814 return; ··· 873 873 printk(KERN_INFO 874 874 "aoe: unrecognized ata command %2.2Xh for %d.%d\n", 875 875 ahout->cmdstat, 876 - be16_to_cpu(get_unaligned(&hin->major)), 876 + get_unaligned_be16(&hin->major), 877 877 hin->minor); 878 878 } 879 879 }
+2 -2
drivers/block/aoe/aoenet.c
··· 128 128 skb_push(skb, ETH_HLEN); /* (1) */ 129 129 130 130 h = (struct aoe_hdr *) skb_mac_header(skb); 131 - n = be32_to_cpu(get_unaligned(&h->tag)); 131 + n = get_unaligned_be32(&h->tag); 132 132 if ((h->verfl & AOEFL_RSP) == 0 || (n & 1<<31)) 133 133 goto exit; 134 134 ··· 140 140 printk(KERN_ERR 141 141 "%s%d.%d@%s; ecode=%d '%s'\n", 142 142 "aoe: error packet from ", 143 - be16_to_cpu(get_unaligned(&h->major)), 143 + get_unaligned_be16(&h->major), 144 144 h->minor, skb->dev->name, 145 145 h->err, aoe_errlist[n]); 146 146 goto exit;