lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Date:   Thu, 10 Aug 2017 19:35:33 +0200
From:   Helge Deller <deller@....de>
To:     Petr Mladek <pmladek@...e.com>,
        Sergey Senozhatsky <sergey.senozhatsky@...il.com>,
        Steven Rostedt <rostedt@...dmis.org>,
        linux-kernel@...r.kernel.org, linux-parisc@...r.kernel.org
Subject: [PATCH] printk-formats.txt: Add examples for %pS and %pF

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@....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
 ===============
 

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ