All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] mm: fix noisy sparse warning in LIBCFS_ALLOC_PRE()
@ 2015-12-27  5:12 ` Joshua Clayton
  0 siblings, 0 replies; 10+ messages in thread
From: Joshua Clayton @ 2015-12-27  5:12 UTC (permalink / raw)
  To: Andrew Morton
  Cc: linux-mm, linux-kernel, Greg Kroah-Hartman, Oleg Drokin,
	Andreas Dilger, lustre-devel, devel, Joshua Clayton

running sparse on drivers/staging/lustre results in dozens of warnings:
include/linux/gfp.h:281:41: warning:
odd constant _Bool cast (400000 becomes 1)

Use "!!" to explicitly convert the result to bool range.
---
 include/linux/gfp.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/include/linux/gfp.h b/include/linux/gfp.h
index 91f74e7..6e58a8f 100644
--- a/include/linux/gfp.h
+++ b/include/linux/gfp.h
@@ -278,7 +278,7 @@ static inline int gfpflags_to_migratetype(const gfp_t gfp_flags)
 
 static inline bool gfpflags_allow_blocking(const gfp_t gfp_flags)
 {
-	return (bool __force)(gfp_flags & __GFP_DIRECT_RECLAIM);
+	return (bool __force)!!(gfp_flags & __GFP_DIRECT_RECLAIM);
 }
 
 #ifdef CONFIG_HIGHMEM
-- 
2.6.4

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

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

end of thread, other threads:[~2015-12-30  4:54 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-12-27  5:12 [PATCH] mm: fix noisy sparse warning in LIBCFS_ALLOC_PRE() Joshua Clayton
2015-12-27  5:12 ` Joshua Clayton
2015-12-27  5:41 ` Al Viro
2015-12-27  5:41   ` Al Viro
2015-12-27  6:39   ` [PATCH v2] " Joshua Clayton
2015-12-27  6:39     ` Joshua Clayton
2015-12-30  4:47 ` [PATCH] " Sudip Mukherjee
2015-12-30  4:47   ` Sudip Mukherjee
2015-12-30  4:54   ` Joshua Clayton
2015-12-30  4:54     ` Joshua Clayton

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.