mm/slab_common.c:385:13: sparse: restricted gfp_t degrades to integer
Subsystems (2)
A message that is not in the archive (sent off-list or not yet received): 510bae53.+nWBFPQ3bGiTzPs/%[email protected]
A message that is not in the archive (sent off-list or not yet received): 0000013c971ab472-8542127a-19e8-4f6a-8b7e-5f5ab8bcd8fd-000000@email.amazonses.com
Quoted 15 lines · Christoph Lameter
Quoted 12 lines · kbuild test robot
374 int index; 375 376 if (size <= 192) { 377 if (!size) 378 return ZERO_SIZE_PTR; 379 380 index = size_index[size_index_elem(size)]; 381 } else 382 index = fls(size - 1); 383 384 #ifdef CONFIG_ZONE_DMAQuoted 1 line
385 if (
unlikely((flags & SLAB_CACHE_DMA)))
Quoted 1 line
Should flags be cast to integer before doing the & operation?
It seems not easy to quiet this warning..
(unsigned long)flags & SLAB_CACHE_DMA /c/wfg/sound/mm/slab_common.c:385:13: sparse: cast from restricted gfp_t
flags & (gfp_t)SLAB_CACHE_DMA /c/wfg/sound/mm/slab_common.c:385:13: sparse: cast to restricted gfp_t
Thanks,
Fengguang
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to [email protected]. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"[email protected]"> [email protected] </a>
PATCH 1/1 mm/sl[au]b: correct allocation type check in kmalloc_slab()
commit "slab: Common Kmalloc cache determination" made mistake in kmalloc_slab(). SLAB_CACHE_DMA is for kmem_cache creation, not for allocation. For allocation, we should use GFP_XXX to identify type of allocation. So, change SLAB_CACHE_DMA to GFP_DMA.
mm/slab_common.c +1 -1
@@ -382,7 +382,7 @@ struct kmem_cache *kmalloc_slab(size_t size, gfp_t flags) index =fls (size -1 );#ifdef CONFIG_ZONE_DMA -if (unlikely ((flags &SLAB_CACHE_DMA ))) +if (unlikely ((flags &GFP_DMA )))return kmalloc_dma_caches[index];#endif
Signature · 7 lines
1.7.9.5 -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to [email protected]. For more info on Linux MM, see: http://www.linux-mm.org/ . Don't email: <a href=mailto:"[email protected]"> [email protected] </a>
Re: [PATCH for-next] mm/sl[au]b: correct allocation type check in kmalloc_slab()
Quoted 4 lines · Joonsoo Kim
commit "slab: Common Kmalloc cache determination" made mistake in
kmalloc_slab().SLAB_CACHE_DMAis forkmem_cachecreation, not for allocation. For allocation, we should useGFP_XXXto identify type of allocation. So, changeSLAB_CACHE_DMAtoGFP_DMA.
Correct.
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to [email protected]. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"[email protected]"> [email protected] </a>