From: David Wilder <dwilder@us.ibm.com>
To: Andrew Morton <akpm@linux-foundation.org>
Cc: linux-kernel@vger.kernel.org, systemtap@sourceware.org,
prasadav@us.ibm.com, hch@infradead.org
Subject: Re: [patch 2/3] Trace code and documentation
Date: Fri, 29 Feb 2008 08:28:28 -0800 [thread overview]
Message-ID: <47C832AC.4040906@us.ibm.com> (raw)
In-Reply-To: <20080228020441.a08e4772.akpm@linux-foundation.org>
Andrew Morton wrote:
> On Tue, 26 Feb 2008 14:38:48 -0800 "David J. Wilder" <dwilder@us.ibm.com> wrote:
>
>> + if (strncmp(buf, "start", strlen("start")) == 0) {
>> + ret = trace_start(trace);
>> + if (ret)
>> + return ret;
>> + } else if (strncmp(buf, "stop", strlen("stop")) == 0)
>> + trace_stop(trace);
>
> Does gcc manage to avoid the pointless strlen() calls here?
>
> It's a bit untidy that you can write "startfoo" in there and the kernel
> will happily accept it.
I agree. I will change it to something like this in my next update.
buf[count-1] = '\0';
if (strcmp(buf, "start") == 0) {
ret = trace_start(trace);
if (ret)
return ret;
} else if (strcmp(buf, "stop") == 0)
trace_stop(trace);
else
return -EINVAL;
next prev parent reply other threads:[~2008-02-29 16:29 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-02-26 22:38 [patch 2/3] Trace code and documentation David J. Wilder
2008-02-28 10:04 ` Andrew Morton
2008-02-29 16:28 ` David Wilder [this message]
-- strict thread matches above, loose matches on Subject: below --
2008-03-03 23:52 David J. Wilder
2007-11-13 1:02 David J. Wilder
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=47C832AC.4040906@us.ibm.com \
--to=dwilder@us.ibm.com \
--cc=akpm@linux-foundation.org \
--cc=hch@infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=prasadav@us.ibm.com \
--cc=systemtap@sourceware.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