Re: [PATCH v2] lib: Documentation: Synchronize %p formatting documentation

From: Martin Kletzander
Date: Thu Sep 24 2015 - 08:37:25 EST


On Thu, Sep 24, 2015 at 08:20:27AM +0000, Shevchenko, Andriy wrote:
On Thu, 2015-09-24 at 11:16 +0300, Andy Shevchenko wrote:
On Thu, 2015-09-24 at 10:08 +0200, Martin Kletzander wrote:
> Move all pointer-formatting documentation to one place in the code
> and
> one place in the documentation instead of keeping it in three
> places
> with different level of completeness. Documentation/printk
> -formats.txt
> has detailed information about each modifier, docstring above
> pointer()
> has short descriptions of them (as that is the function dealing
> with
> %p)
> and docstring above vsprintf() is removed as redundant. Both
> docstrings
> in the code that were modified are updated with a reminder of
> updating
> the documentation upon any further change.
>

Good for me!

Reviewed-by: Andy Shevchenko <andriy.shevchenko@xxxxxxxxxxxxxxx>


Ah, sorry, it seems you have to distinguish %pn (which seems now as %p
+ n if I didn't miss anything) and %n.


Sorry, my bad, thanks for catching that.

After addressing this, take my above tag.


I added few more tiny fixes (see diff below), is it still OK for me to
add the Reviewed-by there?

Martin

diff --git i/Documentation/printk-formats.txt w/Documentation/printk-formats.txt
index c85e27264a2b..f6d1ab6b1165 100644
--- i/Documentation/printk-formats.txt
+++ w/Documentation/printk-formats.txt
@@ -315,9 +315,11 @@ Command from struct task_struct

Ignored argument:

- %pn
+ %n %n

- The argument passed will be ignored.
+ The argument passed will be ignored. In other words, literal "%n" will
+ be in the output and the argument will be considered for next format
+ specifier.

Thank you for your cooperation and attention.

diff --git i/lib/vsprintf.c w/lib/vsprintf.c
index 07205016415d..3e66fbbae8cd 100644
--- i/lib/vsprintf.c
+++ w/lib/vsprintf.c
@@ -1465,7 +1465,7 @@ int kptr_restrict __read_mostly;
* - 'Cr' For a clock, it prints the current rate of the clock
* - 'T' For task_struct->comm
*
- * ** Please update Documentation/printk-formats.txt when making changes **
+ * ** Please update also Documentation/printk-formats.txt when making changes **
*
* Note: The difference between 'S' and 'F' is that on ia64 and ppc64
* function pointers are really function descriptors, which contain a
@@ -1831,11 +1831,14 @@ qualifier:
* @fmt: The format string to use
* @args: Arguments for the format string
*
- * This function follows C99 vsnprintf, but has some extensions. See
- * pointer() or Documentation/printk-formats.txt for all format
- * specifiers.
+ * This function follows C99 vsnprintf, but has some extensions:
+ * %n is ignored
+ * %p* is handled by pointer()
+ *
+ * See pointer() or Documentation/printk-formats.txt for more
+ * extensive description.
*
- * ** Please update the documentation when making changes **
+ * ** Please update the documentation on both places when making changes **
*
* The return value is the number of characters which would
* be generated for the given input, excluding the trailing
--

Attachment: signature.asc
Description: PGP signature