Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1275279 > unrolled thread
| Started by | Jeff Layton <jlayton@poochiereds.net> |
|---|---|
| First post | 2015-11-23 13:30 +0100 |
| Last post | 2015-11-23 21:50 +0100 |
| Articles | 3 — 2 participants |
Back to article view | Back to linux.kernel
[PATCH v2] mm: fix up sparse warning in gfpflags_allow_blocking Jeff Layton <jlayton@poochiereds.net> - 2015-11-23 13:30 +0100
Re: [PATCH v2] mm: fix up sparse warning in gfpflags_allow_blocking Michal Hocko <mhocko@kernel.org> - 2015-11-23 13:50 +0100
Re: [PATCH v2] mm: fix up sparse warning in gfpflags_allow_blocking Jeff Layton <jlayton@poochiereds.net> - 2015-11-23 21:50 +0100
| From | Jeff Layton <jlayton@poochiereds.net> |
|---|---|
| Date | 2015-11-23 13:30 +0100 |
| Subject | [PATCH v2] mm: fix up sparse warning in gfpflags_allow_blocking |
| Message-ID | <qxYpQ-1FW-11@gated-at.bofh.it> |
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>
---
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
--
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/
[toc] | [next] | [standalone]
| From | Michal Hocko <mhocko@kernel.org> |
|---|---|
| Date | 2015-11-23 13:50 +0100 |
| Message-ID | <qxYJc-1N0-19@gated-at.bofh.it> |
| In reply to | #1275279 |
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 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/
[toc] | [prev] | [next] | [standalone]
| From | Jeff Layton <jlayton@poochiereds.net> |
|---|---|
| Date | 2015-11-23 21:50 +0100 |
| Message-ID | <qy6dI-6Rx-25@gated-at.bofh.it> |
| In reply to | #1275292 |
On Mon, 23 Nov 2015 13:45:04 +0100
Michal Hocko <mhocko@kernel.org> wrote:
> 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!
>
Doh! The original version has already been merged. I'll spin up a new
patch that will apply to mainline when I get a bit of time.
Thanks,
Jeff
> > ---
> > 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
>
--
Jeff Layton <jlayton@poochiereds.net>
--
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/
[toc] | [prev] | [standalone]
Back to top | Article view | linux.kernel
csiph-web