diff options
author | Ed L. Cashin <ecashin@coraid.com> | 2007-10-17 02:27:03 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-10-17 11:42:52 -0400 |
commit | abdbf94d7c6f1fcb2931d5cb7562a6159323b704 (patch) | |
tree | 2adf0cbefea57e38954eda621dcff013518d5abd | |
parent | 7c9e69faa28027913ee059c285a5ea8382e24b5d (diff) |
aoe: remove unecessary wrapper function
We can just use skb_mac_header now, and we don't need a wrapper function to
perform the cast. Instead of requiring the reader to check aoe.h to look
up what an aoe_hdr function does, I'd rather do without it.
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
-rw-r--r-- | drivers/block/aoe/aoe.h | 9 | ||||
-rw-r--r-- | drivers/block/aoe/aoecmd.c | 14 | ||||
-rw-r--r-- | drivers/block/aoe/aoenet.c | 2 |
3 files changed, 8 insertions, 17 deletions
diff --git a/drivers/block/aoe/aoe.h b/drivers/block/aoe/aoe.h index ba07f762c4cb..07f02f855ab5 100644 --- a/drivers/block/aoe/aoe.h +++ b/drivers/block/aoe/aoe.h | |||
@@ -48,15 +48,6 @@ struct aoe_hdr { | |||
48 | __be32 tag; | 48 | __be32 tag; |
49 | }; | 49 | }; |
50 | 50 | ||
51 | #ifdef __KERNEL__ | ||
52 | #include <linux/skbuff.h> | ||
53 | |||
54 | static inline struct aoe_hdr *aoe_hdr(const struct sk_buff *skb) | ||
55 | { | ||
56 | return (struct aoe_hdr *)skb_mac_header(skb); | ||
57 | } | ||
58 | #endif | ||
59 | |||
60 | struct aoe_atahdr { | 51 | struct aoe_atahdr { |
61 | unsigned char aflags; | 52 | unsigned char aflags; |
62 | unsigned char errfeat; | 53 | unsigned char errfeat; |
diff --git a/drivers/block/aoe/aoecmd.c b/drivers/block/aoe/aoecmd.c index 99672017ca56..4d59d5057734 100644 --- a/drivers/block/aoe/aoecmd.c +++ b/drivers/block/aoe/aoecmd.c | |||
@@ -120,7 +120,7 @@ aoecmd_ata_rw(struct aoedev *d, struct frame *f) | |||
120 | 120 | ||
121 | /* initialize the headers & frame */ | 121 | /* initialize the headers & frame */ |
122 | skb = f->skb; | 122 | skb = f->skb; |
123 | h = aoe_hdr(skb); | 123 | h = (struct aoe_hdr *) skb_mac_header(skb); |
124 | ah = (struct aoe_atahdr *) (h+1); | 124 | ah = (struct aoe_atahdr *) (h+1); |
125 | skb_put(skb, sizeof *h + sizeof *ah); | 125 | skb_put(skb, sizeof *h + sizeof *ah); |
126 | memset(h, 0, skb->len); | 126 | memset(h, 0, skb->len); |
@@ -209,7 +209,7 @@ aoecmd_cfg_pkts(ushort aoemajor, unsigned char aoeminor, struct sk_buff **tail) | |||
209 | skb->dev = ifp; | 209 | skb->dev = ifp; |
210 | if (sl_tail == NULL) | 210 | if (sl_tail == NULL) |
211 | sl_tail = skb; | 211 | sl_tail = skb; |
212 | h = aoe_hdr(skb); | 212 | h = (struct aoe_hdr *) skb_mac_header(skb); |
213 | memset(h, 0, sizeof *h + sizeof *ch); | 213 | memset(h, 0, sizeof *h + sizeof *ch); |
214 | 214 | ||
215 | memset(h->dst, 0xff, sizeof h->dst); | 215 | memset(h->dst, 0xff, sizeof h->dst); |
@@ -304,7 +304,7 @@ rexmit(struct aoedev *d, struct frame *f) | |||
304 | aoechr_error(buf); | 304 | aoechr_error(buf); |
305 | 305 | ||
306 | skb = f->skb; | 306 | skb = f->skb; |
307 | h = aoe_hdr(skb); | 307 | h = (struct aoe_hdr *) skb_mac_header(skb); |
308 | ah = (struct aoe_atahdr *) (h+1); | 308 | ah = (struct aoe_atahdr *) (h+1); |
309 | f->tag = n; | 309 | f->tag = n; |
310 | h->tag = cpu_to_be32(n); | 310 | h->tag = cpu_to_be32(n); |
@@ -533,7 +533,7 @@ aoecmd_ata_rsp(struct sk_buff *skb) | |||
533 | char ebuf[128]; | 533 | char ebuf[128]; |
534 | u16 aoemajor; | 534 | u16 aoemajor; |
535 | 535 | ||
536 | hin = aoe_hdr(skb); | 536 | hin = (struct aoe_hdr *) skb_mac_header(skb); |
537 | aoemajor = be16_to_cpu(get_unaligned(&hin->major)); | 537 | aoemajor = be16_to_cpu(get_unaligned(&hin->major)); |
538 | d = aoedev_by_aoeaddr(aoemajor, hin->minor); | 538 | d = aoedev_by_aoeaddr(aoemajor, hin->minor); |
539 | if (d == NULL) { | 539 | if (d == NULL) { |
@@ -565,7 +565,7 @@ aoecmd_ata_rsp(struct sk_buff *skb) | |||
565 | calc_rttavg(d, tsince(f->tag)); | 565 | calc_rttavg(d, tsince(f->tag)); |
566 | 566 | ||
567 | ahin = (struct aoe_atahdr *) (hin+1); | 567 | ahin = (struct aoe_atahdr *) (hin+1); |
568 | hout = aoe_hdr(f->skb); | 568 | hout = (struct aoe_hdr *) skb_mac_header(f->skb); |
569 | ahout = (struct aoe_atahdr *) (hout+1); | 569 | ahout = (struct aoe_atahdr *) (hout+1); |
570 | buf = f->buf; | 570 | buf = f->buf; |
571 | 571 | ||
@@ -699,7 +699,7 @@ aoecmd_ata_id(struct aoedev *d) | |||
699 | 699 | ||
700 | /* initialize the headers & frame */ | 700 | /* initialize the headers & frame */ |
701 | skb = f->skb; | 701 | skb = f->skb; |
702 | h = aoe_hdr(skb); | 702 | h = (struct aoe_hdr *) skb_mac_header(skb); |
703 | ah = (struct aoe_atahdr *) (h+1); | 703 | ah = (struct aoe_atahdr *) (h+1); |
704 | skb_put(skb, sizeof *h + sizeof *ah); | 704 | skb_put(skb, sizeof *h + sizeof *ah); |
705 | memset(h, 0, skb->len); | 705 | memset(h, 0, skb->len); |
@@ -730,7 +730,7 @@ aoecmd_cfg_rsp(struct sk_buff *skb) | |||
730 | enum { MAXFRAMES = 16 }; | 730 | enum { MAXFRAMES = 16 }; |
731 | u16 n; | 731 | u16 n; |
732 | 732 | ||
733 | h = aoe_hdr(skb); | 733 | h = (struct aoe_hdr *) skb_mac_header(skb); |
734 | ch = (struct aoe_cfghdr *) (h+1); | 734 | ch = (struct aoe_cfghdr *) (h+1); |
735 | 735 | ||
736 | /* | 736 | /* |
diff --git a/drivers/block/aoe/aoenet.c b/drivers/block/aoe/aoenet.c index 4dc0fb7da94b..4e6deb7f5c24 100644 --- a/drivers/block/aoe/aoenet.c +++ b/drivers/block/aoe/aoenet.c | |||
@@ -127,7 +127,7 @@ aoenet_rcv(struct sk_buff *skb, struct net_device *ifp, struct packet_type *pt, | |||
127 | goto exit; | 127 | goto exit; |
128 | skb_push(skb, ETH_HLEN); /* (1) */ | 128 | skb_push(skb, ETH_HLEN); /* (1) */ |
129 | 129 | ||
130 | h = aoe_hdr(skb); | 130 | h = (struct aoe_hdr *) skb_mac_header(skb); |
131 | n = be32_to_cpu(get_unaligned(&h->tag)); | 131 | n = be32_to_cpu(get_unaligned(&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; |