From: Rasmus Villemoes <linux@rasmusvillemoes.dk>
To: "Theodore Ts'o" <tytso@mit.edu>
Cc: Andrew Morton <akpm@linux-foundation.org>, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 00/22] treewide: Replace strnicmp with strncasecmp
Date: Wed, 17 Sep 2014 10:23:04 +0200 [thread overview]
Message-ID: <878uliirkn.fsf@rasmusvillemoes.dk> (raw)
In-Reply-To: <20140916215502.GN6205@thunk.org> (Theodore Ts'o's message of "Tue, 16 Sep 2014 17:55:02 -0400")
On Tue, Sep 16 2014, Theodore Ts'o <tytso@mit.edu> wrote:
> On Tue, Sep 16, 2014 at 10:51:14PM +0200, Rasmus Villemoes wrote:
>> The kernel used to contain two functions for length-delimited,
>> case-insensitive string comparison, strnicmp with correct semantics
>> and a slightly buggy strncasecmp. The latter is the POSIX name, so
>> strnicmp was renamed to strncasecmp, and strnicmp made into a wrapper
>> for the new strncasecmp to avoid breaking existing users.
>
> For the sake of those people who need to review the patches, can you
> say a bit more about the difference in semantics between strnicmp and
> strncasecmp, and why it's safe to do a global search and replace
> without worrying about the semantic differences?
>
The new strncasecmp is exactly the old strnicmp, making
s/strnicmp/strncasecmp/g a semantic noop. But of course it needs to be
applied after the renaming. Andrew said he'd take these follow-up
patches and make sure they're applied in proper order. Even without the
follow-up patches, strnicmp users shouldn't be affected except for a
very small extra indirection overhead.
The two functions behaved identically whenever the length argument was
non-zero. For len==0, the old strncasecmp however effectively became
strcasecmp.
http://thread.gmane.org/gmane.linux.kernel/1775150/focus=1775152
Thanks,
Rasmus
prev parent reply other threads:[~2014-09-17 8:23 UTC|newest]
Thread overview: 36+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-09-16 20:51 Rasmus Villemoes
2014-09-16 20:51 ` [PATCH 01/22] ARM: " Rasmus Villemoes
2014-09-16 20:51 ` [PATCH 02/22] block: " Rasmus Villemoes
2014-09-16 20:51 ` [PATCH 03/22] netfilter: " Rasmus Villemoes
2014-09-16 20:51 ` [PATCH 04/22] video: fbdev: " Rasmus Villemoes
2014-09-16 20:51 ` [PATCH 05/22] cifs: " Rasmus Villemoes
2014-09-16 20:51 ` [PATCH 06/22] ocfs2: " Rasmus Villemoes
2014-09-16 20:51 ` [PATCH 07/22] isofs: " Rasmus Villemoes
2014-09-16 21:19 ` Jan Kara
2014-09-16 20:51 ` [PATCH 08/22] ALSA: hda - " Rasmus Villemoes
2014-09-17 5:54 ` Takashi Iwai
2014-09-16 20:51 ` [PATCH 09/22] batman-adv: " Rasmus Villemoes
2014-09-17 6:00 ` [B.A.T.M.A.N.] " Antonio Quartulli
2014-09-16 20:51 ` [PATCH 10/22] ACPI / battery: " Rasmus Villemoes
2014-09-25 23:46 ` Rafael J. Wysocki
2014-09-16 20:51 ` [PATCH 11/22] cpufreq: " Rasmus Villemoes
2014-09-16 21:22 ` Viresh Kumar
2014-09-25 23:53 ` Rafael J. Wysocki
2014-09-16 20:51 ` [PATCH 12/22] cpuidle: " Rasmus Villemoes
2014-09-25 23:52 ` Rafael J. Wysocki
2014-09-16 20:51 ` [PATCH 13/22] scsi: " Rasmus Villemoes
2014-09-16 20:51 ` [PATCH 14/22] ib_srpt: " Rasmus Villemoes
2014-09-16 20:51 ` [PATCH 15/22] Input: edt-ft5x06 - " Rasmus Villemoes
2014-09-17 16:26 ` Dmitry Torokhov
2014-09-16 20:51 ` [PATCH 16/22] altera-stapl: " Rasmus Villemoes
2014-09-16 20:51 ` [PATCH 17/22] thinkpad_acpi: " Rasmus Villemoes
2014-09-16 22:08 ` Darren Hart
2014-09-17 8:12 ` Rasmus Villemoes
2014-09-16 20:51 ` [PATCH 18/22] PNP: " Rasmus Villemoes
2014-09-16 20:51 ` [PATCH 19/22] s390/cio: " Rasmus Villemoes
2014-09-16 20:51 ` [PATCH 20/22] staging: r8188eu: " Rasmus Villemoes
2014-09-16 20:51 ` [PATCH 21/22] Thermal: " Rasmus Villemoes
2014-09-18 0:49 ` Zhang Rui
2014-09-16 20:51 ` [PATCH 22/22] kdb: " Rasmus Villemoes
2014-09-16 21:55 ` [PATCH 00/22] treewide: " Theodore Ts'o
2014-09-17 8:23 ` Rasmus Villemoes [this message]
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=878uliirkn.fsf@rasmusvillemoes.dk \
--to=linux@rasmusvillemoes.dk \
--cc=akpm@linux-foundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=tytso@mit.edu \
/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