linux/drivers/platform/x86
André Goddard Rosa e7d2860b69 tree-wide: convert open calls to remove spaces to skip_spaces() lib function
Makes use of skip_spaces() defined in lib/string.c for removing leading
spaces from strings all over the tree.

It decreases lib.a code size by 47 bytes and reuses the function tree-wide:
   text    data     bss     dec     hex filename
  64688     584     592   65864   10148 (TOTALS-BEFORE)
  64641     584     592   65817   10119 (TOTALS-AFTER)

Also, while at it, if we see (*str && isspace(*str)), we can be sure to
remove the first condition (*str) as the second one (isspace(*str)) also
evaluates to 0 whenever *str == 0, making it redundant. In other words,
"a char equals zero is never a space".

Julia Lawall tried the semantic patch (http://coccinelle.lip6.fr) below,
and found occurrences of this pattern on 3 more files:
    drivers/leds/led-class.c
    drivers/leds/ledtrig-timer.c
    drivers/video/output.c

@@
expression str;
@@

( // ignore skip_spaces cases
while (*str &&  isspace(*str)) { \(str++;\|++str;\) }
|
- *str &&
isspace(*str)
)

Signed-off-by: André Goddard Rosa <andre.goddard@gmail.com>
Cc: Julia Lawall <julia@diku.dk>
Cc: Martin Schwidefsky <schwidefsky@de.ibm.com>
Cc: Jeff Dike <jdike@addtoit.com>
Cc: Ingo Molnar <mingo@elte.hu>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: "H. Peter Anvin" <hpa@zytor.com>
Cc: Richard Purdie <rpurdie@rpsys.net>
Cc: Neil Brown <neilb@suse.de>
Cc: Kyle McMartin <kyle@mcmartin.ca>
Cc: Henrique de Moraes Holschuh <hmh@hmh.eng.br>
Cc: David Howells <dhowells@redhat.com>
Cc: <linux-ext4@vger.kernel.org>
Cc: Samuel Ortiz <samuel@sortiz.org>
Cc: Patrick McHardy <kaber@trash.net>
Cc: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2009-12-15 08:53:32 -08:00
..
acer-wmi.c Input: libps2 - additional locking for i8042 ports 2009-09-17 23:23:45 -07:00
acerhdf.c const: constify remaining dev_pm_ops 2009-12-15 08:53:25 -08:00
asus_acpi.c ACPI: asus-acpi: use .notify method instead of installing handler directly 2009-06-18 00:13:15 -04:00
asus-laptop.c asus-laptop: Fix coding style for comments 2009-08-29 14:15:54 -04:00
compal-laptop.c create drivers/platform/x86/ from drivers/misc/ 2008-12-19 04:42:32 -05:00
dell-laptop.c dell-laptop: fix rfkill conversion 2009-06-15 15:05:58 -04:00
dell-wmi.c dell-wmi: don't generate errors on empty messages 2009-06-17 23:44:22 -04:00
eeepc-laptop.c const: constify remaining dev_pm_ops 2009-12-15 08:53:25 -08:00
fujitsu-laptop.c fujitsu-laptop: address missed led-class ifdef fixup 2009-10-09 16:49:57 -04:00
hp-wmi.c const: constify remaining dev_pm_ops 2009-12-15 08:53:25 -08:00
intel_menlow.c ACPICA: Add post-order callback to acpi_walk_namespace 2009-11-24 21:31:10 -05:00
Kconfig Merge branch 'fujitsu' into release 2009-09-19 02:09:50 -04:00
Makefile topstar-laptop: add new driver for hotkeys support on Topstar N01 2009-09-19 01:16:13 -04:00
msi-laptop.c create drivers/platform/x86/ from drivers/misc/ 2008-12-19 04:42:32 -05:00
panasonic-laptop.c Merge branches 'release', 'APERF', 'ARAT', 'misc', 'kelvin', 'device-lock' and 'bjorn.notify' into release 2009-04-07 18:18:42 -04:00
sony-laptop.c ACPICA: Add post-order callback to acpi_walk_namespace 2009-11-24 21:31:10 -05:00
tc1100-wmi.c tc1100-wmi: Fix state reporting 2009-04-03 12:03:27 -04:00
thinkpad_acpi.c tree-wide: convert open calls to remove spaces to skip_spaces() lib function 2009-12-15 08:53:32 -08:00
topstar-laptop.c topstar-laptop: add new driver for hotkeys support on Topstar N01 2009-09-19 01:16:13 -04:00
toshiba_acpi.c toshiba_acpi: return on a fail path 2009-08-28 15:17:07 -04:00
wmi.c ACPI: Move definition of PREFIX from acpi_bus.h to internal..h 2009-08-28 19:57:27 -04:00