lkml.org 
[lkml]   [2018]   [Dec]   [19]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 2/7] tracing: Change strlen to sizeof for hist trigger static strings
On Wed, 19 Dec 2018 14:38:39 -0600
Tom Zanussi <zanussi@kernel.org> wrote:

> On Wed, 2018-12-19 at 15:30 -0500, Steven Rostedt wrote:
> > On Wed, 19 Dec 2018 12:20:19 -0800
> > Joe Perches <joe@perches.com> 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. ;-)
> > >
> > > I believe the 'strlen("foo") -> sizeof("foo") - 1'
> > > conversions do not change objects at all.
> > >
> > > strlen("constant") is already optimized by gcc to a
> > > constant value when fed a constant string.
> >
> > If that's the case (and it probably is), then yeah, strlen is
> > probably
> > better. As it can handle the "not a constant" that you stated in
> > another email.
> >
>
> OK, so I guess that means we should just drop this patch ('[PATCH 2/7]
> tracing: Change strlen to sizeof for hist trigger static strings').
>

No, that patch is fine, the macro was not. I've already applied your
patch set. Just need to run it through my tests.

-- Steve

\
 
 \ /
  Last update: 2018-12-19 22:02    [W:0.141 / U:0.128 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site