Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

Add kerneldoc documentation for new printk format extensions

Add documentation in kerneldoc for new printk format extensions

This patch documents the new %pS/%pF options in printk in kernel doc.

Hope I didn't miss any other extension.

Signed-off-by: Andi Kleen <ak@linux.intel.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>

authored by

Andi Kleen and committed by
Linus Torvalds
20036fdc 9536727e

+14
+2
kernel/printk.c
··· 593 593 * 594 594 * See also: 595 595 * printf(3) 596 + * 597 + * See the vsnprintf() documentation for format string extensions over C99. 596 598 */ 597 599 598 600 asmlinkage int printk(const char *fmt, ...)
+12
lib/vsprintf.c
··· 565 565 * @fmt: The format string to use 566 566 * @args: Arguments for the format string 567 567 * 568 + * This function follows C99 vsnprintf, but has some extensions: 569 + * %pS output the name of a text symbol 570 + * %pF output the name of a function pointer 571 + * 568 572 * The return value is the number of characters which would 569 573 * be generated for the given input, excluding the trailing 570 574 * '\0', as per ISO C99. If you want to have the exact ··· 810 806 * 811 807 * Call this function if you are already dealing with a va_list. 812 808 * You probably want scnprintf() instead. 809 + * 810 + * See the vsnprintf() documentation for format string extensions over C99. 813 811 */ 814 812 int vscnprintf(char *buf, size_t size, const char *fmt, va_list args) 815 813 { ··· 834 828 * generated for the given input, excluding the trailing null, 835 829 * as per ISO C99. If the return is greater than or equal to 836 830 * @size, the resulting string is truncated. 831 + * 832 + * See the vsnprintf() documentation for format string extensions over C99. 837 833 */ 838 834 int snprintf(char * buf, size_t size, const char *fmt, ...) 839 835 { ··· 885 877 * 886 878 * Call this function if you are already dealing with a va_list. 887 879 * You probably want sprintf() instead. 880 + * 881 + * See the vsnprintf() documentation for format string extensions over C99. 888 882 */ 889 883 int vsprintf(char *buf, const char *fmt, va_list args) 890 884 { ··· 904 894 * The function returns the number of characters written 905 895 * into @buf. Use snprintf() or scnprintf() in order to avoid 906 896 * buffer overflows. 897 + * 898 + * See the vsnprintf() documentation for format string extensions over C99. 907 899 */ 908 900 int sprintf(char * buf, const char *fmt, ...) 909 901 {