From: Can Peng Date: Mon, 8 Dec 2025 09:50:10 +0000 (+0800) Subject: crypto: fips - annotate fips_enable() with __init to free init memory after boot X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=97282e2cdecb209b4d19b2a7c52eb71fb8a82435;p=thirdparty%2Fkernel%2Flinux.git crypto: fips - annotate fips_enable() with __init to free init memory after boot The fips_enable() function is only invoked early during kernel boot via the __setup() macro ("fips=" command line parameter), and is never used again after initialization completes. Annotating it with __init places the function in the .init.text section, allowing the kernel to free its memory after init (when freeing_initmem() runs), reducing runtime memory footprint. This is a standard practice for setup/early-parse functions and has no functional impact — the parsing logic, return values, and fips mode setting behavior remain unchanged. Signed-off-by: Can Peng Signed-off-by: Herbert Xu --- diff --git a/crypto/fips.c b/crypto/fips.c index 65d2bc070a263..c59711248d956 100644 --- a/crypto/fips.c +++ b/crypto/fips.c @@ -22,7 +22,7 @@ ATOMIC_NOTIFIER_HEAD(fips_fail_notif_chain); EXPORT_SYMBOL_GPL(fips_fail_notif_chain); /* Process kernel command-line parameter at boot time. fips=0 or fips=1 */ -static int fips_enable(char *str) +static int __init fips_enable(char *str) { if (kstrtoint(str, 0, &fips_enabled)) return 0;