linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2 0/2] vsprintf: remove redundant %pCn format specifier
@ 2025-03-11  9:21 Luca Ceresoli
  2025-03-11  9:21 ` [PATCH v2 1/2] thermal: bcm2835: use %pC instead of %pCn Luca Ceresoli
                   ` (2 more replies)
  0 siblings, 3 replies; 9+ messages in thread
From: Luca Ceresoli @ 2025-03-11  9:21 UTC (permalink / raw)
  To: Rafael J. Wysocki, Daniel Lezcano, Zhang Rui, Lukasz Luba,
	Florian Fainelli, Ray Jui, Scott Branden,
	Broadcom internal kernel review list, Petr Mladek, Steven Rostedt,
	Andy Shevchenko, Rasmus Villemoes, Sergey Senozhatsky,
	Jonathan Corbet, Andrew Morton, Alex Shi, Yanteng Si
  Cc: Binbin Zhou, Thomas Petazzoni, Michael Turquette, Stephen Boyd,
	Geert Uytterhoeven, Liu Ying, linux-clk, linux-pm,
	linux-rpi-kernel, linux-arm-kernel, linux-kernel, linux-doc,
	Luca Ceresoli

There are two printk format specifiers for clocks: %pC and %pCn, and they
print exactly the same string. Geert confirmed the intended reason for
having two was that %pC would act as a default, like some (but not all)
formats do. However there seem to be no advantage in having two instead of
one, especially now that there is no other %pC specifier since commit
666902e42fd8 ("lib/vsprintf: Remove atomic-unsafe support for %pCr").

Definitely having two without properly documenting they do the same creates
misunderstandings [0].

Since %pCn is used in a single place, replace it with %pC and remove %pCn
to simplify such format specifiers implementation and avoid
misunderstandings.

[0] https://lore.kernel.org/dri-devel/f8df2b5e-b005-4ada-8108-159b2b94a72e@nxp.com/

Signed-off-by: Luca Ceresoli <luca.ceresoli@bootlin.com>
---
Changes in v2:
- Add Chinese translation
- Link to v1: https://lore.kernel.org/r/20250307-vsprintf-pcn-v1-0-df0b2ccf610f@bootlin.com

---
Luca Ceresoli (2):
      thermal: bcm2835: use %pC instead of %pCn
      vsprintf: remove redundant and unused %pCn format specifier

 Documentation/core-api/printk-formats.rst                    |  3 +--
 Documentation/translations/zh_CN/core-api/printk-formats.rst |  3 +--
 drivers/thermal/broadcom/bcm2835_thermal.c                   |  2 +-
 lib/vsprintf.c                                               | 10 ++--------
 4 files changed, 5 insertions(+), 13 deletions(-)
---
base-commit: 4d872d51bc9d7b899c1f61534e3dbde72613f627
change-id: 20250307-vsprintf-pcn-8a43e3b0d43e

Best regards,
-- 
Luca Ceresoli <luca.ceresoli@bootlin.com>



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

end of thread, other threads:[~2025-04-18 10:44 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-03-11  9:21 [PATCH v2 0/2] vsprintf: remove redundant %pCn format specifier Luca Ceresoli
2025-03-11  9:21 ` [PATCH v2 1/2] thermal: bcm2835: use %pC instead of %pCn Luca Ceresoli
2025-03-11  9:21 ` [PATCH v2 2/2] vsprintf: remove redundant and unused %pCn format specifier Luca Ceresoli
2025-03-11  9:34   ` Yanteng Si
2025-03-11 14:36   ` Petr Mladek
2025-04-07 16:46     ` Luca Ceresoli
2025-04-08  7:33       ` Petr Mladek
2025-04-18 10:08         ` Daniel Lezcano
2025-04-18 10:10 ` [PATCH v2 0/2] vsprintf: remove redundant " Daniel Lezcano

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).