提交 5bb983b0 编写于 作者: C Christoph Lameter 提交者: Christoph Lameter

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: NChristoph Lameter <clameter@sgi.com>
上级 0afc2edf
......@@ -2601,6 +2601,7 @@ EXPORT_SYMBOL(ksize);
void kfree(const void *x)
{
struct page *page;
void *object = (void *)x;
if (unlikely(ZERO_OR_NULL_PTR(x)))
return;
......@@ -2610,7 +2611,7 @@ void kfree(const void *x)
put_page(page);
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);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册