]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
[NETFILTER]: conntrack: get rid of sparse warnings
authorStephen Hemminger <shemminger@vyatta.com>
Thu, 31 Jan 2008 12:08:10 +0000 (04:08 -0800)
committerDavid S. Miller <davem@davemloft.net>
Fri, 1 Feb 2008 03:27:46 +0000 (19:27 -0800)
Teach sparse about locking here, and fix signed/unsigned warnings.

Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
Signed-off-by: Patrick McHardy <kaber@trash.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/netfilter/nf_conntrack_irc.c
net/netfilter/nf_conntrack_proto_sctp.c
net/netfilter/nf_conntrack_proto_tcp.c
net/netfilter/nf_conntrack_sip.c
net/netfilter/nf_conntrack_standalone.c
net/netfilter/nf_conntrack_tftp.c

index dfaed4ba83cd542783945e55c7a0edb13add4e11..c336b07a0d4c49e51cee1d9f6d3934fe79531c0a 100644 (file)
@@ -23,7 +23,7 @@
 
 #define MAX_PORTS 8
 static unsigned short ports[MAX_PORTS];
-static int ports_c;
+static unsigned int ports_c;
 static unsigned int max_dcc_channels = 8;
 static unsigned int dcc_timeout __read_mostly = 300;
 /* This is slow, but it's simple. --RR */
index 21d29e782baf3ae0970efac12e8587b934fa1f47..7017b161a14b77d744648f956ccb16bb27256def 100644 (file)
@@ -624,7 +624,7 @@ static struct nf_conntrack_l4proto nf_conntrack_l4proto_sctp6 __read_mostly = {
 #endif
 };
 
-int __init nf_conntrack_proto_sctp_init(void)
+static int __init nf_conntrack_proto_sctp_init(void)
 {
        int ret;
 
@@ -647,7 +647,7 @@ int __init nf_conntrack_proto_sctp_init(void)
        return ret;
 }
 
-void __exit nf_conntrack_proto_sctp_fini(void)
+static void __exit nf_conntrack_proto_sctp_fini(void)
 {
        nf_conntrack_l4proto_unregister(&nf_conntrack_l4proto_sctp6);
        nf_conntrack_l4proto_unregister(&nf_conntrack_l4proto_sctp4);
index 64c9b910419c052395b1e431b84e262f11fa13b5..8e22075356654666f7cef2e46889e64ecfe8edef 100644 (file)
@@ -1098,16 +1098,16 @@ static const struct nla_policy tcp_nla_policy[CTA_PROTOINFO_TCP_MAX+1] = {
 
 static int nlattr_to_tcp(struct nlattr *cda[], struct nf_conn *ct)
 {
-       struct nlattr *attr = cda[CTA_PROTOINFO_TCP];
+       struct nlattr *pattr = cda[CTA_PROTOINFO_TCP];
        struct nlattr *tb[CTA_PROTOINFO_TCP_MAX+1];
        int err;
 
        /* updates could not contain anything about the private
         * protocol info, in that case skip the parsing */
-       if (!attr)
+       if (!pattr)
                return 0;
 
-       err = nla_parse_nested(tb, CTA_PROTOINFO_TCP_MAX, attr, tcp_nla_policy);
+       err = nla_parse_nested(tb, CTA_PROTOINFO_TCP_MAX, pattr, tcp_nla_policy);
        if (err < 0)
                return err;
 
index 47d8947cf26348124698a0c90cbdc0323766b1d2..775f7d468105e8a3c5c565c91bb31a4bf6881cf7 100644 (file)
@@ -28,7 +28,7 @@ MODULE_ALIAS("ip_conntrack_sip");
 
 #define MAX_PORTS      8
 static unsigned short ports[MAX_PORTS];
-static int ports_c;
+static unsigned int ports_c;
 module_param_array(ports, ushort, &ports_c, 0400);
 MODULE_PARM_DESC(ports, "port numbers of SIP servers");
 
@@ -407,7 +407,7 @@ static int sip_help(struct sk_buff *skb,
        unsigned int dataoff, datalen;
        const char *dptr;
        int ret = NF_ACCEPT;
-       int matchoff, matchlen;
+       unsigned int matchoff, matchlen;
        u_int16_t port;
        enum sip_header_pos pos;
        typeof(nf_nat_sip_hook) nf_nat_sip;
index 696074a037c1a10a1e1177854a2f303da8434541..28c5ae8f5625040e4db1a975b0612ebfe93b7355 100644 (file)
@@ -93,6 +93,7 @@ static struct hlist_node *ct_get_idx(struct seq_file *seq, loff_t pos)
 }
 
 static void *ct_seq_start(struct seq_file *seq, loff_t *pos)
+       __acquires(nf_conntrack_lock)
 {
        read_lock_bh(&nf_conntrack_lock);
        return ct_get_idx(seq, *pos);
@@ -105,6 +106,7 @@ static void *ct_seq_next(struct seq_file *s, void *v, loff_t *pos)
 }
 
 static void ct_seq_stop(struct seq_file *s, void *v)
+       __releases(nf_conntrack_lock)
 {
        read_unlock_bh(&nf_conntrack_lock);
 }
index e894aa1ff3ad4a683bd05a8f028504342c21589c..176f769d30723dff873b6d2ff22262b1fe3b4231 100644 (file)
@@ -25,7 +25,7 @@ MODULE_ALIAS("ip_conntrack_tftp");
 
 #define MAX_PORTS 8
 static unsigned short ports[MAX_PORTS];
-static int ports_c;
+static unsigned int ports_c;
 module_param_array(ports, ushort, &ports_c, 0400);
 MODULE_PARM_DESC(ports, "Port numbers of TFTP servers");