mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] printk-formats.txt: Add examples for %pS and %pF
@ 2017-08-10 17:35 Helge Deller
  2017-08-11  0:15 ` Sergey Senozhatsky
  2017-08-15 12:46 ` Steven Rostedt
  0 siblings, 2 replies; 16+ messages in thread
From: Helge Deller @ 2017-08-10 17:35 UTC (permalink / raw)
  To: Petr Mladek, Sergey Senozhatsky, Steven Rostedt, linux-kernel,
	linux-parisc

Sometimes people seems unclear when to use the %pS or %pF printk format.
Adding some examples may help to avoid such mistakes.

See for example commit 51d96dc2e2dc ("random: fix warning message on ia64 and
parisc") which fixed such a wrong format string.

Signed-off-by: Helge Deller <deller@gmx.de>

diff --git a/Documentation/printk-formats.txt b/Documentation/printk-formats.txt
index 65ea591..be8c05b 100644
--- a/Documentation/printk-formats.txt
+++ b/Documentation/printk-formats.txt
@@ -73,6 +73,12 @@ actually function descriptors which must first be resolved. The ``F`` and
 ``f`` specifiers perform this resolution and then provide the same
 functionality as the ``S`` and ``s`` specifiers.
 
+Examples::
+
+	printk("Called from %pS.\n", __builtin_return_address(0));
+	printk("Called from %pS.\n", (void *)regs->ip);
+	printk("Called from %pF.\n", &gettimeofday);
+
 Kernel Pointers
 ===============
 

^ permalink raw reply	[flat|nested] 16+ messages in thread

end of thread, other threads:[~2017-08-24  9:21 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-08-10 17:35 [PATCH] printk-formats.txt: Add examples for %pS and %pF Helge Deller
2017-08-11  0:15 ` Sergey Senozhatsky
2017-08-11  7:31   ` Helge Deller
2017-08-15 11:36     ` Petr Mladek
2017-08-15 19:58       ` Helge Deller
2017-08-23 14:48         ` Petr Mladek
2017-08-23 14:49           ` Steven Rostedt
2017-08-23 19:36             ` Helge Deller
2017-08-24  9:21               ` Petr Mladek
2017-08-24  0:41           ` Sergey Senozhatsky
2017-08-24  2:11             ` Steven Rostedt
2017-08-16  8:14       ` Sergey Senozhatsky
2017-08-15 12:46 ` Steven Rostedt
2017-08-15 19:41   ` Helge Deller
2017-08-15 19:47     ` Helge Deller
2017-08-15 21:35       ` Steven Rostedt

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®