Please note: This project is no longer active. The website is kept online for historic purposes only.
If you´re looking for a Linux driver for your Atheros WLAN device, you should continue here .

Ticket #373 (new task)

Opened 14 years ago

Last modified 14 years ago

printk consistency

Reported by: grabeuh@free.fr Assigned to:
Priority: minor Milestone: version 0.9.x - progressive release candidate phase
Component: madwifi: other Version: trunk
Keywords: Cc: grabeuh@free.fr
Patch is attached: 1 Pending:

Description

Right now, there are multiple functions that can be used to print messages and, in several places in the driver source code, they are used in an heterogeneous way. The result can sometime be disturbing like in ieee80211_announce (net80211/ieee80211.c:891) where printf, printk and if_printf are used.

It is worth saying that printf is also used in an ambiguous way since it is in fact #define'd as printk (net80211/ieee80211_linux.h:315). if_printf is also making printk calls after some vsnprint in a buffer, while a vprintk could be used, I think.

I think it would add consistency to the source code if only printk or some function was used.

I can deal with this if nobody is motivated but I would like comments on this topic so I don't work on some useless patch :)

Attachments

printk_consistency.diff (20.2 kB) - added by dyqith@gmail on 03/13/06 05:06:49.
Replaced all printf to printk and all if_printf to printk

Change History

02/07/06 06:21:30 changed by mrenzmann

if_printf could be changed to be a macro call, I think. Something like:

#define if_printf(dev, fmt, args...) printk(KERN_INFO "%s: " fmt, dev->name, ##args)

Maybe KERN_INFO should even be KERN_DEBUG (that would need a further inspection of the kind of messages that are printed out via this function/macro).

The printf should be plainly replaced by printk. Although this might add to the amount/complexity of diffs for ported patches from FreeBSD, it would be worth the additional work for consistency.

Comments?

03/13/06 05:06:49 changed by dyqith@gmail

  • attachment printk_consistency.diff added.

Replaced all printf to printk and all if_printf to printk

03/13/06 05:10:09 changed by dyqith@gmail

  • patch_attached set to 1.

It's been a month and no one said anything about this (and I haven't seen any patches ported from BSD), so I went ahead and made a patch to change all printf to printk and all if_printf to printk that printed the dev's name.

Signed-off-by: Daniel Wu <dyqith@gmail.com>

(notice that I'm trying to help close as many tickets as possible, and speed the devel work on the driver...)

04/23/06 02:14:15 changed by kelmo

  • milestone changed from version 0.9.0 - move to new codebase to version 0.9.x - progressive release candidate phase.

I haven't seen any patched ported from bsd, and I'd agree that this would make the code much cleaner and uniform. But i would not put a huge pririty on it.