diff options
author | Rasmus Villemoes <linux@rasmusvillemoes.dk> | 2014-10-13 18:54:50 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2014-10-13 20:18:25 -0400 |
commit | 30614cf34105c5b5b9a39c65a2ea32c58b03aa8e (patch) | |
tree | 2052b1795f0d31b353184aa288be71b7c650cea6 /drivers/misc | |
parent | 0f3ae5baafba9e48e2d3b173b982a46ad90149b4 (diff) |
altera-stapl: replace strnicmp with strncasecmp
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.
Signed-off-by: Rasmus Villemoes <linux@rasmusvillemoes.dk>
Cc: "Igor M. Liplianin" <liplianin@netup.ru>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'drivers/misc')
-rw-r--r-- | drivers/misc/altera-stapl/altera.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/misc/altera-stapl/altera.c b/drivers/misc/altera-stapl/altera.c index 24272e022bec..bca2630d006f 100644 --- a/drivers/misc/altera-stapl/altera.c +++ b/drivers/misc/altera-stapl/altera.c | |||
@@ -454,7 +454,7 @@ exit_done: | |||
454 | 454 | ||
455 | name = &p[str_table + name_id]; | 455 | name = &p[str_table + name_id]; |
456 | 456 | ||
457 | if (strnicmp(aconf->action, name, strlen(name)) == 0) { | 457 | if (strncasecmp(aconf->action, name, strlen(name)) == 0) { |
458 | action_found = 1; | 458 | action_found = 1; |
459 | current_proc = | 459 | current_proc = |
460 | get_unaligned_be32(&p[action_table + | 460 | get_unaligned_be32(&p[action_table + |
@@ -2176,7 +2176,7 @@ static int altera_get_note(u8 *p, s32 program_size, | |||
2176 | key_ptr = &p[note_strings + | 2176 | key_ptr = &p[note_strings + |
2177 | get_unaligned_be32( | 2177 | get_unaligned_be32( |
2178 | &p[note_table + (8 * i)])]; | 2178 | &p[note_table + (8 * i)])]; |
2179 | if ((strnicmp(key, key_ptr, strlen(key_ptr)) == 0) && | 2179 | if ((strncasecmp(key, key_ptr, strlen(key_ptr)) == 0) && |
2180 | (key != NULL)) { | 2180 | (key != NULL)) { |
2181 | status = 0; | 2181 | status = 0; |
2182 | 2182 | ||