lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20151123124503.GJ21050@dhcp22.suse.cz>
Date:	Mon, 23 Nov 2015 13:45:04 +0100
From:	Michal Hocko <mhocko@...nel.org>
To:	Jeff Layton <jlayton@...chiereds.net>
Cc:	Andrew Morton <akpm@...ux-foundation.org>,
	Mel Gorman <mgorman@...hsingularity.net>, linux-mm@...ck.org,
	linux-kernel@...r.kernel.org
Subject: Re: [PATCH v2] mm: fix up sparse warning in gfpflags_allow_blocking

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@...nel.org>
> Cc: Mel Gorman <mgorman@...hsingularity.net>
> Signed-off-by: Jeff Layton <jeff.layton@...marydata.com>

Acked-by: Michal Hocko <mhocko@...e.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 from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ