Re: [PATCH v6 01/17] lib/bootconfig: add missing __init annotations to static helpers
From: Google
Date: Tue Mar 17 2026 - 03:33:28 EST
On Sun, 15 Mar 2026 12:19:59 +0000
Josh Law <objecting@xxxxxxxxxxxxx> wrote:
> skip_comment() and skip_spaces_until_newline() are static functions
> called exclusively from __init code paths but lack the __init
> annotation themselves. Add it so their memory can be reclaimed after
> init.
>
> Signed-off-by: Josh Law <objecting@xxxxxxxxxxxxx>
> ---
> lib/bootconfig.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/lib/bootconfig.c b/lib/bootconfig.c
> index b0ef1e74e98a..51fd2299ec0f 100644
> --- a/lib/bootconfig.c
> +++ b/lib/bootconfig.c
> @@ -509,7 +509,7 @@ static inline __init bool xbc_valid_keyword(char *key)
> return *key == '\0';
> }
>
> -static char *skip_comment(char *p)
> +static char __init *skip_comment(char *p)
static __init char *skip_comment()
__init attribute is not for char but the function itself.
> {
> char *ret;
>
> @@ -522,7 +522,7 @@ static char *skip_comment(char *p)
> return ret;
> }
>
> -static char *skip_spaces_until_newline(char *p)
> +static char __init *skip_spaces_until_newline(char *p)
Ditto.
> {
> while (isspace(*p) && *p != '\n')
> p++;
> --
> 2.34.1
>
>
--
Masami Hiramatsu (Google) <mhiramat@xxxxxxxxxx>