Linux SCSI subsystem development
 help / color / mirror / Atom feed
* [PATCH] strstrip incorrectly marked __must_check
@ 2009-11-03 18:38 James Bottomley
  2009-11-03 18:59 ` Andrew Morton
  0 siblings, 1 reply; 12+ messages in thread
From: James Bottomley @ 2009-11-03 18:38 UTC (permalink / raw)
  To: KOSAKI Motohiro; +Cc: linux-scsi, linux-kernel, Andrew Morton

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@suse.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

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

end of thread, other threads:[~2009-11-24  9:09 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-11-03 18:38 [PATCH] strstrip incorrectly marked __must_check James Bottomley
2009-11-03 18:59 ` Andrew Morton
2009-11-03 19:04   ` Matthew Wilcox
2009-11-03 19:06     ` KOSAKI Motohiro
2009-11-03 19:10     ` Alan Cox
2009-11-03 19:11     ` James Bottomley
2009-11-03 19:10   ` James Bottomley
2009-11-03 19:12   ` Alan Cox
2009-11-03 19:58     ` KOSAKI Motohiro
2009-11-23 13:04       ` Michael Holzheu
2009-11-24  8:55         ` KOSAKI Motohiro
2009-11-24  9:09           ` Michael Holzheu

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