public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2 0/4] printf: Add struct range print specifier
@ 2024-10-26  0:46 Ira Weiny
  2024-10-26  0:46 ` [PATCH v2 1/4] test printf: Add very basic struct resource tests Ira Weiny
                   ` (4 more replies)
  0 siblings, 5 replies; 15+ messages in thread
From: Ira Weiny @ 2024-10-26  0:46 UTC (permalink / raw)
  To: Andrew Morton, Petr Mladek, Steven Rostedt, Andy Shevchenko,
	Rasmus Villemoes, Sergey Senozhatsky, Jonathan Corbet,
	Davidlohr Bueso, Jonathan Cameron, Dave Jiang, Alison Schofield,
	Vishal Verma, Dan Williams
  Cc: Fan Ni, Bagas Sanjaya, linux-kernel, linux-doc, linux-cxl,
	Ira Weiny, Jonathan Cameron

Support for the Compute Express Link (CXL) Dynamic Capacity Devices
(DCD) have grown a number of uses to print struct range.[1]  Support for
a printf specifier '%pra' was being worked within a large series and has
garnered a number of comments and discussion.

To better accelerate both features introduce a separate series to settle
the struct range print enhancement divorced from the CXL DCD feature.

Struct range is used to store a number range similar to struct resource.
Printing struct range becomes cumbersome having to specify 2 specifiers
and the members of the struct.  Furthermore, print output benefits from
using a standardized format.

Add to the pointer specifier support for struct range.  Share code with
struct resource for more standardization.  Add tests for struct resource
to help prevent regressions.

%pra was settled on as the most reasonable format in previous
discussions.[2]

Link: https://lore.kernel.org/all/20241007-dcd-type2-upstream-v4-2-c261ee6eeded@intel.com/ [1]
Link: https://lore.kernel.org/all/66cea3bf3332f_f937b29424@iweiny-mobl.notmuch/ [2]

Signed-off-by: Ira Weiny <ira.weiny@intel.com>
---
Changes in v2:
- Andy: s/resource_and_range/resource_or_range/
- djbw/Petr: Address comments on documentation
- Link to v1: https://patch.msgid.link/20241018-cxl-pra-v1-0-7f49ba58208b@intel.com

---
Ira Weiny (4):
      test printf: Add very basic struct resource tests
      Documentation/printf: struct resource add start == end special case
      printf: Add print format (%pra) for struct range
      cxl/cdat: Use %pra for dpa range outputs

 Documentation/core-api/printk-formats.rst | 20 +++++++++-
 drivers/cxl/core/cdat.c                   |  8 ++--
 include/linux/range.h                     |  6 +++
 lib/test_printf.c                         | 61 +++++++++++++++++++++++++++++++
 lib/vsprintf.c                            | 57 ++++++++++++++++++++++++++---
 5 files changed, 141 insertions(+), 11 deletions(-)
---
base-commit: 9852d85ec9d492ebef56dc5f229416c925758edc
change-id: 20240930-cxl-pra-53956ac5fc1e

Best regards,
-- 
Ira Weiny <ira.weiny@intel.com>


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

end of thread, other threads:[~2024-11-07 14:43 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-10-26  0:46 [PATCH v2 0/4] printf: Add struct range print specifier Ira Weiny
2024-10-26  0:46 ` [PATCH v2 1/4] test printf: Add very basic struct resource tests Ira Weiny
2024-10-28  9:07   ` Andy Shevchenko
2024-10-28 21:29     ` Ira Weiny
2024-10-26  0:46 ` [PATCH v2 2/4] Documentation/printf: struct resource add start == end special case Ira Weiny
2024-10-28  9:07   ` Andy Shevchenko
2024-10-29 15:19   ` Jonathan Cameron
2024-11-07 12:34   ` Petr Mladek
2024-10-26  0:46 ` [PATCH v2 3/4] printf: Add print format (%pra) for struct range Ira Weiny
2024-10-28  9:11   ` Andy Shevchenko
2024-11-07 14:24   ` Petr Mladek
2024-10-26  0:46 ` [PATCH v2 4/4] cxl/cdat: Use %pra for dpa range outputs Ira Weiny
2024-10-30 10:51 ` [PATCH v2 0/4] printf: Add struct range print specifier metux
2024-10-31 21:34   ` Ira Weiny
2024-11-07 14:43   ` Petr Mladek

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