Commit ba79a0ce authored by Randy Dunlap's avatar Randy Dunlap Committed by David S. Miller

[NET]: janitor: don't init statics to 0.

parent b62bd852
......@@ -71,8 +71,8 @@ static int check_ci(struct atm_vcc *vcc,short vpi,int vci)
int atm_find_ci(struct atm_vcc *vcc,short *vpi,int *vci)
{
static short p = 0; /* poor man's per-device cache */
static int c = 0;
static short p; /* poor man's per-device cache */
static int c;
short old_p;
int old_c;
int err;
......
......@@ -1379,8 +1379,8 @@ static void mpc_timer_refresh()
static void mpc_cache_check( unsigned long checking_time )
{
struct mpoa_client *mpc = mpcs;
static unsigned long previous_resolving_check_time = 0;
static unsigned long previous_refresh_time = 0;
static unsigned long previous_resolving_check_time;
static unsigned long previous_refresh_time;
while( mpc != NULL ){
mpc->in_ops->clear_count(mpc);
......
......@@ -39,7 +39,7 @@ static DECLARE_WAIT_QUEUE_HEAD(sigd_sleep);
static void sigd_put_skb(struct sk_buff *skb)
{
#ifdef WAIT_FOR_DEMON
static unsigned long silence = 0;
static unsigned long silence;
DECLARE_WAITQUEUE(wait,current);
add_wait_queue(&sigd_sleep,&wait);
......
......@@ -1779,7 +1779,7 @@ static int ax25_ioctl(struct socket *sock, unsigned int cmd, unsigned long arg)
/* old structure? */
if (cmd == SIOCAX25GETINFOOLD) {
static int warned = 0;
static int warned;
if (!warned) {
printk(KERN_INFO "%s uses old SIOCAX25GETINFO\n",
current->comm);
......
......@@ -12,20 +12,20 @@
#include <linux/spinlock.h>
#include <net/ax25.h>
static int min_ipdefmode[] = {0}, max_ipdefmode[] = {1};
static int min_axdefmode[] = {0}, max_axdefmode[] = {1};
static int min_backoff[] = {0}, max_backoff[] = {2};
static int min_conmode[] = {0}, max_conmode[] = {2};
static int min_ipdefmode[1], max_ipdefmode[] = {1};
static int min_axdefmode[1], max_axdefmode[] = {1};
static int min_backoff[1], max_backoff[] = {2};
static int min_conmode[1], max_conmode[] = {2};
static int min_window[] = {1}, max_window[] = {7};
static int min_ewindow[] = {1}, max_ewindow[] = {63};
static int min_t1[] = {1}, max_t1[] = {30 * HZ};
static int min_t2[] = {1}, max_t2[] = {20 * HZ};
static int min_t3[] = {0}, max_t3[] = {3600 * HZ};
static int min_idle[] = {0}, max_idle[] = {65535 * HZ};
static int min_t3[1], max_t3[] = {3600 * HZ};
static int min_idle[1], max_idle[] = {65535 * HZ};
static int min_n2[] = {1}, max_n2[] = {31};
static int min_paclen[] = {1}, max_paclen[] = {512};
static int min_proto[] = {0}, max_proto[] = {3};
static int min_ds_timeout[] = {0}, max_ds_timeout[] = {65535 * HZ};
static int min_proto[1], max_proto[] = {3};
static int min_ds_timeout[1], max_ds_timeout[] = {65535 * HZ};
static struct ctl_table_header *ax25_table_header;
......
......@@ -70,7 +70,7 @@ static struct rtable __fake_rtable = {
/* PF_BRIDGE/PRE_ROUTING *********************************************/
static void __br_dnat_complain(void)
{
static unsigned long last_complaint = 0;
static unsigned long last_complaint;
if (jiffies - last_complaint >= 5 * HZ) {
printk(KERN_WARNING "Performing cross-bridge DNAT requires IP "
......
......@@ -138,7 +138,7 @@ static void br_stp_change_bridge_id(struct net_bridge *br, unsigned char *addr)
br_become_root_bridge(br);
}
static unsigned char br_mac_zero[6] = {0,0,0,0,0,0};
static unsigned char br_mac_zero[6];
/* called under bridge lock */
void br_stp_recalculate_bridge_id(struct net_bridge *br)
......
......@@ -1472,7 +1472,7 @@ static struct rtnetlink_link dnet_rtnetlink_table[RTM_MAX-RTM_BASE+1] =
};
#ifdef MODULE
static int addr[2] = {0, 0};
static int addr[2];
MODULE_PARM(addr, "2i");
MODULE_PARM_DESC(addr, "The DECnet address of this machine: area,node");
......
......@@ -246,7 +246,7 @@ unsigned int arpt_do_table(struct sk_buff **pskb,
struct arpt_table *table,
void *userdata)
{
static const char nulldevname[IFNAMSIZ] = { 0 };
static const char nulldevname[IFNAMSIZ];
unsigned int verdict = NF_DROP;
struct arphdr *arp;
int hotdrop = 0;
......
......@@ -60,7 +60,7 @@ LIST_HEAD(ip_conntrack_expect_list);
LIST_HEAD(protocol_list);
static LIST_HEAD(helpers);
unsigned int ip_conntrack_htable_size = 0;
static int ip_conntrack_max = 0;
static int ip_conntrack_max;
static atomic_t ip_conntrack_count = ATOMIC_INIT(0);
struct list_head *ip_conntrack_hash;
static kmem_cache_t *ip_conntrack_cachep;
......@@ -618,7 +618,7 @@ init_conntrack(const struct ip_conntrack_tuple *tuple,
size_t hash;
struct ip_conntrack_expect *expected;
int i;
static unsigned int drop_next = 0;
static unsigned int drop_next;
if (!ip_conntrack_hash_rnd_initted) {
get_random_bytes(&ip_conntrack_hash_rnd, 4);
......@@ -1393,7 +1393,7 @@ void ip_conntrack_cleanup(void)
nf_unregister_sockopt(&so_getorigdst);
}
static int hashsize = 0;
static int hashsize;
MODULE_PARM(hashsize, "i");
int __init ip_conntrack_init(void)
......
......@@ -19,12 +19,12 @@ struct module *ip_conntrack_ftp = THIS_MODULE;
#define MAX_PORTS 8
static int ports[MAX_PORTS];
static int ports_c = 0;
static int ports_c;
#ifdef MODULE_PARM
MODULE_PARM(ports, "1-" __MODULE_STRING(MAX_PORTS) "i");
#endif
static int loose = 0;
static int loose;
MODULE_PARM(loose, "i");
#if 0
......
......@@ -35,7 +35,7 @@
#define MAX_PORTS 8
static int ports[MAX_PORTS];
static int ports_c = 0;
static int ports_c;
static int max_dcc_channels = 8;
static unsigned int dcc_timeout = 300;
/* This is slow, but it's simple. --RR */
......
......@@ -22,7 +22,7 @@ MODULE_LICENSE("GPL");
#define MAX_PORTS 8
static int ports[MAX_PORTS];
static int ports_c = 0;
static int ports_c;
#ifdef MODULE_PARM
MODULE_PARM(ports, "1-" __MODULE_STRING(MAX_PORTS) "i");
MODULE_PARM_DESC(ports, "port numbers of tftp servers");
......
......@@ -278,7 +278,7 @@ find_best_ips_proto(struct ip_conntrack_tuple *tuple,
struct ip_conntrack_tuple tuple;
} best = { NULL, 0xFFFFFFFF };
u_int32_t *var_ipp, *other_ipp, saved_ip, orig_dstip;
static unsigned int randomness = 0;
static unsigned int randomness;
if (HOOK2MANIP(hooknum) == IP_NAT_MANIP_SRC) {
var_ipp = &tuple->src.ip;
......
......@@ -18,7 +18,7 @@
#define MAX_PORTS 8
static int ports[MAX_PORTS];
static int ports_c = 0;
static int ports_c;
#ifdef MODULE_PARM
MODULE_PARM(ports, "1-" __MODULE_STRING(MAX_PORTS) "i");
......
......@@ -36,7 +36,7 @@
#define MAX_PORTS 8
static int ports[MAX_PORTS];
static int ports_c = 0;
static int ports_c;
MODULE_AUTHOR("Harald Welte <laforge@gnumonks.org>");
MODULE_DESCRIPTION("IRC (DCC) network address translation module");
......
......@@ -26,7 +26,7 @@ icmp_unique_tuple(struct ip_conntrack_tuple *tuple,
enum ip_nat_manip_type maniptype,
const struct ip_conntrack *conntrack)
{
static u_int16_t id = 0;
static u_int16_t id;
unsigned int range_size
= (unsigned int)range->max.icmp.id - range->min.icmp.id + 1;
unsigned int i;
......
......@@ -32,7 +32,7 @@ tcp_unique_tuple(struct ip_conntrack_tuple *tuple,
enum ip_nat_manip_type maniptype,
const struct ip_conntrack *conntrack)
{
static u_int16_t port = 0, *portptr;
static u_int16_t port, *portptr;
unsigned int range_size, min, i;
if (maniptype == IP_NAT_MANIP_SRC)
......
......@@ -33,7 +33,7 @@ udp_unique_tuple(struct ip_conntrack_tuple *tuple,
enum ip_nat_manip_type maniptype,
const struct ip_conntrack *conntrack)
{
static u_int16_t port = 0, *portptr;
static u_int16_t port, *portptr;
unsigned int range_size, min, i;
if (maniptype == IP_NAT_MANIP_SRC)
......
......@@ -62,7 +62,7 @@
#define SNMP_TRAP_PORT 162
#define NOCT1(n) (u_int8_t )((n) & 0xff)
static int debug = 0;
static int debug;
static spinlock_t snmp_lock = SPIN_LOCK_UNLOCKED;
/*
......
......@@ -256,7 +256,7 @@ ipt_do_table(struct sk_buff **pskb,
struct ipt_table *table,
void *userdata)
{
static const char nulldevname[IFNAMSIZ] = { 0 };
static const char nulldevname[IFNAMSIZ];
u_int16_t offset;
struct iphdr *ip;
u_int16_t datalen;
......
......@@ -17,7 +17,7 @@ match(const struct sk_buff *skb,
int *hotdrop)
{
int i;
static const char nulldevname[IFNAMSIZ] = { 0 };
static const char nulldevname[IFNAMSIZ];
const struct ipt_physdev_info *info = matchinfo;
unsigned long ret;
const char *indev, *outdev;
......
......@@ -65,7 +65,7 @@
#include <asm/system.h>
#if 0 /*def MODULE*/
static int unloadable = 0; /* XX: Turn to one when all is ok within the
static int unloadable; /* XX: Turn to one when all is ok within the
module for allowing unload */
MODULE_PARM(unloadable, "i");
#endif
......
......@@ -329,7 +329,7 @@ ip6t_do_table(struct sk_buff **pskb,
struct ip6t_table *table,
void *userdata)
{
static const char nulldevname[IFNAMSIZ] = { 0 };
static const char nulldevname[IFNAMSIZ];
u_int16_t offset = 0;
struct ipv6hdr *ipv6;
void *protohdr;
......
......@@ -68,7 +68,7 @@ static void *ckey;
static void *skey;
/* Module parameters */
static int eth = 0; /* Use "eth" or "irlan" name for devices */
static int eth; /* Use "eth" or "irlan" name for devices */
static int access = ACCESS_PEER; /* PEER, DIRECT or HOSTED */
#ifdef CONFIG_PROC_FS
......
......@@ -67,7 +67,7 @@ static int min_slot_timeout = 20;
static int max_max_baud_rate = 16000000; /* See qos.c - IrLAP spec */
static int min_max_baud_rate = 2400;
static int max_min_tx_turn_time = 10000; /* See qos.c - IrLAP spec */
static int min_min_tx_turn_time = 0;
static int min_min_tx_turn_time;
static int max_max_tx_data_size = 2048; /* See qos.c - IrLAP spec */
static int min_max_tx_data_size = 64;
static int max_max_tx_window = 7; /* See qos.c - IrLAP spec */
......
......@@ -15,9 +15,9 @@
/*
* Values taken from NET/ROM documentation.
*/
static int min_quality[] = {0}, max_quality[] = {255};
static int min_obs[] = {0}, max_obs[] = {255};
static int min_ttl[] = {0}, max_ttl[] = {255};
static int min_quality[1], max_quality[] = {255};
static int min_obs[1], max_obs[] = {255};
static int min_ttl[1], max_ttl[] = {255};
static int min_t1[] = {5 * HZ};
static int max_t1[] = {600 * HZ};
static int min_n2[] = {2}, max_n2[] = {127};
......@@ -28,7 +28,7 @@ static int max_t4[] = {1000 * HZ};
static int min_window[] = {1}, max_window[] = {127};
static int min_idle[] = {0 * HZ};
static int max_idle[] = {65535 * HZ};
static int min_route[] = {0}, max_route[] = {1};
static int min_route[1], max_route[] = {1};
static int min_fails[] = {1}, max_fails[] = {10};
static struct ctl_table_header *nr_table_header;
......
......@@ -16,7 +16,7 @@ static int min_timer[] = {1 * HZ};
static int max_timer[] = {300 * HZ};
static int min_idle[] = {0 * HZ};
static int max_idle[] = {65535 * HZ};
static int min_route[] = {0}, max_route[] = {1};
static int min_route[1], max_route[] = {1};
static int min_ftimer[] = {60 * HZ};
static int max_ftimer[] = {600 * HZ};
static int min_maxvcs[] = {1}, max_maxvcs[] = {254};
......
......@@ -645,7 +645,7 @@ static int atm_tc_dump_class(struct Qdisc *sch, unsigned long cl,
if (flow->excess)
RTA_PUT(skb,TCA_ATM_EXCESS,sizeof(u32),&flow->classid);
else {
static u32 zero = 0;
static u32 zero;
RTA_PUT(skb,TCA_ATM_EXCESS,sizeof(zero),&zero);
}
......
......@@ -45,7 +45,7 @@ struct des_cred {
* Make sure we don't place more than one call to the key server at
* a time.
*/
static int in_keycall = 0;
static int in_keycall;
#define FAIL(err) \
{ if (data) put_cred(data); \
......@@ -202,7 +202,7 @@ svcauth_des(struct svc_rqst *rqstp, u32 *statp, u32 *authp)
static struct des_cred *
get_cred_byname(struct svc_rqst *rqstp, u32 *authp, char *fullname, u32 *cryptkey)
{
static int in_keycall = 0;
static int in_keycall;
struct des_cred *cred;
if (in_keycall) {
......
......@@ -579,8 +579,8 @@ xprt_complete_rqst(struct rpc_xprt *xprt, struct rpc_rqst *req, int copied)
#ifdef RPC_PROFILE
/* Profile only reads for now */
if (copied > 1024) {
static unsigned long nextstat = 0;
static unsigned long pkt_rtt = 0, pkt_len = 0, pkt_cnt = 0;
static unsigned long nextstat;
static unsigned long pkt_rtt, pkt_len, pkt_cnt;
pkt_cnt++;
pkt_len += req->rq_slen + copied;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment