<feed xmlns='http://www.w3.org/2005/Atom'>
<title>user/sven/linux.git/lib/string.c, branch v3.0.85</title>
<subtitle>Linux Kernel
</subtitle>
<id>https://git.stealer.net/cgit.cgi/user/sven/linux.git/atom?h=v3.0.85</id>
<link rel='self' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/atom?h=v3.0.85'/>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/'/>
<updated>2011-05-19T07:25:28Z</updated>
<entry>
<title>Add a strtobool function matching semantics of existing in kernel equivalents</title>
<updated>2011-05-19T07:25:28Z</updated>
<author>
<name>Jonathan Cameron</name>
<email>jic23@cam.ac.uk</email>
</author>
<published>2011-04-19T11:43:45Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=d0f1fed29e6e73d9d17f4c91a5896a4ce3938d45'/>
<id>urn:sha1:d0f1fed29e6e73d9d17f4c91a5896a4ce3938d45</id>
<content type='text'>
This is a rename of the usr_strtobool proposal, which was a renamed,
relocated and fixed version of previous kstrtobool RFC

Signed-off-by: Jonathan Cameron &lt;jic23@cam.ac.uk&gt;
Signed-off-by: Rusty Russell &lt;rusty@rustcorp.com.au&gt;
</content>
</entry>
<entry>
<title>lib/string.c: simplify strnstr()</title>
<updated>2010-03-06T19:26:35Z</updated>
<author>
<name>André Goddard Rosa</name>
<email>andre.goddard@gmail.com</email>
</author>
<published>2010-03-05T21:43:12Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=d6a2eedfddcded92c8f9b0ac022a99c4134696b0'/>
<id>urn:sha1:d6a2eedfddcded92c8f9b0ac022a99c4134696b0</id>
<content type='text'>
Signed-off-by: André Goddard Rosa &lt;andre.goddard@gmail.com&gt;
Cc: Li Zefan &lt;lizf@cn.fujitsu.com&gt;
Cc: Joe Perches &lt;joe@perches.com&gt;
Cc: Frederic Weisbecker &lt;fweisbec@gmail.com&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
</entry>
<entry>
<title>lib/string.c: simplify stricmp()</title>
<updated>2010-03-06T19:26:35Z</updated>
<author>
<name>André Goddard Rosa</name>
<email>andre.goddard@gmail.com</email>
</author>
<published>2010-03-05T21:43:11Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=a11d2b64e1f2556953120d516241243ea365f0ae'/>
<id>urn:sha1:a11d2b64e1f2556953120d516241243ea365f0ae</id>
<content type='text'>
Removes 32 bytes on core2 with gcc 4.4.1:
   text    data     bss     dec     hex filename
   3196       0       0    3196     c7c lib/string-BEFORE.o
   3164       0       0    3164     c5c lib/string-AFTER.o

Signed-off-by: André Goddard Rosa &lt;andre.goddard@gmail.com&gt;
Cc: Joe Perches &lt;joe@perches.com&gt;
Cc: Frederic Weisbecker &lt;fweisbec@gmail.com&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
</entry>
<entry>
<title>lib: Introduce strnstr()</title>
<updated>2010-01-15T03:38:09Z</updated>
<author>
<name>Li Zefan</name>
<email>lizf@cn.fujitsu.com</email>
</author>
<published>2010-01-14T02:53:55Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=d5f1fb53353edc38da326445267c1df0c9676df2'/>
<id>urn:sha1:d5f1fb53353edc38da326445267c1df0c9676df2</id>
<content type='text'>
It differs strstr() in that it limits the length to be searched
in the first string.

Signed-off-by: Li Zefan &lt;lizf@cn.fujitsu.com&gt;
LKML-Reference: &lt;4B4E8743.6030805@cn.fujitsu.com&gt;
Acked-by: Frederic Weisbecker &lt;fweisbec@gmail.com&gt;
Signed-off-by: Steven Rostedt &lt;rostedt@goodmis.org&gt;
</content>
</entry>
<entry>
<title>lib/string.c: fix kernel-doc warnings</title>
<updated>2009-12-22T22:17:55Z</updated>
<author>
<name>Randy Dunlap</name>
<email>randy.dunlap@oracle.com</email>
</author>
<published>2009-12-21T22:37:22Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=a6cd13f3c98d1d16213e3b61054b9c209d93f877'/>
<id>urn:sha1:a6cd13f3c98d1d16213e3b61054b9c209d93f877</id>
<content type='text'>
Fix kernel-doc warnings (@arg name) in string.c::skip_spaces().

  Warning(lib/string.c:347): No description found for parameter 'str'
  Warning(lib/string.c:347): Excess function parameter 's' description in 'skip_spaces'

Signed-off-by: Randy Dunlap &lt;randy.dunlap@oracle.com&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
</entry>
<entry>
<title>Subject: Re: [PATCH] strstrip incorrectly marked __must_check</title>
<updated>2009-12-15T16:53:34Z</updated>
<author>
<name>KOSAKI Motohiro</name>
<email>kosaki.motohiro@jp.fujitsu.com</email>
</author>
<published>2009-12-15T02:01:15Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=ca54cb8c9eb38095dc420b73c6380ce1dbeb10fa'/>
<id>urn:sha1:ca54cb8c9eb38095dc420b73c6380ce1dbeb10fa</id>
<content type='text'>
Recently, We marked strstrip() as must_check.  because it was frequently
misused and it should be checked.  However, we found one exception.
scsi/ipr.c intentionally ignore return value of strstrip.  Because it
wishes to keep the whitespace at the beginning.

Thus we need to keep with and without checked whitespace trim function.
This patch adds a new strim() and changes ipr.c to use it.

[akpm@linux-foundation.org: coding-style fixes]
Suggested-by: Alan Cox &lt;alan@lxorguk.ukuu.org.uk&gt;
Signed-off-by: KOSAKI Motohiro &lt;kosaki.motohiro@jp.fujitsu.com&gt;
Cc: James Bottomley &lt;James.Bottomley@HansenPartnership.com&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
</entry>
<entry>
<title>string: on strstrip(), first remove leading spaces before running over str</title>
<updated>2009-12-15T16:53:32Z</updated>
<author>
<name>André Goddard Rosa</name>
<email>andre.goddard@gmail.com</email>
</author>
<published>2009-12-15T02:01:04Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=84c95c9acf088c99d8793d78036b67faa5d0b851'/>
<id>urn:sha1:84c95c9acf088c99d8793d78036b67faa5d0b851</id>
<content type='text'>
... so that strlen() iterates over a smaller string comprising of the
remaining characters only.

Signed-off-by: André Goddard Rosa &lt;andre.goddard@gmail.com&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
</entry>
<entry>
<title>string: factorize skip_spaces and export it to be generally available</title>
<updated>2009-12-15T16:53:32Z</updated>
<author>
<name>André Goddard Rosa</name>
<email>andre.goddard@gmail.com</email>
</author>
<published>2009-12-15T02:01:04Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=f653398c86a1c104f0992bd788dd4bb065449be4'/>
<id>urn:sha1:f653398c86a1c104f0992bd788dd4bb065449be4</id>
<content type='text'>
On the following sentence:
    while (*s &amp;&amp; isspace(*s))
        s++;

If *s == 0, isspace() evaluates to ((_ctype[*s] &amp; 0x20) != 0), which
evaluates to ((0x08 &amp; 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 &lt;andre.goddard@gmail.com&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
</entry>
<entry>
<title>strcmp: fix overflow and possibly signedness error</title>
<updated>2009-11-19T01:18:13Z</updated>
<author>
<name>Linus Torvalds</name>
<email>torvalds@linux-foundation.org</email>
</author>
<published>2009-11-18T21:31:52Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=a414f01ac2899f273ef8fe98fa44158ac12793f2'/>
<id>urn:sha1:a414f01ac2899f273ef8fe98fa44158ac12793f2</id>
<content type='text'>
Doing the strcmp return value as

	signed char __res = *cs - *ct;

is wrong for two reasons.  The subtraction can overflow because __res
doesn't use a type big enough.  Moreover the compared bytes should be
interpreted as unsigned char as specified by POSIX.

The same problem is fixed in strncmp.

Signed-off-by: Uwe Kleine-König &lt;u.kleine-koenig@pengutronix.de&gt;
Cc: Michael Buesch &lt;mb@bu3sch.de&gt;
Cc: Andreas Schwab &lt;schwab@linux-m68k.org&gt;
Cc: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
</entry>
<entry>
<title>Add a new sysfs_streq() string comparison function</title>
<updated>2008-05-01T15:03:59Z</updated>
<author>
<name>David Brownell</name>
<email>david-b@pacbell.net</email>
</author>
<published>2008-05-01T11:34:42Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=34990cf702bdf2b4964e0629dab4af7669f8b2c5'/>
<id>urn:sha1:34990cf702bdf2b4964e0629dab4af7669f8b2c5</id>
<content type='text'>
Add a new sysfs_streq() string comparison function, which ignores
the trailing newlines found in sysfs inputs.  By example:

	sysfs_streq("a", "b")	==&gt; false
	sysfs_streq("a", "a")	==&gt; true
	sysfs_streq("a", "a\n")	==&gt; true
	sysfs_streq("a\n", "a")	==&gt; true

This is intended to simplify parsing of sysfs inputs, letting them
avoid the need to manually strip off newlines from inputs.

Signed-off-by: David Brownell &lt;dbrownell@users.sourceforge.net&gt;
Acked-by: Greg KH &lt;greg@kroah.com&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
</entry>
</feed>
