From: Jason Baron <jbaron@redhat.com>
To: greg@kroah.com, Bart Van Assche <bvanassche@acm.org>
Cc: jim.cromie@gmail.com, joe@perches.com, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 14/16] dynamic_debug: add trim_prefix() to provide source-root relative paths
Date: Wed, 21 Dec 2011 16:32:01 -0500 [thread overview]
Message-ID: <20111221213200.GB30393@redhat.com> (raw)
In-Reply-To: <CAO+b5-od4CFkJkxQKoXq4e85XeKq9VFX2kh5FbT7_JMSgFX=JQ@mail.gmail.com>
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
next prev parent reply other threads:[~2011-12-21 21:32 UTC|newest]
Thread overview: 26+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-12-19 22:11 [PATCH 00/16] dynamic debug: ehancements and cleanups Jason Baron
2011-12-19 22:11 ` [PATCH 01/16] dynamic_debug: fix whitespace complaints from scripts/cleanfile Jason Baron
2011-12-19 22:11 ` [PATCH 02/16] dynamic_debug: drop enabled field from struct _ddebug, use _DPRINTK_FLAGS_PRINT Jason Baron
2011-12-19 22:11 ` [PATCH 03/16] dynamic_debug: make dynamic-debug supersede DEBUG ccflag Jason Baron
2011-12-19 22:12 ` [PATCH 04/16] dynamic_debug: change verbosity at runtime Jason Baron
2011-12-19 22:12 ` [PATCH 05/16] dynamic_debug: replace strcpy with strlcpy, in ddebug_setup_query() Jason Baron
2011-12-20 8:08 ` Bart Van Assche
2011-12-21 21:30 ` Jason Baron
2011-12-19 22:12 ` [PATCH 06/16] dynamic_debug: pr_err() call should not depend upon verbosity Jason Baron
2011-12-19 22:12 ` [PATCH 07/16] dynamic_debug: drop explicit !=NULL checks Jason Baron
2011-12-19 22:12 ` [PATCH 08/16] dynamic_debug: describe_flags with '=[pmflt_]*' Jason Baron
2011-12-19 22:12 ` [PATCH 09/16] dynamic_debug: tighten up error checking on debug queries Jason Baron
2011-12-19 22:12 ` [PATCH 10/16] dynamic_debug: early return if _ddebug table is empty Jason Baron
2011-12-19 22:12 ` [PATCH 11/16] dynamic_debug: reduce lineno field to a saner 18 bits Jason Baron
2011-12-19 22:13 ` [PATCH 12/16] dynamic_debug: chop off comments in ddebug_tokenize Jason Baron
2011-12-19 22:13 ` [PATCH 13/16] dynamic_debug: enlarge command/query write buffer Jason Baron
2011-12-19 22:13 ` [PATCH 14/16] dynamic_debug: add trim_prefix() to provide source-root relative paths Jason Baron
2011-12-20 8:15 ` Bart Van Assche
2011-12-21 21:32 ` Jason Baron [this message]
2011-12-19 22:13 ` [PATCH 15/16] dynamic_debug: factor vpr_info_dq out of ddebug_parse_query Jason Baron
2011-12-20 8:17 ` Bart Van Assche
2011-12-20 15:47 ` Jim Cromie
2011-12-20 15:49 ` Bart Van Assche
2011-12-21 21:33 ` Jason Baron
2012-01-24 20:50 ` Greg KH
2011-12-19 22:13 ` [PATCH 16/16] dynamic_debug: process multiple debug-queries on a line Jason Baron
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20111221213200.GB30393@redhat.com \
--to=jbaron@redhat.com \
--cc=bvanassche@acm.org \
--cc=greg@kroah.com \
--cc=jim.cromie@gmail.com \
--cc=joe@perches.com \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Powered by JetHome