| Age | Commit message (Collapse) | Author |
|
We have several platforms using local copies of identical
code.
Signed-off-by: David S. Miller <davem@davemloft.net>
|
|
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 <rpjday@mindspring.com>
Cc: "Randy.Dunlap" <rdunlap@xenotime.net>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
|
|
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 <schwidefsky@de.ibm.com>
Signed-off-by: Michael Holzheu <holzheu@de.ibm.com>
Acked-by: Pekka Enberg <penberg@cs.helsinki.fi>
Acked-by Joern Engel <joern@wh.fh-wedel.de>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
|
|
Add a new strstrip() function to lib/string.c for removing leading and
trailing whitespace from a string.
Cc: Michael Holzheu <holzheu@de.ibm.com>
Acked-by: Ingo Oeser <ioe-lkml@rameria.de>
Acked-by: Joern Engel <joern@wohnheim.fh-wedel.de>
Cc: Corey Minyard <minyard@acm.org>
Signed-off-by: Pekka Enberg <penberg@cs.helsinki.fi>
Acked-by: Michael Holzheu <HOLZHEU@de.ibm.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
|
|
lib/string.c: In function 'memcpy':
lib/string.c:470: warning: initialization discards qualifiers from pointer =
target type
Signed-off-by: Jan-Benedict Glaw <jbglaw@lug-owl.de>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
|
|
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 <kyle@parisc-linux.org>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
|
|
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 <kyle@parisc-linux.org>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
|
|
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 <sam@ravnborg.org>
Cc: Yoshinori Sato <ysato@users.sourceforge.jp>
Cc: David Howells <dhowells@redhat.com>
Cc: Greg Ungerer <gerg@uclinux.org>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
|
|
A couple of (char *) casts removed in a previous cleanup patch in
lib/string.c:memmove() were actually useful, as they suppressed a couple of
warnings:
assignment discards qualifiers from pointer target type
Fix by declaring the local variable const in the first place, so casts
aren't needed to strip the const qualifier.
Signed-off-by: Paul Jackson <pj@sgi.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
|
|
The first two hunks of the patch really belongs in patch 1, but I missed
them on the first pass and instead of redoing all 3 patches I stuck them in
this one.
Signed-off-by: Jesper Juhl <jesper.juhl@gmail.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
|
|
Removes a few pointless register keywords. register is merely a compiler
hint that access to the variable should be optimized, but gcc (3.3.6 in my
case) generates the exact same code with and without the keyword, and even
if gcc did something different with register present I think it is doubtful
we would want to optimize access to these variables - especially since this
is generic library code and there are supposed to be optimized versions in
asm/ for anything that really matters speed wise.
(akpm: iirc, keyword register is a gcc no-op unless using -O0)
Signed-off-by: Jesper Juhl <jesper.juhl@gmail.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
|
|
Removes some blank lines, removes some trailing whitespace, adds spaces
after commas and a few similar changes.
Signed-off-by: Jesper Juhl <jesper.juhl@gmail.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
|
|
this clarifies the documentation on the behavier of strncpy().
Signed-off-by: Domen Puncer <domen@coderock.org>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
|
|
In include/asm-x86_64/string.h there are such comments:
/* Use C out of line version for memcmp */
#define memcmp __builtin_memcmp
int memcmp(const void * cs,const void * ct,size_t count);
This would mean that if the compiler does not decide to use __builtin_memcmp,
it emits a call to memcmp to be satisfied by the C out-of-line version in
lib/string.c. What happens is that after preprocessing, in lib/string.i you
may find the definition of "__builtin_strcmp".
Actually, by accident, in the object you will find the definition of strcmp
and such (maybe a trick intended to redirect calls to __builtin_memcmp to the
default memcmp when the definition is not expanded); however, this particular
case is not a documented feature as far as I can see.
Also, the EXPORT_SYMBOL does not work, so it's duplicated in the arch.
I simply added some #undef to lib/string.c and removed the (now duplicated)
exports in x86-64 and UML/x86_64 subarchs (the second ones are introduced by
another patch I just posted for -mm).
Signed-off-by: Paolo 'Blaisorblade' Giarrusso <blaisorblade@yahoo.it>
CC: Andi Kleen <ak@suse.de>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
|
|
Nothing in the kernel is using bcopy right know, and that is a good thing.
Why? Because a lot of the architectures implement a broken bcopy()....
the userspace standard bcopy() is basically a memmove() with a weird
parameter order, however a bunch of architectures implement a memcpy() not a
memmove().
Instead of fixing this inconsistency, I decided to remove it entirely,
explicit memcpy() and memmove() are prefered anyway (welcome to the 1990's)
and nothing in the kernel is using these functions, so this saves code size
as well for everyone.
Signed-off-by: Arjan van de Ven <arjan@infradead.org>
Signed-off-by: Adrian Bunk <bunk@stusta.de>
[ Side note: the only reason for bcopy appears to be totally ancient
gcc versions for OSF/1, used to originally cross-compile Linux on
alpha. Possibly some other similar cases. Time to move on ;-]
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
|
|
IN_STRING_C was an i386-specific hack by Andi Kleen to provide out-of-line
versions of some lib/string.c functions that aren't directly used on i386
(because there are inline assembly versions).
This can cause problems if gcc chooses to transparently replace a call to one
string function with a call to another string function (the example Andi gave
was a replacement of a sprintf call with a strcpy call) which generates a
function call to the replacement function.
The problems observed by Andi only occur in recent kernels without
-fno-unit-at-a-time.
With -ffreestanding it can't even cause any problems in case we'd one day drop
the -fno-unit-at-a-time since gcc mustn't assume in a freestanding environment
that all standard C library functions are available.
The effect of this patch is a small space saving in the kernel.
Signed-off-by: Adrian Bunk <bunk@stusta.de>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
|
|
Quite a few functions in lib/string.c are not exported. I ran into this
trying to use strnchr() in a module.
This patch
- exports every function defined in lib/string.c
- adds some missing __HAVE_ARCH_xxx defines for i386
- gets rid of the exports of functions from lib/string.c in arch/s390
(BTW, why is s390 exporting things NOVERS?)
Signed-off-by: Roland Dreier <roland@topspin.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
|
|
A classic..
lib/string.c:165:19: warning: assignment expression in conditional
From: Mika Kukkonen <mika@osdl.org>
Signed-off-by: Randy Dunlap <rddunlap@osdl.org>
|
|
From: Alexey Dobriyan <adobriyan@mail.ru>
Fix various kernel-doc parameters.
|
|
Convert dev_alloc_name from O(n^2) lookup to O(n) by using a page as
bitmap to figure out how many devices of that pattern have been allocated.
This works for up to 32k devices (PAGE_SIZE*8) on i386, more on other
platforms. Correctly handles the boundary cases where number of devices
won't fit because name length is limited.
Adds strnchr to the string libraries since we need to find the % format
character, but only care if it is in the first 15 bytes.
|
|
From: Andi Kleen <ak@muc.de>
gcc 3.4 optimizes sprintf(foo,"%s",string) into strcpy. Unfortunately that
isn't seen by the inliner and linux/i386 has no out-of-line strcpy so you
end up with a linker error.
This patch adds out of line copies for most string functions to avoid this.
Actually it doesn't export them to modules yet, that would be the next
step.
BTW In my opinion we shouldn't use inline string functions at all. The
__builtin_str* in modern gcc are better (I used them very successfully on
x86-64) and for the bigger functions like strrchr,strtok et.al. it just
doesn't make any sense to inline them or even code them in assembler.
Also fix the bcopy prototype gcc was complaining about.
|
|
|
|
|
|
This is Erik Andersen's excellent strncpy.
It works like magic. That "if" isn't a jump;
gcc uses a few integer instructions to wipe
out all jumps except for the loop itself and
the function call/return.
This has been exhaustively tested against glibc.
The existing code has 5 extra branches and
is over twice as large. (my gcc, etc.)
|
|
From: Yoshinori Sato <ysato@users.sourceforge.jp>
It writes one too many zeroes when nulling out the destination.
|
|
|
|
|
|
|
|
|
|
This patch implements a generic strcspn.
|
|
|
|
- Andrea Arkangeli: raw-io fixes
- Johannes Erdfelt: USB updates
- reiserfs update
- Al Viro: fsync/umount race fix
- Rusty Russell: netfilter sync
|
|
- Bob Tracy: Cyrix MTRR setup fix (don't make it twice as big as asked
for)
- Trond Myklebust: rpciod needs to be PF_MEMALLOC to avoid deadlocks on
memory allocation when writing out NFS data under low memory conditions.
Fix up BKL and RPC interactions.
- Jeff Garzik: tulip network driver update
- fix truncate to call down to the filesystem with the kernel lock.
- David Mosberger: ia64 update
- David Mosberger: simplify ELF program header generation.
- Alan Cox: merge from -ac series
- Jeff Garzik: make serial.c recognize modem devices properly
|
|
- Alan Cox: continued merging
- Urban Widmark: smbfs fix (d_add on already hashed dentry - no-no).
- Andrew Morton: 3c59x update
- Jeff Garzik: network driver cleanups and fixes
- Gérard Roudier: sym-ncr drivers update
- Jens Axboe: more loop cleanups and fixes
- David Miller: sparc update, some networking fixes
|
|
|