aboutsummaryrefslogtreecommitdiffstats
path: root/lib/string.c
diff options
context:
space:
mode:
authorJesper Juhl <jesper.juhl@gmail.com>2005-10-30 18:02:12 -0500
committerLinus Torvalds <torvalds@g5.osdl.org>2005-10-30 20:37:19 -0500
commitcc75fb71c0100d921637a11ded5e333883be5df3 (patch)
treecc305a6ab2cbd8d5f5754e1bf900a458d7d2a4cb /lib/string.c
parent51a0f0f658b0e757d569e8ac224ccb6bbfe3c181 (diff)
[PATCH] lib/string.c cleanup: remove pointless register keyword
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>
Diffstat (limited to 'lib/string.c')
-rw-r--r--lib/string.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/string.c b/lib/string.c
index 54eb3f81f85e..542829742c85 100644
--- a/lib/string.c
+++ b/lib/string.c
@@ -219,7 +219,7 @@ EXPORT_SYMBOL(strlcat);
219#undef strcmp 219#undef strcmp
220int strcmp(const char *cs, const char *ct) 220int strcmp(const char *cs, const char *ct)
221{ 221{
222 register signed char __res; 222 signed char __res;
223 223
224 while (1) { 224 while (1) {
225 if ((__res = *cs - *ct++) != 0 || !*cs++) 225 if ((__res = *cs - *ct++) != 0 || !*cs++)
@@ -239,7 +239,7 @@ EXPORT_SYMBOL(strcmp);
239 */ 239 */
240int strncmp(const char *cs, const char *ct, size_t count) 240int strncmp(const char *cs, const char *ct, size_t count)
241{ 241{
242 register signed char __res = 0; 242 signed char __res = 0;
243 243
244 while (count) { 244 while (count) {
245 if ((__res = *cs - *ct++) != 0 || !*cs++) 245 if ((__res = *cs - *ct++) != 0 || !*cs++)