From: Stephen Hemminger <shemminger@vyatta.com>
To: Patrick McHardy <kaber@trash.net>
Cc: netfilter-devel@vger.kernel.org
Subject: [PATCH 6/8] nf_conntrack-h323: sparse fixes
Date: Thu, 24 Jan 2008 10:15:42 -0800 [thread overview]
Message-ID: <20080124181628.392423639@vyatta.com> (raw)
In-Reply-To: 20080124181536.446214111@vyatta.com
[-- Attachment #1: nf-conntrack-h323-sparse.patch --]
[-- Type: text/plain, Size: 6123 bytes --]
Sparse complains when a function is not really static. Putting static
on the function prototype is not enough.
Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
--- a/net/netfilter/nf_conntrack_h323_asn1.c 2008-01-24 08:25:04.000000000 -0800
+++ b/net/netfilter/nf_conntrack_h323_asn1.c 2008-01-24 10:11:41.000000000 -0800
@@ -126,7 +126,7 @@ static int decode_choice(bitstr_t * bs,
/* Decoder Functions Vector */
typedef int (*decoder_t) (bitstr_t *, field_t *, char *, int);
-static decoder_t Decoders[] = {
+static const decoder_t Decoders[] = {
decode_nul,
decode_bool,
decode_oid,
@@ -150,7 +150,7 @@ static decoder_t Decoders[] = {
* Functions
****************************************************************************/
/* Assume bs is aligned && v < 16384 */
-unsigned get_len(bitstr_t * bs)
+static unsigned get_len(bitstr_t * bs)
{
unsigned v;
@@ -166,7 +166,7 @@ unsigned get_len(bitstr_t * bs)
}
/****************************************************************************/
-unsigned get_bit(bitstr_t * bs)
+static unsigned get_bit(bitstr_t * bs)
{
unsigned b = (*bs->cur) & (0x80 >> bs->bit);
@@ -177,7 +177,7 @@ unsigned get_bit(bitstr_t * bs)
/****************************************************************************/
/* Assume b <= 8 */
-unsigned get_bits(bitstr_t * bs, unsigned b)
+static unsigned get_bits(bitstr_t * bs, unsigned b)
{
unsigned v, l;
@@ -203,7 +203,7 @@ unsigned get_bits(bitstr_t * bs, unsigne
/****************************************************************************/
/* Assume b <= 32 */
-unsigned get_bitmap(bitstr_t * bs, unsigned b)
+static unsigned get_bitmap(bitstr_t * bs, unsigned b)
{
unsigned v, l, shift, bytes;
@@ -242,7 +242,7 @@ unsigned get_bitmap(bitstr_t * bs, unsig
/****************************************************************************
* Assume bs is aligned and sizeof(unsigned int) == 4
****************************************************************************/
-unsigned get_uint(bitstr_t * bs, int b)
+static unsigned get_uint(bitstr_t * bs, int b)
{
unsigned v = 0;
@@ -264,7 +264,7 @@ unsigned get_uint(bitstr_t * bs, int b)
}
/****************************************************************************/
-int decode_nul(bitstr_t * bs, field_t * f, char *base, int level)
+static int decode_nul(bitstr_t * bs, field_t * f, char *base, int level)
{
PRINT("%*.s%s\n", level * TAB_SIZE, " ", f->name);
@@ -272,7 +272,7 @@ int decode_nul(bitstr_t * bs, field_t *
}
/****************************************************************************/
-int decode_bool(bitstr_t * bs, field_t * f, char *base, int level)
+static int decode_bool(bitstr_t * bs, field_t * f, char *base, int level)
{
PRINT("%*.s%s\n", level * TAB_SIZE, " ", f->name);
@@ -283,7 +283,7 @@ int decode_bool(bitstr_t * bs, field_t *
}
/****************************************************************************/
-int decode_oid(bitstr_t * bs, field_t * f, char *base, int level)
+static int decode_oid(bitstr_t * bs, field_t * f, char *base, int level)
{
int len;
@@ -299,7 +299,7 @@ int decode_oid(bitstr_t * bs, field_t *
}
/****************************************************************************/
-int decode_int(bitstr_t * bs, field_t * f, char *base, int level)
+static int decode_int(bitstr_t * bs, field_t * f, char *base, int level)
{
unsigned len;
@@ -342,7 +342,7 @@ int decode_int(bitstr_t * bs, field_t *
}
/****************************************************************************/
-int decode_enum(bitstr_t * bs, field_t * f, char *base, int level)
+static int decode_enum(bitstr_t * bs, field_t * f, char *base, int level)
{
PRINT("%*.s%s\n", level * TAB_SIZE, " ", f->name);
@@ -357,7 +357,7 @@ int decode_enum(bitstr_t * bs, field_t *
}
/****************************************************************************/
-int decode_bitstr(bitstr_t * bs, field_t * f, char *base, int level)
+static int decode_bitstr(bitstr_t * bs, field_t * f, char *base, int level)
{
unsigned len;
@@ -390,7 +390,7 @@ int decode_bitstr(bitstr_t * bs, field_t
}
/****************************************************************************/
-int decode_numstr(bitstr_t * bs, field_t * f, char *base, int level)
+static int decode_numstr(bitstr_t * bs, field_t * f, char *base, int level)
{
unsigned len;
@@ -407,7 +407,7 @@ int decode_numstr(bitstr_t * bs, field_t
}
/****************************************************************************/
-int decode_octstr(bitstr_t * bs, field_t * f, char *base, int level)
+static int decode_octstr(bitstr_t * bs, field_t * f, char *base, int level)
{
unsigned len;
@@ -455,7 +455,7 @@ int decode_octstr(bitstr_t * bs, field_t
}
/****************************************************************************/
-int decode_bmpstr(bitstr_t * bs, field_t * f, char *base, int level)
+static int decode_bmpstr(bitstr_t * bs, field_t * f, char *base, int level)
{
unsigned len;
@@ -480,7 +480,7 @@ int decode_bmpstr(bitstr_t * bs, field_t
}
/****************************************************************************/
-int decode_seq(bitstr_t * bs, field_t * f, char *base, int level)
+static int decode_seq(bitstr_t * bs, field_t * f, char *base, int level)
{
unsigned ext, bmp, i, opt, len = 0, bmp2, bmp2_len;
int err;
@@ -596,7 +596,7 @@ int decode_seq(bitstr_t * bs, field_t *
}
/****************************************************************************/
-int decode_seqof(bitstr_t * bs, field_t * f, char *base, int level)
+static int decode_seqof(bitstr_t * bs, field_t * f, char *base, int level)
{
unsigned count, effective_count = 0, i, len = 0;
int err;
@@ -685,7 +685,7 @@ int decode_seqof(bitstr_t * bs, field_t
/****************************************************************************/
-int decode_choice(bitstr_t * bs, field_t * f, char *base, int level)
+static int decode_choice(bitstr_t * bs, field_t * f, char *base, int level)
{
unsigned type, ext, len = 0;
int err;
--
Stephen Hemminger <stephen.hemminger@vyatta.com>
next prev parent reply other threads:[~2008-01-24 18:24 UTC|newest]
Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-01-24 18:15 [PATCH 0/8] trivial patches to netfilter for net-2.6.25 Stephen Hemminger
2008-01-24 18:15 ` [PATCH 1/8] nf_nat_snmp: sparse warning Stephen Hemminger
2008-01-24 18:32 ` Patrick McHardy
2008-01-24 18:15 ` [PATCH 2/8] netfilter: get rid of " Stephen Hemminger
2008-01-24 18:34 ` Patrick McHardy
2008-01-24 18:15 ` [PATCH 3/8] nf_conntrack: sparse warnings Stephen Hemminger
2008-01-24 18:35 ` Patrick McHardy
2008-01-24 18:15 ` [PATCH 4/8] netfilter: more sparse warning fixes Stephen Hemminger
2008-01-24 18:40 ` Patrick McHardy
2008-01-24 18:15 ` [PATCH 5/8] conntrack: get rid of sparse warnings Stephen Hemminger
2008-01-24 18:42 ` Patrick McHardy
2008-01-24 18:15 ` Stephen Hemminger [this message]
2008-01-24 18:44 ` [PATCH 6/8] nf_conntrack-h323: sparse fixes Patrick McHardy
2008-01-24 18:15 ` [PATCH 7/8] netfilter: more spase fixes Stephen Hemminger
2008-01-24 18:43 ` Patrick McHardy
2008-01-24 18:15 ` [PATCH 8/8] nf_conntrack ipv6: unused code and sparse fix Stephen Hemminger
2008-01-24 18:45 ` Patrick McHardy
2008-01-25 1:24 ` Yasuyuki KOZAKAI
2008-01-28 2:50 ` Yasuyuki KOZAKAI
[not found] ` <200801280250.m0S2oWF1019241@toshiba.co.jp>
2008-01-29 12:54 ` Patrick McHardy
-- strict thread matches above, loose matches on Subject: below --
2008-01-24 18:35 [PATCH 6/8] nf_conntrack-h323: sparse fixes Jan Engelhardt
2008-01-24 18:46 ` Patrick McHardy
2008-01-24 19:07 ` Jan Engelhardt
2008-01-29 12:57 ` Patrick McHardy
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20080124181628.392423639@vyatta.com \
--to=shemminger@vyatta.com \
--cc=kaber@trash.net \
--cc=netfilter-devel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).