Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1231933 > unrolled thread
| Started by | Martin Kletzander <mkletzan@redhat.com> |
|---|---|
| First post | 2015-09-24 10:10 +0200 |
| Last post | 2015-09-24 14:40 +0200 |
| Articles | 4 — 3 participants |
Back to article view | Back to linux.kernel
[PATCH v2] lib: Documentation: Synchronize %p formatting documentation Martin Kletzander <mkletzan@redhat.com> - 2015-09-24 10:10 +0200
Re: [PATCH v2] lib: Documentation: Synchronize %p formatting documentation Andy Shevchenko <andriy.shevchenko@linux.intel.com> - 2015-09-24 10:20 +0200
Re: [PATCH v2] lib: Documentation: Synchronize %p formatting documentation "Shevchenko, Andriy" <andriy.shevchenko@intel.com> - 2015-09-24 10:30 +0200
Re: [PATCH v2] lib: Documentation: Synchronize %p formatting documentation Martin Kletzander <mkletzan@redhat.com> - 2015-09-24 14:40 +0200
| From | Martin Kletzander <mkletzan@redhat.com> |
|---|---|
| Date | 2015-09-24 10:10 +0200 |
| Subject | [PATCH v2] lib: Documentation: Synchronize %p formatting documentation |
| Message-ID | <qc9Lk-5Dv-11@gated-at.bofh.it> |
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.
Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
---
Documentation/printk-formats.txt | 27 +++++++++++++++++++++++++
lib/vsprintf.c | 43 ++++++++--------------------------------
2 files changed, 35 insertions(+), 35 deletions(-)
diff --git a/Documentation/printk-formats.txt b/Documentation/printk-formats.txt
index 2ec6d84f391c..c85e27264a2b 100644
--- a/Documentation/printk-formats.txt
+++ b/Documentation/printk-formats.txt
@@ -119,6 +119,7 @@ Raw buffer as an escaped string:
If field width is omitted the 1 byte only will be escaped.
Raw buffer as a hex string:
+
%*ph 00 01 02 ... 3f
%*phC 00:01:02: ... :3f
%*phD 00-01-02- ... -3f
@@ -234,6 +235,7 @@ UUID/GUID addresses:
Passed by reference.
dentry names:
+
%pd{,2,3,4}
%pD{,2,3,4}
@@ -264,6 +266,8 @@ struct va_format:
va_list *va;
};
+ Implements a "recursive vsnprintf".
+
Do not use this feature without some mechanism to verify the
correctness of the format string and va_list arguments.
@@ -292,6 +296,29 @@ bitmap and its derivatives such as cpumask and nodemask:
Passed by reference.
+Network device features:
+
+ %pNF 0x000000000000c000
+
+ For printing netdev_features_t.
+
+ Passed by reference.
+
+Command from struct task_struct
+
+ %pT ls
+
+ For printing executable name excluding path from struct
+ task_struct.
+
+ Passed by reference.
+
+Ignored argument:
+
+ %pn
+
+ The argument passed will be ignored.
+
Thank you for your cooperation and attention.
diff --git a/lib/vsprintf.c b/lib/vsprintf.c
index becd87facf48..9ab68775b840 100644
--- a/lib/vsprintf.c
+++ b/lib/vsprintf.c
@@ -1463,7 +1463,10 @@ int kptr_restrict __read_mostly;
* - 'Cn' For a clock, it prints the name (Common Clock Framework) or address
* (legacy clock framework) of the clock
* - 'Cr' For a clock, it prints the current rate of the clock
- * - 'T' task_struct->comm
+ * - 'T' For task_struct->comm
+ * - 'n' For ignored argument
+ *
+ * ** Please update 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
@@ -1829,41 +1832,11 @@ qualifier:
* @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 with offset
- * %ps output the name of a text symbol without offset
- * %pF output the name of a function pointer with its offset
- * %pf output the name of a function pointer without its offset
- * %pB output the name of a backtrace symbol with its offset
- * %pR output the address range in a struct resource with decoded flags
- * %pr output the address range in a struct resource with raw flags
- * %pb output the bitmap with field width as the number of bits
- * %pbl output the bitmap as range list with field width as the number of bits
- * %pM output a 6-byte MAC address with colons
- * %pMR output a 6-byte MAC address with colons in reversed order
- * %pMF output a 6-byte MAC address with dashes
- * %pm output a 6-byte MAC address without colons
- * %pmR output a 6-byte MAC address without colons in reversed order
- * %pI4 print an IPv4 address without leading zeros
- * %pi4 print an IPv4 address with leading zeros
- * %pI6 print an IPv6 address with colons
- * %pi6 print an IPv6 address without colons
- * %pI6c print an IPv6 address as specified by RFC 5952
- * %pIS depending on sa_family of 'struct sockaddr *' print IPv4/IPv6 address
- * %piS depending on sa_family of 'struct sockaddr *' print IPv4/IPv6 address
- * %pU[bBlL] print a UUID/GUID in big or little endian using lower or upper
- * case.
- * %*pE[achnops] print an escaped buffer
- * %*ph[CDN] a variable-length hex string with a separator (supports up to 64
- * bytes of the input)
- * %pC output the name (Common Clock Framework) or address (legacy clock
- * framework) of a clock
- * %pCn output the name (Common Clock Framework) or address (legacy clock
- * framework) of a clock
- * %pCr output the current rate of a clock
- * %n is ignored
+ * This function follows C99 vsnprintf, but has some extensions. See
+ * pointer() or Documentation/printk-formats.txt for all format
+ * specifiers.
*
- * ** Please update Documentation/printk-formats.txt when making changes **
+ * ** Please update the documentation when making changes **
*
* The return value is the number of characters which would
* be generated for the given input, excluding the trailing
--
2.5.3
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
[toc] | [next] | [standalone]
| From | Andy Shevchenko <andriy.shevchenko@linux.intel.com> |
|---|---|
| Date | 2015-09-24 10:20 +0200 |
| Subject | Re: [PATCH v2] lib: Documentation: Synchronize %p formatting documentation |
| Message-ID | <qc9V0-5OU-19@gated-at.bofh.it> |
| In reply to | #1231933 |
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@linux.intel.com>
> Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
> ---
> Documentation/printk-formats.txt | 27 +++++++++++++++++++++++++
> lib/vsprintf.c | 43 ++++++++----------------------
> ----------
> 2 files changed, 35 insertions(+), 35 deletions(-)
>
> diff --git a/Documentation/printk-formats.txt b/Documentation/printk
> -formats.txt
> index 2ec6d84f391c..c85e27264a2b 100644
> --- a/Documentation/printk-formats.txt
> +++ b/Documentation/printk-formats.txt
> @@ -119,6 +119,7 @@ Raw buffer as an escaped string:
> If field width is omitted the 1 byte only will be escaped.
>
> Raw buffer as a hex string:
> +
> %*ph 00 01 02 ... 3f
> %*phC 00:01:02: ... :3f
> %*phD 00-01-02- ... -3f
> @@ -234,6 +235,7 @@ UUID/GUID addresses:
> Passed by reference.
>
> dentry names:
> +
> %pd{,2,3,4}
> %pD{,2,3,4}
>
> @@ -264,6 +266,8 @@ struct va_format:
> va_list *va;
> };
>
> + Implements a "recursive vsnprintf".
> +
> Do not use this feature without some mechanism to verify the
> correctness of the format string and va_list arguments.
>
> @@ -292,6 +296,29 @@ bitmap and its derivatives such as cpumask and
> nodemask:
>
> Passed by reference.
>
> +Network device features:
> +
> + %pNF 0x000000000000c000
> +
> + For printing netdev_features_t.
> +
> + Passed by reference.
> +
> +Command from struct task_struct
> +
> + %pT ls
> +
> + For printing executable name excluding path from struct
> + task_struct.
> +
> + Passed by reference.
> +
> +Ignored argument:
> +
> + %pn
> +
> + The argument passed will be ignored.
> +
> Thank you for your cooperation and attention.
>
>
> diff --git a/lib/vsprintf.c b/lib/vsprintf.c
> index becd87facf48..9ab68775b840 100644
> --- a/lib/vsprintf.c
> +++ b/lib/vsprintf.c
> @@ -1463,7 +1463,10 @@ int kptr_restrict __read_mostly;
> * - 'Cn' For a clock, it prints the name (Common Clock Framework)
> or address
> * (legacy clock framework) of the clock
> * - 'Cr' For a clock, it prints the current rate of the clock
> - * - 'T' task_struct->comm
> + * - 'T' For task_struct->comm
> + * - 'n' For ignored argument
> + *
> + * ** Please update 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
> @@ -1829,41 +1832,11 @@ qualifier:
> * @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 with offset
> - * %ps output the name of a text symbol without offset
> - * %pF output the name of a function pointer with its offset
> - * %pf output the name of a function pointer without its offset
> - * %pB output the name of a backtrace symbol with its offset
> - * %pR output the address range in a struct resource with decoded
> flags
> - * %pr output the address range in a struct resource with raw flags
> - * %pb output the bitmap with field width as the number of bits
> - * %pbl output the bitmap as range list with field width as the
> number of bits
> - * %pM output a 6-byte MAC address with colons
> - * %pMR output a 6-byte MAC address with colons in reversed order
> - * %pMF output a 6-byte MAC address with dashes
> - * %pm output a 6-byte MAC address without colons
> - * %pmR output a 6-byte MAC address without colons in reversed order
> - * %pI4 print an IPv4 address without leading zeros
> - * %pi4 print an IPv4 address with leading zeros
> - * %pI6 print an IPv6 address with colons
> - * %pi6 print an IPv6 address without colons
> - * %pI6c print an IPv6 address as specified by RFC 5952
> - * %pIS depending on sa_family of 'struct sockaddr *' print
> IPv4/IPv6 address
> - * %piS depending on sa_family of 'struct sockaddr *' print
> IPv4/IPv6 address
> - * %pU[bBlL] print a UUID/GUID in big or little endian using lower
> or upper
> - * case.
> - * %*pE[achnops] print an escaped buffer
> - * %*ph[CDN] a variable-length hex string with a separator (supports
> up to 64
> - * bytes of the input)
> - * %pC output the name (Common Clock Framework) or address (legacy
> clock
> - * framework) of a clock
> - * %pCn output the name (Common Clock Framework) or address (legacy
> clock
> - * framework) of a clock
> - * %pCr output the current rate of a clock
> - * %n is ignored
> + * This function follows C99 vsnprintf, but has some extensions.
> See
> + * pointer() or Documentation/printk-formats.txt for all format
> + * specifiers.
> *
> - * ** Please update Documentation/printk-formats.txt when making
> changes **
> + * ** Please update the documentation when making changes **
> *
> * The return value is the number of characters which would
> * be generated for the given input, excluding the trailing
--
Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Intel Finland Oy
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
[toc] | [prev] | [next] | [standalone]
| From | "Shevchenko, Andriy" <andriy.shevchenko@intel.com> |
|---|---|
| Date | 2015-09-24 10:30 +0200 |
| Subject | Re: [PATCH v2] lib: Documentation: Synchronize %p formatting documentation |
| Message-ID | <qca4G-60q-25@gated-at.bofh.it> |
| In reply to | #1231940 |
T24gVGh1LCAyMDE1LTA5LTI0IGF0IDExOjE2ICswMzAwLCBBbmR5IFNoZXZjaGVua28gd3JvdGU6 DQo+IE9uIFRodSwgMjAxNS0wOS0yNCBhdCAxMDowOCArMDIwMCwgTWFydGluIEtsZXR6YW5kZXIg d3JvdGU6DQo+ID4gTW92ZSBhbGwgcG9pbnRlci1mb3JtYXR0aW5nIGRvY3VtZW50YXRpb24gdG8g b25lIHBsYWNlIGluIHRoZSBjb2RlIA0KPiA+IGFuZA0KPiA+IG9uZSBwbGFjZSBpbiB0aGUgZG9j dW1lbnRhdGlvbiBpbnN0ZWFkIG9mIGtlZXBpbmcgaXQgaW4gdGhyZWUgDQo+ID4gcGxhY2VzDQo+ ID4gd2l0aCBkaWZmZXJlbnQgbGV2ZWwgb2YgY29tcGxldGVuZXNzLiAgRG9jdW1lbnRhdGlvbi9w cmludGsNCj4gPiAtZm9ybWF0cy50eHQNCj4gPiBoYXMgZGV0YWlsZWQgaW5mb3JtYXRpb24gYWJv dXQgZWFjaCBtb2RpZmllciwgZG9jc3RyaW5nIGFib3ZlIA0KPiA+IHBvaW50ZXIoKQ0KPiA+IGhh cyB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uIEFueSByZXZpZXcgb3IgZGlzdHJpYnV0aW9uCmJ5IG90aGVycyBpcyBzdHJpY3Rs eSBwcm9oaWJpdGVkLiBJZiB5b3UgYXJlIG5vdCB0aGUgaW50ZW5kZWQKcmVjaXBpZW50LCBwbGVh c2UgY29udGFjdCB0aGUgc2VuZGVyIGFuZCBkZWxldGUgYWxsIGNvcGllcy4K -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[toc] | [prev] | [next] | [standalone]
| From | Martin Kletzander <mkletzan@redhat.com> |
|---|---|
| Date | 2015-09-24 14:40 +0200 |
| Subject | Re: [PATCH v2] lib: Documentation: Synchronize %p formatting documentation |
| Message-ID | <qcdYC-36h-1@gated-at.bofh.it> |
| In reply to | #1231945 |
[Multipart message — attachments visible in raw view] — view raw
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@linux.intel.com> >> > >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 --
[toc] | [prev] | [standalone]
Back to top | Article view | linux.kernel
csiph-web