Re: [PATCH] docs: pr_*() kerneldocs and basic printk docs

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

 



On 4/2/20 1:26 AM, Ricardo Cañuelo wrote:
> 
>>> +  #define pr_fmt(fmt) "%s:%s: " fmt, KBUILD_MODNAME, __func__
>>
>> "fmt" should be last, not first, in order for modname and func to be
>> prefixes.
> 
> The way it's used in the pr_*() macros, this is the correct way to get the
> prefixes right.
> 
> Example:
> 
> 	pr_emerg("message no. %d", num)
> 
> expands to
> 
> 	printk(KERN_EMERG pr_fmt("message no. %d", num)
> 
> which expands to
> 
> 	printk(KERN_EMERG "%s:%s: " "message no. %d", KBUILD_MODNAME,
> 			__func__, num)

I see.  Thanks for explaining.

-- 
~Randy




[Index of Archives]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Linux FS]     [Yosemite Forum]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]     [Linux Resources]

  Powered by Linux