Commit f885f8d1 authored by Harvey Harrison's avatar Harvey Harrison Committed by Linus Torvalds

drivers/block: use get_unaligned_* helpers

Signed-off-by: default avatarHarvey 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: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent 6510d419
...@@ -668,16 +668,16 @@ ataid_complete(struct aoedev *d, struct aoetgt *t, unsigned char *id) ...@@ -668,16 +668,16 @@ ataid_complete(struct aoedev *d, struct aoetgt *t, unsigned char *id)
u16 n; u16 n;
/* word 83: command set supported */ /* word 83: command set supported */
n = le16_to_cpu(get_unaligned((__le16 *) &id[83<<1])); n = get_unaligned_le16(&id[83 << 1]);
/* word 86: command set/feature enabled */ /* word 86: command set/feature enabled */
n |= le16_to_cpu(get_unaligned((__le16 *) &id[86<<1])); n |= get_unaligned_le16(&id[86 << 1]);
if (n & (1<<10)) { /* bit 10: LBA 48 */ if (n & (1<<10)) { /* bit 10: LBA 48 */
d->flags |= DEVFL_EXT; d->flags |= DEVFL_EXT;
/* word 100: number lba48 sectors */ /* word 100: number lba48 sectors */
ssize = le64_to_cpu(get_unaligned((__le64 *) &id[100<<1])); ssize = get_unaligned_le64(&id[100 << 1]);
/* set as in ide-disk.c:init_idedisk_capacity */ /* set as in ide-disk.c:init_idedisk_capacity */
d->geo.cylinders = ssize; d->geo.cylinders = ssize;
...@@ -688,12 +688,12 @@ ataid_complete(struct aoedev *d, struct aoetgt *t, unsigned char *id) ...@@ -688,12 +688,12 @@ ataid_complete(struct aoedev *d, struct aoetgt *t, unsigned char *id)
d->flags &= ~DEVFL_EXT; d->flags &= ~DEVFL_EXT;
/* number lba28 sectors */ /* number lba28 sectors */
ssize = le32_to_cpu(get_unaligned((__le32 *) &id[60<<1])); ssize = get_unaligned_le32(&id[60 << 1]);
/* NOTE: obsolete in ATA 6 */ /* NOTE: obsolete in ATA 6 */
d->geo.cylinders = le16_to_cpu(get_unaligned((__le16 *) &id[54<<1])); d->geo.cylinders = get_unaligned_le16(&id[54 << 1]);
d->geo.heads = le16_to_cpu(get_unaligned((__le16 *) &id[55<<1])); d->geo.heads = get_unaligned_le16(&id[55 << 1]);
d->geo.sectors = le16_to_cpu(get_unaligned((__le16 *) &id[56<<1])); d->geo.sectors = get_unaligned_le16(&id[56 << 1]);
} }
if (d->ssize != ssize) if (d->ssize != ssize)
...@@ -779,7 +779,7 @@ aoecmd_ata_rsp(struct sk_buff *skb) ...@@ -779,7 +779,7 @@ aoecmd_ata_rsp(struct sk_buff *skb)
u16 aoemajor; u16 aoemajor;
hin = (struct aoe_hdr *) skb_mac_header(skb); hin = (struct aoe_hdr *) skb_mac_header(skb);
aoemajor = be16_to_cpu(get_unaligned(&hin->major)); aoemajor = get_unaligned_be16(&hin->major);
d = aoedev_by_aoeaddr(aoemajor, hin->minor); d = aoedev_by_aoeaddr(aoemajor, hin->minor);
if (d == NULL) { if (d == NULL) {
snprintf(ebuf, sizeof ebuf, "aoecmd_ata_rsp: ata response " snprintf(ebuf, sizeof ebuf, "aoecmd_ata_rsp: ata response "
...@@ -791,7 +791,7 @@ aoecmd_ata_rsp(struct sk_buff *skb) ...@@ -791,7 +791,7 @@ aoecmd_ata_rsp(struct sk_buff *skb)
spin_lock_irqsave(&d->lock, flags); spin_lock_irqsave(&d->lock, flags);
n = be32_to_cpu(get_unaligned(&hin->tag)); n = get_unaligned_be32(&hin->tag);
t = gettgt(d, hin->src); t = gettgt(d, hin->src);
if (t == NULL) { if (t == NULL) {
printk(KERN_INFO "aoe: can't find target e%ld.%d:%012llx\n", 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,9 +806,9 @@ aoecmd_ata_rsp(struct sk_buff *skb)
snprintf(ebuf, sizeof ebuf, snprintf(ebuf, sizeof ebuf,
"%15s e%d.%d tag=%08x@%08lx\n", "%15s e%d.%d tag=%08x@%08lx\n",
"unexpected rsp", "unexpected rsp",
be16_to_cpu(get_unaligned(&hin->major)), get_unaligned_be16(&hin->major),
hin->minor, hin->minor,
be32_to_cpu(get_unaligned(&hin->tag)), get_unaligned_be32(&hin->tag),
jiffies); jiffies);
aoechr_error(ebuf); aoechr_error(ebuf);
return; return;
...@@ -873,7 +873,7 @@ aoecmd_ata_rsp(struct sk_buff *skb) ...@@ -873,7 +873,7 @@ aoecmd_ata_rsp(struct sk_buff *skb)
printk(KERN_INFO printk(KERN_INFO
"aoe: unrecognized ata command %2.2Xh for %d.%d\n", "aoe: unrecognized ata command %2.2Xh for %d.%d\n",
ahout->cmdstat, ahout->cmdstat,
be16_to_cpu(get_unaligned(&hin->major)), get_unaligned_be16(&hin->major),
hin->minor); hin->minor);
} }
} }
......
...@@ -128,7 +128,7 @@ aoenet_rcv(struct sk_buff *skb, struct net_device *ifp, struct packet_type *pt, ...@@ -128,7 +128,7 @@ aoenet_rcv(struct sk_buff *skb, struct net_device *ifp, struct packet_type *pt,
skb_push(skb, ETH_HLEN); /* (1) */ skb_push(skb, ETH_HLEN); /* (1) */
h = (struct aoe_hdr *) skb_mac_header(skb); h = (struct aoe_hdr *) skb_mac_header(skb);
n = be32_to_cpu(get_unaligned(&h->tag)); n = get_unaligned_be32(&h->tag);
if ((h->verfl & AOEFL_RSP) == 0 || (n & 1<<31)) if ((h->verfl & AOEFL_RSP) == 0 || (n & 1<<31))
goto exit; goto exit;
...@@ -140,7 +140,7 @@ aoenet_rcv(struct sk_buff *skb, struct net_device *ifp, struct packet_type *pt, ...@@ -140,7 +140,7 @@ aoenet_rcv(struct sk_buff *skb, struct net_device *ifp, struct packet_type *pt,
printk(KERN_ERR printk(KERN_ERR
"%s%d.%d@%s; ecode=%d '%s'\n", "%s%d.%d@%s; ecode=%d '%s'\n",
"aoe: error packet from ", "aoe: error packet from ",
be16_to_cpu(get_unaligned(&h->major)), get_unaligned_be16(&h->major),
h->minor, skb->dev->name, h->minor, skb->dev->name,
h->err, aoe_errlist[n]); h->err, aoe_errlist[n]);
goto exit; goto exit;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment