]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/commitdiff
aoe: remove unecessary wrapper function
authorEd L. Cashin <ecashin@coraid.com>
Wed, 17 Oct 2007 06:27:03 +0000 (23:27 -0700)
committerLinus Torvalds <torvalds@woody.linux-foundation.org>
Wed, 17 Oct 2007 15:42:52 +0000 (08:42 -0700)
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>
drivers/block/aoe/aoe.h
drivers/block/aoe/aoecmd.c
drivers/block/aoe/aoenet.c

index ba07f762c4cbf23cabedb7b0feb4903483d213f9..07f02f855ab5562e8faea4600ebd28fc92145d4a 100644 (file)
@@ -48,15 +48,6 @@ struct aoe_hdr {
        __be32 tag;
 };
 
-#ifdef __KERNEL__
-#include <linux/skbuff.h>
-
-static inline struct aoe_hdr *aoe_hdr(const struct sk_buff *skb)
-{
-       return (struct aoe_hdr *)skb_mac_header(skb);
-}
-#endif
-
 struct aoe_atahdr {
        unsigned char aflags;
        unsigned char errfeat;
index 99672017ca56f5212229db8fb9312e7c81842e7b..4d59d5057734ab41686a37a7abb148ab361ee285 100644 (file)
@@ -120,7 +120,7 @@ aoecmd_ata_rw(struct aoedev *d, struct frame *f)
 
        /* initialize the headers & frame */
        skb = f->skb;
-       h = aoe_hdr(skb);
+       h = (struct aoe_hdr *) skb_mac_header(skb);
        ah = (struct aoe_atahdr *) (h+1);
        skb_put(skb, sizeof *h + sizeof *ah);
        memset(h, 0, skb->len);
@@ -209,7 +209,7 @@ aoecmd_cfg_pkts(ushort aoemajor, unsigned char aoeminor, struct sk_buff **tail)
                skb->dev = ifp;
                if (sl_tail == NULL)
                        sl_tail = skb;
-               h = aoe_hdr(skb);
+               h = (struct aoe_hdr *) skb_mac_header(skb);
                memset(h, 0, sizeof *h + sizeof *ch);
 
                memset(h->dst, 0xff, sizeof h->dst);
@@ -304,7 +304,7 @@ rexmit(struct aoedev *d, struct frame *f)
        aoechr_error(buf);
 
        skb = f->skb;
-       h = aoe_hdr(skb);
+       h = (struct aoe_hdr *) skb_mac_header(skb);
        ah = (struct aoe_atahdr *) (h+1);
        f->tag = n;
        h->tag = cpu_to_be32(n);
@@ -533,7 +533,7 @@ aoecmd_ata_rsp(struct sk_buff *skb)
        char ebuf[128];
        u16 aoemajor;
 
-       hin = aoe_hdr(skb);
+       hin = (struct aoe_hdr *) skb_mac_header(skb);
        aoemajor = be16_to_cpu(get_unaligned(&hin->major));
        d = aoedev_by_aoeaddr(aoemajor, hin->minor);
        if (d == NULL) {
@@ -565,7 +565,7 @@ aoecmd_ata_rsp(struct sk_buff *skb)
        calc_rttavg(d, tsince(f->tag));
 
        ahin = (struct aoe_atahdr *) (hin+1);
-       hout = aoe_hdr(f->skb);
+       hout = (struct aoe_hdr *) skb_mac_header(f->skb);
        ahout = (struct aoe_atahdr *) (hout+1);
        buf = f->buf;
 
@@ -699,7 +699,7 @@ aoecmd_ata_id(struct aoedev *d)
 
        /* initialize the headers & frame */
        skb = f->skb;
-       h = aoe_hdr(skb);
+       h = (struct aoe_hdr *) skb_mac_header(skb);
        ah = (struct aoe_atahdr *) (h+1);
        skb_put(skb, sizeof *h + sizeof *ah);
        memset(h, 0, skb->len);
@@ -730,7 +730,7 @@ aoecmd_cfg_rsp(struct sk_buff *skb)
        enum { MAXFRAMES = 16 };
        u16 n;
 
-       h = aoe_hdr(skb);
+       h = (struct aoe_hdr *) skb_mac_header(skb);
        ch = (struct aoe_cfghdr *) (h+1);
 
        /*
index 4dc0fb7da94b50dacbdb0084dc7f7f037f0db435..4e6deb7f5c24e2b5ff5e748ef65cef798ce3e861 100644 (file)
@@ -127,7 +127,7 @@ aoenet_rcv(struct sk_buff *skb, struct net_device *ifp, struct packet_type *pt,
                goto exit;
        skb_push(skb, ETH_HLEN);        /* (1) */
 
-       h = aoe_hdr(skb);
+       h = (struct aoe_hdr *) skb_mac_header(skb);
        n = be32_to_cpu(get_unaligned(&h->tag));
        if ((h->verfl & AOEFL_RSP) == 0 || (n & 1<<31))
                goto exit;