android_kernel_xiaomi_sm8350/fs/ext4
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
..
acl.c
acl.h
balloc.c ext4: fold ext4_free_blocks() and ext4_mb_free_blocks() 2009-11-22 07:44:56 -05:00
bitmap.c
block_validity.c ext4: add check for wraparound in ext4_data_block_valid() 2009-11-22 20:48:34 -05:00
dir.c
ext4_extents.h ext4: Split uninitialized extents for direct I/O 2009-09-28 15:49:08 -04:00
ext4_jbd2.c ext4: fold ext4_journal_forget() into ext4_forget() 2009-11-22 21:00:13 -05:00
ext4_jbd2.h ext4: Wait for proper transaction commit on fsync 2009-12-08 23:51:10 -05:00
ext4.h ext4: Wait for proper transaction commit on fsync 2009-12-08 23:51:10 -05:00
extents.c ext4: Fix potential fiemap deadlock (mmap_sem vs. i_data_sem) 2009-12-09 21:30:02 -05:00
file.c const: mark struct vm_struct_operations 2009-09-27 11:39:25 -07:00
fsync.c ext4: Wait for proper transaction commit on fsync 2009-12-08 23:51:10 -05:00
hash.c
ialloc.c
inode.c Merge branch 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tytso/ext4 2009-12-10 09:33:29 -08:00
ioctl.c ext4: Fix insufficient checks in EXT4_IOC_MOVE_EXT 2009-12-06 23:38:31 -05:00
Kconfig task_struct: make journal_info conditional 2009-12-15 08:53:27 -08:00
Makefile
mballoc.c Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tj/percpu 2009-12-14 09:58:24 -08:00
mballoc.h ext4: Use tracepoints for mb_history trace file 2009-09-30 00:32:42 -04:00
migrate.c ext4: quota macros cleanup 2009-12-08 22:42:15 -05:00
move_extent.c ext4: Fix insufficient checks in EXT4_IOC_MOVE_EXT 2009-12-06 23:38:31 -05:00
namei.c ext4: quota macros cleanup 2009-12-08 22:42:15 -05:00
resize.c ext4: Return the PTR_ERR of the correct pointer in setup_new_group_blocks() 2009-12-07 10:38:16 -05:00
super.c tree-wide: convert open calls to remove spaces to skip_spaces() lib function 2009-12-15 08:53:32 -08:00
symlink.c
xattr_security.c
xattr_trusted.c
xattr_user.c
xattr.c ext4: call ext4_forget() from ext4_free_blocks() 2009-11-23 07:17:05 -05:00
xattr.h