From: Randy Dunlap <rdunlap@xenotime.net>
To: linux-kernel@vger.kernel.org
Subject: [PATCH 5/8] docs: add printk lib. extensions
Date: Thu, 09 Oct 2008 16:52:35 -0700 [thread overview]
Message-ID: <12235963551949@xenotime.net> (raw)
In-Reply-To: <12235963551043@xenotime.net>
From: Andi Kleen <ak@linux.intel.com>
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: Randy Dunlap <randy.dunlap@oracle.com>
---
kernel/printk.c | 2 ++
lib/vsprintf.c | 12 ++++++++++++
2 files changed, 14 insertions(+)
--- linux-2.6.27-rc9-git2.orig/kernel/printk.c
+++ linux-2.6.27-rc9-git2/kernel/printk.c
@@ -593,6 +593,8 @@ static int have_callable_console(void)
*
* See also:
* printf(3)
+ *
+ * See the vsnprintf() documentation for format string extensions over C99.
*/
asmlinkage int printk(const char *fmt, ...)
--- linux-2.6.27-rc9-git2.orig/lib/vsprintf.c
+++ linux-2.6.27-rc9-git2/lib/vsprintf.c
@@ -565,6 +565,10 @@ static char *pointer(const char *fmt, ch
* @fmt: The format string to use
* @args: Arguments for the format string
*
+ * This function follows C99 vsnprintf, but has some extensions:
+ * %pS - output the name of a text symbol
+ * %pF - output the name of a function pointer
+ *
* The return value is the number of characters which would
* be generated for the given input, excluding the trailing
* '\0', as per ISO C99. If you want to have the exact
@@ -806,6 +810,8 @@ EXPORT_SYMBOL(vsnprintf);
*
* Call this function if you are already dealing with a va_list.
* You probably want scnprintf() instead.
+ *
+ * See the vsnprintf() documentation for format string extensions over C99.
*/
int vscnprintf(char *buf, size_t size, const char *fmt, va_list args)
{
@@ -828,6 +834,8 @@ EXPORT_SYMBOL(vscnprintf);
* generated for the given input, excluding the trailing null,
* as per ISO C99. If the return is greater than or equal to
* @size, the resulting string is truncated.
+ *
+ * See the vsnprintf() documentation for format string extensions over C99.
*/
int snprintf(char * buf, size_t size, const char *fmt, ...)
{
@@ -877,6 +885,8 @@ EXPORT_SYMBOL(scnprintf);
*
* Call this function if you are already dealing with a va_list.
* You probably want sprintf() instead.
+ *
+ * See the vsnprintf() documentation for format string extensions over C99.
*/
int vsprintf(char *buf, const char *fmt, va_list args)
{
@@ -894,6 +904,8 @@ EXPORT_SYMBOL(vsprintf);
* The function returns the number of characters written
* into @buf. Use snprintf() or scnprintf() in order to avoid
* buffer overflows.
+ *
+ * See the vsnprintf() documentation for format string extensions over C99.
*/
int sprintf(char * buf, const char *fmt, ...)
{
--
next prev parent reply other threads:[~2008-10-09 23:56 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-10-09 23:52 [PATCH 1/8 for 2.6.27] docs: fix uvesafb mode_option Randy Dunlap
2008-10-09 23:52 ` [PATCH 4/8] docs: fix ManagementStyle book name Randy Dunlap
2008-10-09 23:52 ` [PATCH 7/8] docs: fix Doc/x86/ subdir references Randy Dunlap
2008-10-09 23:52 ` Randy Dunlap [this message]
2008-10-09 23:52 ` [PATCH 8/8] docs: fix docbook cmd output alignment Randy Dunlap
2008-10-09 23:52 ` [PATCH 6/8] docs: add URL for paper on submitting patches Randy Dunlap
2008-10-09 23:52 ` [PATCH 2/8] docs: fix CDROM missing test program reference Randy Dunlap
2008-10-09 23:52 ` [PATCH 3/8] docs: fix ramfs hello program build name Randy Dunlap
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=12235963551949@xenotime.net \
--to=rdunlap@xenotime.net \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox