linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 00/22] treewide: Replace strnicmp with strncasecmp
@ 2014-09-16 20:51 Rasmus Villemoes
  2014-09-16 20:51 ` [PATCH 01/22] ARM: " Rasmus Villemoes
                   ` (22 more replies)
  0 siblings, 23 replies; 36+ messages in thread
From: Rasmus Villemoes @ 2014-09-16 20:51 UTC (permalink / raw)
  To: Andrew Morton; +Cc: linux-kernel, Rasmus Villemoes

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.

Sorry for the unimaginative and identical commit messages.

Rasmus Villemoes (22):
  ARM: Replace strnicmp with strncasecmp
  block: Replace strnicmp with strncasecmp
  netfilter: Replace strnicmp with strncasecmp
  video: fbdev: Replace strnicmp with strncasecmp
  cifs: Replace strnicmp with strncasecmp
  ocfs2: Replace strnicmp with strncasecmp
  isofs: Replace strnicmp with strncasecmp
  ALSA: hda - Replace strnicmp with strncasecmp
  batman-adv: Replace strnicmp with strncasecmp
  ACPI / battery: Replace strnicmp with strncasecmp
  cpufreq: Replace strnicmp with strncasecmp
  cpuidle: Replace strnicmp with strncasecmp
  scsi: Replace strnicmp with strncasecmp
  ib_srpt: Replace strnicmp with strncasecmp
  Input: edt-ft5x06 - Replace strnicmp with strncasecmp
  altera-stapl: Replace strnicmp with strncasecmp
  thinkpad_acpi: Replace strnicmp with strncasecmp
  PNP: Replace strnicmp with strncasecmp
  s390/cio: Replace strnicmp with strncasecmp
  staging: r8188eu: Replace strnicmp with strncasecmp
  Thermal: Replace strnicmp with strncasecmp
  kdb: Replace strnicmp with strncasecmp

 arch/arm/mach-pxa/lpd270.c                     | 12 ++---
 block/partitions/mac.c                         |  8 ++--
 drivers/acpi/battery.c                         |  2 +-
 drivers/cpufreq/cpufreq.c                      |  6 +--
 drivers/cpuidle/governor.c                     |  2 +-
 drivers/infiniband/ulp/srpt/ib_srpt.c          |  2 +-
 drivers/input/touchscreen/edt-ft5x06.c         |  2 +-
 drivers/misc/altera-stapl/altera.c             |  4 +-
 drivers/platform/x86/thinkpad_acpi.c           |  4 +-
 drivers/pnp/interface.c                        | 24 +++++-----
 drivers/s390/cio/chp.c                         |  4 +-
 drivers/scsi/ips.c                             |  2 +-
 drivers/scsi/scsi_debug.c                      |  2 +-
 drivers/staging/rtl8188eu/os_dep/rtw_android.c |  2 +-
 drivers/thermal/thermal_core.c                 |  8 ++--
 drivers/video/fbdev/pvr2fb.c                   |  2 +-
 drivers/video/fbdev/s3c2410fb.c                |  8 ++--
 drivers/video/fbdev/sis/sis_main.c             | 66 +++++++++++++-------------
 drivers/video/fbdev/sm501fb.c                  |  4 +-
 fs/cifs/cifs_dfs_ref.c                         |  6 +--
 fs/cifs/connect.c                              |  4 +-
 fs/isofs/inode.c                               |  2 +-
 fs/ocfs2/cluster/heartbeat.c                   |  2 +-
 fs/ocfs2/cluster/masklog.c                     |  6 +--
 kernel/debug/kdb/kdb_bp.c                      |  6 +--
 net/batman-adv/gateway_common.c                |  8 ++--
 net/netfilter/ipvs/ip_vs_ftp.c                 |  6 +--
 net/netfilter/nf_conntrack_ftp.c               |  4 +-
 net/netfilter/nf_conntrack_sip.c               | 22 ++++-----
 net/netfilter/nf_log.c                         |  2 +-
 net/netfilter/nf_nat_sip.c                     |  2 +-
 sound/pci/hda/hda_sysfs.c                      |  2 +-
 32 files changed, 118 insertions(+), 118 deletions(-)

-- 
2.0.4


^ permalink raw reply	[flat|nested] 36+ messages in thread

* [PATCH 01/22] ARM: Replace strnicmp with strncasecmp
  2014-09-16 20:51 [PATCH 00/22] treewide: Replace strnicmp with strncasecmp Rasmus Villemoes
@ 2014-09-16 20:51 ` Rasmus Villemoes
  2014-09-16 20:51 ` [PATCH 02/22] block: " Rasmus Villemoes
                   ` (21 subsequent siblings)
  22 siblings, 0 replies; 36+ messages in thread
From: Rasmus Villemoes @ 2014-09-16 20:51 UTC (permalink / raw)
  To: Andrew Morton
  Cc: linux-kernel, Rasmus Villemoes, Russell King, linux-arm-kernel

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: Russell King <linux@arm.linux.org.uk>
Cc: linux-arm-kernel@lists.infradead.org
Signed-off-by: Rasmus Villemoes <linux@rasmusvillemoes.dk>
---
 arch/arm/mach-pxa/lpd270.c | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/arch/arm/mach-pxa/lpd270.c b/arch/arm/mach-pxa/lpd270.c
index 9f6ec16..ad777b3 100644
--- a/arch/arm/mach-pxa/lpd270.c
+++ b/arch/arm/mach-pxa/lpd270.c
@@ -416,17 +416,17 @@ static struct pxafb_mach_info *lpd270_lcd_to_use;
 
 static int __init lpd270_set_lcd(char *str)
 {
-	if (!strnicmp(str, "lq057q3dc02", 11)) {
+	if (!strncasecmp(str, "lq057q3dc02", 11)) {
 		lpd270_lcd_to_use = &sharp_lq057q3dc02;
-	} else if (!strnicmp(str, "lq121s1dg31", 11)) {
+	} else if (!strncasecmp(str, "lq121s1dg31", 11)) {
 		lpd270_lcd_to_use = &sharp_lq121s1dg31;
-	} else if (!strnicmp(str, "lq036q1da01", 11)) {
+	} else if (!strncasecmp(str, "lq036q1da01", 11)) {
 		lpd270_lcd_to_use = &sharp_lq036q1da01;
-	} else if (!strnicmp(str, "lq64d343", 8)) {
+	} else if (!strncasecmp(str, "lq64d343", 8)) {
 		lpd270_lcd_to_use = &sharp_lq64d343;
-	} else if (!strnicmp(str, "lq10d368", 8)) {
+	} else if (!strncasecmp(str, "lq10d368", 8)) {
 		lpd270_lcd_to_use = &sharp_lq10d368;
-	} else if (!strnicmp(str, "lq035q7db02-20", 14)) {
+	} else if (!strncasecmp(str, "lq035q7db02-20", 14)) {
 		lpd270_lcd_to_use = &sharp_lq035q7db02_20;
 	} else {
 		printk(KERN_INFO "lpd270: unknown lcd panel [%s]\n", str);
-- 
2.0.4


^ permalink raw reply related	[flat|nested] 36+ messages in thread

* [PATCH 02/22] block: Replace strnicmp with strncasecmp
  2014-09-16 20:51 [PATCH 00/22] treewide: Replace strnicmp with strncasecmp Rasmus Villemoes
  2014-09-16 20:51 ` [PATCH 01/22] ARM: " Rasmus Villemoes
@ 2014-09-16 20:51 ` Rasmus Villemoes
  2014-09-16 20:51 ` [PATCH 03/22] netfilter: " Rasmus Villemoes
                   ` (20 subsequent siblings)
  22 siblings, 0 replies; 36+ messages in thread
From: Rasmus Villemoes @ 2014-09-16 20:51 UTC (permalink / raw)
  To: Andrew Morton; +Cc: linux-kernel, Rasmus Villemoes, Jens Axboe

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: Jens Axboe <axboe@kernel.dk>
Signed-off-by: Rasmus Villemoes <linux@rasmusvillemoes.dk>
---
 block/partitions/mac.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/block/partitions/mac.c b/block/partitions/mac.c
index 76d8ba6..c2c48ec 100644
--- a/block/partitions/mac.c
+++ b/block/partitions/mac.c
@@ -81,7 +81,7 @@ int mac_partition(struct parsed_partitions *state)
 			be32_to_cpu(part->start_block) * (secsize/512),
 			be32_to_cpu(part->block_count) * (secsize/512));
 
-		if (!strnicmp(part->type, "Linux_RAID", 10))
+		if (!strncasecmp(part->type, "Linux_RAID", 10))
 			state->parts[slot].flags = ADDPART_FLAG_RAID;
 #ifdef CONFIG_PPC_PMAC
 		/*
@@ -100,7 +100,7 @@ int mac_partition(struct parsed_partitions *state)
 				goodness++;
 
 			if (strcasecmp(part->type, "Apple_UNIX_SVR2") == 0
-			    || (strnicmp(part->type, "Linux", 5) == 0
+			    || (strncasecmp(part->type, "Linux", 5) == 0
 			        && strcasecmp(part->type, "Linux_swap") != 0)) {
 				int i, l;
 
@@ -109,13 +109,13 @@ int mac_partition(struct parsed_partitions *state)
 				if (strcmp(part->name, "/") == 0)
 					goodness++;
 				for (i = 0; i <= l - 4; ++i) {
-					if (strnicmp(part->name + i, "root",
+					if (strncasecmp(part->name + i, "root",
 						     4) == 0) {
 						goodness += 2;
 						break;
 					}
 				}
-				if (strnicmp(part->name, "swap", 4) == 0)
+				if (strncasecmp(part->name, "swap", 4) == 0)
 					goodness--;
 			}
 
-- 
2.0.4


^ permalink raw reply related	[flat|nested] 36+ messages in thread

* [PATCH 03/22] netfilter: Replace strnicmp with strncasecmp
  2014-09-16 20:51 [PATCH 00/22] treewide: Replace strnicmp with strncasecmp 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 ` Rasmus Villemoes
  2014-09-16 20:51 ` [PATCH 04/22] video: fbdev: " Rasmus Villemoes
                   ` (19 subsequent siblings)
  22 siblings, 0 replies; 36+ messages in thread
From: Rasmus Villemoes @ 2014-09-16 20:51 UTC (permalink / raw)
  To: Andrew Morton
  Cc: linux-kernel, Rasmus Villemoes, David S. Miller, netdev,
	netfilter-devel, coreteam

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: "David S. Miller" <davem@davemloft.net>
Cc: netdev@vger.kernel.org
Cc: netfilter-devel@vger.kernel.org
Cc: coreteam@netfilter.org
Signed-off-by: Rasmus Villemoes <linux@rasmusvillemoes.dk>
---
 net/netfilter/ipvs/ip_vs_ftp.c   |  6 +++---
 net/netfilter/nf_conntrack_ftp.c |  4 ++--
 net/netfilter/nf_conntrack_sip.c | 22 +++++++++++-----------
 net/netfilter/nf_log.c           |  2 +-
 net/netfilter/nf_nat_sip.c       |  2 +-
 5 files changed, 18 insertions(+), 18 deletions(-)

diff --git a/net/netfilter/ipvs/ip_vs_ftp.c b/net/netfilter/ipvs/ip_vs_ftp.c
index 77c1732..cce4a51 100644
--- a/net/netfilter/ipvs/ip_vs_ftp.c
+++ b/net/netfilter/ipvs/ip_vs_ftp.c
@@ -96,13 +96,13 @@ static int ip_vs_ftp_get_addrport(char *data, char *data_limit,
 
 	if (data_limit - data < plen) {
 		/* check if there is partial match */
-		if (strnicmp(data, pattern, data_limit - data) == 0)
+		if (strncasecmp(data, pattern, data_limit - data) == 0)
 			return -1;
 		else
 			return 0;
 	}
 
-	if (strnicmp(data, pattern, plen) != 0) {
+	if (strncasecmp(data, pattern, plen) != 0) {
 		return 0;
 	}
 	s = data + plen;
@@ -353,7 +353,7 @@ static int ip_vs_ftp_in(struct ip_vs_app *app, struct ip_vs_conn *cp,
 	data_limit = skb_tail_pointer(skb);
 
 	while (data <= data_limit - 6) {
-		if (strnicmp(data, "PASV\r\n", 6) == 0) {
+		if (strncasecmp(data, "PASV\r\n", 6) == 0) {
 			/* Passive mode on */
 			IP_VS_DBG(7, "got PASV at %td of %td\n",
 				  data - data_start,
diff --git a/net/netfilter/nf_conntrack_ftp.c b/net/netfilter/nf_conntrack_ftp.c
index b8a0924..b666959 100644
--- a/net/netfilter/nf_conntrack_ftp.c
+++ b/net/netfilter/nf_conntrack_ftp.c
@@ -304,12 +304,12 @@ static int find_pattern(const char *data, size_t dlen,
 
 	if (dlen <= plen) {
 		/* Short packet: try for partial? */
-		if (strnicmp(data, pattern, dlen) == 0)
+		if (strncasecmp(data, pattern, dlen) == 0)
 			return -1;
 		else return 0;
 	}
 
-	if (strnicmp(data, pattern, plen) != 0) {
+	if (strncasecmp(data, pattern, plen) != 0) {
 #if 0
 		size_t i;
 
diff --git a/net/netfilter/nf_conntrack_sip.c b/net/netfilter/nf_conntrack_sip.c
index 4c3ba1c..885b4ab 100644
--- a/net/netfilter/nf_conntrack_sip.c
+++ b/net/netfilter/nf_conntrack_sip.c
@@ -247,7 +247,7 @@ int ct_sip_parse_request(const struct nf_conn *ct,
 	for (; dptr < limit - strlen("sip:"); dptr++) {
 		if (*dptr == '\r' || *dptr == '\n')
 			return -1;
-		if (strnicmp(dptr, "sip:", strlen("sip:")) == 0) {
+		if (strncasecmp(dptr, "sip:", strlen("sip:")) == 0) {
 			dptr += strlen("sip:");
 			break;
 		}
@@ -350,7 +350,7 @@ static const char *ct_sip_header_search(const char *dptr, const char *limit,
 			continue;
 		}
 
-		if (strnicmp(dptr, needle, len) == 0)
+		if (strncasecmp(dptr, needle, len) == 0)
 			return dptr;
 	}
 	return NULL;
@@ -383,10 +383,10 @@ int ct_sip_get_header(const struct nf_conn *ct, const char *dptr,
 		/* Find header. Compact headers must be followed by a
 		 * non-alphabetic character to avoid mismatches. */
 		if (limit - dptr >= hdr->len &&
-		    strnicmp(dptr, hdr->name, hdr->len) == 0)
+		    strncasecmp(dptr, hdr->name, hdr->len) == 0)
 			dptr += hdr->len;
 		else if (hdr->cname && limit - dptr >= hdr->clen + 1 &&
-			 strnicmp(dptr, hdr->cname, hdr->clen) == 0 &&
+			 strncasecmp(dptr, hdr->cname, hdr->clen) == 0 &&
 			 !isalpha(*(dptr + hdr->clen)))
 			dptr += hdr->clen;
 		else
@@ -620,9 +620,9 @@ static int ct_sip_parse_transport(struct nf_conn *ct, const char *dptr,
 
 	if (ct_sip_parse_param(ct, dptr, dataoff, datalen, "transport=",
 			       &matchoff, &matchlen)) {
-		if (!strnicmp(dptr + matchoff, "TCP", strlen("TCP")))
+		if (!strncasecmp(dptr + matchoff, "TCP", strlen("TCP")))
 			*proto = IPPROTO_TCP;
-		else if (!strnicmp(dptr + matchoff, "UDP", strlen("UDP")))
+		else if (!strncasecmp(dptr + matchoff, "UDP", strlen("UDP")))
 			*proto = IPPROTO_UDP;
 		else
 			return 0;
@@ -743,10 +743,10 @@ int ct_sip_get_sdp_header(const struct nf_conn *ct, const char *dptr,
 
 		if (term != SDP_HDR_UNSPEC &&
 		    limit - dptr >= thdr->len &&
-		    strnicmp(dptr, thdr->name, thdr->len) == 0)
+		    strncasecmp(dptr, thdr->name, thdr->len) == 0)
 			break;
 		else if (limit - dptr >= hdr->len &&
-			 strnicmp(dptr, hdr->name, hdr->len) == 0)
+			 strncasecmp(dptr, hdr->name, hdr->len) == 0)
 			dptr += hdr->len;
 		else
 			continue;
@@ -1394,7 +1394,7 @@ static int process_sip_response(struct sk_buff *skb, unsigned int protoff,
 		if (handler->response == NULL)
 			continue;
 		if (*datalen < matchend + handler->len ||
-		    strnicmp(*dptr + matchend, handler->method, handler->len))
+		    strncasecmp(*dptr + matchend, handler->method, handler->len))
 			continue;
 		return handler->response(skb, protoff, dataoff, dptr, datalen,
 					 cseq, code);
@@ -1435,7 +1435,7 @@ static int process_sip_request(struct sk_buff *skb, unsigned int protoff,
 		if (handler->request == NULL)
 			continue;
 		if (*datalen < handler->len ||
-		    strnicmp(*dptr, handler->method, handler->len))
+		    strncasecmp(*dptr, handler->method, handler->len))
 			continue;
 
 		if (ct_sip_get_header(ct, *dptr, 0, *datalen, SIP_HDR_CSEQ,
@@ -1462,7 +1462,7 @@ static int process_sip_msg(struct sk_buff *skb, struct nf_conn *ct,
 	const struct nf_nat_sip_hooks *hooks;
 	int ret;
 
-	if (strnicmp(*dptr, "SIP/2.0 ", strlen("SIP/2.0 ")) != 0)
+	if (strncasecmp(*dptr, "SIP/2.0 ", strlen("SIP/2.0 ")) != 0)
 		ret = process_sip_request(skb, protoff, dataoff, dptr, datalen);
 	else
 		ret = process_sip_response(skb, protoff, dataoff, dptr, datalen);
diff --git a/net/netfilter/nf_log.c b/net/netfilter/nf_log.c
index daad602..d719764 100644
--- a/net/netfilter/nf_log.c
+++ b/net/netfilter/nf_log.c
@@ -30,7 +30,7 @@ static struct nf_logger *__find_logger(int pf, const char *str_logger)
 
 		log = rcu_dereference_protected(loggers[pf][i],
 						lockdep_is_held(&nf_log_mutex));
-		if (!strnicmp(str_logger, log->name, strlen(log->name)))
+		if (!strncasecmp(str_logger, log->name, strlen(log->name)))
 			return log;
 	}
 
diff --git a/net/netfilter/nf_nat_sip.c b/net/netfilter/nf_nat_sip.c
index b4d691d..791fac4 100644
--- a/net/netfilter/nf_nat_sip.c
+++ b/net/netfilter/nf_nat_sip.c
@@ -155,7 +155,7 @@ static unsigned int nf_nat_sip(struct sk_buff *skb, unsigned int protoff,
 	int request, in_header;
 
 	/* Basic rules: requests and responses. */
-	if (strnicmp(*dptr, "SIP/2.0", strlen("SIP/2.0")) != 0) {
+	if (strncasecmp(*dptr, "SIP/2.0", strlen("SIP/2.0")) != 0) {
 		if (ct_sip_parse_request(ct, *dptr, *datalen,
 					 &matchoff, &matchlen,
 					 &addr, &port) > 0 &&
-- 
2.0.4


^ permalink raw reply related	[flat|nested] 36+ messages in thread

* [PATCH 04/22] video: fbdev: Replace strnicmp with strncasecmp
  2014-09-16 20:51 [PATCH 00/22] treewide: Replace strnicmp with strncasecmp Rasmus Villemoes
                   ` (2 preceding siblings ...)
  2014-09-16 20:51 ` [PATCH 03/22] netfilter: " Rasmus Villemoes
@ 2014-09-16 20:51 ` Rasmus Villemoes
  2014-09-16 20:51 ` [PATCH 05/22] cifs: " Rasmus Villemoes
                   ` (18 subsequent siblings)
  22 siblings, 0 replies; 36+ messages in thread
From: Rasmus Villemoes @ 2014-09-16 20:51 UTC (permalink / raw)
  To: Andrew Morton
  Cc: linux-kernel, Rasmus Villemoes, Jean-Christophe Plagniol-Villard,
	Tomi Valkeinen, linux-fbdev, linux-arm-kernel, linux-samsung-soc

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: Jean-Christophe Plagniol-Villard <plagnioj@jcrosoft.com>
Cc: Tomi Valkeinen <tomi.valkeinen@ti.com>
Cc: linux-fbdev@vger.kernel.org
Cc: linux-arm-kernel@lists.infradead.org
Cc: linux-samsung-soc@vger.kernel.org
Signed-off-by: Rasmus Villemoes <linux@rasmusvillemoes.dk>
---
 drivers/video/fbdev/pvr2fb.c       |  2 +-
 drivers/video/fbdev/s3c2410fb.c    |  8 ++---
 drivers/video/fbdev/sis/sis_main.c | 66 +++++++++++++++++++-------------------
 drivers/video/fbdev/sm501fb.c      |  4 +--
 4 files changed, 40 insertions(+), 40 deletions(-)

diff --git a/drivers/video/fbdev/pvr2fb.c b/drivers/video/fbdev/pvr2fb.c
index 167cfff..7c74f58 100644
--- a/drivers/video/fbdev/pvr2fb.c
+++ b/drivers/video/fbdev/pvr2fb.c
@@ -1001,7 +1001,7 @@ static int pvr2_get_param(const struct pvr2_params *p, const char *s, int val,
 
 	for (i = 0 ; i < size ; i++ ) {
 		if (s != NULL) {
-			if (!strnicmp(p[i].name, s, strlen(s)))
+			if (!strncasecmp(p[i].name, s, strlen(s)))
 				return p[i].val;
 		} else {
 			if (p[i].val == val)
diff --git a/drivers/video/fbdev/s3c2410fb.c b/drivers/video/fbdev/s3c2410fb.c
index 43c63a4..e350eb5 100644
--- a/drivers/video/fbdev/s3c2410fb.c
+++ b/drivers/video/fbdev/s3c2410fb.c
@@ -601,12 +601,12 @@ static int s3c2410fb_debug_store(struct device *dev,
 	if (len < 1)
 		return -EINVAL;
 
-	if (strnicmp(buf, "on", 2) == 0 ||
-	    strnicmp(buf, "1", 1) == 0) {
+	if (strncasecmp(buf, "on", 2) == 0 ||
+	    strncasecmp(buf, "1", 1) == 0) {
 		debug = 1;
 		dev_dbg(dev, "s3c2410fb: Debug On");
-	} else if (strnicmp(buf, "off", 3) == 0 ||
-		   strnicmp(buf, "0", 1) == 0) {
+	} else if (strncasecmp(buf, "off", 3) == 0 ||
+		   strncasecmp(buf, "0", 1) == 0) {
 		debug = 0;
 		dev_dbg(dev, "s3c2410fb: Debug Off");
 	} else {
diff --git a/drivers/video/fbdev/sis/sis_main.c b/drivers/video/fbdev/sis/sis_main.c
index 3f12a2d..4f5cf03 100644
--- a/drivers/video/fbdev/sis/sis_main.c
+++ b/drivers/video/fbdev/sis/sis_main.c
@@ -162,7 +162,7 @@ static void sisfb_search_mode(char *name, bool quiet)
 		return;
 	}
 
-	if(!strnicmp(name, sisbios_mode[MODE_INDEX_NONE].name, strlen(name))) {
+	if(!strncasecmp(name, sisbios_mode[MODE_INDEX_NONE].name, strlen(name))) {
 		if(!quiet)
 			printk(KERN_ERR "sisfb: Mode 'none' not supported anymore. Using default.\n");
 
@@ -201,7 +201,7 @@ static void sisfb_search_mode(char *name, bool quiet)
 
 	i = 0; j = 0;
 	while(sisbios_mode[i].mode_no[0] != 0) {
-		if(!strnicmp(nameptr, sisbios_mode[i++].name, strlen(nameptr))) {
+		if(!strncasecmp(nameptr, sisbios_mode[i++].name, strlen(nameptr))) {
 			if(sisfb_fstn) {
 				if(sisbios_mode[i-1].mode_no[1] == 0x50 ||
 				   sisbios_mode[i-1].mode_no[1] == 0x56 ||
@@ -262,7 +262,7 @@ sisfb_search_crt2type(const char *name)
 	if(name == NULL) return;
 
 	while(sis_crt2type[i].type_no != -1) {
-		if(!strnicmp(name, sis_crt2type[i].name, strlen(sis_crt2type[i].name))) {
+		if(!strncasecmp(name, sis_crt2type[i].name, strlen(sis_crt2type[i].name))) {
 			sisfb_crt2type = sis_crt2type[i].type_no;
 			sisfb_tvplug = sis_crt2type[i].tvplug_no;
 			sisfb_crt2flags = sis_crt2type[i].flags;
@@ -289,7 +289,7 @@ sisfb_search_tvstd(const char *name)
 		return;
 
 	while(sis_tvtype[i].type_no != -1) {
-		if(!strnicmp(name, sis_tvtype[i].name, strlen(sis_tvtype[i].name))) {
+		if(!strncasecmp(name, sis_tvtype[i].name, strlen(sis_tvtype[i].name))) {
 			sisfb_tvstd = sis_tvtype[i].type_no;
 			break;
 		}
@@ -308,12 +308,12 @@ sisfb_search_specialtiming(const char *name)
 	if(name == NULL)
 		return;
 
-	if(!strnicmp(name, "none", 4)) {
+	if(!strncasecmp(name, "none", 4)) {
 		sisfb_specialtiming = CUT_FORCENONE;
 		printk(KERN_DEBUG "sisfb: Special timing disabled\n");
 	} else {
 		while(mycustomttable[i].chipID != 0) {
-			if(!strnicmp(name,mycustomttable[i].optionName,
+			if(!strncasecmp(name,mycustomttable[i].optionName,
 			   strlen(mycustomttable[i].optionName))) {
 				sisfb_specialtiming = mycustomttable[i].SpecialID;
 				found = true;
@@ -3952,68 +3952,68 @@ static int __init sisfb_setup(char *options)
 
 		if(!(*this_opt)) continue;
 
-		if(!strnicmp(this_opt, "off", 3)) {
+		if(!strncasecmp(this_opt, "off", 3)) {
 			sisfb_off = 1;
-		} else if(!strnicmp(this_opt, "forcecrt2type:", 14)) {
+		} else if(!strncasecmp(this_opt, "forcecrt2type:", 14)) {
 			/* Need to check crt2 type first for fstn/dstn */
 			sisfb_search_crt2type(this_opt + 14);
-		} else if(!strnicmp(this_opt, "tvmode:",7)) {
+		} else if(!strncasecmp(this_opt, "tvmode:",7)) {
 			sisfb_search_tvstd(this_opt + 7);
-		} else if(!strnicmp(this_opt, "tvstandard:",11)) {
+		} else if(!strncasecmp(this_opt, "tvstandard:",11)) {
 			sisfb_search_tvstd(this_opt + 11);
-		} else if(!strnicmp(this_opt, "mode:", 5)) {
+		} else if(!strncasecmp(this_opt, "mode:", 5)) {
 			sisfb_search_mode(this_opt + 5, false);
-		} else if(!strnicmp(this_opt, "vesa:", 5)) {
+		} else if(!strncasecmp(this_opt, "vesa:", 5)) {
 			sisfb_search_vesamode(simple_strtoul(this_opt + 5, NULL, 0), false);
-		} else if(!strnicmp(this_opt, "rate:", 5)) {
+		} else if(!strncasecmp(this_opt, "rate:", 5)) {
 			sisfb_parm_rate = simple_strtoul(this_opt + 5, NULL, 0);
-		} else if(!strnicmp(this_opt, "forcecrt1:", 10)) {
+		} else if(!strncasecmp(this_opt, "forcecrt1:", 10)) {
 			sisfb_forcecrt1 = (int)simple_strtoul(this_opt + 10, NULL, 0);
-		} else if(!strnicmp(this_opt, "mem:",4)) {
+		} else if(!strncasecmp(this_opt, "mem:",4)) {
 			sisfb_parm_mem = simple_strtoul(this_opt + 4, NULL, 0);
-		} else if(!strnicmp(this_opt, "pdc:", 4)) {
+		} else if(!strncasecmp(this_opt, "pdc:", 4)) {
 			sisfb_pdc = simple_strtoul(this_opt + 4, NULL, 0);
-		} else if(!strnicmp(this_opt, "pdc1:", 5)) {
+		} else if(!strncasecmp(this_opt, "pdc1:", 5)) {
 			sisfb_pdca = simple_strtoul(this_opt + 5, NULL, 0);
-		} else if(!strnicmp(this_opt, "noaccel", 7)) {
+		} else if(!strncasecmp(this_opt, "noaccel", 7)) {
 			sisfb_accel = 0;
-		} else if(!strnicmp(this_opt, "accel", 5)) {
+		} else if(!strncasecmp(this_opt, "accel", 5)) {
 			sisfb_accel = -1;
-		} else if(!strnicmp(this_opt, "noypan", 6)) {
+		} else if(!strncasecmp(this_opt, "noypan", 6)) {
 			sisfb_ypan = 0;
-		} else if(!strnicmp(this_opt, "ypan", 4)) {
+		} else if(!strncasecmp(this_opt, "ypan", 4)) {
 			sisfb_ypan = -1;
-		} else if(!strnicmp(this_opt, "nomax", 5)) {
+		} else if(!strncasecmp(this_opt, "nomax", 5)) {
 			sisfb_max = 0;
-		} else if(!strnicmp(this_opt, "max", 3)) {
+		} else if(!strncasecmp(this_opt, "max", 3)) {
 			sisfb_max = -1;
-		} else if(!strnicmp(this_opt, "userom:", 7)) {
+		} else if(!strncasecmp(this_opt, "userom:", 7)) {
 			sisfb_userom = (int)simple_strtoul(this_opt + 7, NULL, 0);
-		} else if(!strnicmp(this_opt, "useoem:", 7)) {
+		} else if(!strncasecmp(this_opt, "useoem:", 7)) {
 			sisfb_useoem = (int)simple_strtoul(this_opt + 7, NULL, 0);
-		} else if(!strnicmp(this_opt, "nocrt2rate", 10)) {
+		} else if(!strncasecmp(this_opt, "nocrt2rate", 10)) {
 			sisfb_nocrt2rate = 1;
-		} else if(!strnicmp(this_opt, "scalelcd:", 9)) {
+		} else if(!strncasecmp(this_opt, "scalelcd:", 9)) {
 			unsigned long temp = 2;
 			temp = simple_strtoul(this_opt + 9, NULL, 0);
 			if((temp == 0) || (temp == 1)) {
 			   sisfb_scalelcd = temp ^ 1;
 			}
-		} else if(!strnicmp(this_opt, "tvxposoffset:", 13)) {
+		} else if(!strncasecmp(this_opt, "tvxposoffset:", 13)) {
 			int temp = 0;
 			temp = (int)simple_strtol(this_opt + 13, NULL, 0);
 			if((temp >= -32) && (temp <= 32)) {
 			   sisfb_tvxposoffset = temp;
 			}
-		} else if(!strnicmp(this_opt, "tvyposoffset:", 13)) {
+		} else if(!strncasecmp(this_opt, "tvyposoffset:", 13)) {
 			int temp = 0;
 			temp = (int)simple_strtol(this_opt + 13, NULL, 0);
 			if((temp >= -32) && (temp <= 32)) {
 			   sisfb_tvyposoffset = temp;
 			}
-		} else if(!strnicmp(this_opt, "specialtiming:", 14)) {
+		} else if(!strncasecmp(this_opt, "specialtiming:", 14)) {
 			sisfb_search_specialtiming(this_opt + 14);
-		} else if(!strnicmp(this_opt, "lvdshl:", 7)) {
+		} else if(!strncasecmp(this_opt, "lvdshl:", 7)) {
 			int temp = 4;
 			temp = simple_strtoul(this_opt + 7, NULL, 0);
 			if((temp >= 0) && (temp <= 3)) {
@@ -4022,9 +4022,9 @@ static int __init sisfb_setup(char *options)
 		} else if(this_opt[0] >= '0' && this_opt[0] <= '9') {
 			sisfb_search_mode(this_opt, true);
 #if !defined(__i386__) && !defined(__x86_64__)
-		} else if(!strnicmp(this_opt, "resetcard", 9)) {
+		} else if(!strncasecmp(this_opt, "resetcard", 9)) {
 			sisfb_resetcard = 1;
-	        } else if(!strnicmp(this_opt, "videoram:", 9)) {
+	        } else if(!strncasecmp(this_opt, "videoram:", 9)) {
 			sisfb_videoram = simple_strtoul(this_opt + 9, NULL, 0);
 #endif
 		} else {
diff --git a/drivers/video/fbdev/sm501fb.c b/drivers/video/fbdev/sm501fb.c
index c2c8eb6..9e74e8f 100644
--- a/drivers/video/fbdev/sm501fb.c
+++ b/drivers/video/fbdev/sm501fb.c
@@ -1187,9 +1187,9 @@ static ssize_t sm501fb_crtsrc_store(struct device *dev,
 	if (len < 1)
 		return -EINVAL;
 
-	if (strnicmp(buf, "crt", 3) == 0)
+	if (strncasecmp(buf, "crt", 3) == 0)
 		head = HEAD_CRT;
-	else if (strnicmp(buf, "panel", 5) == 0)
+	else if (strncasecmp(buf, "panel", 5) == 0)
 		head = HEAD_PANEL;
 	else
 		return -EINVAL;
-- 
2.0.4


^ permalink raw reply related	[flat|nested] 36+ messages in thread

* [PATCH 05/22] cifs: Replace strnicmp with strncasecmp
  2014-09-16 20:51 [PATCH 00/22] treewide: Replace strnicmp with strncasecmp Rasmus Villemoes
                   ` (3 preceding siblings ...)
  2014-09-16 20:51 ` [PATCH 04/22] video: fbdev: " Rasmus Villemoes
@ 2014-09-16 20:51 ` Rasmus Villemoes
  2014-09-16 20:51 ` [PATCH 06/22] ocfs2: " Rasmus Villemoes
                   ` (17 subsequent siblings)
  22 siblings, 0 replies; 36+ messages in thread
From: Rasmus Villemoes @ 2014-09-16 20:51 UTC (permalink / raw)
  To: Andrew Morton
  Cc: linux-kernel, Rasmus Villemoes, Steve French, linux-cifs,
	samba-technical

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: Steve French <sfrench@samba.org>
Cc: linux-cifs@vger.kernel.org
Cc: samba-technical@lists.samba.org
Signed-off-by: Rasmus Villemoes <linux@rasmusvillemoes.dk>
---
 fs/cifs/cifs_dfs_ref.c | 6 +++---
 fs/cifs/connect.c      | 4 ++--
 2 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/fs/cifs/cifs_dfs_ref.c b/fs/cifs/cifs_dfs_ref.c
index 58df174..b8602f1 100644
--- a/fs/cifs/cifs_dfs_ref.c
+++ b/fs/cifs/cifs_dfs_ref.c
@@ -195,15 +195,15 @@ char *cifs_compose_mount_options(const char *sb_mountdata,
 		else
 			noff = tkn_e - (sb_mountdata + off) + 1;
 
-		if (strnicmp(sb_mountdata + off, "unc=", 4) == 0) {
+		if (strncasecmp(sb_mountdata + off, "unc=", 4) == 0) {
 			off += noff;
 			continue;
 		}
-		if (strnicmp(sb_mountdata + off, "ip=", 3) == 0) {
+		if (strncasecmp(sb_mountdata + off, "ip=", 3) == 0) {
 			off += noff;
 			continue;
 		}
-		if (strnicmp(sb_mountdata + off, "prefixpath=", 11) == 0) {
+		if (strncasecmp(sb_mountdata + off, "prefixpath=", 11) == 0) {
 			off += noff;
 			continue;
 		}
diff --git a/fs/cifs/connect.c b/fs/cifs/connect.c
index 8a9fded..48e079e 100644
--- a/fs/cifs/connect.c
+++ b/fs/cifs/connect.c
@@ -1705,7 +1705,7 @@ cifs_parse_mount_options(const char *mountdata, const char *devname,
 				goto cifs_parse_mount_err;
 			}
 
-			 if (strnicmp(string, "default", 7) != 0) {
+			 if (strncasecmp(string, "default", 7) != 0) {
 				vol->iocharset = kstrdup(string,
 							 GFP_KERNEL);
 				if (!vol->iocharset) {
@@ -1777,7 +1777,7 @@ cifs_parse_mount_options(const char *mountdata, const char *devname,
 			if (string == NULL)
 				goto out_nomem;
 
-			if (strnicmp(string, "1", 1) == 0) {
+			if (strncasecmp(string, "1", 1) == 0) {
 				/* This is the default */
 				break;
 			}
-- 
2.0.4


^ permalink raw reply related	[flat|nested] 36+ messages in thread

* [PATCH 06/22] ocfs2: Replace strnicmp with strncasecmp
  2014-09-16 20:51 [PATCH 00/22] treewide: Replace strnicmp with strncasecmp Rasmus Villemoes
                   ` (4 preceding siblings ...)
  2014-09-16 20:51 ` [PATCH 05/22] cifs: " Rasmus Villemoes
@ 2014-09-16 20:51 ` Rasmus Villemoes
  2014-09-16 20:51 ` [PATCH 07/22] isofs: " Rasmus Villemoes
                   ` (16 subsequent siblings)
  22 siblings, 0 replies; 36+ messages in thread
From: Rasmus Villemoes @ 2014-09-16 20:51 UTC (permalink / raw)
  To: Andrew Morton
  Cc: linux-kernel, Rasmus Villemoes, Mark Fasheh, Joel Becker, ocfs2-devel

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


^ permalink raw reply related	[flat|nested] 36+ messages in thread

* [PATCH 07/22] isofs: Replace strnicmp with strncasecmp
  2014-09-16 20:51 [PATCH 00/22] treewide: Replace strnicmp with strncasecmp Rasmus Villemoes
                   ` (5 preceding siblings ...)
  2014-09-16 20:51 ` [PATCH 06/22] ocfs2: " Rasmus Villemoes
@ 2014-09-16 20:51 ` Rasmus Villemoes
  2014-09-16 21:19   ` Jan Kara
  2014-09-16 20:51 ` [PATCH 08/22] ALSA: hda - " Rasmus Villemoes
                   ` (15 subsequent siblings)
  22 siblings, 1 reply; 36+ messages in thread
From: Rasmus Villemoes @ 2014-09-16 20:51 UTC (permalink / raw)
  To: Andrew Morton; +Cc: linux-kernel, Rasmus Villemoes, Jan Kara

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: Jan Kara <jack@suse.cz>
Signed-off-by: Rasmus Villemoes <linux@rasmusvillemoes.dk>
---
 fs/isofs/inode.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/fs/isofs/inode.c b/fs/isofs/inode.c
index 5ddaf86..881b3bd 100644
--- a/fs/isofs/inode.c
+++ b/fs/isofs/inode.c
@@ -247,7 +247,7 @@ static int isofs_dentry_cmp_common(
 	}
 	if (alen == blen) {
 		if (ci) {
-			if (strnicmp(name->name, str, alen) == 0)
+			if (strncasecmp(name->name, str, alen) == 0)
 				return 0;
 		} else {
 			if (strncmp(name->name, str, alen) == 0)
-- 
2.0.4


^ permalink raw reply related	[flat|nested] 36+ messages in thread

* [PATCH 08/22] ALSA: hda - Replace strnicmp with strncasecmp
  2014-09-16 20:51 [PATCH 00/22] treewide: Replace strnicmp with strncasecmp Rasmus Villemoes
                   ` (6 preceding siblings ...)
  2014-09-16 20:51 ` [PATCH 07/22] isofs: " Rasmus Villemoes
@ 2014-09-16 20:51 ` Rasmus Villemoes
  2014-09-17  5:54   ` Takashi Iwai
  2014-09-16 20:51 ` [PATCH 09/22] batman-adv: " Rasmus Villemoes
                   ` (14 subsequent siblings)
  22 siblings, 1 reply; 36+ messages in thread
From: Rasmus Villemoes @ 2014-09-16 20:51 UTC (permalink / raw)
  To: Andrew Morton
  Cc: linux-kernel, Rasmus Villemoes, Jaroslav Kysela, Takashi Iwai,
	alsa-devel

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: Jaroslav Kysela <perex@perex.cz>
Cc: Takashi Iwai <tiwai@suse.de>
Cc: alsa-devel@alsa-project.org
Signed-off-by: Rasmus Villemoes <linux@rasmusvillemoes.dk>
---
 sound/pci/hda/hda_sysfs.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/sound/pci/hda/hda_sysfs.c b/sound/pci/hda/hda_sysfs.c
index e207909..9b49f15 100644
--- a/sound/pci/hda/hda_sysfs.c
+++ b/sound/pci/hda/hda_sysfs.c
@@ -514,7 +514,7 @@ enum {
 
 static inline int strmatch(const char *a, const char *b)
 {
-	return strnicmp(a, b, strlen(b)) == 0;
+	return strncasecmp(a, b, strlen(b)) == 0;
 }
 
 /* parse the contents after the line "[codec]"
-- 
2.0.4


^ permalink raw reply related	[flat|nested] 36+ messages in thread

* [PATCH 09/22] batman-adv: Replace strnicmp with strncasecmp
  2014-09-16 20:51 [PATCH 00/22] treewide: Replace strnicmp with strncasecmp Rasmus Villemoes
                   ` (7 preceding siblings ...)
  2014-09-16 20:51 ` [PATCH 08/22] ALSA: hda - " Rasmus Villemoes
@ 2014-09-16 20:51 ` 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
                   ` (13 subsequent siblings)
  22 siblings, 1 reply; 36+ messages in thread
From: Rasmus Villemoes @ 2014-09-16 20:51 UTC (permalink / raw)
  To: Andrew Morton
  Cc: linux-kernel, Rasmus Villemoes, Marek Lindner, b.a.t.m.a.n, netdev

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: Marek Lindner <mareklindner@neomailbox.ch>
Cc: b.a.t.m.a.n@lists.open-mesh.org
Cc: netdev@vger.kernel.org
Signed-off-by: Rasmus Villemoes <linux@rasmusvillemoes.dk>
---
 net/batman-adv/gateway_common.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/net/batman-adv/gateway_common.c b/net/batman-adv/gateway_common.c
index 6f5e621..88a1bc3 100644
--- a/net/batman-adv/gateway_common.c
+++ b/net/batman-adv/gateway_common.c
@@ -44,10 +44,10 @@ static bool batadv_parse_gw_bandwidth(struct net_device *net_dev, char *buff,
 	if (strlen(buff) > 4) {
 		tmp_ptr = buff + strlen(buff) - 4;
 
-		if (strnicmp(tmp_ptr, "mbit", 4) == 0)
+		if (strncasecmp(tmp_ptr, "mbit", 4) == 0)
 			bw_unit_type = BATADV_BW_UNIT_MBIT;
 
-		if ((strnicmp(tmp_ptr, "kbit", 4) == 0) ||
+		if ((strncasecmp(tmp_ptr, "kbit", 4) == 0) ||
 		    (bw_unit_type == BATADV_BW_UNIT_MBIT))
 			*tmp_ptr = '\0';
 	}
@@ -77,10 +77,10 @@ static bool batadv_parse_gw_bandwidth(struct net_device *net_dev, char *buff,
 		if (strlen(slash_ptr + 1) > 4) {
 			tmp_ptr = slash_ptr + 1 - 4 + strlen(slash_ptr + 1);
 
-			if (strnicmp(tmp_ptr, "mbit", 4) == 0)
+			if (strncasecmp(tmp_ptr, "mbit", 4) == 0)
 				bw_unit_type = BATADV_BW_UNIT_MBIT;
 
-			if ((strnicmp(tmp_ptr, "kbit", 4) == 0) ||
+			if ((strncasecmp(tmp_ptr, "kbit", 4) == 0) ||
 			    (bw_unit_type == BATADV_BW_UNIT_MBIT))
 				*tmp_ptr = '\0';
 		}
-- 
2.0.4


^ permalink raw reply related	[flat|nested] 36+ messages in thread

* [PATCH 10/22] ACPI / battery: Replace strnicmp with strncasecmp
  2014-09-16 20:51 [PATCH 00/22] treewide: Replace strnicmp with strncasecmp Rasmus Villemoes
                   ` (8 preceding siblings ...)
  2014-09-16 20:51 ` [PATCH 09/22] batman-adv: " Rasmus Villemoes
@ 2014-09-16 20:51 ` Rasmus Villemoes
  2014-09-25 23:46   ` Rafael J. Wysocki
  2014-09-16 20:51 ` [PATCH 11/22] cpufreq: " Rasmus Villemoes
                   ` (12 subsequent siblings)
  22 siblings, 1 reply; 36+ messages in thread
From: Rasmus Villemoes @ 2014-09-16 20:51 UTC (permalink / raw)
  To: Andrew Morton
  Cc: linux-kernel, Rasmus Villemoes, Rafael J. Wysocki, Len Brown, linux-acpi

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: "Rafael J. Wysocki" <rjw@rjwysocki.net>
Cc: Len Brown <lenb@kernel.org>
Cc: linux-acpi@vger.kernel.org
Signed-off-by: Rasmus Villemoes <linux@rasmusvillemoes.dk>
---
 drivers/acpi/battery.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/acpi/battery.c b/drivers/acpi/battery.c
index 5fdfe65..8ec8a89 100644
--- a/drivers/acpi/battery.c
+++ b/drivers/acpi/battery.c
@@ -695,7 +695,7 @@ static void acpi_battery_quirks(struct acpi_battery *battery)
 	if (battery->power_unit && dmi_name_in_vendors("LENOVO")) {
 		const char *s;
 		s = dmi_get_system_info(DMI_PRODUCT_VERSION);
-		if (s && !strnicmp(s, "ThinkPad", 8)) {
+		if (s && !strncasecmp(s, "ThinkPad", 8)) {
 			dmi_walk(find_battery, battery);
 			if (test_bit(ACPI_BATTERY_QUIRK_THINKPAD_MAH,
 				     &battery->flags) &&
-- 
2.0.4


^ permalink raw reply related	[flat|nested] 36+ messages in thread

* [PATCH 11/22] cpufreq: Replace strnicmp with strncasecmp
  2014-09-16 20:51 [PATCH 00/22] treewide: Replace strnicmp with strncasecmp Rasmus Villemoes
                   ` (9 preceding siblings ...)
  2014-09-16 20:51 ` [PATCH 10/22] ACPI / battery: " Rasmus Villemoes
@ 2014-09-16 20:51 ` Rasmus Villemoes
  2014-09-16 21:22   ` Viresh Kumar
  2014-09-16 20:51 ` [PATCH 12/22] cpuidle: " Rasmus Villemoes
                   ` (11 subsequent siblings)
  22 siblings, 1 reply; 36+ messages in thread
From: Rasmus Villemoes @ 2014-09-16 20:51 UTC (permalink / raw)
  To: Andrew Morton
  Cc: linux-kernel, Rasmus Villemoes, Rafael J. Wysocki, Viresh Kumar,
	linux-pm

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: "Rafael J. Wysocki" <rjw@rjwysocki.net>
Cc: Viresh Kumar <viresh.kumar@linaro.org>
Cc: linux-pm@vger.kernel.org
Signed-off-by: Rasmus Villemoes <linux@rasmusvillemoes.dk>
---
 drivers/cpufreq/cpufreq.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/cpufreq/cpufreq.c b/drivers/cpufreq/cpufreq.c
index d9fdedd..3330f51 100644
--- a/drivers/cpufreq/cpufreq.c
+++ b/drivers/cpufreq/cpufreq.c
@@ -437,7 +437,7 @@ static struct cpufreq_governor *__find_governor(const char *str_governor)
 	struct cpufreq_governor *t;
 
 	list_for_each_entry(t, &cpufreq_governor_list, governor_list)
-		if (!strnicmp(str_governor, t->name, CPUFREQ_NAME_LEN))
+		if (!strncasecmp(str_governor, t->name, CPUFREQ_NAME_LEN))
 			return t;
 
 	return NULL;
@@ -455,10 +455,10 @@ static int cpufreq_parse_governor(char *str_governor, unsigned int *policy,
 		goto out;
 
 	if (cpufreq_driver->setpolicy) {
-		if (!strnicmp(str_governor, "performance", CPUFREQ_NAME_LEN)) {
+		if (!strncasecmp(str_governor, "performance", CPUFREQ_NAME_LEN)) {
 			*policy = CPUFREQ_POLICY_PERFORMANCE;
 			err = 0;
-		} else if (!strnicmp(str_governor, "powersave",
+		} else if (!strncasecmp(str_governor, "powersave",
 						CPUFREQ_NAME_LEN)) {
 			*policy = CPUFREQ_POLICY_POWERSAVE;
 			err = 0;
-- 
2.0.4


^ permalink raw reply related	[flat|nested] 36+ messages in thread

* [PATCH 12/22] cpuidle: Replace strnicmp with strncasecmp
  2014-09-16 20:51 [PATCH 00/22] treewide: Replace strnicmp with strncasecmp Rasmus Villemoes
                   ` (10 preceding siblings ...)
  2014-09-16 20:51 ` [PATCH 11/22] cpufreq: " Rasmus Villemoes
@ 2014-09-16 20:51 ` Rasmus Villemoes
  2014-09-25 23:52   ` Rafael J. Wysocki
  2014-09-16 20:51 ` [PATCH 13/22] scsi: " Rasmus Villemoes
                   ` (10 subsequent siblings)
  22 siblings, 1 reply; 36+ messages in thread
From: Rasmus Villemoes @ 2014-09-16 20:51 UTC (permalink / raw)
  To: Andrew Morton
  Cc: linux-kernel, Rasmus Villemoes, Rafael J. Wysocki,
	Daniel Lezcano, linux-pm

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: "Rafael J. Wysocki" <rjw@rjwysocki.net>
Cc: Daniel Lezcano <daniel.lezcano@linaro.org>
Cc: linux-pm@vger.kernel.org
Signed-off-by: Rasmus Villemoes <linux@rasmusvillemoes.dk>
---
 drivers/cpuidle/governor.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/cpuidle/governor.c b/drivers/cpuidle/governor.c
index ca89412..fb9f511 100644
--- a/drivers/cpuidle/governor.c
+++ b/drivers/cpuidle/governor.c
@@ -28,7 +28,7 @@ static struct cpuidle_governor * __cpuidle_find_governor(const char *str)
 	struct cpuidle_governor *gov;
 
 	list_for_each_entry(gov, &cpuidle_governors, governor_list)
-		if (!strnicmp(str, gov->name, CPUIDLE_NAME_LEN))
+		if (!strncasecmp(str, gov->name, CPUIDLE_NAME_LEN))
 			return gov;
 
 	return NULL;
-- 
2.0.4


^ permalink raw reply related	[flat|nested] 36+ messages in thread

* [PATCH 13/22] scsi: Replace strnicmp with strncasecmp
  2014-09-16 20:51 [PATCH 00/22] treewide: Replace strnicmp with strncasecmp Rasmus Villemoes
                   ` (11 preceding siblings ...)
  2014-09-16 20:51 ` [PATCH 12/22] cpuidle: " Rasmus Villemoes
@ 2014-09-16 20:51 ` Rasmus Villemoes
  2014-09-16 20:51 ` [PATCH 14/22] ib_srpt: " Rasmus Villemoes
                   ` (9 subsequent siblings)
  22 siblings, 0 replies; 36+ messages in thread
From: Rasmus Villemoes @ 2014-09-16 20:51 UTC (permalink / raw)
  To: Andrew Morton
  Cc: linux-kernel, Rasmus Villemoes, Adaptec OEM Raid Solutions,
	James E.J. Bottomley, linux-scsi

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: Adaptec OEM Raid Solutions <aacraid@adaptec.com>
Cc: "James E.J. Bottomley" <JBottomley@parallels.com>
Cc: linux-scsi@vger.kernel.org
Signed-off-by: Rasmus Villemoes <linux@rasmusvillemoes.dk>
---
 drivers/scsi/ips.c        | 2 +-
 drivers/scsi/scsi_debug.c | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/scsi/ips.c b/drivers/scsi/ips.c
index 52a216f..e5afc38 100644
--- a/drivers/scsi/ips.c
+++ b/drivers/scsi/ips.c
@@ -528,7 +528,7 @@ ips_setup(char *ips_str)
 		 * Update the variables
 		 */
 		for (i = 0; i < ARRAY_SIZE(options); i++) {
-			if (strnicmp
+			if (strncasecmp
 			    (key, options[i].option_name,
 			     strlen(options[i].option_name)) == 0) {
 				if (value)
diff --git a/drivers/scsi/scsi_debug.c b/drivers/scsi/scsi_debug.c
index d19c0e3..c81af36 100644
--- a/drivers/scsi/scsi_debug.c
+++ b/drivers/scsi/scsi_debug.c
@@ -3367,7 +3367,7 @@ static ssize_t opts_store(struct device_driver *ddp, const char *buf,
 	char work[20];
 
         if (1 == sscanf(buf, "%10s", work)) {
-		if (0 == strnicmp(work,"0x", 2)) {
+		if (0 == strncasecmp(work,"0x", 2)) {
 			if (1 == sscanf(&work[2], "%x", &opts))
 				goto opts_done;
 		} else {
-- 
2.0.4


^ permalink raw reply related	[flat|nested] 36+ messages in thread

* [PATCH 14/22] ib_srpt: Replace strnicmp with strncasecmp
  2014-09-16 20:51 [PATCH 00/22] treewide: Replace strnicmp with strncasecmp Rasmus Villemoes
                   ` (12 preceding siblings ...)
  2014-09-16 20:51 ` [PATCH 13/22] scsi: " Rasmus Villemoes
@ 2014-09-16 20:51 ` Rasmus Villemoes
  2014-09-16 20:51 ` [PATCH 15/22] Input: edt-ft5x06 - " Rasmus Villemoes
                   ` (8 subsequent siblings)
  22 siblings, 0 replies; 36+ messages in thread
From: Rasmus Villemoes @ 2014-09-16 20:51 UTC (permalink / raw)
  To: Andrew Morton
  Cc: linux-kernel, Rasmus Villemoes, Roland Dreier,
	Nicholas Bellinger, linux-rdma

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: Roland Dreier <roland@kernel.org>
Cc: Nicholas Bellinger <nab@linux-iscsi.org>
Cc: linux-rdma@vger.kernel.org
Signed-off-by: Rasmus Villemoes <linux@rasmusvillemoes.dk>
---
 drivers/infiniband/ulp/srpt/ib_srpt.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/infiniband/ulp/srpt/ib_srpt.c b/drivers/infiniband/ulp/srpt/ib_srpt.c
index d28a8c2..7206547 100644
--- a/drivers/infiniband/ulp/srpt/ib_srpt.c
+++ b/drivers/infiniband/ulp/srpt/ib_srpt.c
@@ -3574,7 +3574,7 @@ static int srpt_parse_i_port_id(u8 i_port_id[16], const char *name)
 	int ret, rc;
 
 	p = name;
-	if (strnicmp(p, "0x", 2) == 0)
+	if (strncasecmp(p, "0x", 2) == 0)
 		p += 2;
 	ret = -EINVAL;
 	len = strlen(p);
-- 
2.0.4


^ permalink raw reply related	[flat|nested] 36+ messages in thread

* [PATCH 15/22] Input: edt-ft5x06 - Replace strnicmp with strncasecmp
  2014-09-16 20:51 [PATCH 00/22] treewide: Replace strnicmp with strncasecmp Rasmus Villemoes
                   ` (13 preceding siblings ...)
  2014-09-16 20:51 ` [PATCH 14/22] ib_srpt: " Rasmus Villemoes
@ 2014-09-16 20:51 ` Rasmus Villemoes
  2014-09-17 16:26   ` Dmitry Torokhov
  2014-09-16 20:51 ` [PATCH 16/22] altera-stapl: " Rasmus Villemoes
                   ` (7 subsequent siblings)
  22 siblings, 1 reply; 36+ messages in thread
From: Rasmus Villemoes @ 2014-09-16 20:51 UTC (permalink / raw)
  To: Andrew Morton
  Cc: linux-kernel, Rasmus Villemoes, Dmitry Torokhov, linux-input

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: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Cc: linux-input@vger.kernel.org
Signed-off-by: Rasmus Villemoes <linux@rasmusvillemoes.dk>
---
 drivers/input/touchscreen/edt-ft5x06.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/input/touchscreen/edt-ft5x06.c b/drivers/input/touchscreen/edt-ft5x06.c
index 8857d5b..ee3434f 100644
--- a/drivers/input/touchscreen/edt-ft5x06.c
+++ b/drivers/input/touchscreen/edt-ft5x06.c
@@ -812,7 +812,7 @@ static int edt_ft5x06_ts_identify(struct i2c_client *client,
 	/* if we find something consistent, stay with that assumption
 	 * at least M09 won't send 3 bytes here
 	 */
-	if (!(strnicmp(rdbuf + 1, "EP0", 3))) {
+	if (!(strncasecmp(rdbuf + 1, "EP0", 3))) {
 		tsdata->version = M06;
 
 		/* remove last '$' end marker */
-- 
2.0.4


^ permalink raw reply related	[flat|nested] 36+ messages in thread

* [PATCH 16/22] altera-stapl: Replace strnicmp with strncasecmp
  2014-09-16 20:51 [PATCH 00/22] treewide: Replace strnicmp with strncasecmp Rasmus Villemoes
                   ` (14 preceding siblings ...)
  2014-09-16 20:51 ` [PATCH 15/22] Input: edt-ft5x06 - " Rasmus Villemoes
@ 2014-09-16 20:51 ` Rasmus Villemoes
  2014-09-16 20:51 ` [PATCH 17/22] thinkpad_acpi: " Rasmus Villemoes
                   ` (6 subsequent siblings)
  22 siblings, 0 replies; 36+ messages in thread
From: Rasmus Villemoes @ 2014-09-16 20:51 UTC (permalink / raw)
  To: Andrew Morton; +Cc: linux-kernel, Rasmus Villemoes, Igor M. Liplianin

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: "Igor M. Liplianin" <liplianin@netup.ru>
Signed-off-by: Rasmus Villemoes <linux@rasmusvillemoes.dk>
---
 drivers/misc/altera-stapl/altera.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/misc/altera-stapl/altera.c b/drivers/misc/altera-stapl/altera.c
index 24272e0..bca2630 100644
--- a/drivers/misc/altera-stapl/altera.c
+++ b/drivers/misc/altera-stapl/altera.c
@@ -454,7 +454,7 @@ exit_done:
 
 				name = &p[str_table + name_id];
 
-				if (strnicmp(aconf->action, name, strlen(name)) == 0) {
+				if (strncasecmp(aconf->action, name, strlen(name)) == 0) {
 					action_found = 1;
 					current_proc =
 						get_unaligned_be32(&p[action_table +
@@ -2176,7 +2176,7 @@ static int altera_get_note(u8 *p, s32 program_size,
 			key_ptr = &p[note_strings +
 					get_unaligned_be32(
 					&p[note_table + (8 * i)])];
-			if ((strnicmp(key, key_ptr, strlen(key_ptr)) == 0) &&
+			if ((strncasecmp(key, key_ptr, strlen(key_ptr)) == 0) &&
 						(key != NULL)) {
 				status = 0;
 
-- 
2.0.4


^ permalink raw reply related	[flat|nested] 36+ messages in thread

* [PATCH 17/22] thinkpad_acpi: Replace strnicmp with strncasecmp
  2014-09-16 20:51 [PATCH 00/22] treewide: Replace strnicmp with strncasecmp Rasmus Villemoes
                   ` (15 preceding siblings ...)
  2014-09-16 20:51 ` [PATCH 16/22] altera-stapl: " Rasmus Villemoes
@ 2014-09-16 20:51 ` Rasmus Villemoes
  2014-09-16 22:08   ` Darren Hart
  2014-09-16 20:51 ` [PATCH 18/22] PNP: " Rasmus Villemoes
                   ` (5 subsequent siblings)
  22 siblings, 1 reply; 36+ messages in thread
From: Rasmus Villemoes @ 2014-09-16 20:51 UTC (permalink / raw)
  To: Andrew Morton
  Cc: linux-kernel, Rasmus Villemoes, Henrique de Moraes Holschuh,
	Darren Hart, ibm-acpi-devel, platform-driver-x86

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: Henrique de Moraes Holschuh <ibm-acpi@hmh.eng.br>
Cc: Darren Hart <dvhart@infradead.org>
Cc: ibm-acpi-devel@lists.sourceforge.net
Cc: platform-driver-x86@vger.kernel.org
Signed-off-by: Rasmus Villemoes <linux@rasmusvillemoes.dk>
---
 drivers/platform/x86/thinkpad_acpi.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/platform/x86/thinkpad_acpi.c b/drivers/platform/x86/thinkpad_acpi.c
index 3bbc6eb..f6a14c0 100644
--- a/drivers/platform/x86/thinkpad_acpi.c
+++ b/drivers/platform/x86/thinkpad_acpi.c
@@ -8878,13 +8878,13 @@ static int __must_check __init get_thinkpad_model_data(
 	}
 
 	s = dmi_get_system_info(DMI_PRODUCT_VERSION);
-	if (s && !(strnicmp(s, "ThinkPad", 8) && strnicmp(s, "Lenovo", 6))) {
+	if (s && !(strncasecmp(s, "ThinkPad", 8) && strncasecmp(s, "Lenovo", 6))) {
 		tp->model_str = kstrdup(s, GFP_KERNEL);
 		if (!tp->model_str)
 			return -ENOMEM;
 	} else {
 		s = dmi_get_system_info(DMI_BIOS_VENDOR);
-		if (s && !(strnicmp(s, "Lenovo", 6))) {
+		if (s && !(strncasecmp(s, "Lenovo", 6))) {
 			tp->model_str = kstrdup(s, GFP_KERNEL);
 			if (!tp->model_str)
 				return -ENOMEM;
-- 
2.0.4


^ permalink raw reply related	[flat|nested] 36+ messages in thread

* [PATCH 18/22] PNP: Replace strnicmp with strncasecmp
  2014-09-16 20:51 [PATCH 00/22] treewide: Replace strnicmp with strncasecmp Rasmus Villemoes
                   ` (16 preceding siblings ...)
  2014-09-16 20:51 ` [PATCH 17/22] thinkpad_acpi: " Rasmus Villemoes
@ 2014-09-16 20:51 ` Rasmus Villemoes
  2014-09-16 20:51 ` [PATCH 19/22] s390/cio: " Rasmus Villemoes
                   ` (4 subsequent siblings)
  22 siblings, 0 replies; 36+ messages in thread
From: Rasmus Villemoes @ 2014-09-16 20:51 UTC (permalink / raw)
  To: Andrew Morton; +Cc: linux-kernel, Rasmus Villemoes, Rafael J. Wysocki

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: "Rafael J. Wysocki" <rafael.j.wysocki@intel.com>
Signed-off-by: Rasmus Villemoes <linux@rasmusvillemoes.dk>
---
 drivers/pnp/interface.c | 24 ++++++++++++------------
 1 file changed, 12 insertions(+), 12 deletions(-)

diff --git a/drivers/pnp/interface.c b/drivers/pnp/interface.c
index e6c403b..4b6808f 100644
--- a/drivers/pnp/interface.c
+++ b/drivers/pnp/interface.c
@@ -346,41 +346,41 @@ static ssize_t resources_store(struct device *dmdev,
 	}
 
 	buf = skip_spaces(buf);
-	if (!strnicmp(buf, "disable", 7)) {
+	if (!strncasecmp(buf, "disable", 7)) {
 		retval = pnp_disable_dev(dev);
 		goto done;
 	}
-	if (!strnicmp(buf, "activate", 8)) {
+	if (!strncasecmp(buf, "activate", 8)) {
 		retval = pnp_activate_dev(dev);
 		goto done;
 	}
-	if (!strnicmp(buf, "fill", 4)) {
+	if (!strncasecmp(buf, "fill", 4)) {
 		if (dev->active)
 			goto done;
 		retval = pnp_auto_config_dev(dev);
 		goto done;
 	}
-	if (!strnicmp(buf, "auto", 4)) {
+	if (!strncasecmp(buf, "auto", 4)) {
 		if (dev->active)
 			goto done;
 		pnp_init_resources(dev);
 		retval = pnp_auto_config_dev(dev);
 		goto done;
 	}
-	if (!strnicmp(buf, "clear", 5)) {
+	if (!strncasecmp(buf, "clear", 5)) {
 		if (dev->active)
 			goto done;
 		pnp_init_resources(dev);
 		goto done;
 	}
-	if (!strnicmp(buf, "get", 3)) {
+	if (!strncasecmp(buf, "get", 3)) {
 		mutex_lock(&pnp_res_mutex);
 		if (pnp_can_read(dev))
 			dev->protocol->get(dev);
 		mutex_unlock(&pnp_res_mutex);
 		goto done;
 	}
-	if (!strnicmp(buf, "set", 3)) {
+	if (!strncasecmp(buf, "set", 3)) {
 		resource_size_t start;
 		resource_size_t end;
 		unsigned long flags;
@@ -392,31 +392,31 @@ static ssize_t resources_store(struct device *dmdev,
 		mutex_lock(&pnp_res_mutex);
 		while (1) {
 			buf = skip_spaces(buf);
-			if (!strnicmp(buf, "io", 2)) {
+			if (!strncasecmp(buf, "io", 2)) {
 				buf = pnp_get_resource_value(buf + 2,
 							     IORESOURCE_IO,
 							     &start, &end,
 							     &flags);
 				pnp_add_io_resource(dev, start, end, flags);
-			} else if (!strnicmp(buf, "mem", 3)) {
+			} else if (!strncasecmp(buf, "mem", 3)) {
 				buf = pnp_get_resource_value(buf + 3,
 							     IORESOURCE_MEM,
 							     &start, &end,
 							     &flags);
 				pnp_add_mem_resource(dev, start, end, flags);
-			} else if (!strnicmp(buf, "irq", 3)) {
+			} else if (!strncasecmp(buf, "irq", 3)) {
 				buf = pnp_get_resource_value(buf + 3,
 							     IORESOURCE_IRQ,
 							     &start, NULL,
 							     &flags);
 				pnp_add_irq_resource(dev, start, flags);
-			} else if (!strnicmp(buf, "dma", 3)) {
+			} else if (!strncasecmp(buf, "dma", 3)) {
 				buf = pnp_get_resource_value(buf + 3,
 							     IORESOURCE_DMA,
 							     &start, NULL,
 							     &flags);
 				pnp_add_dma_resource(dev, start, flags);
-			} else if (!strnicmp(buf, "bus", 3)) {
+			} else if (!strncasecmp(buf, "bus", 3)) {
 				buf = pnp_get_resource_value(buf + 3,
 							     IORESOURCE_BUS,
 							     &start, &end,
-- 
2.0.4


^ permalink raw reply related	[flat|nested] 36+ messages in thread

* [PATCH 19/22] s390/cio: Replace strnicmp with strncasecmp
  2014-09-16 20:51 [PATCH 00/22] treewide: Replace strnicmp with strncasecmp Rasmus Villemoes
                   ` (17 preceding siblings ...)
  2014-09-16 20:51 ` [PATCH 18/22] PNP: " Rasmus Villemoes
@ 2014-09-16 20:51 ` Rasmus Villemoes
  2014-09-16 20:51 ` [PATCH 20/22] staging: r8188eu: " Rasmus Villemoes
                   ` (3 subsequent siblings)
  22 siblings, 0 replies; 36+ messages in thread
From: Rasmus Villemoes @ 2014-09-16 20:51 UTC (permalink / raw)
  To: Andrew Morton
  Cc: linux-kernel, Rasmus Villemoes, Sebastian Ott,
	Peter Oberparleiter, linux390, linux-s390

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: Sebastian Ott <sebott@linux.vnet.ibm.com>
Cc: Peter Oberparleiter <oberpar@linux.vnet.ibm.com>
Cc: linux390@de.ibm.com
Cc: linux-s390@vger.kernel.org
Signed-off-by: Rasmus Villemoes <linux@rasmusvillemoes.dk>
---
 drivers/s390/cio/chp.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/s390/cio/chp.c b/drivers/s390/cio/chp.c
index d497aa0..c692dfe 100644
--- a/drivers/s390/cio/chp.c
+++ b/drivers/s390/cio/chp.c
@@ -257,11 +257,11 @@ static ssize_t chp_status_write(struct device *dev,
 	if (!num_args)
 		return count;
 
-	if (!strnicmp(cmd, "on", 2) || !strcmp(cmd, "1")) {
+	if (!strncasecmp(cmd, "on", 2) || !strcmp(cmd, "1")) {
 		mutex_lock(&cp->lock);
 		error = s390_vary_chpid(cp->chpid, 1);
 		mutex_unlock(&cp->lock);
-	} else if (!strnicmp(cmd, "off", 3) || !strcmp(cmd, "0")) {
+	} else if (!strncasecmp(cmd, "off", 3) || !strcmp(cmd, "0")) {
 		mutex_lock(&cp->lock);
 		error = s390_vary_chpid(cp->chpid, 0);
 		mutex_unlock(&cp->lock);
-- 
2.0.4


^ permalink raw reply related	[flat|nested] 36+ messages in thread

* [PATCH 20/22] staging: r8188eu: Replace strnicmp with strncasecmp
  2014-09-16 20:51 [PATCH 00/22] treewide: Replace strnicmp with strncasecmp Rasmus Villemoes
                   ` (18 preceding siblings ...)
  2014-09-16 20:51 ` [PATCH 19/22] s390/cio: " Rasmus Villemoes
@ 2014-09-16 20:51 ` Rasmus Villemoes
  2014-09-16 20:51 ` [PATCH 21/22] Thermal: " Rasmus Villemoes
                   ` (2 subsequent siblings)
  22 siblings, 0 replies; 36+ messages in thread
From: Rasmus Villemoes @ 2014-09-16 20:51 UTC (permalink / raw)
  To: Andrew Morton
  Cc: linux-kernel, Rasmus Villemoes, Greg Kroah-Hartman, Larry Finger, devel

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: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Larry Finger <Larry.Finger@lwfinger.net>
Cc: devel@driverdev.osuosl.org
Signed-off-by: Rasmus Villemoes <linux@rasmusvillemoes.dk>
---
 drivers/staging/rtl8188eu/os_dep/rtw_android.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/rtl8188eu/os_dep/rtw_android.c b/drivers/staging/rtl8188eu/os_dep/rtw_android.c
index ca2736d..2b5ddc3 100644
--- a/drivers/staging/rtl8188eu/os_dep/rtw_android.c
+++ b/drivers/staging/rtl8188eu/os_dep/rtw_android.c
@@ -79,7 +79,7 @@ int rtw_android_cmdstr_to_num(char *cmdstr)
 {
 	int cmd_num;
 	for (cmd_num = 0; cmd_num < ANDROID_WIFI_CMD_MAX; cmd_num++)
-		if (0 == strnicmp(cmdstr , android_wifi_cmd_str[cmd_num],
+		if (0 == strncasecmp(cmdstr , android_wifi_cmd_str[cmd_num],
 				  strlen(android_wifi_cmd_str[cmd_num])))
 			break;
 	return cmd_num;
-- 
2.0.4


^ permalink raw reply related	[flat|nested] 36+ messages in thread

* [PATCH 21/22] Thermal: Replace strnicmp with strncasecmp
  2014-09-16 20:51 [PATCH 00/22] treewide: Replace strnicmp with strncasecmp Rasmus Villemoes
                   ` (19 preceding siblings ...)
  2014-09-16 20:51 ` [PATCH 20/22] staging: r8188eu: " Rasmus Villemoes
@ 2014-09-16 20:51 ` 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
  22 siblings, 1 reply; 36+ messages in thread
From: Rasmus Villemoes @ 2014-09-16 20:51 UTC (permalink / raw)
  To: Andrew Morton
  Cc: linux-kernel, Rasmus Villemoes, Zhang Rui, Eduardo Valentin, linux-pm

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: Zhang Rui <rui.zhang@intel.com>
Cc: Eduardo Valentin <edubezval@gmail.com>
Cc: linux-pm@vger.kernel.org
Signed-off-by: Rasmus Villemoes <linux@rasmusvillemoes.dk>
---
 drivers/thermal/thermal_core.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/thermal/thermal_core.c b/drivers/thermal/thermal_core.c
index 71b0ec0..1e23f4f 100644
--- a/drivers/thermal/thermal_core.c
+++ b/drivers/thermal/thermal_core.c
@@ -66,7 +66,7 @@ static struct thermal_governor *__find_governor(const char *name)
 		return def_governor;
 
 	list_for_each_entry(pos, &thermal_governor_list, governor_list)
-		if (!strnicmp(name, pos->name, THERMAL_NAME_LENGTH))
+		if (!strncasecmp(name, pos->name, THERMAL_NAME_LENGTH))
 			return pos;
 
 	return NULL;
@@ -104,7 +104,7 @@ int thermal_register_governor(struct thermal_governor *governor)
 
 		name = pos->tzp->governor_name;
 
-		if (!strnicmp(name, governor->name, THERMAL_NAME_LENGTH))
+		if (!strncasecmp(name, governor->name, THERMAL_NAME_LENGTH))
 			pos->governor = governor;
 	}
 
@@ -129,7 +129,7 @@ void thermal_unregister_governor(struct thermal_governor *governor)
 	mutex_lock(&thermal_list_lock);
 
 	list_for_each_entry(pos, &thermal_tz_list, node) {
-		if (!strnicmp(pos->governor->name, governor->name,
+		if (!strncasecmp(pos->governor->name, governor->name,
 						THERMAL_NAME_LENGTH))
 			pos->governor = NULL;
 	}
@@ -1665,7 +1665,7 @@ struct thermal_zone_device *thermal_zone_get_zone_by_name(const char *name)
 
 	mutex_lock(&thermal_list_lock);
 	list_for_each_entry(pos, &thermal_tz_list, node)
-		if (!strnicmp(name, pos->type, THERMAL_NAME_LENGTH)) {
+		if (!strncasecmp(name, pos->type, THERMAL_NAME_LENGTH)) {
 			found++;
 			ref = pos;
 		}
-- 
2.0.4


^ permalink raw reply related	[flat|nested] 36+ messages in thread

* [PATCH 22/22] kdb: Replace strnicmp with strncasecmp
  2014-09-16 20:51 [PATCH 00/22] treewide: Replace strnicmp with strncasecmp Rasmus Villemoes
                   ` (20 preceding siblings ...)
  2014-09-16 20:51 ` [PATCH 21/22] Thermal: " Rasmus Villemoes
@ 2014-09-16 20:51 ` Rasmus Villemoes
  2014-09-16 21:55 ` [PATCH 00/22] treewide: " Theodore Ts'o
  22 siblings, 0 replies; 36+ messages in thread
From: Rasmus Villemoes @ 2014-09-16 20:51 UTC (permalink / raw)
  To: Andrew Morton
  Cc: linux-kernel, Rasmus Villemoes, Jason Wessel, kgdb-bugreport

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: Jason Wessel <jason.wessel@windriver.com>
Cc: kgdb-bugreport@lists.sourceforge.net
Signed-off-by: Rasmus Villemoes <linux@rasmusvillemoes.dk>
---
 kernel/debug/kdb/kdb_bp.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/kernel/debug/kdb/kdb_bp.c b/kernel/debug/kdb/kdb_bp.c
index 70a5046..b20d544 100644
--- a/kernel/debug/kdb/kdb_bp.c
+++ b/kernel/debug/kdb/kdb_bp.c
@@ -52,11 +52,11 @@ static int kdb_parsebp(int argc, const char **argv, int *nextargp, kdb_bp_t *bp)
 
 	bp->bph_length = 1;
 	if ((argc + 1) != nextarg) {
-		if (strnicmp(argv[nextarg], "datar", sizeof("datar")) == 0)
+		if (strncasecmp(argv[nextarg], "datar", sizeof("datar")) == 0)
 			bp->bp_type = BP_ACCESS_WATCHPOINT;
-		else if (strnicmp(argv[nextarg], "dataw", sizeof("dataw")) == 0)
+		else if (strncasecmp(argv[nextarg], "dataw", sizeof("dataw")) == 0)
 			bp->bp_type = BP_WRITE_WATCHPOINT;
-		else if (strnicmp(argv[nextarg], "inst", sizeof("inst")) == 0)
+		else if (strncasecmp(argv[nextarg], "inst", sizeof("inst")) == 0)
 			bp->bp_type = BP_HARDWARE_BREAKPOINT;
 		else
 			return KDB_ARGCOUNT;
-- 
2.0.4


^ permalink raw reply related	[flat|nested] 36+ messages in thread

* Re: [PATCH 07/22] isofs: Replace strnicmp with strncasecmp
  2014-09-16 20:51 ` [PATCH 07/22] isofs: " Rasmus Villemoes
@ 2014-09-16 21:19   ` Jan Kara
  0 siblings, 0 replies; 36+ messages in thread
From: Jan Kara @ 2014-09-16 21:19 UTC (permalink / raw)
  To: Rasmus Villemoes; +Cc: Andrew Morton, linux-kernel, Jan Kara

On Tue 16-09-14 22:51:21, 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.
> 
> 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: Jan Kara <jack@suse.cz>
> Signed-off-by: Rasmus Villemoes <linux@rasmusvillemoes.dk>
  Looks good.

  Reviewed-by: Jan Kara <jack@suse.cz>

								Honza
> ---
>  fs/isofs/inode.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/fs/isofs/inode.c b/fs/isofs/inode.c
> index 5ddaf86..881b3bd 100644
> --- a/fs/isofs/inode.c
> +++ b/fs/isofs/inode.c
> @@ -247,7 +247,7 @@ static int isofs_dentry_cmp_common(
>  	}
>  	if (alen == blen) {
>  		if (ci) {
> -			if (strnicmp(name->name, str, alen) == 0)
> +			if (strncasecmp(name->name, str, alen) == 0)
>  				return 0;
>  		} else {
>  			if (strncmp(name->name, str, alen) == 0)
> -- 
> 2.0.4
> 
-- 
Jan Kara <jack@suse.cz>
SUSE Labs, CR

^ permalink raw reply	[flat|nested] 36+ messages in thread

* Re: [PATCH 11/22] cpufreq: Replace strnicmp with strncasecmp
  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
  0 siblings, 1 reply; 36+ messages in thread
From: Viresh Kumar @ 2014-09-16 21:22 UTC (permalink / raw)
  To: Rasmus Villemoes
  Cc: Andrew Morton, Linux Kernel Mailing List, Rafael J. Wysocki, linux-pm

On 16 September 2014 13:51, Rasmus Villemoes <linux@rasmusvillemoes.dk> 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.
>
> 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: "Rafael J. Wysocki" <rjw@rjwysocki.net>
> Cc: Viresh Kumar <viresh.kumar@linaro.org>
> Cc: linux-pm@vger.kernel.org
> Signed-off-by: Rasmus Villemoes <linux@rasmusvillemoes.dk>
> ---
>  drivers/cpufreq/cpufreq.c | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)

Not really sure about the implementation of these routines but the
changes look fine.

Acked-by: Viresh Kumar <viresh.kumar@linaro.org>

--
viresh

^ permalink raw reply	[flat|nested] 36+ messages in thread

* Re: [PATCH 00/22] treewide: Replace strnicmp with strncasecmp
  2014-09-16 20:51 [PATCH 00/22] treewide: Replace strnicmp with strncasecmp Rasmus Villemoes
                   ` (21 preceding siblings ...)
  2014-09-16 20:51 ` [PATCH 22/22] kdb: " Rasmus Villemoes
@ 2014-09-16 21:55 ` Theodore Ts'o
  2014-09-17  8:23   ` Rasmus Villemoes
  22 siblings, 1 reply; 36+ messages in thread
From: Theodore Ts'o @ 2014-09-16 21:55 UTC (permalink / raw)
  To: Rasmus Villemoes; +Cc: Andrew Morton, linux-kernel

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?

Thanks,

					- Ted

^ permalink raw reply	[flat|nested] 36+ messages in thread

* Re: [PATCH 17/22] thinkpad_acpi: Replace strnicmp with strncasecmp
  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
  0 siblings, 1 reply; 36+ messages in thread
From: Darren Hart @ 2014-09-16 22:08 UTC (permalink / raw)
  To: Rasmus Villemoes
  Cc: Andrew Morton, linux-kernel, Henrique de Moraes Holschuh,
	ibm-acpi-devel, platform-driver-x86

On Tue, Sep 16, 2014 at 10:51:31PM +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.

When was this done? As of this morning I still see them as independent functions
in lib/string.c.

-- 
Darren Hart
Intel Open Source Technology Center

^ permalink raw reply	[flat|nested] 36+ messages in thread

* Re: [PATCH 08/22] ALSA: hda - Replace strnicmp with strncasecmp
  2014-09-16 20:51 ` [PATCH 08/22] ALSA: hda - " Rasmus Villemoes
@ 2014-09-17  5:54   ` Takashi Iwai
  0 siblings, 0 replies; 36+ messages in thread
From: Takashi Iwai @ 2014-09-17  5:54 UTC (permalink / raw)
  To: Rasmus Villemoes; +Cc: Andrew Morton, linux-kernel, Jaroslav Kysela, alsa-devel

At Tue, 16 Sep 2014 22:51:22 +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.
> 
> 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: Jaroslav Kysela <perex@perex.cz>
> Cc: Takashi Iwai <tiwai@suse.de>
> Cc: alsa-devel@alsa-project.org
> Signed-off-by: Rasmus Villemoes <linux@rasmusvillemoes.dk>

Applied, thanks.


Takashi

> ---
>  sound/pci/hda/hda_sysfs.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/sound/pci/hda/hda_sysfs.c b/sound/pci/hda/hda_sysfs.c
> index e207909..9b49f15 100644
> --- a/sound/pci/hda/hda_sysfs.c
> +++ b/sound/pci/hda/hda_sysfs.c
> @@ -514,7 +514,7 @@ enum {
>  
>  static inline int strmatch(const char *a, const char *b)
>  {
> -	return strnicmp(a, b, strlen(b)) == 0;
> +	return strncasecmp(a, b, strlen(b)) == 0;
>  }
>  
>  /* parse the contents after the line "[codec]"
> -- 
> 2.0.4
> 

^ permalink raw reply	[flat|nested] 36+ messages in thread

* Re: [B.A.T.M.A.N.] [PATCH 09/22] batman-adv: Replace strnicmp with strncasecmp
  2014-09-16 20:51 ` [PATCH 09/22] batman-adv: " Rasmus Villemoes
@ 2014-09-17  6:00   ` Antonio Quartulli
  0 siblings, 0 replies; 36+ messages in thread
From: Antonio Quartulli @ 2014-09-17  6:00 UTC (permalink / raw)
  To: The list for a Better Approach To Mobile Ad-hoc Networking,
	Andrew Morton
  Cc: netdev, Rasmus Villemoes, linux-kernel, Marek Lindner

[-- Attachment #1: Type: text/plain, Size: 834 bytes --]

On 16/09/14 22:51, 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.
> 
> 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: Marek Lindner <mareklindner@neomailbox.ch>
> Cc: b.a.t.m.a.n@lists.open-mesh.org
> Cc: netdev@vger.kernel.org
> Signed-off-by: Rasmus Villemoes <linux@rasmusvillemoes.dk>

Acked-by: Antonio Quartulli <antonio@meshcoding.com>

Thank you



-- 
Antonio Quartulli


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

^ permalink raw reply	[flat|nested] 36+ messages in thread

* Re: [PATCH 17/22] thinkpad_acpi: Replace strnicmp with strncasecmp
  2014-09-16 22:08   ` Darren Hart
@ 2014-09-17  8:12     ` Rasmus Villemoes
  0 siblings, 0 replies; 36+ messages in thread
From: Rasmus Villemoes @ 2014-09-17  8:12 UTC (permalink / raw)
  To: Darren Hart
  Cc: Andrew Morton, linux-kernel, Henrique de Moraes Holschuh,
	ibm-acpi-devel, platform-driver-x86

On Wed, Sep 17 2014, Darren Hart <dvhart@infradead.org> wrote:

> On Tue, Sep 16, 2014 at 10:51:31PM +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.
>
> When was this done? As of this morning I still see them as independent functions
> in lib/string.c.

It will be in 3.18. I thought it had made it to linux-next, but should
have double-checked (and included the 3.18 info in the email); sorry.

http://thread.gmane.org/gmane.linux.kernel/1775150/focus=1775152

Rasmus

^ permalink raw reply	[flat|nested] 36+ messages in thread

* Re: [PATCH 00/22] treewide: Replace strnicmp with strncasecmp
  2014-09-16 21:55 ` [PATCH 00/22] treewide: " Theodore Ts'o
@ 2014-09-17  8:23   ` Rasmus Villemoes
  0 siblings, 0 replies; 36+ messages in thread
From: Rasmus Villemoes @ 2014-09-17  8:23 UTC (permalink / raw)
  To: Theodore Ts'o; +Cc: Andrew Morton, linux-kernel

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

^ permalink raw reply	[flat|nested] 36+ messages in thread

* Re: [PATCH 15/22] Input: edt-ft5x06 - Replace strnicmp with strncasecmp
  2014-09-16 20:51 ` [PATCH 15/22] Input: edt-ft5x06 - " Rasmus Villemoes
@ 2014-09-17 16:26   ` Dmitry Torokhov
  0 siblings, 0 replies; 36+ messages in thread
From: Dmitry Torokhov @ 2014-09-17 16:26 UTC (permalink / raw)
  To: Rasmus Villemoes; +Cc: Andrew Morton, linux-kernel, linux-input

On Tue, Sep 16, 2014 at 10:51:29PM +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.
> 
> 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: Dmitry Torokhov <dmitry.torokhov@gmail.com>
> Cc: linux-input@vger.kernel.org
> Signed-off-by: Rasmus Villemoes <linux@rasmusvillemoes.dk>

Applied, thank you.

-- 
Dmitry

^ permalink raw reply	[flat|nested] 36+ messages in thread

* Re: [PATCH 21/22] Thermal: Replace strnicmp with strncasecmp
  2014-09-16 20:51 ` [PATCH 21/22] Thermal: " Rasmus Villemoes
@ 2014-09-18  0:49   ` Zhang Rui
  0 siblings, 0 replies; 36+ messages in thread
From: Zhang Rui @ 2014-09-18  0:49 UTC (permalink / raw)
  To: Rasmus Villemoes; +Cc: Andrew Morton, linux-kernel, Eduardo Valentin, linux-pm

On Tue, 2014-09-16 at 22:51 +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.
> 
> 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: Zhang Rui <rui.zhang@intel.com>
> Cc: Eduardo Valentin <edubezval@gmail.com>
> Cc: linux-pm@vger.kernel.org
> Signed-off-by: Rasmus Villemoes <linux@rasmusvillemoes.dk>

Acked-by: Zhang Rui <rui.zhang@intel.com>

thanks,
rui
> ---
>  drivers/thermal/thermal_core.c | 8 ++++----
>  1 file changed, 4 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/thermal/thermal_core.c b/drivers/thermal/thermal_core.c
> index 71b0ec0..1e23f4f 100644
> --- a/drivers/thermal/thermal_core.c
> +++ b/drivers/thermal/thermal_core.c
> @@ -66,7 +66,7 @@ static struct thermal_governor *__find_governor(const char *name)
>  		return def_governor;
>  
>  	list_for_each_entry(pos, &thermal_governor_list, governor_list)
> -		if (!strnicmp(name, pos->name, THERMAL_NAME_LENGTH))
> +		if (!strncasecmp(name, pos->name, THERMAL_NAME_LENGTH))
>  			return pos;
>  
>  	return NULL;
> @@ -104,7 +104,7 @@ int thermal_register_governor(struct thermal_governor *governor)
>  
>  		name = pos->tzp->governor_name;
>  
> -		if (!strnicmp(name, governor->name, THERMAL_NAME_LENGTH))
> +		if (!strncasecmp(name, governor->name, THERMAL_NAME_LENGTH))
>  			pos->governor = governor;
>  	}
>  
> @@ -129,7 +129,7 @@ void thermal_unregister_governor(struct thermal_governor *governor)
>  	mutex_lock(&thermal_list_lock);
>  
>  	list_for_each_entry(pos, &thermal_tz_list, node) {
> -		if (!strnicmp(pos->governor->name, governor->name,
> +		if (!strncasecmp(pos->governor->name, governor->name,
>  						THERMAL_NAME_LENGTH))
>  			pos->governor = NULL;
>  	}
> @@ -1665,7 +1665,7 @@ struct thermal_zone_device *thermal_zone_get_zone_by_name(const char *name)
>  
>  	mutex_lock(&thermal_list_lock);
>  	list_for_each_entry(pos, &thermal_tz_list, node)
> -		if (!strnicmp(name, pos->type, THERMAL_NAME_LENGTH)) {
> +		if (!strncasecmp(name, pos->type, THERMAL_NAME_LENGTH)) {
>  			found++;
>  			ref = pos;
>  		}



^ permalink raw reply	[flat|nested] 36+ messages in thread

* Re: [PATCH 10/22] ACPI / battery: Replace strnicmp with strncasecmp
  2014-09-16 20:51 ` [PATCH 10/22] ACPI / battery: " Rasmus Villemoes
@ 2014-09-25 23:46   ` Rafael J. Wysocki
  0 siblings, 0 replies; 36+ messages in thread
From: Rafael J. Wysocki @ 2014-09-25 23:46 UTC (permalink / raw)
  To: Rasmus Villemoes; +Cc: Andrew Morton, linux-kernel, Len Brown, linux-acpi

On Tuesday, September 16, 2014 10:51:24 PM 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.
> 
> 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: "Rafael J. Wysocki" <rjw@rjwysocki.net>
> Cc: Len Brown <lenb@kernel.org>
> Cc: linux-acpi@vger.kernel.org
> Signed-off-by: Rasmus Villemoes <linux@rasmusvillemoes.dk>

Queued up for 3.18, thanks!

> ---
>  drivers/acpi/battery.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/acpi/battery.c b/drivers/acpi/battery.c
> index 5fdfe65..8ec8a89 100644
> --- a/drivers/acpi/battery.c
> +++ b/drivers/acpi/battery.c
> @@ -695,7 +695,7 @@ static void acpi_battery_quirks(struct acpi_battery *battery)
>  	if (battery->power_unit && dmi_name_in_vendors("LENOVO")) {
>  		const char *s;
>  		s = dmi_get_system_info(DMI_PRODUCT_VERSION);
> -		if (s && !strnicmp(s, "ThinkPad", 8)) {
> +		if (s && !strncasecmp(s, "ThinkPad", 8)) {
>  			dmi_walk(find_battery, battery);
>  			if (test_bit(ACPI_BATTERY_QUIRK_THINKPAD_MAH,
>  				     &battery->flags) &&
> 

-- 
I speak only for myself.
Rafael J. Wysocki, Intel Open Source Technology Center.

^ permalink raw reply	[flat|nested] 36+ messages in thread

* Re: [PATCH 12/22] cpuidle: Replace strnicmp with strncasecmp
  2014-09-16 20:51 ` [PATCH 12/22] cpuidle: " Rasmus Villemoes
@ 2014-09-25 23:52   ` Rafael J. Wysocki
  0 siblings, 0 replies; 36+ messages in thread
From: Rafael J. Wysocki @ 2014-09-25 23:52 UTC (permalink / raw)
  To: Rasmus Villemoes; +Cc: Andrew Morton, linux-kernel, Daniel Lezcano, linux-pm

On Tuesday, September 16, 2014 10:51:26 PM 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.
> 
> 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: "Rafael J. Wysocki" <rjw@rjwysocki.net>
> Cc: Daniel Lezcano <daniel.lezcano@linaro.org>
> Cc: linux-pm@vger.kernel.org
> Signed-off-by: Rasmus Villemoes <linux@rasmusvillemoes.dk>

Queued up for 3.18, thanks!

> ---
>  drivers/cpuidle/governor.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/cpuidle/governor.c b/drivers/cpuidle/governor.c
> index ca89412..fb9f511 100644
> --- a/drivers/cpuidle/governor.c
> +++ b/drivers/cpuidle/governor.c
> @@ -28,7 +28,7 @@ static struct cpuidle_governor * __cpuidle_find_governor(const char *str)
>  	struct cpuidle_governor *gov;
>  
>  	list_for_each_entry(gov, &cpuidle_governors, governor_list)
> -		if (!strnicmp(str, gov->name, CPUIDLE_NAME_LEN))
> +		if (!strncasecmp(str, gov->name, CPUIDLE_NAME_LEN))
>  			return gov;
>  
>  	return NULL;
> 

-- 
I speak only for myself.
Rafael J. Wysocki, Intel Open Source Technology Center.

^ permalink raw reply	[flat|nested] 36+ messages in thread

* Re: [PATCH 11/22] cpufreq: Replace strnicmp with strncasecmp
  2014-09-16 21:22   ` Viresh Kumar
@ 2014-09-25 23:53     ` Rafael J. Wysocki
  0 siblings, 0 replies; 36+ messages in thread
From: Rafael J. Wysocki @ 2014-09-25 23:53 UTC (permalink / raw)
  To: Viresh Kumar
  Cc: Rasmus Villemoes, Andrew Morton, Linux Kernel Mailing List, linux-pm

On Tuesday, September 16, 2014 02:22:49 PM Viresh Kumar wrote:
> On 16 September 2014 13:51, Rasmus Villemoes <linux@rasmusvillemoes.dk> 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.
> >
> > 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: "Rafael J. Wysocki" <rjw@rjwysocki.net>
> > Cc: Viresh Kumar <viresh.kumar@linaro.org>
> > Cc: linux-pm@vger.kernel.org
> > Signed-off-by: Rasmus Villemoes <linux@rasmusvillemoes.dk>
> > ---
> >  drivers/cpufreq/cpufreq.c | 6 +++---
> >  1 file changed, 3 insertions(+), 3 deletions(-)
> 
> Not really sure about the implementation of these routines but the
> changes look fine.
> 
> Acked-by: Viresh Kumar <viresh.kumar@linaro.org>

Queued up for 3.18, thanks!

-- 
I speak only for myself.
Rafael J. Wysocki, Intel Open Source Technology Center.

^ permalink raw reply	[flat|nested] 36+ messages in thread

end of thread, other threads:[~2014-09-25 23:33 UTC | newest]

Thread overview: 36+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-09-16 20:51 [PATCH 00/22] treewide: Replace strnicmp with strncasecmp 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 is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).