mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2025-01-07 13:43:51 +00:00
SLUB: Deal with annoying gcc warning on kfree()
gcc 4.2 spits out an annoying warning if one casts a const void * pointer to a void * pointer. No warning is generated if the conversion is done through an assignment. Signed-off-by: Christoph Lameter <clameter@sgi.com>
This commit is contained in:
parent
0afc2edfad
commit
5bb983b0cc
@ -2601,6 +2601,7 @@ EXPORT_SYMBOL(ksize);
|
|||||||
void kfree(const void *x)
|
void kfree(const void *x)
|
||||||
{
|
{
|
||||||
struct page *page;
|
struct page *page;
|
||||||
|
void *object = (void *)x;
|
||||||
|
|
||||||
if (unlikely(ZERO_OR_NULL_PTR(x)))
|
if (unlikely(ZERO_OR_NULL_PTR(x)))
|
||||||
return;
|
return;
|
||||||
@ -2610,7 +2611,7 @@ void kfree(const void *x)
|
|||||||
put_page(page);
|
put_page(page);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
slab_free(page->slab, page, (void *)x, __builtin_return_address(0));
|
slab_free(page->slab, page, object, __builtin_return_address(0));
|
||||||
}
|
}
|
||||||
EXPORT_SYMBOL(kfree);
|
EXPORT_SYMBOL(kfree);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user