Commit 77155e15 authored by Adrian Bunk's avatar Adrian Bunk Committed by Thomas Graf

[PKT_SCHED]: Staticize and other cleanups.

The patch below contans the following possible cleanups:
- make some needlessly global code static
- sch_htb.c: #undef HTB_DEBUG
Signed-off-by: default avatarAdrian Bunk <bunk@stusta.de>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 6c94b148
...@@ -82,9 +82,6 @@ extern int tcf_action_dump(struct sk_buff *skb, struct tc_action *a, int, int); ...@@ -82,9 +82,6 @@ extern int tcf_action_dump(struct sk_buff *skb, struct tc_action *a, int, int);
extern int tcf_action_dump_old(struct sk_buff *skb, struct tc_action *a, int, int); extern int tcf_action_dump_old(struct sk_buff *skb, struct tc_action *a, int, int);
extern int tcf_action_dump_1(struct sk_buff *skb, struct tc_action *a, int, int); extern int tcf_action_dump_1(struct sk_buff *skb, struct tc_action *a, int, int);
extern int tcf_action_copy_stats (struct sk_buff *,struct tc_action *); extern int tcf_action_copy_stats (struct sk_buff *,struct tc_action *);
extern int tcf_act_police_locate(struct rtattr *rta, struct rtattr *est,struct tc_action *,int , int );
extern int tcf_act_police_dump(struct sk_buff *, struct tc_action *, int, int);
extern int tcf_act_police(struct sk_buff **skb, struct tc_action *a);
#endif /* CONFIG_NET_CLS_ACT */ #endif /* CONFIG_NET_CLS_ACT */
extern int tcf_police(struct sk_buff *skb, struct tcf_police *p); extern int tcf_police(struct sk_buff *skb, struct tcf_police *p);
......
...@@ -68,7 +68,7 @@ gact_determ(struct tcf_gact *p) { ...@@ -68,7 +68,7 @@ gact_determ(struct tcf_gact *p) {
} }
g_rand gact_rand[MAX_RAND]= { NULL,gact_net_rand, gact_determ}; static g_rand gact_rand[MAX_RAND]= { NULL,gact_net_rand, gact_determ};
#endif #endif
static int static int
......
...@@ -163,7 +163,7 @@ void tcf_police_destroy(struct tcf_police *p) ...@@ -163,7 +163,7 @@ void tcf_police_destroy(struct tcf_police *p)
} }
#ifdef CONFIG_NET_CLS_ACT #ifdef CONFIG_NET_CLS_ACT
int tcf_act_police_locate(struct rtattr *rta, struct rtattr *est,struct tc_action *a, int ovr, int bind) static int tcf_act_police_locate(struct rtattr *rta, struct rtattr *est,struct tc_action *a, int ovr, int bind)
{ {
unsigned h; unsigned h;
int ret = 0; int ret = 0;
...@@ -272,7 +272,7 @@ int tcf_act_police_locate(struct rtattr *rta, struct rtattr *est,struct tc_actio ...@@ -272,7 +272,7 @@ int tcf_act_police_locate(struct rtattr *rta, struct rtattr *est,struct tc_actio
return -1; return -1;
} }
int tcf_act_police_cleanup(struct tc_action *a, int bind) static int tcf_act_police_cleanup(struct tc_action *a, int bind)
{ {
struct tcf_police *p; struct tcf_police *p;
p = PRIV(a); p = PRIV(a);
...@@ -282,7 +282,7 @@ int tcf_act_police_cleanup(struct tc_action *a, int bind) ...@@ -282,7 +282,7 @@ int tcf_act_police_cleanup(struct tc_action *a, int bind)
return 0; return 0;
} }
int tcf_act_police(struct sk_buff **pskb, struct tc_action *a) static int tcf_act_police(struct sk_buff **pskb, struct tc_action *a)
{ {
psched_time_t now; psched_time_t now;
struct sk_buff *skb = *pskb; struct sk_buff *skb = *pskb;
...@@ -345,7 +345,7 @@ int tcf_act_police(struct sk_buff **pskb, struct tc_action *a) ...@@ -345,7 +345,7 @@ int tcf_act_police(struct sk_buff **pskb, struct tc_action *a)
return p->action; return p->action;
} }
int tcf_act_police_dump(struct sk_buff *skb, struct tc_action *a, int bind, int ref) static int tcf_act_police_dump(struct sk_buff *skb, struct tc_action *a, int bind, int ref)
{ {
unsigned char *b = skb->tail; unsigned char *b = skb->tail;
struct tc_police opt; struct tc_police opt;
......
...@@ -207,7 +207,7 @@ struct Qdisc *qdisc_lookup(struct net_device *dev, u32 handle) ...@@ -207,7 +207,7 @@ struct Qdisc *qdisc_lookup(struct net_device *dev, u32 handle)
return NULL; return NULL;
} }
struct Qdisc *qdisc_leaf(struct Qdisc *p, u32 classid) static struct Qdisc *qdisc_leaf(struct Qdisc *p, u32 classid)
{ {
unsigned long cl; unsigned long cl;
struct Qdisc *leaf; struct Qdisc *leaf;
...@@ -226,7 +226,7 @@ struct Qdisc *qdisc_leaf(struct Qdisc *p, u32 classid) ...@@ -226,7 +226,7 @@ struct Qdisc *qdisc_leaf(struct Qdisc *p, u32 classid)
/* Find queueing discipline by name */ /* Find queueing discipline by name */
struct Qdisc_ops *qdisc_lookup_ops(struct rtattr *kind) static struct Qdisc_ops *qdisc_lookup_ops(struct rtattr *kind)
{ {
struct Qdisc_ops *q = NULL; struct Qdisc_ops *q = NULL;
...@@ -290,7 +290,7 @@ void qdisc_put_rtab(struct qdisc_rate_table *tab) ...@@ -290,7 +290,7 @@ void qdisc_put_rtab(struct qdisc_rate_table *tab)
/* Allocate an unique handle from space managed by kernel */ /* Allocate an unique handle from space managed by kernel */
u32 qdisc_alloc_handle(struct net_device *dev) static u32 qdisc_alloc_handle(struct net_device *dev)
{ {
int i = 0x10000; int i = 0x10000;
static u32 autohandle = TC_H_MAKE(0x80000000U, 0); static u32 autohandle = TC_H_MAKE(0x80000000U, 0);
...@@ -356,8 +356,9 @@ dev_graft_qdisc(struct net_device *dev, struct Qdisc *qdisc) ...@@ -356,8 +356,9 @@ dev_graft_qdisc(struct net_device *dev, struct Qdisc *qdisc)
Old qdisc is not destroyed but returned in *old. Old qdisc is not destroyed but returned in *old.
*/ */
int qdisc_graft(struct net_device *dev, struct Qdisc *parent, u32 classid, static int qdisc_graft(struct net_device *dev, struct Qdisc *parent,
struct Qdisc *new, struct Qdisc **old) u32 classid,
struct Qdisc *new, struct Qdisc **old)
{ {
int err = 0; int err = 0;
struct Qdisc *q = *old; struct Qdisc *q = *old;
......
...@@ -320,7 +320,7 @@ static unsigned int dsmark_drop(struct Qdisc *sch) ...@@ -320,7 +320,7 @@ static unsigned int dsmark_drop(struct Qdisc *sch)
} }
int dsmark_init(struct Qdisc *sch,struct rtattr *opt) static int dsmark_init(struct Qdisc *sch,struct rtattr *opt)
{ {
struct dsmark_qdisc_data *p = PRIV(sch); struct dsmark_qdisc_data *p = PRIV(sch);
struct rtattr *tb[TCA_DSMARK_MAX]; struct rtattr *tb[TCA_DSMARK_MAX];
......
...@@ -283,7 +283,7 @@ struct Qdisc noop_qdisc = { ...@@ -283,7 +283,7 @@ struct Qdisc noop_qdisc = {
.list = LIST_HEAD_INIT(noop_qdisc.list), .list = LIST_HEAD_INIT(noop_qdisc.list),
}; };
struct Qdisc_ops noqueue_qdisc_ops = { static struct Qdisc_ops noqueue_qdisc_ops = {
.next = NULL, .next = NULL,
.cl_ops = NULL, .cl_ops = NULL,
.id = "noqueue", .id = "noqueue",
...@@ -294,7 +294,7 @@ struct Qdisc_ops noqueue_qdisc_ops = { ...@@ -294,7 +294,7 @@ struct Qdisc_ops noqueue_qdisc_ops = {
.owner = THIS_MODULE, .owner = THIS_MODULE,
}; };
struct Qdisc noqueue_qdisc = { static struct Qdisc noqueue_qdisc = {
.enqueue = NULL, .enqueue = NULL,
.dequeue = noop_dequeue, .dequeue = noop_dequeue,
.flags = TCQ_F_BUILTIN, .flags = TCQ_F_BUILTIN,
......
...@@ -71,7 +71,7 @@ ...@@ -71,7 +71,7 @@
#define HTB_HSIZE 16 /* classid hash size */ #define HTB_HSIZE 16 /* classid hash size */
#define HTB_EWMAC 2 /* rate average over HTB_EWMAC*HTB_HSIZE sec */ #define HTB_EWMAC 2 /* rate average over HTB_EWMAC*HTB_HSIZE sec */
#define HTB_DEBUG 1 /* compile debugging support (activated by tc tool) */ #undef HTB_DEBUG /* compile debugging support (activated by tc tool) */
#define HTB_RATECM 1 /* whether to use rate computer */ #define HTB_RATECM 1 /* whether to use rate computer */
#define HTB_HYSTERESIS 1/* whether to use mode hysteresis for speedup */ #define HTB_HYSTERESIS 1/* whether to use mode hysteresis for speedup */
#define HTB_QLOCK(S) spin_lock_bh(&(S)->dev->queue_lock) #define HTB_QLOCK(S) spin_lock_bh(&(S)->dev->queue_lock)
......
...@@ -274,7 +274,7 @@ static struct nf_hook_ops ing_ops = { ...@@ -274,7 +274,7 @@ static struct nf_hook_ops ing_ops = {
#endif #endif
#endif #endif
int ingress_init(struct Qdisc *sch,struct rtattr *opt) static int ingress_init(struct Qdisc *sch,struct rtattr *opt)
{ {
struct ingress_qdisc_data *p = PRIV(sch); struct ingress_qdisc_data *p = PRIV(sch);
......
...@@ -47,7 +47,8 @@ struct prio_sched_data ...@@ -47,7 +47,8 @@ struct prio_sched_data
}; };
struct Qdisc *prio_classify(struct sk_buff *skb, struct Qdisc *sch,int *r) static struct Qdisc *prio_classify(struct sk_buff *skb,
struct Qdisc *sch, int *r)
{ {
struct prio_sched_data *q = qdisc_priv(sch); struct prio_sched_data *q = qdisc_priv(sch);
u32 band = skb->priority; u32 band = skb->priority;
......
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