]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/commitdiff
phonet: sparse annotations of protocol, remove forward declaration
authorHarvey Harrison <harvey.harrison@gmail.com>
Fri, 7 Nov 2008 07:10:50 +0000 (23:10 -0800)
committerDavid S. Miller <davem@davemloft.net>
Fri, 7 Nov 2008 07:10:50 +0000 (23:10 -0800)
net/phonet/af_phonet.c:38:36: error: marked inline, but without a definition
net/phonet/pep-gprs.c:63:10: warning: incorrect type in return expression (different base types)
net/phonet/pep-gprs.c:63:10:    expected int
net/phonet/pep-gprs.c:63:10:    got restricted __be16 [usertype] <noident>
net/phonet/pep-gprs.c:65:10: warning: incorrect type in return expression (different base types)
net/phonet/pep-gprs.c:65:10:    expected int
net/phonet/pep-gprs.c:65:10:    got restricted __be16 [usertype] <noident>
net/phonet/pep-gprs.c:124:16: warning: incorrect type in assignment (different base types)
net/phonet/pep-gprs.c:124:16:    expected restricted __be16 [usertype] protocol
net/phonet/pep-gprs.c:124:16:    got unsigned short [unsigned] [usertype] protocol

Signed-off-by: Harvey Harrison <harvey.harrison@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/phonet/af_phonet.c
net/phonet/pep-gprs.c

index defeb7a0d502ab92dcc7253f0f97e10ae341209e..f400ff1689041c506645b3205b5cef57b1645df2 100644 (file)
 
 static struct net_proto_family phonet_proto_family;
 static struct phonet_protocol *phonet_proto_get(int protocol);
-static inline void phonet_proto_put(struct phonet_protocol *pp);
+
+static inline void phonet_proto_put(struct phonet_protocol *pp)
+{
+       module_put(pp->prot->owner);
+}
 
 /* protocol family functions */
 
@@ -428,11 +432,6 @@ static struct phonet_protocol *phonet_proto_get(int protocol)
        return pp;
 }
 
-static inline void phonet_proto_put(struct phonet_protocol *pp)
-{
-       module_put(pp->prot->owner);
-}
-
 /* Module registration */
 static int __init phonet_init(void)
 {
index 9978afbd9f2ad5033375df896358f88b929ecfcc..a4324075355f2448b7d435aea762e65a24f3159c 100644 (file)
@@ -49,14 +49,14 @@ struct gprs_dev {
        unsigned                tx_max;
 };
 
-static int gprs_type_trans(struct sk_buff *skb)
+static __be16 gprs_type_trans(struct sk_buff *skb)
 {
        const u8 *pvfc;
        u8 buf;
 
        pvfc = skb_header_pointer(skb, 0, 1, &buf);
        if (!pvfc)
-               return 0;
+               return htons(0);
        /* Look at IP version field */
        switch (*pvfc >> 4) {
        case 4:
@@ -64,7 +64,7 @@ static int gprs_type_trans(struct sk_buff *skb)
        case 6:
                return htons(ETH_P_IPV6);
        }
-       return 0;
+       return htons(0);
 }
 
 /*
@@ -84,7 +84,7 @@ static void gprs_state_change(struct sock *sk)
 static int gprs_recv(struct gprs_dev *dev, struct sk_buff *skb)
 {
        int err = 0;
-       u16 protocol = gprs_type_trans(skb);
+       __be16 protocol = gprs_type_trans(skb);
 
        if (!protocol) {
                err = -EINVAL;