public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] x86: fix two sparse warnings in early boot string handling
@ 2014-02-11 18:33 Paul Gortmaker
  2014-02-11 22:26 ` David Rientjes
  0 siblings, 1 reply; 12+ messages in thread
From: Paul Gortmaker @ 2014-02-11 18:33 UTC (permalink / raw)
  To: linux-kernel
  Cc: Paul Gortmaker, H. Peter Anvin, Thomas Gleixner, Ingo Molnar, x86

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@zytor.com>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: x86@kernel.org
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
---
 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


^ permalink raw reply related	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2014-02-13 14:01 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-02-11 18:33 [PATCH] x86: fix two sparse warnings in early boot string handling Paul Gortmaker
2014-02-11 22:26 ` David Rientjes
2014-02-12  2:00   ` Paul Gortmaker
2014-02-12  2:23     ` David Rientjes
2014-02-12 14:57       ` Paul Gortmaker
2014-02-12 15:49         ` Paul Gortmaker
2014-02-12 22:00           ` David Rientjes
2014-02-12 22:29             ` Paul Gortmaker
2014-02-12 23:14               ` David Rientjes
2014-02-12 23:31                 ` H. Peter Anvin
2014-02-13 10:31                   ` Matt Fleming
2014-02-13 14:01                     ` H. Peter Anvin

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox