lkml.org 
[lkml]   [2011]   [Dec]   [21]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 14/16] dynamic_debug: add trim_prefix() to provide source-root relative paths
On Tue, Dec 20, 2011 at 08:15:55AM +0000, Bart Van Assche wrote:
> On Mon, Dec 19, 2011 at 10:13 PM, Jason Baron <jbaron@redhat.com> wrote:
> > +/* Return the path relative to source root */
> > +static inline const char *trim_prefix(const char *path)
> > +{
> > +       int skip = strlen(__FILE__) - strlen("lib/dynamic_debug.c");
> > +
> > +       if (strncmp(path, __FILE__, skip))
> > +               skip = 0; /* prefix mismatch, don't skip */
> > +
> > +       return path + skip;
> > +}
>
> Isn't the preferred style to write if (strncmp(...) != 0) ..., i.e. to
> mention "!= 0" explicitly instead of leaving it out when comparing
> strings ?
>
> Bart.

Greg,

Again, no functional change here, just a style thing. Let me know if you
want a re-post. I am fine with it as-is.

Thanks,

-Jason
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2011-12-21 22:35    [W:0.376 / U:0.424 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site