diff mbox

[05/62] radix tree: Add a missing cast to gfp_t

Message ID 20171122210739.29916-6-willy@infradead.org (mailing list archive)
State New, archived
Headers show

Commit Message

Matthew Wilcox Nov. 22, 2017, 9:06 p.m. UTC
From: Matthew Wilcox <mawilcox@microsoft.com>

sparse complains about an invalid type assignment.

Signed-off-by: Matthew Wilcox <mawilcox@microsoft.com>
---
 lib/radix-tree.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Matthew Wilcox Nov. 22, 2017, 10:24 p.m. UTC | #1
On Wed, Nov 22, 2017 at 10:28:48PM +0100, Luc Van Oostenryck wrote:
> > -	root->gfp_mask &= (1 << ROOT_TAG_SHIFT) - 1;
> > +	root->gfp_mask &= (__force gfp_t)((1 << ROOT_TAG_SHIFT) - 1);
> 
> IMO, it would be better to define something for that in radix-tree.h,
> like it has been done for ROOT_IS_IDR.

If we were keeping the radix tree around, I'd agree, but the point of
the rest of this patch set is replacing it ;-)  I should probably have
just dropped this patch, to be honest.
Luc Van Oostenryck Nov. 22, 2017, 10:35 p.m. UTC | #2
On Wed, Nov 22, 2017 at 02:24:02PM -0800, Matthew Wilcox wrote:
> On Wed, Nov 22, 2017 at 10:28:48PM +0100, Luc Van Oostenryck wrote:
> > > -	root->gfp_mask &= (1 << ROOT_TAG_SHIFT) - 1;
> > > +	root->gfp_mask &= (__force gfp_t)((1 << ROOT_TAG_SHIFT) - 1);
> > 
> > IMO, it would be better to define something for that in radix-tree.h,
> > like it has been done for ROOT_IS_IDR.
> 
> If we were keeping the radix tree around, I'd agree, but the point of
> the rest of this patch set is replacing it ;-)  I should probably have
> just dropped this patch, to be honest.

Ah OK, sure.
I confess I didn't saw the whole series, just this patch.

-- Luc
diff mbox

Patch

diff --git a/lib/radix-tree.c b/lib/radix-tree.c
index c8d55565fafa..f00303e0b216 100644
--- a/lib/radix-tree.c
+++ b/lib/radix-tree.c
@@ -178,7 +178,7 @@  static inline void root_tag_clear(struct radix_tree_root *root, unsigned tag)
 
 static inline void root_tag_clear_all(struct radix_tree_root *root)
 {
-	root->gfp_mask &= (1 << ROOT_TAG_SHIFT) - 1;
+	root->gfp_mask &= (__force gfp_t)((1 << ROOT_TAG_SHIFT) - 1);
 }
 
 static inline int root_tag_get(const struct radix_tree_root *root, unsigned tag)