Thread (17 messages) 17 messages, 3 authors, 2011-06-30

Re: [PATCH v4 1/6] NFC: add nfc subsystem core

From: Joe Perches <joe@perches.com>
Date: 2011-06-29 23:46:06

On Wed, 2011-06-29 at 20:23 -0300, Aloisio Almeida wrote:
quoted
quoted
Today, dynamic_debug can add __func__ to the output as
desired so I think that it's not really necessary
to add to any <foo>_dbg callsite.
That's true only for pr_debug() function. You cannot add __func__ info
on dev_dbg() calls dynamically.
I believe that's false.  It's definitely stored.

#define dynamic_dev_dbg(dev, 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))				\
		dev_printk(KERN_DEBUG, dev, fmt, ##__VA_ARGS__);	\
	} while (0)

Jason?  True or false?
So, for net/nfc/* I propose to use directly pr_*() functions.
For device drivers the following macros would be provided:
#define nfc_dev_info(dev, fmt, arg...) dev_info((dev), "NFC: " fmt, ## arg)
#define nfc_dev_err(dev, fmt, arg...) dev_err((dev), "%s: " fmt,
__func__, ## arg)
#define nfc_dev_dbg(dev, fmt, arg...) dev_dbg((dev), "%s: " fmt,
__func__, ## arg)
What do you think?
I still think __func__ isn't useful ;)
I think you should add NFC to nfc_dev_err too.

cheers, Joe
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help