diff options
author | KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com> | 2009-12-14 21:01:15 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2009-12-15 11:53:34 -0500 |
commit | ca54cb8c9eb38095dc420b73c6380ce1dbeb10fa (patch) | |
tree | 35b5ba777b962e95039521d912d926a9372b2e8f /include/linux/string.h | |
parent | 925ede0bf4ecef96fc2d939b16619530111aa16e (diff) |
Subject: Re: [PATCH] strstrip incorrectly marked __must_check
Recently, We marked strstrip() as must_check. because it was frequently
misused and it should be checked. However, we found one exception.
scsi/ipr.c intentionally ignore return value of strstrip. Because it
wishes to keep the whitespace at the beginning.
Thus we need to keep with and without checked whitespace trim function.
This patch adds a new strim() and changes ipr.c to use it.
[akpm@linux-foundation.org: coding-style fixes]
Suggested-by: Alan Cox <alan@lxorguk.ukuu.org.uk>
Signed-off-by: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
Cc: James Bottomley <James.Bottomley@HansenPartnership.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'include/linux/string.h')
-rw-r--r-- | include/linux/string.h | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/include/linux/string.h b/include/linux/string.h index 168dad11ae03..651839a2a755 100644 --- a/include/linux/string.h +++ b/include/linux/string.h | |||
@@ -63,7 +63,14 @@ extern char * strnchr(const char *, size_t, int); | |||
63 | extern char * strrchr(const char *,int); | 63 | extern char * strrchr(const char *,int); |
64 | #endif | 64 | #endif |
65 | extern char * __must_check skip_spaces(const char *); | 65 | extern char * __must_check skip_spaces(const char *); |
66 | extern char * __must_check strstrip(char *); | 66 | |
67 | extern char *strim(char *); | ||
68 | |||
69 | static inline __must_check char *strstrip(char *str) | ||
70 | { | ||
71 | return strim(str); | ||
72 | } | ||
73 | |||
67 | #ifndef __HAVE_ARCH_STRSTR | 74 | #ifndef __HAVE_ARCH_STRSTR |
68 | extern char * strstr(const char *,const char *); | 75 | extern char * strstr(const char *,const char *); |
69 | #endif | 76 | #endif |