linux-cvs-patches
[Top] [All Lists]

CVS Update@linux-mips.org: linux

To: linux-cvs-patches@linux-mips.org
Subject: CVS Update@linux-mips.org: linux
From: ralf@linux-mips.org
Date: Fri, 28 Jan 2005 17:53:00 +0000
Reply-to: linux-mips@linux-mips.org
Sender: linux-cvs-patches-bounce@linux-mips.org
CVSROOT:        /home/cvs
Module name:    linux
Changes by:     ralf@ftp.linux-mips.org 05/01/28 17:52:53

Modified files:
        lib            : string.c 

Log message:
        Drop optimizations which due to C compiler progress no longer help.

diff -urN linux/lib/string.c linux/lib/string.c
--- linux/lib/string.c  2005/01/13 14:07:01     1.26
+++ linux/lib/string.c  2005/01/28 17:52:53     1.27
@@ -442,7 +442,7 @@
  *
  * Do not use memset() to access IO space, use memset_io() instead.
  */
-void * memset(void * s,int c, size_t count)
+void * memset(void * s,int c,size_t count)
 {
        char *xs = (char *) s;
 
@@ -564,15 +564,14 @@
 void * memscan(void * addr, int c, size_t size)
 {
        unsigned char * p = (unsigned char *) addr;
-       unsigned char * e = p + size;
 
-       while (p != e) {
-               if (*p == (unsigned char)c)
+       while (size) {
+               if (*p == c)
                        return (void *) p;
                p++;
+               size--;
        }
-
-       return (void *) p;
+       return (void *) p;
 }
 EXPORT_SYMBOL(memscan);
 #endif

<Prev in Thread] Current Thread [Next in Thread>