* [2.6 patch] net/sched/: possible cleanups
@ 2004-12-15 1:27 Adrian Bunk
2004-12-15 1:59 ` Arnaldo Carvalho de Melo
` (2 more replies)
0 siblings, 3 replies; 7+ messages in thread
From: Adrian Bunk @ 2004-12-15 1:27 UTC (permalink / raw)
To: netdev; +Cc: linux-kernel
The patch below contans the following possible cleanups:
- make some needlessly global code static
- sch_htb.c: #undef HTB_DEBUG
diffstat output:
include/net/act_api.h | 3 ---
net/sched/gact.c | 2 +-
net/sched/police.c | 8 ++++----
net/sched/sch_api.c | 11 ++++++-----
net/sched/sch_dsmark.c | 2 +-
net/sched/sch_generic.c | 4 ++--
net/sched/sch_htb.c | 2 +-
net/sched/sch_ingress.c | 2 +-
net/sched/sch_prio.c | 3 ++-
9 files changed, 18 insertions(+), 19 deletions(-)
Signed-off-by: Adrian Bunk <bunk@stusta.de>
--- linux-2.6.10-rc3-mm1-full/net/sched/gact.c.old 2004-12-14 22:32:34.000000000 +0100
+++ linux-2.6.10-rc3-mm1-full/net/sched/gact.c 2004-12-14 22:32:42.000000000 +0100
@@ -68,7 +68,7 @@
}
-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
static int
--- linux-2.6.10-rc3-mm1-full/include/net/act_api.h.old 2004-12-14 22:33:02.000000000 +0100
+++ linux-2.6.10-rc3-mm1-full/include/net/act_api.h 2004-12-14 22:33:14.000000000 +0100
@@ -82,9 +82,6 @@
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_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 */
extern int tcf_police(struct sk_buff *skb, struct tcf_police *p);
--- linux-2.6.10-rc3-mm1-full/net/sched/police.c.old 2004-12-14 22:33:22.000000000 +0100
+++ linux-2.6.10-rc3-mm1-full/net/sched/police.c 2004-12-14 22:33:39.000000000 +0100
@@ -163,7 +163,7 @@
}
#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;
int ret = 0;
@@ -265,7 +265,7 @@
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;
p = PRIV(a);
@@ -275,7 +275,7 @@
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;
struct sk_buff *skb = *pskb;
@@ -338,7 +338,7 @@
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;
struct tc_police opt;
--- linux-2.6.10-rc3-mm1-full/net/sched/sch_api.c.old 2004-12-14 22:36:33.000000000 +0100
+++ linux-2.6.10-rc3-mm1-full/net/sched/sch_api.c 2004-12-14 22:39:03.000000000 +0100
@@ -207,7 +207,7 @@
return NULL;
}
-struct Qdisc *qdisc_leaf(struct Qdisc *p, u32 classid)
+static struct Qdisc *qdisc_leaf(struct Qdisc *p, u32 classid)
{
unsigned long cl;
struct Qdisc *leaf;
@@ -226,7 +226,7 @@
/* 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;
@@ -290,7 +290,7 @@
/* 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;
static u32 autohandle = TC_H_MAKE(0x80000000U, 0);
@@ -356,8 +356,9 @@
Old qdisc is not destroyed but returned in *old.
*/
-int qdisc_graft(struct net_device *dev, struct Qdisc *parent, u32 classid,
- struct Qdisc *new, struct Qdisc **old)
+static int qdisc_graft(struct net_device *dev, struct Qdisc *parent,
+ u32 classid,
+ struct Qdisc *new, struct Qdisc **old)
{
int err = 0;
struct Qdisc *q = *old;
--- linux-2.6.10-rc3-mm1-full/net/sched/sch_dsmark.c.old 2004-12-14 22:39:16.000000000 +0100
+++ linux-2.6.10-rc3-mm1-full/net/sched/sch_dsmark.c 2004-12-14 22:39:24.000000000 +0100
@@ -320,7 +320,7 @@
}
-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 rtattr *tb[TCA_DSMARK_MAX];
--- linux-2.6.10-rc3-mm1-full/net/sched/sch_generic.c.old 2004-12-14 22:39:41.000000000 +0100
+++ linux-2.6.10-rc3-mm1-full/net/sched/sch_generic.c 2004-12-14 22:40:00.000000000 +0100
@@ -283,7 +283,7 @@
.list = LIST_HEAD_INIT(noop_qdisc.list),
};
-struct Qdisc_ops noqueue_qdisc_ops = {
+static struct Qdisc_ops noqueue_qdisc_ops = {
.next = NULL,
.cl_ops = NULL,
.id = "noqueue",
@@ -294,7 +294,7 @@
.owner = THIS_MODULE,
};
-struct Qdisc noqueue_qdisc = {
+static struct Qdisc noqueue_qdisc = {
.enqueue = NULL,
.dequeue = noop_dequeue,
.flags = TCQ_F_BUILTIN,
--- linux-2.6.10-rc3-mm1-full/net/sched/sch_ingress.c.old 2004-12-14 22:40:25.000000000 +0100
+++ linux-2.6.10-rc3-mm1-full/net/sched/sch_ingress.c 2004-12-14 22:40:34.000000000 +0100
@@ -274,7 +274,7 @@
#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);
--- linux-2.6.10-rc3-mm1-full/net/sched/sch_prio.c.old 2004-12-14 22:40:49.000000000 +0100
+++ linux-2.6.10-rc3-mm1-full/net/sched/sch_prio.c 2004-12-14 22:41:03.000000000 +0100
@@ -47,7 +47,8 @@
};
-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);
u32 band = skb->priority;
--- linux-2.6.10-rc3-mm1-full/net/sched/sch_htb.c.old 2004-12-14 22:41:56.000000000 +0100
+++ linux-2.6.10-rc3-mm1-full/net/sched/sch_htb.c 2004-12-14 23:46:12.000000000 +0100
@@ -71,7 +71,7 @@
#define HTB_HSIZE 16 /* classid hash size */
#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_HYSTERESIS 1/* whether to use mode hysteresis for speedup */
#define HTB_QLOCK(S) spin_lock_bh(&(S)->dev->queue_lock)
^ permalink raw reply [flat|nested] 7+ messages in thread* Re: [2.6 patch] net/sched/: possible cleanups
2004-12-15 1:27 [2.6 patch] net/sched/: possible cleanups Adrian Bunk
@ 2004-12-15 1:59 ` Arnaldo Carvalho de Melo
2004-12-18 1:00 ` Adrian Bunk
2004-12-15 11:27 ` Thomas Graf
2004-12-28 5:19 ` David S. Miller
2 siblings, 1 reply; 7+ messages in thread
From: Arnaldo Carvalho de Melo @ 2004-12-15 1:59 UTC (permalink / raw)
To: Adrian Bunk; +Cc: netdev
Adrian Bunk wrote:
> The patch below contans the following possible cleanups:
> - make some needlessly global code static
> - sch_htb.c: #undef HTB_DEBUG
>
>
> diffstat output:
> include/net/act_api.h | 3 ---
Adrian, may I suggest that you post the networking related patches
only to netdev?
- Arnaldo
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [2.6 patch] net/sched/: possible cleanups
2004-12-15 1:59 ` Arnaldo Carvalho de Melo
@ 2004-12-18 1:00 ` Adrian Bunk
2004-12-18 4:16 ` Arnaldo Carvalho de Melo
0 siblings, 1 reply; 7+ messages in thread
From: Adrian Bunk @ 2004-12-18 1:00 UTC (permalink / raw)
To: Arnaldo Carvalho de Melo; +Cc: netdev
On Tue, Dec 14, 2004 at 11:59:49PM -0200, Arnaldo Carvalho de Melo wrote:
>
> Adrian Bunk wrote:
> >The patch below contans the following possible cleanups:
> >- make some needlessly global code static
> >- sch_htb.c: #undef HTB_DEBUG
> >
> >
> >diffstat output:
> > include/net/act_api.h | 3 ---
>
> Adrian, may I suggest that you post the networking related patches
> only to netdev?
Until now I thought it's never a bad idea to Cc linux-kernel on any
patches. Is there a specific reason why you consider this being a bad
thing (well, bandwith shouldn't be that much of an issue considering how
high-volume linux-kernel is...)?
> - Arnaldo
cu
Adrian
--
"Is there not promise of rain?" Ling Tan asked suddenly out
of the darkness. There had been need of rain for many days.
"Only a promise," Lao Er said.
Pearl S. Buck - Dragon Seed
^ permalink raw reply [flat|nested] 7+ messages in thread* Re: [2.6 patch] net/sched/: possible cleanups
2004-12-18 1:00 ` Adrian Bunk
@ 2004-12-18 4:16 ` Arnaldo Carvalho de Melo
0 siblings, 0 replies; 7+ messages in thread
From: Arnaldo Carvalho de Melo @ 2004-12-18 4:16 UTC (permalink / raw)
To: Adrian Bunk; +Cc: netdev
Adrian Bunk wrote:
> On Tue, Dec 14, 2004 at 11:59:49PM -0200, Arnaldo Carvalho de Melo wrote:
>
>>Adrian Bunk wrote:
>>
>>>The patch below contans the following possible cleanups:
>>>- make some needlessly global code static
>>>- sch_htb.c: #undef HTB_DEBUG
>>>
>>>
>>>diffstat output:
>>>include/net/act_api.h | 3 ---
>>
>>Adrian, may I suggest that you post the networking related patches
>>only to netdev?
>
>
> Until now I thought it's never a bad idea to Cc linux-kernel on any
> patches. Is there a specific reason why you consider this being a bad
> thing (well, bandwith shouldn't be that much of an issue considering how
> high-volume linux-kernel is...)?
I mentioned that when making the same request to another person one or
two days ago: all the networking hackers I know are subscribed to netdev,
several of them aren't subscribed to linux-kernel.
- Arnaldo
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [2.6 patch] net/sched/: possible cleanups
2004-12-15 1:27 [2.6 patch] net/sched/: possible cleanups Adrian Bunk
2004-12-15 1:59 ` Arnaldo Carvalho de Melo
@ 2004-12-15 11:27 ` Thomas Graf
2004-12-15 14:03 ` jamal
2004-12-28 5:19 ` David S. Miller
2 siblings, 1 reply; 7+ messages in thread
From: Thomas Graf @ 2004-12-15 11:27 UTC (permalink / raw)
To: Adrian Bunk; +Cc: Jamal Hadi Salim, netdev
* Adrian Bunk <20041215012754.GH12937@stusta.de> 2004-12-15 02:27
> -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);
This looks like a police compat API for action policers but I think it's
fine, Jamal?
The other changes all make sense to me.
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [2.6 patch] net/sched/: possible cleanups
2004-12-15 11:27 ` Thomas Graf
@ 2004-12-15 14:03 ` jamal
0 siblings, 0 replies; 7+ messages in thread
From: jamal @ 2004-12-15 14:03 UTC (permalink / raw)
To: Thomas Graf; +Cc: Adrian Bunk, netdev
This is fine. The new architecture doesnt require classifiers explicitly
call those function. Rest also looks fine to me. Good effort Adrian.
cheers,
jamal
On Wed, 2004-12-15 at 06:27, Thomas Graf wrote:
> * Adrian Bunk <20041215012754.GH12937@stusta.de> 2004-12-15 02:27
>
> > -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);
>
> This looks like a police compat API for action policers but I think it's
> fine, Jamal?
>
> The other changes all make sense to me.
>
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [2.6 patch] net/sched/: possible cleanups
2004-12-15 1:27 [2.6 patch] net/sched/: possible cleanups Adrian Bunk
2004-12-15 1:59 ` Arnaldo Carvalho de Melo
2004-12-15 11:27 ` Thomas Graf
@ 2004-12-28 5:19 ` David S. Miller
2 siblings, 0 replies; 7+ messages in thread
From: David S. Miller @ 2004-12-28 5:19 UTC (permalink / raw)
To: Adrian Bunk; +Cc: netdev, linux-kernel
On Wed, 15 Dec 2004 02:27:54 +0100
Adrian Bunk <bunk@stusta.de> wrote:
> The patch below contans the following possible cleanups:
> - make some needlessly global code static
> - sch_htb.c: #undef HTB_DEBUG
Applied, thanks Adrian.
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2004-12-28 5:19 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-12-15 1:27 [2.6 patch] net/sched/: possible cleanups Adrian Bunk
2004-12-15 1:59 ` Arnaldo Carvalho de Melo
2004-12-18 1:00 ` Adrian Bunk
2004-12-18 4:16 ` Arnaldo Carvalho de Melo
2004-12-15 11:27 ` Thomas Graf
2004-12-15 14:03 ` jamal
2004-12-28 5:19 ` David S. Miller
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).