Re: [PATCH] api-trace.txt: fix typo
- From
Eric Sunshine <sunshine@sunshineco.com>
- Date
- Apr 5, 2016, 17:15 UTC
- Message-ID
- <CAPig+cRO22wVRkrMicxLe=Gw4905QMxnnxM8kvtsMJaFv76Yrg@mail.gmail.com>
- In-Reply-To
- <1459850723-46974-1-git-send-email-gitter.spiros@gmail.com>
On Tue, Apr 5, 2016 at 6:05 AM, Elia Pinto <gitter.spiros@gmail.com> wrote:
Show 11 quoted lines
> The correct api is trace_printf_key
>
> Signed-off-by: Elia Pinto <gitter.spiros@gmail.com>
> ---
> diff --git a/Documentation/technical/api-trace.txt b/Documentation/technical/api-trace.txt
> @@ -28,7 +28,7 @@ static struct trace_key trace_foo = TRACE_KEY_INIT(FOO);
> static void trace_print_foo(const char *message)
> {
> - trace_print_key(&trace_foo, message);
> + trace_printf_key(&trace_foo, message);
> }Since you're touching this already, I wonder if it would make sense to rewrite this example to avoid the dangerous sending of an arbitrary string (which might contain %) to a printf-like function. Like this, for example:
trace_printf_key(&trace_foo, "%s", message);