mirror-linux/include
David Laight 995ddc58d7 fortify: Use C arithmetic not FIELD_xxx() in FORTIFY_REASON defines
FIELD_GET() and FIELD_PREP() are mainly useful for hardware register
accesses, but here they are being used for some very simple oprations.

This wouldn't matter much, but they contain a lot of compile-time
checks (that really aren't needed here) that bloat the expansion
of FIELD_GET(GENMASK(7, 1), func) to over 18KB.
Even with the 'bloat reduced' FIELD_GET/PREP they are still hundreds of
characters.

Replace FIELD_GET(BIT(0), r) with ((r) & 1), FIELD_GET(GENMASK(7, 1), r) with
(r) >> 1), and (FIELD_PREP(BIT(0), write) | FIELD_PREP(GENMASK(7, 1), func))
with ((func) << 1 | (write)).

The generated code is the same, but it makes the .c file less obfuctaced,
the .i file much easier to read, and should marginally decrease compilation
time.

Signed-off-by: David Laight <david.laight.linux@gmail.com>
Link: https://patch.msgid.link/20251214125857.3308-1-david.laight.linux@gmail.com
Signed-off-by: Kees Cook <kees@kernel.org>
2026-01-14 19:49:52 -08:00
..
acpi
asm-generic hyperv-next for v6.19 2025-12-09 06:10:17 +09:00
clocksource
crypto This update includes the following changes: 2025-12-03 11:28:38 -08:00
cxl
drm Cross-subsystem Changes: 2025-12-05 10:16:25 +10:00
dt-bindings This pull request is entirely SoC clk drivers, not for lack of trying to modify 2025-12-08 09:38:52 +09:00
hyperv mshv: Add definitions for MSHV sleep state configuration 2025-12-05 23:24:57 +00:00
keys
kunit
kvm
linux fortify: Use C arithmetic not FIELD_xxx() in FORTIFY_REASON defines 2026-01-14 19:49:52 -08:00
math-emu
media
memory
misc
net Including fixes from netfilter and CAN. 2025-12-19 07:55:35 +12:00
pcmcia
ras Significant patch series in this merge are as follows: 2025-12-05 13:52:43 -08:00
rdma
rv
scsi
soc This pull request is entirely SoC clk drivers, not for lack of trying to modify 2025-12-08 09:38:52 +09:00
sound soundwire updates for 6.19 2025-12-13 16:26:55 +12:00
target
trace Miscellaneous x86 fixes: 2025-12-21 14:41:29 -08:00
uapi crypto: af_alg - Annotate struct af_alg_iv with __counted_by 2026-01-14 14:43:18 -08:00
ufs
vdso
video
xen
Kbuild