netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] replace dst_release refcount error with standard WARN_ON
@ 2004-10-21 20:34 Stephen Hemminger
  2004-10-22  5:05 ` David S. Miller
  0 siblings, 1 reply; 2+ messages in thread
From: Stephen Hemminger @ 2004-10-21 20:34 UTC (permalink / raw)
  To: davem; +Cc: netdev

Replace the dst count underflow bug message with a standard WARN message.
This makes errors noticeable and also reduces the kernel text size by 600
since we aren't doing as much to setup the printk.

Signed-off-by: Stephen Hemminger <shemminger@osdl.org>


diff -Nru a/include/net/dst.h b/include/net/dst.h
--- a/include/net/dst.h	2004-10-21 13:30:02 -07:00
+++ b/include/net/dst.h	2004-10-21 13:30:02 -07:00
@@ -142,16 +142,11 @@
 	return dst;
 }
 
-extern const char dst_underflow_bug_msg[];
-
 static inline
 void dst_release(struct dst_entry * dst)
 {
 	if (dst) {
-		if (atomic_read(&dst->__refcnt) < 1)
-			printk(dst_underflow_bug_msg, 
-			       atomic_read(&dst->__refcnt), 
-			       dst, current_text_addr());
+		WARN_ON(atomic_read(&dst->__refcnt) < 1);
 		atomic_dec(&dst->__refcnt);
 	}
 }
diff -Nru a/net/core/dst.c b/net/core/dst.c
--- a/net/core/dst.c	2004-10-21 13:30:02 -07:00
+++ b/net/core/dst.c	2004-10-21 13:30:02 -07:00
@@ -19,8 +19,6 @@
 
 #include <net/dst.h>
 
-const char dst_underflow_bug_msg[] = KERN_DEBUG "BUG: dst underflow %d: %p at %p\n";
-
 /* Locking strategy:
  * 1) Garbage collection state of dead destination cache
  *    entries is protected by dst_lock.
@@ -275,7 +273,6 @@
 	register_netdevice_notifier(&dst_dev_notifier);
 }
 
-EXPORT_SYMBOL(dst_underflow_bug_msg);
 EXPORT_SYMBOL(__dst_free);
 EXPORT_SYMBOL(dst_alloc);
 EXPORT_SYMBOL(dst_destroy);

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] replace dst_release refcount error with standard WARN_ON
  2004-10-21 20:34 [PATCH] replace dst_release refcount error with standard WARN_ON Stephen Hemminger
@ 2004-10-22  5:05 ` David S. Miller
  0 siblings, 0 replies; 2+ messages in thread
From: David S. Miller @ 2004-10-22  5:05 UTC (permalink / raw)
  To: Stephen Hemminger; +Cc: netdev

On Thu, 21 Oct 2004 13:34:34 -0700
Stephen Hemminger <shemminger@osdl.org> wrote:

> Replace the dst count underflow bug message with a standard WARN message.
> This makes errors noticeable and also reduces the kernel text size by 600
> since we aren't doing as much to setup the printk.
> 
> Signed-off-by: Stephen Hemminger <shemminger@osdl.org>

Applied, thanks Stephen.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2004-10-22  5:05 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-10-21 20:34 [PATCH] replace dst_release refcount error with standard WARN_ON Stephen Hemminger
2004-10-22  5:05 ` 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).