[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <1257273488.9427.27.camel@mulgrave.site>
Date: Tue, 03 Nov 2009 12:38:08 -0600
From: James Bottomley <James.Bottomley@...e.de>
To: KOSAKI Motohiro <kosaki.motohiro@...fujitsu.com>
Cc: linux-scsi@...r.kernel.org,
linux-kernel <linux-kernel@...r.kernel.org>,
Andrew Morton <akpm@...ux-foundation.org>
Subject: [PATCH] strstrip incorrectly marked __must_check
strstrip strips whitespace from the beginning and end of a string. I
agree you have to take the returned pointer if you want to strip from
the beginning. However, if you wish to keep the whitespace at the
beginning and only wish strstrip to remove it from the end, then it's
entirely legitimate to discard the returned pointer.
This is what we have in drivers/scsi/ipr.c and the patch to make
strstrip __must_check is now causing SCSI spurious warnings in that
code.
Signed-off-by: James Bottomley <James.Bottomley@...e.de>
---
diff --git a/include/linux/string.h b/include/linux/string.h
index b850886..489019e 100644
--- a/include/linux/string.h
+++ b/include/linux/string.h
@@ -62,7 +62,7 @@ extern char * strnchr(const char *, size_t, int);
#ifndef __HAVE_ARCH_STRRCHR
extern char * strrchr(const char *,int);
#endif
-extern char * __must_check strstrip(char *);
+extern char * strstrip(char *);
#ifndef __HAVE_ARCH_STRSTR
extern char * strstr(const char *,const char *);
#endif
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists