Re: [PATCH] usbnet: convert dev(dbg|err|warn|info) macros tousbnet_(dbg|err|warn|info)

From: Joe Perches
Date: Wed Feb 10 2010 - 01:16:26 EST


On Tue, 2010-02-09 at 21:53 -0800, David Brownell wrote:
> On Tuesday 09 February 2010, Joe Perches wrote:
> > These macros are too similar to the dev_<level> equivalents
> > but take a usbnet * argument.
>
> FYI the history behind that, as I recall, was that the names
> were part of the effort to get rid of kernel 2.4 USB-specific
> macros like err() and info(), or maybe uppercased versions of
> them ... where the dev_err() style messaging wasn't so helpful,
> since it didn't say which network device was involved.

Maybe these usbnet_printk macros could use the proposed
netdev_printk macros instead.

http://patchwork.ozlabs.org/patch/44955/

Maybe:

#define usbnet_dbg(usbnet, fmt, arg...) \
netdev_dbg((usbnet)->net, fmt, ##arg)
#define usbnet_err(usbnet, fmt, arg...) \
netdev_err((usbnet)->net, fmt, ##arg)
#define usbnet_warn(usbnet, fmt, arg...) \
netdev_err((usbnet)->net, fmt, ##arg)
#define usbnet_info(usbnet, fmt, arg...) \
netdev_info((usbnet)->net, fmt, ##arg)

or just use netdev_printks directly.

> Good point that this should be improved.

I neglected to mention that to make the use
style more like the rest of kernel source, this
patch also changes the macro definitions by
removing the \n added to the format and adds the
trailing "\n" to the callers.

Except for the first one. (oops)

> Acked-by: David Brownell <dbrownell@xxxxxxxxxxxxxxxxxxxxx>
> ... should merge via netdev.


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/