aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/pnp
diff options
context:
space:
mode:
authorRasmus Villemoes <linux@rasmusvillemoes.dk>2014-10-13 18:54:54 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2014-10-13 20:18:25 -0400
commit7fb1cab4ac8ef7a1fed5c19593cd5b4be1b1a9b3 (patch)
tree36dbdbaf72013a3a80ab8dabd2171837fbb3061c /drivers/pnp
parent40f5c777ec61d908ffc7f2a6ccbed60d9930a1f8 (diff)
PNP: 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: "Rafael J. Wysocki" <rafael.j.wysocki@intel.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'drivers/pnp')
-rw-r--r--drivers/pnp/interface.c24
1 files changed, 12 insertions, 12 deletions
diff --git a/drivers/pnp/interface.c b/drivers/pnp/interface.c
index e6c403be09a9..4b6808ff0e5d 100644
--- a/drivers/pnp/interface.c
+++ b/drivers/pnp/interface.c
@@ -346,41 +346,41 @@ static ssize_t resources_store(struct device *dmdev,
346 } 346 }
347 347
348 buf = skip_spaces(buf); 348 buf = skip_spaces(buf);
349 if (!strnicmp(buf, "disable", 7)) { 349 if (!strncasecmp(buf, "disable", 7)) {
350 retval = pnp_disable_dev(dev); 350 retval = pnp_disable_dev(dev);
351 goto done; 351 goto done;
352 } 352 }
353 if (!strnicmp(buf, "activate", 8)) { 353 if (!strncasecmp(buf, "activate", 8)) {
354 retval = pnp_activate_dev(dev); 354 retval = pnp_activate_dev(dev);
355 goto done; 355 goto done;
356 } 356 }
357 if (!strnicmp(buf, "fill", 4)) { 357 if (!strncasecmp(buf, "fill", 4)) {
358 if (dev->active) 358 if (dev->active)
359 goto done; 359 goto done;
360 retval = pnp_auto_config_dev(dev); 360 retval = pnp_auto_config_dev(dev);
361 goto done; 361 goto done;
362 } 362 }
363 if (!strnicmp(buf, "auto", 4)) { 363 if (!strncasecmp(buf, "auto", 4)) {
364 if (dev->active) 364 if (dev->active)
365 goto done; 365 goto done;
366 pnp_init_resources(dev); 366 pnp_init_resources(dev);
367 retval = pnp_auto_config_dev(dev); 367 retval = pnp_auto_config_dev(dev);
368 goto done; 368 goto done;
369 } 369 }
370 if (!strnicmp(buf, "clear", 5)) { 370 if (!strncasecmp(buf, "clear", 5)) {
371 if (dev->active) 371 if (dev->active)
372 goto done; 372 goto done;
373 pnp_init_resources(dev); 373 pnp_init_resources(dev);
374 goto done; 374 goto done;
375 } 375 }
376 if (!strnicmp(buf, "get", 3)) { 376 if (!strncasecmp(buf, "get", 3)) {
377 mutex_lock(&pnp_res_mutex); 377 mutex_lock(&pnp_res_mutex);
378 if (pnp_can_read(dev)) 378 if (pnp_can_read(dev))
379 dev->protocol->get(dev); 379 dev->protocol->get(dev);
380 mutex_unlock(&pnp_res_mutex); 380 mutex_unlock(&pnp_res_mutex);
381 goto done; 381 goto done;
382 } 382 }
383 if (!strnicmp(buf, "set", 3)) { 383 if (!strncasecmp(buf, "set", 3)) {
384 resource_size_t start; 384 resource_size_t start;
385 resource_size_t end; 385 resource_size_t end;
386 unsigned long flags; 386 unsigned long flags;
@@ -392,31 +392,31 @@ static ssize_t resources_store(struct device *dmdev,
392 mutex_lock(&pnp_res_mutex); 392 mutex_lock(&pnp_res_mutex);
393 while (1) { 393 while (1) {
394 buf = skip_spaces(buf); 394 buf = skip_spaces(buf);
395 if (!strnicmp(buf, "io", 2)) { 395 if (!strncasecmp(buf, "io", 2)) {
396 buf = pnp_get_resource_value(buf + 2, 396 buf = pnp_get_resource_value(buf + 2,
397 IORESOURCE_IO, 397 IORESOURCE_IO,
398 &start, &end, 398 &start, &end,
399 &flags); 399 &flags);
400 pnp_add_io_resource(dev, start, end, flags); 400 pnp_add_io_resource(dev, start, end, flags);
401 } else if (!strnicmp(buf, "mem", 3)) { 401 } else if (!strncasecmp(buf, "mem", 3)) {
402 buf = pnp_get_resource_value(buf + 3, 402 buf = pnp_get_resource_value(buf + 3,
403 IORESOURCE_MEM, 403 IORESOURCE_MEM,
404 &start, &end, 404 &start, &end,
405 &flags); 405 &flags);
406 pnp_add_mem_resource(dev, start, end, flags); 406 pnp_add_mem_resource(dev, start, end, flags);
407 } else if (!strnicmp(buf, "irq", 3)) { 407 } else if (!strncasecmp(buf, "irq", 3)) {
408 buf = pnp_get_resource_value(buf + 3, 408 buf = pnp_get_resource_value(buf + 3,
409 IORESOURCE_IRQ, 409 IORESOURCE_IRQ,
410 &start, NULL, 410 &start, NULL,
411 &flags); 411 &flags);
412 pnp_add_irq_resource(dev, start, flags); 412 pnp_add_irq_resource(dev, start, flags);
413 } else if (!strnicmp(buf, "dma", 3)) { 413 } else if (!strncasecmp(buf, "dma", 3)) {
414 buf = pnp_get_resource_value(buf + 3, 414 buf = pnp_get_resource_value(buf + 3,
415 IORESOURCE_DMA, 415 IORESOURCE_DMA,
416 &start, NULL, 416 &start, NULL,
417 &flags); 417 &flags);
418 pnp_add_dma_resource(dev, start, flags); 418 pnp_add_dma_resource(dev, start, flags);
419 } else if (!strnicmp(buf, "bus", 3)) { 419 } else if (!strncasecmp(buf, "bus", 3)) {
420 buf = pnp_get_resource_value(buf + 3, 420 buf = pnp_get_resource_value(buf + 3,
421 IORESOURCE_BUS, 421 IORESOURCE_BUS,
422 &start, &end, 422 &start, &end,