diff options
| author | Ira Weiny <[email protected]> | 2024-10-26 00:46:55 +0000 |
|---|---|---|
| committer | Dave Jiang <[email protected]> | 2024-10-28 21:32:43 +0000 |
| commit | 4261974701851630951e9ab31f0de4ade0faea53 (patch) | |
| tree | d274d5ada17c6f07c30543f1af81efdc80ec6358 /drivers/usb/cdns3/cdns3-pci-wrap.c | |
| parent | Documentation/printf: struct resource add start == end special case (diff) | |
| download | kernel-4261974701851630951e9ab31f0de4ade0faea53.tar.gz kernel-4261974701851630951e9ab31f0de4ade0faea53.zip | |
printf: Add print format (%pra) for struct range
The use of struct range in the CXL subsystem is growing. In particular,
the addition of Dynamic Capacity devices uses struct range in a number
of places which are reported in debug and error messages.
To wit requiring the printing of the start/end fields in each print
became cumbersome. Dan Williams mentions in [1] that it might be time
to have a print specifier for struct range similar to struct resource.
A few alternatives were considered including '%par', '%r', and '%pn'.
%pra follows that struct range is similar to struct resource (%p[rR])
but needs to be different. Based on discussions with Petr and Andy
'%pra' was chosen.[2]
Andy also suggested to keep the range prints similar to struct resource
though combined code. Add hex_range() to handle printing for both
pointer types.
Finally introduce DEFINE_RANGE() as a parallel to DEFINE_RES_*() and use
it in the tests.
Cc: Jonathan Corbet <[email protected]>
Cc: [email protected]
Cc: open list <[email protected]>
Link: https://lore.kernel.org/all/[email protected]/ [1]
Link: https://lore.kernel.org/all/[email protected]/ [2]
Suggested-by: Dan Williams <[email protected]>
Signed-off-by: Ira Weiny <[email protected]>
Reviewed-by: Andy Shevchenko <[email protected]>
Link: https://patch.msgid.link/[email protected]
Signed-off-by: Dave Jiang <[email protected]>
Diffstat (limited to 'drivers/usb/cdns3/cdns3-pci-wrap.c')
0 files changed, 0 insertions, 0 deletions
