Skip to contentSkip to conversation

strlen patch

PATCH In review Fred Chen 3 participants 3 messages Aug 13, 2013 x86

lore
Share & tools
lore

Fred Chen

author
#0 lore raw

PATCH 1/1 strlen patch

Below is a patch that fixes sparse error "arch/x86/boot/string.c:119:8: warning: symbol 'strlen' was not declared." by declaring it in arch/x86/boot/boot.h.

---
 arch/x86/boot/boot.h |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)
arch/x86/boot/boot.h +1 -0
index 5b75319..ef72bae 100644
@@ -355,6 +355,7 @@ int strncmp(const char *cs, const char *ct, size_t count);
 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);
 
 /* tty.c */
 void puts(const char *);
Signature · 1 line
1.7.1
#1 lore raw
Quoted 1 line · Fred Chen

fixes sparse error "arch/x86/boot/string.c:119:8: warning: symbol 'strlen' was not declared." by declaring it in arch/x86/boot/boot.h.

[]

arch/x86/boot/boot.h

Quoted 1 line
arch/x86/boot/boot.h +0 -0

[]

arch/x86/boot/boot.h int strncmp(const char *cs, const char *ct, size_t count); · line 358

Quoted 5 lines
arch/x86/boot/boot.h +1 -0
@@ -355,6 +355,7 @@ int strncmp(const char *cs, const char *ct, size_t count);
 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);

better placed before strnlen no?

#2 lore raw

[tip:x86/cleanups] x86, boot: Fix warning due to undeclared strlen()

In reply to Fred Chen
x86, boot: Fix warning due to undeclared strlen()
Commit-ID:  062fe8fe511e7f771ef1dc824eaf996ba50a694b
Gitweb:     http://git.kernel.org/tip/062fe8fe511e7f771ef1dc824eaf996ba50a694b
Author:     Fred Chen <[email protected]>
AuthorDate: Tue, 13 Aug 2013 11:13:00 -0700
Committer:  H. Peter Anvin <[email protected]>
CommitDate: Tue, 13 Aug 2013 11:27:39 -0700

x86, boot: Fix warning due to undeclared strlen()

Below is a patch that fixes sparse error "arch/x86/boot/string.c:119:8: warning: symbol 'strlen' was not declared." by declaring it in arch/x86/boot/boot.h.

---
 arch/x86/boot/boot.h | 1 +
 1 file changed, 1 insertion(+)
arch/x86/boot/boot.h +1 -0
index 5b75319..ef72bae 100644
@@ -355,6 +355,7 @@ int strncmp(const char *cs, const char *ct, size_t count);
 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);
 
 /* tty.c */
 void puts(const char *);