Re: [PATCH 2/7] tracing: Change strlen to sizeof for hist trigger static strings
From: Steven Rostedt
Date: Wed Dec 19 2018 - 15:28:23 EST
On Wed, 19 Dec 2018 14:16:31 -0600
Tom Zanussi <zanussi@xxxxxxxxxx> wrote:
> > Yeah, I had considered it but wasn't sure it was worth it. Since
> > you're suggesting it is, I can send another patch on top of these, or
> > feel free if you want to too. ;-)
> >
>
> How's this?
>
> [PATCH] tracing: Introduce and use strcmp_const() for hist triggers
>
> Provide a new strcmp_const() macro and make use of it instead of the
> longer and more error-prone strncmp(str, "str", sizeof("str") - 1).
>
> Idea-and-macro-by: Steve Rostedt <rostedt@xxxxxxxxxxx>
> Signed-off-by: Tom Zanussi <tom.zanussi@xxxxxxxxxxxxxxx>
> ---
And I just sent you my version :-) (cross emails).
Note, I changed it to strncmp_const() because it should note that it's
a strncmp() and not an strcmp().
Pretty much identical patches too ;-)
-- Steve