[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20250106143007.3d430500@gandalf.local.home>
Date: Mon, 6 Jan 2025 14:30:07 -0500
From: Steven Rostedt <rostedt@...dmis.org>
To: "Masami Hiramatsu (Google)" <mhiramat@...nel.org>
Cc: Peter Zijlstra <peterz@...radead.org>, Anil S Keshavamurthy
<anil.s.keshavamurthy@...el.com>, "David S . Miller" <davem@...emloft.net>,
Mathieu Desnoyers <mathieu.desnoyers@...icios.com>, Oleg Nesterov
<oleg@...hat.com>, Tzvetomir Stoyanov <tz.stoyanov@...il.com>, Naveen N Rao
<naveen@...nel.org>, Josh Poimboeuf <jpoimboe@...nel.org>, Jason Baron
<jbaron@...mai.com>, Ard Biesheuvel <ardb@...nel.org>,
linux-kernel@...r.kernel.org, linux-trace-kernel@...r.kernel.org
Subject: Re: [PATCH 2/6] Provide __free(argv) for argv_split() users
On Sat, 4 Jan 2025 08:01:47 +0900
"Masami Hiramatsu (Google)" <mhiramat@...nel.org> wrote:
> From: Masami Hiramatsu (Google) <mhiramat@...nel.org>
>
> Provide __free(argv) macro for argv_split() users so that they can
> avoid gotos.
>
> Signed-off-by: Masami Hiramatsu (Google) <mhiramat@...nel.org>
> ---
> include/linux/string.h | 2 ++
> 1 file changed, 2 insertions(+)
>
> diff --git a/include/linux/string.h b/include/linux/string.h
> index 493ac4862c77..7035a70e30be 100644
> --- a/include/linux/string.h
> +++ b/include/linux/string.h
> @@ -312,6 +312,8 @@ extern void *kmemdup_array(const void *src, size_t count, size_t element_size, g
> extern char **argv_split(gfp_t gfp, const char *str, int *argcp);
> extern void argv_free(char **argv);
>
> +DEFINE_FREE(argv, char **, argv_free(_T))
> +
> /* lib/cmdline.c */
> extern int get_option(char **str, int *pint);
> extern char *get_options(const char *str, int nints, int *ints);
FYI, I already have this change in linux-next:
https://git.kernel.org/pub/scm/linux/kernel/git/trace/linux-trace.git/commit/?h=for-next&id=9e49ca756d207f4313fb7af48648a67da8e4e250
https://lore.kernel.org/20241220103313.4a74ec8e@gandalf.local.home
-- Steve
Powered by blists - more mailing lists