diff options
author | David S. Miller <davem@davemloft.net> | 2007-03-01 21:30:08 -0500 |
---|---|---|
committer | David S. Miller <davem@sunset.davemloft.net> | 2007-03-02 18:22:55 -0500 |
commit | 43ecf5295b622e9ec93f5b932949acf1c6e4150c (patch) | |
tree | 781fe4935ab8d37f199d66da37adfdd4e8244480 /drivers/block | |
parent | 7ab876703dcbe852652db6441f0aadb3d6b75e94 (diff) |
[AOE]: Add get_unaligned() calls where needed.
Based upon a report by Andrew Walrond.
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/block')
-rw-r--r-- | drivers/block/aoe/aoecmd.c | 12 | ||||
-rw-r--r-- | drivers/block/aoe/aoenet.c | 5 |
2 files changed, 9 insertions, 8 deletions
diff --git a/drivers/block/aoe/aoecmd.c b/drivers/block/aoe/aoecmd.c index bb022ed4a866..8d17d8df3662 100644 --- a/drivers/block/aoe/aoecmd.c +++ b/drivers/block/aoe/aoecmd.c | |||
@@ -530,7 +530,7 @@ aoecmd_ata_rsp(struct sk_buff *skb) | |||
530 | u16 aoemajor; | 530 | u16 aoemajor; |
531 | 531 | ||
532 | hin = (struct aoe_hdr *) skb->mac.raw; | 532 | hin = (struct aoe_hdr *) skb->mac.raw; |
533 | aoemajor = be16_to_cpu(hin->major); | 533 | aoemajor = be16_to_cpu(get_unaligned(&hin->major)); |
534 | d = aoedev_by_aoeaddr(aoemajor, hin->minor); | 534 | d = aoedev_by_aoeaddr(aoemajor, hin->minor); |
535 | if (d == NULL) { | 535 | if (d == NULL) { |
536 | snprintf(ebuf, sizeof ebuf, "aoecmd_ata_rsp: ata response " | 536 | snprintf(ebuf, sizeof ebuf, "aoecmd_ata_rsp: ata response " |
@@ -542,7 +542,7 @@ aoecmd_ata_rsp(struct sk_buff *skb) | |||
542 | 542 | ||
543 | spin_lock_irqsave(&d->lock, flags); | 543 | spin_lock_irqsave(&d->lock, flags); |
544 | 544 | ||
545 | n = be32_to_cpu(hin->tag); | 545 | n = be32_to_cpu(get_unaligned(&hin->tag)); |
546 | f = getframe(d, n); | 546 | f = getframe(d, n); |
547 | if (f == NULL) { | 547 | if (f == NULL) { |
548 | calc_rttavg(d, -tsince(n)); | 548 | calc_rttavg(d, -tsince(n)); |
@@ -550,9 +550,9 @@ aoecmd_ata_rsp(struct sk_buff *skb) | |||
550 | snprintf(ebuf, sizeof ebuf, | 550 | snprintf(ebuf, sizeof ebuf, |
551 | "%15s e%d.%d tag=%08x@%08lx\n", | 551 | "%15s e%d.%d tag=%08x@%08lx\n", |
552 | "unexpected rsp", | 552 | "unexpected rsp", |
553 | be16_to_cpu(hin->major), | 553 | be16_to_cpu(get_unaligned(&hin->major)), |
554 | hin->minor, | 554 | hin->minor, |
555 | be32_to_cpu(hin->tag), | 555 | be32_to_cpu(get_unaligned(&hin->tag)), |
556 | jiffies); | 556 | jiffies); |
557 | aoechr_error(ebuf); | 557 | aoechr_error(ebuf); |
558 | return; | 558 | return; |
@@ -631,7 +631,7 @@ aoecmd_ata_rsp(struct sk_buff *skb) | |||
631 | printk(KERN_INFO | 631 | printk(KERN_INFO |
632 | "aoe: unrecognized ata command %2.2Xh for %d.%d\n", | 632 | "aoe: unrecognized ata command %2.2Xh for %d.%d\n", |
633 | ahout->cmdstat, | 633 | ahout->cmdstat, |
634 | be16_to_cpu(hin->major), | 634 | be16_to_cpu(get_unaligned(&hin->major)), |
635 | hin->minor); | 635 | hin->minor); |
636 | } | 636 | } |
637 | } | 637 | } |
@@ -733,7 +733,7 @@ aoecmd_cfg_rsp(struct sk_buff *skb) | |||
733 | * Enough people have their dip switches set backwards to | 733 | * Enough people have their dip switches set backwards to |
734 | * warrant a loud message for this special case. | 734 | * warrant a loud message for this special case. |
735 | */ | 735 | */ |
736 | aoemajor = be16_to_cpu(h->major); | 736 | aoemajor = be16_to_cpu(get_unaligned(&h->major)); |
737 | if (aoemajor == 0xfff) { | 737 | if (aoemajor == 0xfff) { |
738 | printk(KERN_ERR "aoe: Warning: shelf address is all ones. " | 738 | printk(KERN_ERR "aoe: Warning: shelf address is all ones. " |
739 | "Check shelf dip switches.\n"); | 739 | "Check shelf dip switches.\n"); |
diff --git a/drivers/block/aoe/aoenet.c b/drivers/block/aoe/aoenet.c index 9626e0f5da9d..aab6d91a2c22 100644 --- a/drivers/block/aoe/aoenet.c +++ b/drivers/block/aoe/aoenet.c | |||
@@ -8,6 +8,7 @@ | |||
8 | #include <linux/blkdev.h> | 8 | #include <linux/blkdev.h> |
9 | #include <linux/netdevice.h> | 9 | #include <linux/netdevice.h> |
10 | #include <linux/moduleparam.h> | 10 | #include <linux/moduleparam.h> |
11 | #include <asm/unaligned.h> | ||
11 | #include "aoe.h" | 12 | #include "aoe.h" |
12 | 13 | ||
13 | #define NECODES 5 | 14 | #define NECODES 5 |
@@ -123,7 +124,7 @@ aoenet_rcv(struct sk_buff *skb, struct net_device *ifp, struct packet_type *pt, | |||
123 | skb_push(skb, ETH_HLEN); /* (1) */ | 124 | skb_push(skb, ETH_HLEN); /* (1) */ |
124 | 125 | ||
125 | h = (struct aoe_hdr *) skb->mac.raw; | 126 | h = (struct aoe_hdr *) skb->mac.raw; |
126 | n = be32_to_cpu(h->tag); | 127 | n = be32_to_cpu(get_unaligned(&h->tag)); |
127 | if ((h->verfl & AOEFL_RSP) == 0 || (n & 1<<31)) | 128 | if ((h->verfl & AOEFL_RSP) == 0 || (n & 1<<31)) |
128 | goto exit; | 129 | goto exit; |
129 | 130 | ||
@@ -133,7 +134,7 @@ aoenet_rcv(struct sk_buff *skb, struct net_device *ifp, struct packet_type *pt, | |||
133 | n = 0; | 134 | n = 0; |
134 | if (net_ratelimit()) | 135 | if (net_ratelimit()) |
135 | printk(KERN_ERR "aoe: error packet from %d.%d; ecode=%d '%s'\n", | 136 | printk(KERN_ERR "aoe: error packet from %d.%d; ecode=%d '%s'\n", |
136 | be16_to_cpu(h->major), h->minor, | 137 | be16_to_cpu(get_unaligned(&h->major)), h->minor, |
137 | h->err, aoe_errlist[n]); | 138 | h->err, aoe_errlist[n]); |
138 | goto exit; | 139 | goto exit; |
139 | } | 140 | } |