Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

kgdbts: mark kgdbts_option_setup() with __init to free init memory

The kgdbts_option_setup() function is invoked only once early in boot
via the __setup("kgdbts=", ...) mechanism to parse the kernel
command-line option.After init is complete, it is never called again.

Annotating it with __init places the function in the .init.text section,
enabling the kernel to free its code memory during the init memory
cleanup phase (free_initmem()). This reduces the kernel’s runtime
memory footprint with no functional side effects.

Signed-off-by: Can Peng <pengcan@kylinos.cn>
Link: https://patch.msgid.link/20251208130525.2775885-1-pengcan@kylinos.cn
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

authored by

Can Peng and committed by
Greg Kroah-Hartman
38a5a54f 578d62a2

+1 -1
+1 -1
drivers/misc/kgdbts.c
··· 1066 1066 configured = 0; 1067 1067 } 1068 1068 1069 - static int kgdbts_option_setup(char *opt) 1069 + static int __init kgdbts_option_setup(char *opt) 1070 1070 { 1071 1071 if (strlen(opt) >= MAX_CONFIG_LEN) { 1072 1072 printk(KERN_ERR "kgdbts: config string too long\n");