[PATCH] x86: fix two sparse warnings in early boot string handling

From: Paul Gortmaker
Date: Tue Feb 11 2014 - 13:34:14 EST


Fixes:

arch/x86/boot/compressed/../string.c:60:14: warning: symbol 'atou' was not declared. Should it be static?
arch/x86/boot/string.c:133:6: warning: symbol 'strstr' was not declared. Should it be static?

The atou one could be considered a false positive; it seems somehow
caused by including ./string.c from within /compressed/string.c file.
However git grep shows only the atou prototype and declaration, so
it is completely unused and we can hence delete it.

Cc: "H. Peter Anvin" <hpa@xxxxxxxxx>
Cc: Thomas Gleixner <tglx@xxxxxxxxxxxxx>
Cc: Ingo Molnar <mingo@xxxxxxxxxx>
Cc: x86@xxxxxxxxxx
Signed-off-by: Paul Gortmaker <paul.gortmaker@xxxxxxxxxxxxx>
---
arch/x86/boot/boot.h | 2 +-
arch/x86/boot/string.c | 8 --------
2 files changed, 1 insertion(+), 9 deletions(-)

diff --git a/arch/x86/boot/boot.h b/arch/x86/boot/boot.h
index 50f8c5e0f37e..d318b6b86197 100644
--- a/arch/x86/boot/boot.h
+++ b/arch/x86/boot/boot.h
@@ -344,8 +344,8 @@ void initregs(struct biosregs *regs);
/* string.c */
int strcmp(const char *str1, const char *str2);
int strncmp(const char *cs, const char *ct, size_t count);
+char *strstr(const char *s1, const char *s2);
size_t strnlen(const char *s, size_t maxlen);
-unsigned int atou(const char *s);
unsigned long long simple_strtoull(const char *cp, char **endp, unsigned int base);
size_t strlen(const char *s);

diff --git a/arch/x86/boot/string.c b/arch/x86/boot/string.c
index 574dedfe2890..59b219c03c77 100644
--- a/arch/x86/boot/string.c
+++ b/arch/x86/boot/string.c
@@ -57,14 +57,6 @@ size_t strnlen(const char *s, size_t maxlen)
return (es - s);
}

-unsigned int atou(const char *s)
-{
- unsigned int i = 0;
- while (isdigit(*s))
- i = i * 10 + (*s++ - '0');
- return i;
-}
-
/* Works only for digits and letters, but small and fast */
#define TOLOWER(x) ((x) | 0x20)

--
1.8.5.2

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/