Skip to content

Commit

Permalink
slab: Use correct GFP_DMA constant
Browse files Browse the repository at this point in the history
On Thu, 5 Sep 2013, kbuild test robot wrote:
> >> include/linux/slab.h:433:53: sparse: restricted gfp_t degrades to integer
>    429	static __always_inline void *kmalloc_node(size_t size, gfp_t flags, int node)
>    430	{
>    431	#ifndef CONFIG_SLOB
>    432		if (__builtin_constant_p(size) &&
>  > 433			size <= KMALLOC_MAX_CACHE_SIZE && !(flags & SLAB_CACHE_DMA)) {
>    434			int i = kmalloc_index(size);
>    435

flags is of type gfp_t and not a slab internal flag. Therefore
use GFP_DMA.

Signed-off-by: Christoph Lameter <cl@linux.com>
Signed-off-by: Pekka Enberg <penberg@kernel.org>
  • Loading branch information
Christoph Lameter authored and Pekka Enberg committed Sep 4, 2013
1 parent 76b6f3d commit 23774a2
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion include/linux/slab.h
Original file line number Diff line number Diff line change
Expand Up @@ -430,7 +430,7 @@ static __always_inline void *kmalloc_node(size_t size, gfp_t flags, int node)
{
#ifndef CONFIG_SLOB
if (__builtin_constant_p(size) &&
size <= KMALLOC_MAX_CACHE_SIZE && !(flags & SLAB_CACHE_DMA)) {
size <= KMALLOC_MAX_CACHE_SIZE && !(flags & GFP_DMA)) {
int i = kmalloc_index(size);

if (!i)
Expand Down

0 comments on commit 23774a2

Please sign in to comment.