netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] kill massive wireless-related log spam
@ 2005-10-26  4:28 Jeff Garzik
  2005-10-26 15:04 ` Andi Kleen
  0 siblings, 1 reply; 7+ messages in thread
From: Jeff Garzik @ 2005-10-26  4:28 UTC (permalink / raw)
  To: Linus Torvalds; +Cc: netdev, linux-kernel, jketreno, Andrew Morton


Please apply to 2.6.14-rc.

Although this message is having the intended effect of causing wireless
driver maintainers to upgrade their code, I never should have merged
this patch in its present form.  Leading to tons of bug reports and
unhappy users.

Some wireless apps poll for statistics regularly, which leads to a
printk() every single time they ask for stats.  That's a little bit
_too_ much of a reminder that the driver is using an old API.

Change this to printing out the message once, per kernel boot.

diff --git a/net/core/wireless.c b/net/core/wireless.c
index d17f158..271ddb3 100644
--- a/net/core/wireless.c
+++ b/net/core/wireless.c
@@ -455,10 +455,15 @@ static inline struct iw_statistics *get_
 
 	/* Old location, field to be removed in next WE */
 	if(dev->get_wireless_stats) {
-		printk(KERN_DEBUG "%s (WE) : Driver using old /proc/net/wireless support, please fix driver !\n",
-		       dev->name);
+		static int printed_message;
+
+		if (!printed_message++)
+			printk(KERN_DEBUG "%s (WE) : Driver using old /proc/net/wireless support, please fix driver !\n",
+				dev->name);
+
 		return dev->get_wireless_stats(dev);
 	}
+
 	/* Not found */
 	return (struct iw_statistics *) NULL;
 }

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

end of thread, other threads:[~2005-10-27 17:37 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-10-26  4:28 [PATCH] kill massive wireless-related log spam Jeff Garzik
2005-10-26 15:04 ` Andi Kleen
2005-10-26 15:23   ` Jesper Juhl
2005-10-26 21:23     ` J.A. Magallon
2005-10-26 21:43       ` Jesper Juhl
2005-10-26 15:42   ` Jeff Garzik
2005-10-27 17:37     ` Horst von Brand

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).