Skip to content

vsprintf: remove redundant %pCn format specifier

Luca Ceresoli linux-arm-kernel linux-clk linux-doc linux-pm lkml 2 versions – Applied

Status from this message: Applied, thanks

Get series with b4
b4 am [email protected] change-id 20250307-vsprintf-pcn-8a43e3b0d43e

Versions newest first

  1. v2 Latest2 patches 6 repliesApplied
  2. v12 patches 10 repliesSuperseded

Changes in v2 from the cover letter

- Add Chinese translation
- Link to v1: https://lore.kernel.org/r/[email protected]

Patches in v2 Applied

#Subject and filesSizeRepliesApplied
1/2thermal: bcm2835: use %pC instead of %pCndrivers/thermal/broadcom/bcm2835_thermal.c+1 -10 replies
2/2vsprintf: remove redundant and unused %pCn format specifierDocumentation/core-api/printk-formats.rst Documentation/translations/zh_CN/core-api/printk-formats.rst lib/vsprintf.c+4 -125 replies

Reviews trailers per patch

All 2 patches have a Reviewed-by or Acked-by.

PatchGeert UytterhoevenStephen BoydYanteng SiPetr Mladek
1/2R-b
2/2R-b A-b R-b R-b T-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes. Scroll the table sideways for all 4 reviewers.

Read the v2 thread

Cover letter [PATCH v2 0/2] vsprintf: remove redundant %pCn format specifier

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/[email protected]/

---
Changes in v2:
- Add Chinese translation
- Link to v1: https://lore.kernel.org/r/[email protected]

---
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,

Signature · 1 line
Luca Ceresoli <[email protected]>