diff options
author | Christoph Lameter <clameter@sgi.com> | 2008-02-07 20:47:41 -0500 |
---|---|---|
committer | Christoph Lameter <christoph@stapp.engr.sgi.com> | 2008-02-07 20:47:41 -0500 |
commit | 5bb983b0cce9b7b281af15730f7019116dd42568 (patch) | |
tree | 858d23397eaffb7023e50918bc0a9f785b79c962 /mm/slub.c | |
parent | 0afc2edfada50980bec999f94dcea26ebad3dda6 (diff) |
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>
Diffstat (limited to 'mm/slub.c')
-rw-r--r-- | mm/slub.c | 3 |
1 files changed, 2 insertions, 1 deletions
@@ -2601,6 +2601,7 @@ EXPORT_SYMBOL(ksize); | |||
2601 | void kfree(const void *x) | 2601 | void kfree(const void *x) |
2602 | { | 2602 | { |
2603 | struct page *page; | 2603 | struct page *page; |
2604 | void *object = (void *)x; | ||
2604 | 2605 | ||
2605 | if (unlikely(ZERO_OR_NULL_PTR(x))) | 2606 | if (unlikely(ZERO_OR_NULL_PTR(x))) |
2606 | return; | 2607 | return; |
@@ -2610,7 +2611,7 @@ void kfree(const void *x) | |||
2610 | put_page(page); | 2611 | put_page(page); |
2611 | return; | 2612 | return; |
2612 | } | 2613 | } |
2613 | slab_free(page->slab, page, (void *)x, __builtin_return_address(0)); | 2614 | slab_free(page->slab, page, object, __builtin_return_address(0)); |
2614 | } | 2615 | } |
2615 | EXPORT_SYMBOL(kfree); | 2616 | EXPORT_SYMBOL(kfree); |
2616 | 2617 | ||