lkml.org 
[lkml]   [2007]   [Aug]   [23]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Date
Subject[PATCH 02/30] cris: Remove unnecessary cast of allocation return value in intmem.c
kmalloc() returns a void pointer so there's no need to cast the
return value.

Signed-off-by: Jesper Juhl <jesper.juhl@gmail.com>
---
arch/cris/arch-v32/mm/intmem.c | 10 ++++------
1 files changed, 4 insertions(+), 6 deletions(-)

diff --git a/arch/cris/arch-v32/mm/intmem.c b/arch/cris/arch-v32/mm/intmem.c
index 41ee7f7..691cf3b 100644
--- a/arch/cris/arch-v32/mm/intmem.c
+++ b/arch/cris/arch-v32/mm/intmem.c
@@ -27,8 +27,8 @@ static void crisv32_intmem_init(void)
{
static int initiated = 0;
if (!initiated) {
- struct intmem_allocation* alloc =
- (struct intmem_allocation*)kmalloc(sizeof *alloc, GFP_KERNEL);
+ struct intmem_allocation *alloc =
+ kmalloc(sizeof *alloc, GFP_KERNEL);
INIT_LIST_HEAD(&intmem_allocations);
intmem_virtual = ioremap(MEM_INTMEM_START, MEM_INTMEM_SIZE);
initiated = 1;
@@ -55,8 +55,7 @@ void* crisv32_intmem_alloc(unsigned size, unsigned align)
if (allocation->status == STATUS_FREE &&
allocation->size >= size + alignment) {
if (allocation->size > size + alignment) {
- struct intmem_allocation* alloc =
- (struct intmem_allocation*)
+ struct intmem_allocation *alloc =
kmalloc(sizeof *alloc, GFP_ATOMIC);
alloc->status = STATUS_FREE;
alloc->size = allocation->size - size - alignment;
@@ -64,8 +63,7 @@ void* crisv32_intmem_alloc(unsigned size, unsigned align)
list_add(&alloc->entry, &allocation->entry);

if (alignment) {
- struct intmem_allocation* tmp;
- tmp = (struct intmem_allocation*)
+ struct intmem_allocation *tmp =
kmalloc(sizeof *tmp, GFP_ATOMIC);
tmp->offset = allocation->offset;
tmp->size = alignment;
--
1.5.2.2
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2007-08-24 01:47    [W:0.127 / U:0.200 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site