* [2.6 patch] drivers/net/shaper.c: cleanups
@ 2005-02-19 0:10 Adrian Bunk
2005-02-19 0:18 ` Jeff Garzik
0 siblings, 1 reply; 3+ messages in thread
From: Adrian Bunk @ 2005-02-19 0:10 UTC (permalink / raw)
To: jgarzik, linux-net, linux-kernel
This patch contains the following cleanups:
- remove an unused #define SHAPER_BANNER
- remove the sh_debug flag
Signed-off-by: Adrian Bunk <bunk@stusta.de>
---
drivers/net/shaper.c | 30 +++++-------------------------
1 files changed, 5 insertions(+), 25 deletions(-)
--- linux-2.6.11-rc3-mm2-full/drivers/net/shaper.c.old 2005-02-16 18:20:33.000000000 +0100
+++ linux-2.6.11-rc3-mm2-full/drivers/net/shaper.c 2005-02-16 18:22:48.000000000 +0100
@@ -96,10 +96,6 @@
};
#define SHAPERCB(skb) ((struct shaper_cb *) ((skb)->cb))
-int sh_debug; /* Debug flag */
-
-#define SHAPER_BANNER "CymruNet Traffic Shaper BETA 0.04 for Linux 2.1\n"
-
/*
* Locking
*/
@@ -252,8 +248,6 @@
skb_queue_tail(&shaper->sendq, skb);
}
#endif
- if(sh_debug)
- printk("Frame queued.\n");
if(skb_queue_len(&shaper->sendq)>SHAPER_QLEN)
{
ptr=skb_dequeue(&shaper->sendq);
@@ -271,22 +265,16 @@
static void shaper_queue_xmit(struct shaper *shaper, struct sk_buff *skb)
{
struct sk_buff *newskb=skb_clone(skb, GFP_ATOMIC);
- if(sh_debug)
- printk("Kick frame on %p\n",newskb);
if(newskb)
{
newskb->dev=shaper->dev;
newskb->priority=2;
- if(sh_debug)
- printk("Kick new frame to %s, %d\n",
- shaper->dev->name,newskb->priority);
+
dev_queue_xmit(newskb);
shaper->stats.tx_bytes += skb->len;
shaper->stats.tx_packets++;
- if(sh_debug)
- printk("Kicked new frame out.\n");
dev_kfree_skb(skb);
}
}
@@ -316,8 +304,6 @@
if (test_and_set_bit(0, &shaper->locked))
{
- if(sh_debug)
- printk("Shaper locked.\n");
mod_timer(&shaper->timer, jiffies);
return;
}
@@ -334,8 +320,6 @@
* of SHAPER_BURST) gets kicked onto the link
*/
- if(sh_debug)
- printk("Clock = %ld, jiffies = %ld\n", SHAPERCB(skb)->shapeclock, jiffies);
if(time_before_eq(SHAPERCB(skb)->shapeclock, jiffies + SHAPER_BURST))
{
/*
@@ -444,8 +428,7 @@
{
struct shaper *sh=dev->priv;
int v;
- if(sh_debug)
- printk("Shaper header\n");
+
skb->dev=sh->dev;
v=sh->hard_header(skb,sh->dev,type,daddr,saddr,len);
skb->dev=dev;
@@ -457,8 +440,7 @@
struct shaper *sh=skb->dev->priv;
struct net_device *dev=skb->dev;
int v;
- if(sh_debug)
- printk("Shaper rebuild header\n");
+
skb->dev=sh->dev;
v=sh->rebuild_header(skb);
skb->dev=dev;
@@ -471,8 +453,7 @@
struct shaper *sh=neigh->dev->priv;
struct net_device *tmp;
int ret;
- if(sh_debug)
- printk("Shaper header cache bind\n");
+
tmp=neigh->dev;
neigh->dev=sh->dev;
ret=sh->hard_header_cache(neigh,hh);
@@ -484,8 +465,7 @@
unsigned char *haddr)
{
struct shaper *sh=dev->priv;
- if(sh_debug)
- printk("Shaper cache update\n");
+
sh->header_cache_update(hh, sh->dev, haddr);
}
#endif
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [2.6 patch] drivers/net/shaper.c: cleanups
2005-02-19 0:10 [2.6 patch] drivers/net/shaper.c: cleanups Adrian Bunk
@ 2005-02-19 0:18 ` Jeff Garzik
2005-02-19 8:39 ` [2.6 patch] drivers/net/shaper.c: make a variable static Adrian Bunk
0 siblings, 1 reply; 3+ messages in thread
From: Jeff Garzik @ 2005-02-19 0:18 UTC (permalink / raw)
To: Adrian Bunk; +Cc: linux-net, linux-kernel
Adrian Bunk wrote:
> This patch contains the following cleanups:
> - remove an unused #define SHAPER_BANNER
> - remove the sh_debug flag
>
> Signed-off-by: Adrian Bunk <bunk@stusta.de>
you are removing presumably-useful debug code; NAK.
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [2.6 patch] drivers/net/shaper.c: make a variable static
2005-02-19 0:18 ` Jeff Garzik
@ 2005-02-19 8:39 ` Adrian Bunk
0 siblings, 0 replies; 3+ messages in thread
From: Adrian Bunk @ 2005-02-19 8:39 UTC (permalink / raw)
To: Jeff Garzik; +Cc: linux-net, linux-kernel
On Fri, Feb 18, 2005 at 07:18:19PM -0500, Jeff Garzik wrote:
> Adrian Bunk wrote:
> >This patch contains the following cleanups:
> >- remove an unused #define SHAPER_BANNER
> >- remove the sh_debug flag
> >
> >Signed-off-by: Adrian Bunk <bunk@stusta.de>
>
> you are removing presumably-useful debug code; NAK.
OK, less invasive patch below.
<-- snip -->
This patch makes a needlessly global variable static.
Signed-off-by: Adrian Bunk <bunk@stusta.de>
--- linux-2.6.11-rc3-mm2-full/drivers/net/shaper.c.old 2005-02-16 18:20:33.000000000 +0100
+++ linux-2.6.11-rc3-mm2-full/drivers/net/shaper.c 2005-02-19 09:27:53.000000000 +0100
@@ -96,7 +96,7 @@
};
#define SHAPERCB(skb) ((struct shaper_cb *) ((skb)->cb))
-int sh_debug; /* Debug flag */
+static int sh_debug; /* Debug flag */
#define SHAPER_BANNER "CymruNet Traffic Shaper BETA 0.04 for Linux 2.1\n"
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2005-02-19 8:41 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-02-19 0:10 [2.6 patch] drivers/net/shaper.c: cleanups Adrian Bunk
2005-02-19 0:18 ` Jeff Garzik
2005-02-19 8:39 ` [2.6 patch] drivers/net/shaper.c: make a variable static Adrian Bunk
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.