mm: fix noisy sparse warning in LIBCFS_ALLOC_PRE()
authorJoshua Clayton <[email protected]>
Thu, 14 Jan 2016 23:22:10 +0000 (15:22 -0800)
committerLinus Torvalds <[email protected]>
Fri, 15 Jan 2016 00:00:49 +0000 (16:00 -0800)
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 to bool and get rid of the warning.

Signed-off-by: Joshua Clayton <[email protected]>
Cc: Mel Gorman <[email protected]>
Cc: Al Viro <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
include/linux/gfp.h

index 91f74e741aa2d4d8e09566bdf70fe121b0b22f6a..28ad5f6494b018a2c49493920059de62fcacdb8e 100644 (file)
@@ -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 !!(gfp_flags & __GFP_DIRECT_RECLAIM);
 }
 
 #ifdef CONFIG_HIGHMEM