Files
linux-stable-mirror/include/linux
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
..
2025-12-12 12:36:44 -07:00
2025-12-04 07:19:26 -07:00
2025-12-09 23:29:42 -08:00
2025-11-21 11:21:31 +01:00
2025-12-13 20:04:32 +12:00
2025-12-16 00:57:29 -05:00
2025-11-23 12:30:40 +01:00
2025-11-20 13:43:59 -08:00
2025-11-27 14:24:30 -08:00
2025-11-28 09:21:18 -07:00
2025-11-27 14:22:31 +01:00
2025-11-20 17:57:40 -08:00
2025-11-25 10:07:42 +01:00
2025-11-24 15:08:54 -08:00