From: André Goddard Rosa Date: Tue, 15 Dec 2009 02:01:04 +0000 (-0800) Subject: string: factorize skip_spaces and export it to be generally available X-Git-Tag: v2.6.33-rc1~123 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f653398c86a1c104f0992bd788dd4bb065449be4;p=pandora-kernel.git string: factorize skip_spaces and export it to be generally available On the following sentence: while (*s && isspace(*s)) s++; If *s == 0, isspace() evaluates to ((_ctype[*s] & 0x20) != 0), which evaluates to ((0x08 & 0x20) != 0) which equals to 0 as well. If *s == 1, we depend on isspace() result anyway. In other words, "a char equals zero is never a space", so remove this check. Also, *s != 0 is most common case (non-null string). Fixed const return as noticed by Jan Engelhardt and James Bottomley. Fixed unnecessary extra cast on strstrip() as noticed by Jan Engelhardt. Signed-off-by: André Goddard Rosa Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- Reading git-diff-tree failed