From: "Américo Wang" <xiyou.wangcong@gmail.com>
To: Pavel Vasilyev <pavel@pavlinux.ru>
Cc: Steven Rostedt <rostedt@goodmis.org>,
LKML <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] Repalce strncmp by memcmp
Date: Tue, 30 Nov 2010 17:24:58 +0800 [thread overview]
Message-ID: <20101130092458.GC5203@cr0.nay.redhat.com> (raw)
In-Reply-To: <4CF42E07.40207@pavlinux.ru>
On Tue, Nov 30, 2010 at 01:49:43AM +0300, Pavel Vasilyev wrote:
>On 30.11.2010 01:26, Steven Rostedt wrote:
>> On Mon, 2010-11-29 at 17:18 -0500, Steven Rostedt wrote:
>>
>>> Um, do you realize that the kernel does not always use the same memcmp
>>> as gcc.
>>>
>> Note, I'm not against the change, because in 99% of the cases, memcmp()
>> can and will be faster, and we don't need to worry about these strange
>> cases.
>>
>> What I'm against is a blind s/strncmp/memcmp/ of the kernel, because it
>> may have side effects that you may not have thought of.
>>
>Then we have to hang a large banner that is visible to all developers.
>"Change wherever possible strncmp to memcmp," :)
>
Why? Strings are strings, they are ended by '\0', well-deserved to use str*()
functions rather than mem*().
next prev parent reply other threads:[~2010-11-30 9:20 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-11-29 2:09 Pavel Vasilyev
2010-11-29 2:21 ` microcai
2010-11-29 2:29 ` Ming Lei
2010-11-29 3:11 ` Pavel Vasilyev
2010-11-29 4:13 ` Dmitry Torokhov
2010-11-29 5:26 ` YOSHIFUJI Hideaki
2010-11-29 12:41 ` Pavel Vasilyev
2010-11-29 3:10 ` Américo Wang
2010-11-29 10:18 ` Andi Kleen
2010-11-29 14:58 ` Steven Rostedt
2010-11-29 19:41 ` Pavel Vasilyev
2010-11-29 22:18 ` Steven Rostedt
2010-11-29 22:26 ` Steven Rostedt
2010-11-29 22:49 ` Pavel Vasilyev
2010-11-30 9:24 ` Américo Wang [this message]
2010-11-29 22:51 ` Ryan Mallon
2010-11-30 10:27 ` Bernd Petrovitsch
2010-11-29 23:32 ` Arnaud Lacombe
2010-11-30 10:34 ` Bernd Petrovitsch
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=20101130092458.GC5203@cr0.nay.redhat.com \
--to=xiyou.wangcong@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=pavel@pavlinux.ru \
--cc=rostedt@goodmis.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