Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1274128

[PATCH] mm: fix up sparse warning in gfpflags_allow_blocking

From Jeff Layton <jlayton@poochiereds.net>
Newsgroups linux.kernel
Subject [PATCH] mm: fix up sparse warning in gfpflags_allow_blocking
Date 2015-11-20 15:50 +0100
Message-ID <qwVaG-8uf-23@gated-at.bofh.it> (permalink)
Organization linux.* mail to news gateway

Show all headers | View raw


sparse says:

    include/linux/gfp.h:274:26: warning: incorrect type in return expression (different base types)
    include/linux/gfp.h:274:26:    expected bool
    include/linux/gfp.h:274:26:    got restricted gfp_t

...add a forced cast to silence the warning.

Cc: Mel Gorman <mgorman@techsingularity.net>
Signed-off-by: Jeff Layton <jeff.layton@primarydata.com>
---
 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 6523109e136d..8942af0813e3 100644
--- a/include/linux/gfp.h
+++ b/include/linux/gfp.h
@@ -271,7 +271,7 @@ static inline int gfpflags_to_migratetype(const gfp_t gfp_flags)
 
 static inline bool gfpflags_allow_blocking(const gfp_t gfp_flags)
 {
-	return gfp_flags & __GFP_DIRECT_RECLAIM;
+	return (bool __force)(gfp_flags & __GFP_DIRECT_RECLAIM);
 }
 
 #ifdef CONFIG_HIGHMEM
-- 
2.4.3

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Back to linux.kernel | Previous | Next — Next in thread | Find similar | Unroll thread


Thread

[PATCH] mm: fix up sparse warning in gfpflags_allow_blocking Jeff Layton <jlayton@poochiereds.net> - 2015-11-20 15:50 +0100
  Re: [PATCH] mm: fix up sparse warning in gfpflags_allow_blocking Michal Hocko <mhocko@kernel.org> - 2015-11-23 11:00 +0100
    Re: [PATCH] mm: fix up sparse warning in gfpflags_allow_blocking Jeff Layton <jlayton@poochiereds.net> - 2015-11-23 13:00 +0100

csiph-web