aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/block/aoe
diff options
context:
space:
mode:
authorHarvey Harrison <harvey.harrison@gmail.com>2008-04-29 04:03:30 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2008-04-29 11:06:27 -0400
commitf885f8d127665e784a8071755243bd4e18f594d5 (patch)
tree54a2a5d1e35007e56f032e3a6a1c629a9d73e1f4 /drivers/block/aoe
parent6510d41954dc6a9c8b1dbca7eaca0f23195ca727 (diff)
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>
Diffstat (limited to 'drivers/block/aoe')
-rw-r--r--drivers/block/aoe/aoecmd.c24
-rw-r--r--drivers/block/aoe/aoenet.c4
2 files changed, 14 insertions, 14 deletions
diff --git a/drivers/block/aoe/aoecmd.c b/drivers/block/aoe/aoecmd.c
index d00293ba3b45..8fc429cf82b6 100644
--- a/drivers/block/aoe/aoecmd.c
+++ b/drivers/block/aoe/aoecmd.c
@@ -668,16 +668,16 @@ ataid_complete(struct aoedev *d, struct aoetgt *t, unsigned char *id)
668 u16 n; 668 u16 n;
669 669
670 /* word 83: command set supported */ 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 /* word 86: command set/feature enabled */ 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 if (n & (1<<10)) { /* bit 10: LBA 48 */ 676 if (n & (1<<10)) { /* bit 10: LBA 48 */
677 d->flags |= DEVFL_EXT; 677 d->flags |= DEVFL_EXT;
678 678
679 /* word 100: number lba48 sectors */ 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 /* set as in ide-disk.c:init_idedisk_capacity */ 682 /* set as in ide-disk.c:init_idedisk_capacity */
683 d->geo.cylinders = ssize; 683 d->geo.cylinders = ssize;
@@ -688,12 +688,12 @@ ataid_complete(struct aoedev *d, struct aoetgt *t, unsigned char *id)
688 d->flags &= ~DEVFL_EXT; 688 d->flags &= ~DEVFL_EXT;
689 689
690 /* number lba28 sectors */ 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 /* NOTE: obsolete in ATA 6 */ 693 /* NOTE: obsolete in ATA 6 */
694 d->geo.cylinders = le16_to_cpu(get_unaligned((__le16 *) &id[54<<1])); 694 d->geo.cylinders = get_unaligned_le16(&id[54 << 1]);
695 d->geo.heads = le16_to_cpu(get_unaligned((__le16 *) &id[55<<1])); 695 d->geo.heads = get_unaligned_le16(&id[55 << 1]);
696 d->geo.sectors = le16_to_cpu(get_unaligned((__le16 *) &id[56<<1])); 696 d->geo.sectors = get_unaligned_le16(&id[56 << 1]);
697 } 697 }
698 698
699 if (d->ssize != ssize) 699 if (d->ssize != ssize)
@@ -779,7 +779,7 @@ aoecmd_ata_rsp(struct sk_buff *skb)
779 u16 aoemajor; 779 u16 aoemajor;
780 780
781 hin = (struct aoe_hdr *) skb_mac_header(skb); 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 d = aoedev_by_aoeaddr(aoemajor, hin->minor); 783 d = aoedev_by_aoeaddr(aoemajor, hin->minor);
784 if (d == NULL) { 784 if (d == NULL) {
785 snprintf(ebuf, sizeof ebuf, "aoecmd_ata_rsp: ata response " 785 snprintf(ebuf, sizeof ebuf, "aoecmd_ata_rsp: ata response "
@@ -791,7 +791,7 @@ aoecmd_ata_rsp(struct sk_buff *skb)
791 791
792 spin_lock_irqsave(&d->lock, flags); 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 t = gettgt(d, hin->src); 795 t = gettgt(d, hin->src);
796 if (t == NULL) { 796 if (t == NULL) {
797 printk(KERN_INFO "aoe: can't find target e%ld.%d:%012llx\n", 797 printk(KERN_INFO "aoe: can't find target e%ld.%d:%012llx\n",
@@ -806,9 +806,9 @@ aoecmd_ata_rsp(struct sk_buff *skb)
806 snprintf(ebuf, sizeof ebuf, 806 snprintf(ebuf, sizeof ebuf,
807 "%15s e%d.%d tag=%08x@%08lx\n", 807 "%15s e%d.%d tag=%08x@%08lx\n",
808 "unexpected rsp", 808 "unexpected rsp",
809 be16_to_cpu(get_unaligned(&hin->major)), 809 get_unaligned_be16(&hin->major),
810 hin->minor, 810 hin->minor,
811 be32_to_cpu(get_unaligned(&hin->tag)), 811 get_unaligned_be32(&hin->tag),
812 jiffies); 812 jiffies);
813 aoechr_error(ebuf); 813 aoechr_error(ebuf);
814 return; 814 return;
@@ -873,7 +873,7 @@ aoecmd_ata_rsp(struct sk_buff *skb)
873 printk(KERN_INFO 873 printk(KERN_INFO
874 "aoe: unrecognized ata command %2.2Xh for %d.%d\n", 874 "aoe: unrecognized ata command %2.2Xh for %d.%d\n",
875 ahout->cmdstat, 875 ahout->cmdstat,
876 be16_to_cpu(get_unaligned(&hin->major)), 876 get_unaligned_be16(&hin->major),
877 hin->minor); 877 hin->minor);
878 } 878 }
879 } 879 }
diff --git a/drivers/block/aoe/aoenet.c b/drivers/block/aoe/aoenet.c
index 18d243c73eee..d625169c8e48 100644
--- a/drivers/block/aoe/aoenet.c
+++ b/drivers/block/aoe/aoenet.c
@@ -128,7 +128,7 @@ aoenet_rcv(struct sk_buff *skb, struct net_device *ifp, struct packet_type *pt,
128 skb_push(skb, ETH_HLEN); /* (1) */ 128 skb_push(skb, ETH_HLEN); /* (1) */
129 129
130 h = (struct aoe_hdr *) skb_mac_header(skb); 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 if ((h->verfl & AOEFL_RSP) == 0 || (n & 1<<31)) 132 if ((h->verfl & AOEFL_RSP) == 0 || (n & 1<<31))
133 goto exit; 133 goto exit;
134 134
@@ -140,7 +140,7 @@ aoenet_rcv(struct sk_buff *skb, struct net_device *ifp, struct packet_type *pt,
140 printk(KERN_ERR 140 printk(KERN_ERR
141 "%s%d.%d@%s; ecode=%d '%s'\n", 141 "%s%d.%d@%s; ecode=%d '%s'\n",
142 "aoe: error packet from ", 142 "aoe: error packet from ",
143 be16_to_cpu(get_unaligned(&h->major)), 143 get_unaligned_be16(&h->major),
144 h->minor, skb->dev->name, 144 h->minor, skb->dev->name,
145 h->err, aoe_errlist[n]); 145 h->err, aoe_errlist[n]);
146 goto exit; 146 goto exit;