<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux-toradex.git/lib/string.c, branch tegra-10.7.1</title>
<subtitle>Linux kernel for Apalis and Colibri modules</subtitle>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/'/>
<entry>
<title>strcmp: fix overflow and possibly signedness error</title>
<updated>2009-11-19T01:18:13+00:00</updated>
<author>
<name>Linus Torvalds</name>
<email>torvalds@linux-foundation.org</email>
</author>
<published>2009-11-18T21:31:52+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=a414f01ac2899f273ef8fe98fa44158ac12793f2'/>
<id>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>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
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;
</pre>
</div>
</content>
</entry>
<entry>
<title>Add a new sysfs_streq() string comparison function</title>
<updated>2008-05-01T15:03:59+00:00</updated>
<author>
<name>David Brownell</name>
<email>david-b@pacbell.net</email>
</author>
<published>2008-05-01T11:34:42+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=34990cf702bdf2b4964e0629dab4af7669f8b2c5'/>
<id>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>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
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;
</pre>
</div>
</content>
</entry>
<entry>
<title>[STRING]: Move strcasecmp/strncasecmp to lib/string.c</title>
<updated>2007-04-26T08:54:39+00:00</updated>
<author>
<name>David S. Miller</name>
<email>davem@sunset.davemloft.net</email>
</author>
<published>2007-03-29T08:18:42+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=ded220bd8f0823771fc0a9bdf7f5bcbe543197b6'/>
<id>ded220bd8f0823771fc0a9bdf7f5bcbe543197b6</id>
<content type='text'>
We have several platforms using local copies of identical
code.

Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
We have several platforms using local copies of identical
code.

Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>[PATCH] Numerous fixes to kernel-doc info in source files.</title>
<updated>2007-02-11T18:51:32+00:00</updated>
<author>
<name>Robert P. J. Day</name>
<email>rpjday@mindspring.com</email>
</author>
<published>2007-02-10T09:45:59+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=72fd4a35a824331d7a0f4168d7576502d95d34b3'/>
<id>72fd4a35a824331d7a0f4168d7576502d95d34b3</id>
<content type='text'>
A variety of (mostly) innocuous fixes to the embedded kernel-doc content in
source files, including:

  * make multi-line initial descriptions single line
  * denote some function names, constants and structs as such
  * change erroneous opening '/*' to '/**' in a few places
  * reword some text for clarity

Signed-off-by: Robert P. J. Day &lt;rpjday@mindspring.com&gt;
Cc: "Randy.Dunlap" &lt;rdunlap@xenotime.net&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
A variety of (mostly) innocuous fixes to the embedded kernel-doc content in
source files, including:

  * make multi-line initial descriptions single line
  * denote some function names, constants and structs as such
  * change erroneous opening '/*' to '/**' in a few places
  * reword some text for clarity

Signed-off-by: Robert P. J. Day &lt;rpjday@mindspring.com&gt;
Cc: "Randy.Dunlap" &lt;rdunlap@xenotime.net&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>[PATCH] strstrip remove last blank fix</title>
<updated>2006-10-28T18:30:54+00:00</updated>
<author>
<name>Michael Holzheu</name>
<email>holzheu@de.ibm.com</email>
</author>
<published>2006-10-28T17:38:47+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=6e6d9fa6f95e382bb2d5725dda18b9e811418e79'/>
<id>6e6d9fa6f95e382bb2d5725dda18b9e811418e79</id>
<content type='text'>
strstrip() does not remove the last blank from strings which only consist
of blanks.

Example:
char string[] = "  ";
strstrip(string);

results in " ", but should produce an empty string!

The following patch solves this problem:

Acked-by: Martin Schwidefsky &lt;schwidefsky@de.ibm.com&gt;
Signed-off-by: Michael Holzheu &lt;holzheu@de.ibm.com&gt;
Acked-by: Pekka Enberg &lt;penberg@cs.helsinki.fi&gt;
Acked-by Joern Engel &lt;joern@wh.fh-wedel.de&gt;
Signed-off-by: Andrew Morton &lt;akpm@osdl.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@osdl.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
strstrip() does not remove the last blank from strings which only consist
of blanks.

Example:
char string[] = "  ";
strstrip(string);

results in " ", but should produce an empty string!

The following patch solves this problem:

Acked-by: Martin Schwidefsky &lt;schwidefsky@de.ibm.com&gt;
Signed-off-by: Michael Holzheu &lt;holzheu@de.ibm.com&gt;
Acked-by: Pekka Enberg &lt;penberg@cs.helsinki.fi&gt;
Acked-by Joern Engel &lt;joern@wh.fh-wedel.de&gt;
Signed-off-by: Andrew Morton &lt;akpm@osdl.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@osdl.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>[PATCH] strstrip() API</title>
<updated>2006-06-23T14:43:06+00:00</updated>
<author>
<name>Pekka Enberg</name>
<email>penberg@cs.helsinki.fi</email>
</author>
<published>2006-06-23T09:05:44+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=481fad483487ea967fe20bbc9e565d787f7bf20f'/>
<id>481fad483487ea967fe20bbc9e565d787f7bf20f</id>
<content type='text'>
Add a new strstrip() function to lib/string.c for removing leading and
trailing whitespace from a string.

Cc: Michael Holzheu &lt;holzheu@de.ibm.com&gt;
Acked-by: Ingo Oeser &lt;ioe-lkml@rameria.de&gt;
Acked-by: Joern Engel &lt;joern@wohnheim.fh-wedel.de&gt;
Cc: Corey Minyard &lt;minyard@acm.org&gt;
Signed-off-by: Pekka Enberg &lt;penberg@cs.helsinki.fi&gt;
Acked-by: Michael Holzheu &lt;HOLZHEU@de.ibm.com&gt;
Signed-off-by: Andrew Morton &lt;akpm@osdl.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@osdl.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Add a new strstrip() function to lib/string.c for removing leading and
trailing whitespace from a string.

Cc: Michael Holzheu &lt;holzheu@de.ibm.com&gt;
Acked-by: Ingo Oeser &lt;ioe-lkml@rameria.de&gt;
Acked-by: Joern Engel &lt;joern@wohnheim.fh-wedel.de&gt;
Cc: Corey Minyard &lt;minyard@acm.org&gt;
Signed-off-by: Pekka Enberg &lt;penberg@cs.helsinki.fi&gt;
Acked-by: Michael Holzheu &lt;HOLZHEU@de.ibm.com&gt;
Signed-off-by: Andrew Morton &lt;akpm@osdl.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@osdl.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>[PATCH] Silence a const vs non-const warning</title>
<updated>2006-04-11T13:18:42+00:00</updated>
<author>
<name>Jan-Benedict Glaw</name>
<email>jbglaw@lug-owl.de</email>
</author>
<published>2006-04-11T05:54:09+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=4c416ab71164dc8d3f800a942fb18c4e67f67897'/>
<id>4c416ab71164dc8d3f800a942fb18c4e67f67897</id>
<content type='text'>
lib/string.c: In function 'memcpy':
lib/string.c:470: warning: initialization discards qualifiers from pointer =
target type

Signed-off-by: Jan-Benedict Glaw &lt;jbglaw@lug-owl.de&gt;
Signed-off-by: Andrew Morton &lt;akpm@osdl.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@osdl.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
lib/string.c: In function 'memcpy':
lib/string.c:470: warning: initialization discards qualifiers from pointer =
target type

Signed-off-by: Jan-Benedict Glaw &lt;jbglaw@lug-owl.de&gt;
Signed-off-by: Andrew Morton &lt;akpm@osdl.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@osdl.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>[PATCH] Clean up arch-overrides in linux/string.h</title>
<updated>2006-04-11T13:18:40+00:00</updated>
<author>
<name>Kyle McMartin</name>
<email>kyle@parisc-linux.org</email>
</author>
<published>2006-04-11T05:53:57+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=8833d328caf009f8da58337e17a2cf5d52993a7c'/>
<id>8833d328caf009f8da58337e17a2cf5d52993a7c</id>
<content type='text'>
Some string functions were safely overrideable in lib/string.c, but their
corresponding declarations in linux/string.h were not.  Correct this, and
make strcspn overrideable.

Odds of someone wanting to do optimized assembly of these are small, but
for the sake of cleanliness, might as well bring them into line with the
rest of the file.

Signed-off-by: Kyle McMartin &lt;kyle@parisc-linux.org&gt;
Signed-off-by: Andrew Morton &lt;akpm@osdl.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@osdl.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Some string functions were safely overrideable in lib/string.c, but their
corresponding declarations in linux/string.h were not.  Correct this, and
make strcspn overrideable.

Odds of someone wanting to do optimized assembly of these are small, but
for the sake of cleanliness, might as well bring them into line with the
rest of the file.

Signed-off-by: Kyle McMartin &lt;kyle@parisc-linux.org&gt;
Signed-off-by: Andrew Morton &lt;akpm@osdl.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@osdl.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>[PATCH] No arch-specific strpbrk implementations</title>
<updated>2006-04-11T13:18:40+00:00</updated>
<author>
<name>Kyle McMartin</name>
<email>kyle@parisc-linux.org</email>
</author>
<published>2006-04-11T05:53:56+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=894b5779ceeabdce139068310e58bcf51ed9bb22'/>
<id>894b5779ceeabdce139068310e58bcf51ed9bb22</id>
<content type='text'>
While cleaning up parisc_ksyms.c earlier, I noticed that strpbrk wasn't
being exported from lib/string.c.  Investigating further, I noticed a
changeset that removed its export and added it to _ksyms.c on a few more
architectures.  The justification was that "other arches do it."

I think this is wrong, since no architecture currently defines
__HAVE_ARCH_STRPBRK, there's no reason for any of them to be exporting it
themselves.  Therefore, consolidate the export to lib/string.c.

Signed-off-by: Kyle McMartin &lt;kyle@parisc-linux.org&gt;
Signed-off-by: Andrew Morton &lt;akpm@osdl.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@osdl.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
While cleaning up parisc_ksyms.c earlier, I noticed that strpbrk wasn't
being exported from lib/string.c.  Investigating further, I noticed a
changeset that removed its export and added it to _ksyms.c on a few more
architectures.  The justification was that "other arches do it."

I think this is wrong, since no architecture currently defines
__HAVE_ARCH_STRPBRK, there's no reason for any of them to be exporting it
themselves.  Therefore, consolidate the export to lib/string.c.

Signed-off-by: Kyle McMartin &lt;kyle@parisc-linux.org&gt;
Signed-off-by: Andrew Morton &lt;akpm@osdl.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@osdl.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>[PATCH] multiple exports of strpbrk</title>
<updated>2006-03-22T15:53:56+00:00</updated>
<author>
<name>Andrew Morton</name>
<email>akpm@osdl.org</email>
</author>
<published>2006-03-22T08:07:46+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=f4a641d66c6e135dcfc861521e8008faed2411e1'/>
<id>f4a641d66c6e135dcfc861521e8008faed2411e1</id>
<content type='text'>
Sam's tree includes a new check, which found that we're exporting strpbrk()
multiple times.

It seems that the convention is that this is exported from the arch files, so
reove the lib/string.c export.

Cc: Sam Ravnborg &lt;sam@ravnborg.org&gt;
Cc: Yoshinori Sato &lt;ysato@users.sourceforge.jp&gt;
Cc: David Howells &lt;dhowells@redhat.com&gt;
Cc: Greg Ungerer &lt;gerg@uclinux.org&gt;
Signed-off-by: Andrew Morton &lt;akpm@osdl.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@osdl.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Sam's tree includes a new check, which found that we're exporting strpbrk()
multiple times.

It seems that the convention is that this is exported from the arch files, so
reove the lib/string.c export.

Cc: Sam Ravnborg &lt;sam@ravnborg.org&gt;
Cc: Yoshinori Sato &lt;ysato@users.sourceforge.jp&gt;
Cc: David Howells &lt;dhowells@redhat.com&gt;
Cc: Greg Ungerer &lt;gerg@uclinux.org&gt;
Signed-off-by: Andrew Morton &lt;akpm@osdl.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@osdl.org&gt;
</pre>
</div>
</content>
</entry>
</feed>
