[PATCH 1/2] mtd: nand: generalized error messages with __func__
Mike Frysinger
vapier.adi at gmail.com
Tue May 31 16:19:14 EDT 2011
On Tue, May 31, 2011 at 14:52, Brian Norris wrote:
>> On Thu, 2011-05-26 at 08:14 +0300, Igor Grinberg wrote:
>>> On 05/26/11 00:59, Brian Norris wrote:
>>> pr_err() will save you from the need to define the log level each time.
>>> pr_fmt will save you the need to add %s: and __func__.
>
> Also, it seems that the second statement is not necessarily true. In
> fact, in include/linux/printk.h, we default to the following
> declaration:
> #define pr_fmt(fmt) fmt
> So it seems that, when we desire to print out the relevant function
> name, we should manually use __func__ instead of relying on
> pr_fmt...or should we define our own pr_fmt in include/linux/mtd.h?
while it might run afoul of some people's sense of style, it is
technically possible. try something like this:
#define pr_fmt(fmt) "%s: " fmt, __func__
-mike
More information about the linux-mtd
mailing list