Red Hat Bugzilla – Bug 591078
Add skip_spaces() function implementation (linux/string.h) from upstream
Last modified: 2010-11-11 11:12:20 EST
Created attachment 413113 [details]
Original patch in upstream
Author: André Goddard Rosa <email@example.com>
Date: Mon Dec 14 18:01:04 2009 -0800
string: factorize skip_spaces and export it to be generally available
On the following sentence:
while (*s && isspace(*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 <firstname.lastname@example.org>
Signed-off-by: Andrew Morton <email@example.com>
Signed-off-by: Linus Torvalds <firstname.lastname@example.org>
This request was evaluated by Red Hat Product Management for inclusion in a Red
Hat Enterprise Linux major release. Product Management has requested further
review of this request by Red Hat Engineering, for potential inclusion in a Red
Hat Enterprise Linux Major release. This request is not yet committed for
Created attachment 413502 [details]
Second version of skip_spaces() patch including kernel optimalizations
Patch(es) available on kernel-2.6.32-27.el6
Red Hat Enterprise Linux 6.0 is now available and should resolve
the problem described in this bug report. This report is therefore being closed
with a resolution of CURRENTRELEASE. You may reopen this bug report if the
solution does not work for you.