Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753592AbbKWMpJ (ORCPT ); Mon, 23 Nov 2015 07:45:09 -0500 Received: from mail-wm0-f43.google.com ([74.125.82.43]:37690 "EHLO mail-wm0-f43.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753343AbbKWMpG (ORCPT ); Mon, 23 Nov 2015 07:45:06 -0500 Date: Mon, 23 Nov 2015 13:45:04 +0100 From: Michal Hocko To: Jeff Layton Cc: Andrew Morton , Mel Gorman , linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v2] mm: fix up sparse warning in gfpflags_allow_blocking Message-ID: <20151123124503.GJ21050@dhcp22.suse.cz> References: <1448281409-13132-1-git-send-email-jeff.layton@primarydata.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1448281409-13132-1-git-send-email-jeff.layton@primarydata.com> User-Agent: Mutt/1.5.24 (2015-08-30) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1426 Lines: 47 On Mon 23-11-15 07:23:29, Jeff Layton wrote: > 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 comparison to zero to have it return bool. > > Cc: Michal Hocko > Cc: Mel Gorman > Signed-off-by: Jeff Layton Acked-by: Michal Hocko Thanks! > --- > include/linux/gfp.h | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > [v2: use a compare instead of forced cast, as suggested by Michal] > > diff --git a/include/linux/gfp.h b/include/linux/gfp.h > index 6523109e136d..b76c92073b1b 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 (gfp_flags & __GFP_DIRECT_RECLAIM) != 0; > } > > #ifdef CONFIG_HIGHMEM > -- > 2.4.3 -- Michal Hocko SUSE Labs -- 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/