linux-input.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 15/22] Input: edt-ft5x06 - Replace strnicmp with strncasecmp
       [not found] <1410900696-6481-1-git-send-email-linux@rasmusvillemoes.dk>
@ 2014-09-16 20:51 ` Rasmus Villemoes
  2014-09-17 16:26   ` Dmitry Torokhov
  0 siblings, 1 reply; 2+ 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] 2+ 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 - Replace strnicmp with strncasecmp Rasmus Villemoes
@ 2014-09-17 16:26   ` Dmitry Torokhov
  0 siblings, 0 replies; 2+ 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] 2+ messages in thread

end of thread, other threads:[~2014-09-17 16:26 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <1410900696-6481-1-git-send-email-linux@rasmusvillemoes.dk>
2014-09-16 20:51 ` [PATCH 15/22] Input: edt-ft5x06 - Replace strnicmp with strncasecmp Rasmus Villemoes
2014-09-17 16:26   ` Dmitry Torokhov

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).