linux/Documentation/core-api
Petr Mladek 37eed892cc vsprintf: Use %p4chR instead of %p4cn for reading data in reversed host ordering
The generic FourCC format always prints the data using the big endian
order. It is generic because it allows to read the data using a custom
ordering.

The current code uses "n" for reading data in the reverse host ordering.
It makes the 4 variants [hnbl] consistent with the generic printing
of IPv4 addresses.

Unfortunately, it creates confusion on big endian systems. For example,
it shows the data &(u32)0x67503030 as

	%p4cn	00Pg (0x30305067)

But people expect that the ordering stays the same. The network ordering
is a big-endian ordering.

The problem is that the semantic is not the same. The modifiers affect
the output ordering of IPv4 addresses while they affect the reading order
in case of FourCC code.

Avoid the confusion by replacing the "n" modifier with "hR", aka
reverse host ordering. It is inspired by the existing %p[mM]R printf
format.

Reported-by: Geert Uytterhoeven <geert@linux-m68k.org>
Closes: https://lore.kernel.org/r/CAMuHMdV9tX=TG7E_CrSF=2PY206tXf+_yYRuacG48EWEtJLo-Q@mail.gmail.com
Signed-off-by: Petr Mladek <pmladek@suse.com>
Acked-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
Reviewed-by: Aditya Garg <gargaditya08@live.com>
Link: https://lore.kernel.org/r/20250428123132.578771-1-pmladek@suse.com
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
2025-04-29 09:29:33 -04:00
..
irq
wrappers
asm-annotations.rst
assoc_array.rst
boot-time-mm.rst
cachetlb.rst
cgroup.rst doc/cgroup: Fix title underline length 2025-01-15 09:46:18 +01:00
circular-buffers.rst
cleanup.rst cleanup: Add usage and style documentation 2024-08-05 16:54:41 +02:00
cpu_hotplug.rst Documentation: core-api/cpuhotplug: Fix missing prefix 2024-10-07 11:50:54 -06:00
debug-objects.rst
debugging-via-ohci1394.rst Documentation: Drop or replace remaining mentions of IA64 2023-09-11 08:13:18 +00:00
dma-api-howto.rst docs: dma: correct dma_set_mask() sample code 2024-04-02 10:07:15 -06:00
dma-api.rst docs: dma-api: Fix description of the sync_sg API 2023-11-17 08:52:13 -07:00
dma-attributes.rst
dma-isa-lpc.rst
entry.rst Docs: typos/spelling 2024-05-02 10:02:29 -06:00
errseq.rst
floating-point.rst arch: add ARCH_HAS_KERNEL_FPU_SUPPORT 2024-05-19 14:36:17 -07:00
folio_queue.rst netfs: Add folio_queue API documentation 2024-09-30 14:10:51 +02:00
genalloc.rst
generic-radix-tree.rst
genericirq.rst Updates for the interrupt subsystem: 2024-07-22 13:52:05 -07:00
gfp_mask-from-fs-io.rst docs: core-api/gfp_mask-from-fs-io: indicate that vmalloc supports GFP_NOFS/GFP_NOIO 2024-11-22 10:42:37 -07:00
idr.rst
index.rst Documentation changes this time around include: 2025-01-21 18:00:00 -08:00
kernel-api.rst
kobject.rst
kref.rst kref: Improve documentation 2024-12-13 08:49:31 -07:00
librs.rst
local_ops.rst
maple_tree.rst maple_tree: update the documentation of maple tree 2023-12-10 16:51:32 -08:00
memory-allocation.rst docs/core-api: memory-allocation: GFP_NOWAIT doesn't need __GFP_NOWARN 2024-07-29 15:10:25 -06:00
memory-hotplug.rst
min_heap.rst Documentation/core-api: min_heap: update for variable types change 2025-02-18 13:30:56 -07:00
mm-api.rst mm/slab, docs: switch mm-api docs generation from slab.c to slub.c 2023-12-05 11:11:34 +01:00
netlink.rst
packing.rst lib: packing: document recently added APIs 2024-12-11 20:13:00 -08:00
padata.rst
parser.rst Documentation: core-api: add generic parser docbook 2024-12-11 09:07:40 -07:00
pin_user_pages.rst mm: remove page_mkclean() 2024-07-03 19:30:17 -07:00
printk-basics.rst
printk-formats.rst vsprintf: Use %p4chR instead of %p4cn for reading data in reversed host ordering 2025-04-29 09:29:33 -04:00
printk-index.rst docs:core-api: fixed typos and grammar in printk-index page 2024-05-07 08:01:11 -06:00
protection-keys.rst Documentation/protection-keys: add AArch64 to documentation 2024-10-14 17:27:48 +01:00
rbtree.rst
refcount-vs-atomic.rst refcount: provide ops for cases when object's memory can be reused 2025-03-16 22:06:19 -07:00
swiotlb.rst docs/core-api: swiotlb: fix typos 2024-10-17 09:37:05 -06:00
symbol-namespaces.rst doc: module: DEFAULT_SYMBOL_NAMESPACE must be defined before #includes 2025-01-09 12:36:55 -07:00
this_cpu_ops.rst docs: Improve discussion of this_cpu_ptr(), add raw_cpu_ptr() 2025-02-04 21:50:06 -08:00
timekeeping.rst
tracepoint.rst
unaligned-memory-access.rst move asm/unaligned.h to linux/unaligned.h 2024-10-02 17:23:23 -04:00
union_find.rst Documentation: Fix the compilation errors in union_find.rst 2024-08-02 08:58:16 -10:00
watch_queue.rst
workqueue.rst workqueue: Adjust WQ_MAX_ACTIVE from 512 to 2048 2024-10-08 08:46:54 -10:00
xarray.rst xarray: add xas_try_split() to split a multi-index entry 2025-03-17 22:06:59 -07:00