mirror of
https://github.com/Fishwaldo/linux-bl808.git
synced 2025-06-17 20:25:19 +00:00
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>
This commit is contained in:
parent
925ede0bf4
commit
ca54cb8c9e
3 changed files with 13 additions and 6 deletions
|
@ -63,7 +63,14 @@ extern char * strnchr(const char *, size_t, int);
|
|||
extern char * strrchr(const char *,int);
|
||||
#endif
|
||||
extern char * __must_check skip_spaces(const char *);
|
||||
extern char * __must_check strstrip(char *);
|
||||
|
||||
extern char *strim(char *);
|
||||
|
||||
static inline __must_check char *strstrip(char *str)
|
||||
{
|
||||
return strim(str);
|
||||
}
|
||||
|
||||
#ifndef __HAVE_ARCH_STRSTR
|
||||
extern char * strstr(const char *,const char *);
|
||||
#endif
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue