01 May, 2008

1 commit

  • Add a new sysfs_streq() string comparison function, which ignores
    the trailing newlines found in sysfs inputs. By example:

    sysfs_streq("a", "b") ==> false
    sysfs_streq("a", "a") ==> true
    sysfs_streq("a", "a\n") ==> true
    sysfs_streq("a\n", "a") ==> 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
    Acked-by: Greg KH
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    David Brownell
     

26 Apr, 2007

1 commit


12 Feb, 2007

1 commit

  • 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
    Cc: "Randy.Dunlap"
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Robert P. J. Day
     

29 Oct, 2006

1 commit

  • 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
    Signed-off-by: Michael Holzheu
    Acked-by: Pekka Enberg
    Acked-by Joern Engel
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Michael Holzheu
     

23 Jun, 2006

1 commit

  • Add a new strstrip() function to lib/string.c for removing leading and
    trailing whitespace from a string.

    Cc: Michael Holzheu
    Acked-by: Ingo Oeser
    Acked-by: Joern Engel
    Cc: Corey Minyard
    Signed-off-by: Pekka Enberg
    Acked-by: Michael Holzheu
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Pekka Enberg
     

11 Apr, 2006

3 commits

  • lib/string.c: In function 'memcpy':
    lib/string.c:470: warning: initialization discards qualifiers from pointer =
    target type

    Signed-off-by: Jan-Benedict Glaw
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Jan-Benedict Glaw
     
  • 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
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Kyle McMartin
     
  • 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
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Kyle McMartin
     

22 Mar, 2006

1 commit

  • 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
    Cc: Yoshinori Sato
    Cc: David Howells
    Cc: Greg Ungerer
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Andrew Morton
     

31 Oct, 2005

4 commits

  • 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
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Paul Jackson
     
  • 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
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Jesper Juhl
     
  • 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
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Jesper Juhl
     
  • Removes some blank lines, removes some trailing whitespace, adds spaces
    after commas and a few similar changes.

    Signed-off-by: Jesper Juhl
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Jesper Juhl
     

06 May, 2005

2 commits

  • this clarifies the documentation on the behavier of strncpy().

    Signed-off-by: Domen Puncer
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    walter harms
     
  • 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
    CC: Andi Kleen
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Paolo 'Blaisorblade' Giarrusso
     

17 Apr, 2005

1 commit

  • Initial git repository build. I'm not bothering with the full history,
    even though we have it. We can create a separate "historical" git
    archive of that later if we want to, and in the meantime it's about
    3.2GB when imported into git - space that would just make the early
    git days unnecessarily complicated, when we don't have a lot of good
    infrastructure for it.

    Let it rip!

    Linus Torvalds