From: Jeff Garzik <hidden> Date: 2005-10-26 04:28:29
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.
@@ -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);+staticintprinted_message;++if(!printed_message++)+printk(KERN_DEBUG"%s (WE) : Driver using old /proc/net/wireless support, please fix driver !\n",+dev->name);+returndev->get_wireless_stats(dev);}+/* Not found */return(structiw_statistics*)NULL;}
@@ -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);+staticintprinted_message;++if(!printed_message++)+printk(KERN_DEBUG"%s (WE) : Driver using old /proc/net/wireless support, please fix driver !\n",+dev->name);+returndev->get_wireless_stats(dev);}+
From: J.A. Magallon <hidden> Date: 2005-10-26 21:24:05
On 2005.10.26, at 17:23, Jesper Juhl wrote:
On 10/26/05, Andi Kleen [off-list ref] wrote:
quoted
On Wednesday 26 October 2005 06:28, Jeff Garzik wrote:
quoted
Change this to printing out the message once, per kernel boot.
It doesn't do that. It prints it once every 2^32 calls. Also
I noted that as well. How about just using something along the
lines of
static unsigned char printed_message = 0;
if (!printed_message) {
printk(...);
printed_message++;
}
Sorry, but why not the old good
printed_message = 1
??
What kind of microoptimization is that ?
--
J.A. Magallon <jamagallon()able!es> \ Software is like sex:
wolverine \ It's better when it's free
MacOS X 10.4.2, Darwin Kernel Version 8.2.0
On Wednesday 26 October 2005 06:28, Jeff Garzik wrote:
quoted
Change this to printing out the message once, per kernel boot.
It doesn't do that. It prints it once every 2^32 calls. Also
I noted that as well. How about just using something along the
lines of
static unsigned char printed_message = 0;
if (!printed_message) {
printk(...);
printed_message++;
}
Sorry, but why not the old good
printed_message = 1
??
What kind of microoptimization is that ?
Does it really matter? I needed to pick one of
printed_message=1; or printed_message++;
the end result is the same, so I just picked one at random.
But now that you mention it, I guess ++ would turn into "inc" which
should be faster than an assignment... but it *doesn't matter*... I
was not trying to optimize anything, just make the code work properly
- as in, only ever print the message once...
--
Jesper Juhl [off-list ref]
Don't top-post http://www.catb.org/~esr/jargon/html/T/top-post.html
Plain text mails only, please http://www.expita.com/nomime.html