[AOE]: Add get_unaligned() calls where needed.

Based upon a report by Andrew Walrond.

Signed-off-by: David S. Miller <davem@davemloft.net>

authored by David S. Miller and committed by David S. Miller 43ecf529 7ab87670

+9 -8
+6 -6
drivers/block/aoe/aoecmd.c
··· 530 u16 aoemajor; 531 532 hin = (struct aoe_hdr *) skb->mac.raw; 533 - aoemajor = be16_to_cpu(hin->major); 534 d = aoedev_by_aoeaddr(aoemajor, hin->minor); 535 if (d == NULL) { 536 snprintf(ebuf, sizeof ebuf, "aoecmd_ata_rsp: ata response " ··· 542 543 spin_lock_irqsave(&d->lock, flags); 544 545 - n = be32_to_cpu(hin->tag); 546 f = getframe(d, n); 547 if (f == NULL) { 548 calc_rttavg(d, -tsince(n)); ··· 550 snprintf(ebuf, sizeof ebuf, 551 "%15s e%d.%d tag=%08x@%08lx\n", 552 "unexpected rsp", 553 - be16_to_cpu(hin->major), 554 hin->minor, 555 - be32_to_cpu(hin->tag), 556 jiffies); 557 aoechr_error(ebuf); 558 return; ··· 631 printk(KERN_INFO 632 "aoe: unrecognized ata command %2.2Xh for %d.%d\n", 633 ahout->cmdstat, 634 - be16_to_cpu(hin->major), 635 hin->minor); 636 } 637 } ··· 733 * Enough people have their dip switches set backwards to 734 * warrant a loud message for this special case. 735 */ 736 - aoemajor = be16_to_cpu(h->major); 737 if (aoemajor == 0xfff) { 738 printk(KERN_ERR "aoe: Warning: shelf address is all ones. " 739 "Check shelf dip switches.\n");
··· 530 u16 aoemajor; 531 532 hin = (struct aoe_hdr *) skb->mac.raw; 533 + aoemajor = be16_to_cpu(get_unaligned(&hin->major)); 534 d = aoedev_by_aoeaddr(aoemajor, hin->minor); 535 if (d == NULL) { 536 snprintf(ebuf, sizeof ebuf, "aoecmd_ata_rsp: ata response " ··· 542 543 spin_lock_irqsave(&d->lock, flags); 544 545 + n = be32_to_cpu(get_unaligned(&hin->tag)); 546 f = getframe(d, n); 547 if (f == NULL) { 548 calc_rttavg(d, -tsince(n)); ··· 550 snprintf(ebuf, sizeof ebuf, 551 "%15s e%d.%d tag=%08x@%08lx\n", 552 "unexpected rsp", 553 + be16_to_cpu(get_unaligned(&hin->major)), 554 hin->minor, 555 + be32_to_cpu(get_unaligned(&hin->tag)), 556 jiffies); 557 aoechr_error(ebuf); 558 return; ··· 631 printk(KERN_INFO 632 "aoe: unrecognized ata command %2.2Xh for %d.%d\n", 633 ahout->cmdstat, 634 + be16_to_cpu(get_unaligned(&hin->major)), 635 hin->minor); 636 } 637 } ··· 733 * Enough people have their dip switches set backwards to 734 * warrant a loud message for this special case. 735 */ 736 + aoemajor = be16_to_cpu(get_unaligned(&h->major)); 737 if (aoemajor == 0xfff) { 738 printk(KERN_ERR "aoe: Warning: shelf address is all ones. " 739 "Check shelf dip switches.\n");
+3 -2
drivers/block/aoe/aoenet.c
··· 8 #include <linux/blkdev.h> 9 #include <linux/netdevice.h> 10 #include <linux/moduleparam.h> 11 #include "aoe.h" 12 13 #define NECODES 5 ··· 124 skb_push(skb, ETH_HLEN); /* (1) */ 125 126 h = (struct aoe_hdr *) skb->mac.raw; 127 - n = be32_to_cpu(h->tag); 128 if ((h->verfl & AOEFL_RSP) == 0 || (n & 1<<31)) 129 goto exit; 130 ··· 134 n = 0; 135 if (net_ratelimit()) 136 printk(KERN_ERR "aoe: error packet from %d.%d; ecode=%d '%s'\n", 137 - be16_to_cpu(h->major), h->minor, 138 h->err, aoe_errlist[n]); 139 goto exit; 140 }
··· 8 #include <linux/blkdev.h> 9 #include <linux/netdevice.h> 10 #include <linux/moduleparam.h> 11 + #include <asm/unaligned.h> 12 #include "aoe.h" 13 14 #define NECODES 5 ··· 123 skb_push(skb, ETH_HLEN); /* (1) */ 124 125 h = (struct aoe_hdr *) skb->mac.raw; 126 + n = be32_to_cpu(get_unaligned(&h->tag)); 127 if ((h->verfl & AOEFL_RSP) == 0 || (n & 1<<31)) 128 goto exit; 129 ··· 133 n = 0; 134 if (net_ratelimit()) 135 printk(KERN_ERR "aoe: error packet from %d.%d; ecode=%d '%s'\n", 136 + be16_to_cpu(get_unaligned(&h->major)), h->minor, 137 h->err, aoe_errlist[n]); 138 goto exit; 139 }