aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--kernel/printk.c2
-rw-r--r--lib/vsprintf.c12
2 files changed, 14 insertions, 0 deletions
diff --git a/kernel/printk.c b/kernel/printk.c
index c3ab51dc9faf..fbd94bdaa74f 100644
--- a/kernel/printk.c
+++ b/kernel/printk.c
@@ -593,6 +593,8 @@ static int have_callable_console(void)
593 * 593 *
594 * See also: 594 * See also:
595 * printf(3) 595 * printf(3)
596 *
597 * See the vsnprintf() documentation for format string extensions over C99.
596 */ 598 */
597 599
598asmlinkage int printk(const char *fmt, ...) 600asmlinkage int printk(const char *fmt, ...)
diff --git a/lib/vsprintf.c b/lib/vsprintf.c
index c399bc1093cb..4c6674a41ed9 100644
--- a/lib/vsprintf.c
+++ b/lib/vsprintf.c
@@ -565,6 +565,10 @@ static char *pointer(const char *fmt, char *buf, char *end, void *ptr, int field
565 * @fmt: The format string to use 565 * @fmt: The format string to use
566 * @args: Arguments for the format string 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 * The return value is the number of characters which would 572 * The return value is the number of characters which would
569 * be generated for the given input, excluding the trailing 573 * be generated for the given input, excluding the trailing
570 * '\0', as per ISO C99. If you want to have the exact 574 * '\0', as per ISO C99. If you want to have the exact
@@ -806,6 +810,8 @@ EXPORT_SYMBOL(vsnprintf);
806 * 810 *
807 * Call this function if you are already dealing with a va_list. 811 * Call this function if you are already dealing with a va_list.
808 * You probably want scnprintf() instead. 812 * You probably want scnprintf() instead.
813 *
814 * See the vsnprintf() documentation for format string extensions over C99.
809 */ 815 */
810int vscnprintf(char *buf, size_t size, const char *fmt, va_list args) 816int vscnprintf(char *buf, size_t size, const char *fmt, va_list args)
811{ 817{
@@ -828,6 +834,8 @@ EXPORT_SYMBOL(vscnprintf);
828 * generated for the given input, excluding the trailing null, 834 * generated for the given input, excluding the trailing null,
829 * as per ISO C99. If the return is greater than or equal to 835 * as per ISO C99. If the return is greater than or equal to
830 * @size, the resulting string is truncated. 836 * @size, the resulting string is truncated.
837 *
838 * See the vsnprintf() documentation for format string extensions over C99.
831 */ 839 */
832int snprintf(char * buf, size_t size, const char *fmt, ...) 840int snprintf(char * buf, size_t size, const char *fmt, ...)
833{ 841{
@@ -877,6 +885,8 @@ EXPORT_SYMBOL(scnprintf);
877 * 885 *
878 * Call this function if you are already dealing with a va_list. 886 * Call this function if you are already dealing with a va_list.
879 * You probably want sprintf() instead. 887 * You probably want sprintf() instead.
888 *
889 * See the vsnprintf() documentation for format string extensions over C99.
880 */ 890 */
881int vsprintf(char *buf, const char *fmt, va_list args) 891int vsprintf(char *buf, const char *fmt, va_list args)
882{ 892{
@@ -894,6 +904,8 @@ EXPORT_SYMBOL(vsprintf);
894 * The function returns the number of characters written 904 * The function returns the number of characters written
895 * into @buf. Use snprintf() or scnprintf() in order to avoid 905 * into @buf. Use snprintf() or scnprintf() in order to avoid
896 * buffer overflows. 906 * buffer overflows.
907 *
908 * See the vsnprintf() documentation for format string extensions over C99.
897 */ 909 */
898int sprintf(char * buf, const char *fmt, ...) 910int sprintf(char * buf, const char *fmt, ...)
899{ 911{