mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Rasmus Villemoes <linux@rasmusvillemoes.dk>
To: Andrew Morton <akpm@linux-foundation.org>
Cc: linux-kernel@vger.kernel.org,
	Rasmus Villemoes <linux@rasmusvillemoes.dk>,
	Mark Fasheh <mfasheh@suse.com>, Joel Becker <jlbec@evilplan.org>,
	ocfs2-devel@oss.oracle.com
Subject: [PATCH 06/22] ocfs2: Replace strnicmp with strncasecmp
Date: Tue, 16 Sep 2014 22:51:20 +0200	[thread overview]
Message-ID: <1410900696-6481-7-git-send-email-linux@rasmusvillemoes.dk> (raw)
In-Reply-To: <1410900696-6481-1-git-send-email-linux@rasmusvillemoes.dk>

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.

To allow the compat wrapper strnicmp to be removed at some point in
the future, and to avoid the extra indirection cost, do
s/strnicmp/strncasecmp/g.

Cc: Mark Fasheh <mfasheh@suse.com>
Cc: Joel Becker <jlbec@evilplan.org>
Cc: ocfs2-devel@oss.oracle.com
Signed-off-by: Rasmus Villemoes <linux@rasmusvillemoes.dk>
---
 fs/ocfs2/cluster/heartbeat.c | 2 +-
 fs/ocfs2/cluster/masklog.c   | 6 +++---
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/fs/ocfs2/cluster/heartbeat.c b/fs/ocfs2/cluster/heartbeat.c
index 7303929..eec35c2 100644
--- a/fs/ocfs2/cluster/heartbeat.c
+++ b/fs/ocfs2/cluster/heartbeat.c
@@ -2244,7 +2244,7 @@ ssize_t o2hb_heartbeat_group_mode_store(struct o2hb_heartbeat_group *group,
 		return -EINVAL;
 
 	for (i = 0; i < O2HB_HEARTBEAT_NUM_MODES; ++i) {
-		if (strnicmp(page, o2hb_heartbeat_mode_desc[i], len))
+		if (strncasecmp(page, o2hb_heartbeat_mode_desc[i], len))
 			continue;
 
 		ret = o2hb_global_heartbeat_mode_set(i);
diff --git a/fs/ocfs2/cluster/masklog.c b/fs/ocfs2/cluster/masklog.c
index 07ac24f..af7598b 100644
--- a/fs/ocfs2/cluster/masklog.c
+++ b/fs/ocfs2/cluster/masklog.c
@@ -49,13 +49,13 @@ static ssize_t mlog_mask_show(u64 mask, char *buf)
 
 static ssize_t mlog_mask_store(u64 mask, const char *buf, size_t count)
 {
-	if (!strnicmp(buf, "allow", 5)) {
+	if (!strncasecmp(buf, "allow", 5)) {
 		__mlog_set_u64(mask, mlog_and_bits);
 		__mlog_clear_u64(mask, mlog_not_bits);
-	} else if (!strnicmp(buf, "deny", 4)) {
+	} else if (!strncasecmp(buf, "deny", 4)) {
 		__mlog_set_u64(mask, mlog_not_bits);
 		__mlog_clear_u64(mask, mlog_and_bits);
-	} else if (!strnicmp(buf, "off", 3)) {
+	} else if (!strncasecmp(buf, "off", 3)) {
 		__mlog_clear_u64(mask, mlog_not_bits);
 		__mlog_clear_u64(mask, mlog_and_bits);
 	} else
-- 
2.0.4


  parent reply	other threads:[~2014-09-16 20:58 UTC|newest]

Thread overview: 36+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-09-16 20:51 [PATCH 00/22] treewide: " 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 ` Rasmus Villemoes [this message]
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

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=1410900696-6481-7-git-send-email-linux@rasmusvillemoes.dk \
    --to=linux@rasmusvillemoes.dk \
    --cc=akpm@linux-foundation.org \
    --cc=jlbec@evilplan.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mfasheh@suse.com \
    --cc=ocfs2-devel@oss.oracle.com \
    /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

all inboxes | Powered by JetHome®