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

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

 



Thanks for the comments, Randy

On mié 01-04-2020 09:46:40, Randy Dunlap wrote:

> s/two/three/
> 
> > +
> > +  - printk() messages can specify a log level
> 
>      - '%n' is not supported

I agree, I'll rephrase the paragraph to cover the format string differences in a
more general way (I think I should also mention that floating point conversion
specifiers aren't supported either).


> > +The log level determines the importance of a message. The kernel decides whether
> 
>                  specifies (?)

> > +would set the console_loglevel to print KERN_WARNING (4) or more severe messages
> 
> s/would set/sets/

> > +would print a ``KERN_INFO`` message.
> 
> s/would print/prints/

I agree.

> > +  #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)

Cheers,
Ricardo



[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