linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Michal Hocko <mhocko@kernel.org>
To: Jeff Layton <jlayton@poochiereds.net>
Cc: Andrew Morton <akpm@linux-foundation.org>,
	Mel Gorman <mgorman@techsingularity.net>,
	linux-mm@kvack.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2] mm: fix up sparse warning in gfpflags_allow_blocking
Date: Mon, 23 Nov 2015 13:45:04 +0100	[thread overview]
Message-ID: <20151123124503.GJ21050@dhcp22.suse.cz> (raw)
In-Reply-To: <1448281409-13132-1-git-send-email-jeff.layton@primarydata.com>

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 <mhocko@kernel.org>
> Cc: Mel Gorman <mgorman@techsingularity.net>
> Signed-off-by: Jeff Layton <jeff.layton@primarydata.com>

Acked-by: Michal Hocko <mhocko@suse.com>

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, 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>

  reply	other threads:[~2015-11-23 12:45 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-11-23 12:23 Jeff Layton
2015-11-23 12:45 ` Michal Hocko [this message]
2015-11-23 20:46   ` Jeff Layton

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20151123124503.GJ21050@dhcp22.suse.cz \
    --to=mhocko@kernel.org \
    --cc=akpm@linux-foundation.org \
    --cc=jlayton@poochiereds.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=mgorman@techsingularity.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox