Search Linux Wireless

RE: [PATCH v2] mwifiex: remove PRINTM/HEXDUMP and associated

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, 2011-03-03 at 14:04 -0800, Bing Zhao wrote:
> Hi Joe,
> 
> > Please use pr_fmt
> > #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
> > to prefix "mwifiex: " rather than put it each
> > format string.
>  
> For pr_debug, the original "fmt" is used to construct the _ddebug descriptor:
> 
> #define dynamic_pr_debug(fmt, ...) do {                                 \
>         static struct _ddebug descriptor                                \
>         __used                                                          \
>         __attribute__((section("__verbose"), aligned(8))) =             \
>         { KBUILD_MODNAME, __func__, __FILE__, fmt, __LINE__,            \
>                 _DPRINTK_FLAGS_DEFAULT };                               \
> ......
> 
> So the prefix won't appear in dynamic_debug/control as the "format" string.
> 
> Do you think we should use pr_fmt(fmt) to construct _ddebug descriptor?
>         { KBUILD_MODNAME, __func__, __FILE__, pr_fmt(fmt), __LINE__,            \
> 
> Otherwise, I still have to add "mwifiex: " prefix for every pr_debug() call.

No, I believe that's incorrect.

#define dynamic_pr_debug(fmt, ...) do {					\
	static struct _ddebug descriptor				\
	__used								\
	__attribute__((section("__verbose"), aligned(8))) =		\
	{ KBUILD_MODNAME, __func__, __FILE__, fmt, __LINE__,		\
		_DPRINTK_FLAGS_DEFAULT };				\
	if (unlikely(descriptor.enabled))				\
		printk(KERN_DEBUG pr_fmt(fmt),	##__VA_ARGS__);		\
	} while (0)


dynamic_pr_debug does emit the format string
with pr_fmt(fmt).


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


[Index of Archives]     [Linux Host AP]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Linux Kernel]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Device Mapper]
  Powered by Linux