[PATCH 1/2] mtd: nand: generalized error messages with __func__

Igor Grinberg grinberg at compulab.co.il
Tue Jun 7 03:26:27 EDT 2011


On 06/01/11 21:37, Brian Norris wrote:

> On Wed, Jun 1, 2011 at 3:30 AM, Artem Bityutskiy <dedekind1 at gmail.com> wrote:
>>> or should we define our own pr_fmt in include/linux/mtd.h?
>> Yes, before you include files.
> Well, I've tried this, and as I suspected, I can't just include it in
> mtd.h at the top, since we can't guarantee that <linux/mtd/mtd.h> is
> going to be the first included header in other files. Specifically, in
> include/linux/mtd/nand.h, we include other headers before mtd.h and so
> printk.h has already defined pr_fmt() for us, so this doesn't work.
> I'm not sure if there's a nice place to define pr_fmt() right now...

You should not define pr_fmt() in .h file.
pr_fmt() should be defined in _.c_ file at the top - _before any include is done_.
And yes, like Artem already said, _only_ in those _.c_ files where we want to use it.


-- 
Regards,
Igor.




More information about the linux-mtd mailing list