aboutsummaryrefslogtreecommitdiffstats
path: root/arch/cris/arch-v32/mm
diff options
context:
space:
mode:
authorJoe Perches <joe@perches.com>2010-06-07 23:50:33 -0400
committerJiri Kosina <jkosina@suse.cz>2010-06-16 11:57:46 -0400
commit2fda16d79316eb37a3e0e09f0084623905221be8 (patch)
treeeab1bc3fcc7acab325407e41032309b1bf8f4cf2 /arch/cris/arch-v32/mm
parentc20cbe46bd5c13444e30cefc997704514dc74cc5 (diff)
arch/cris: Remove unnecessary kmalloc casts
And separate declaration from allocation Still no error checking on failure, but it probably doesn't matter. Signed-off-by: Joe Perches <joe@perches.com> Acked-by: Jesper Nilsson <jesper.nilsson@axis.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
Diffstat (limited to 'arch/cris/arch-v32/mm')
-rw-r--r--arch/cris/arch-v32/mm/intmem.c13
1 files changed, 5 insertions, 8 deletions
diff --git a/arch/cris/arch-v32/mm/intmem.c b/arch/cris/arch-v32/mm/intmem.c
index 9e8b69cdf19e..1b17d92cef8e 100644
--- a/arch/cris/arch-v32/mm/intmem.c
+++ b/arch/cris/arch-v32/mm/intmem.c
@@ -33,8 +33,8 @@ static void crisv32_intmem_init(void)
33{ 33{
34 static int initiated = 0; 34 static int initiated = 0;
35 if (!initiated) { 35 if (!initiated) {
36 struct intmem_allocation* alloc = 36 struct intmem_allocation* alloc;
37 (struct intmem_allocation*)kmalloc(sizeof *alloc, GFP_KERNEL); 37 alloc = kmalloc(sizeof *alloc, GFP_KERNEL);
38 INIT_LIST_HEAD(&intmem_allocations); 38 INIT_LIST_HEAD(&intmem_allocations);
39 intmem_virtual = ioremap(MEM_INTMEM_START + RESERVED_SIZE, 39 intmem_virtual = ioremap(MEM_INTMEM_START + RESERVED_SIZE,
40 MEM_INTMEM_SIZE - RESERVED_SIZE); 40 MEM_INTMEM_SIZE - RESERVED_SIZE);
@@ -62,9 +62,8 @@ void* crisv32_intmem_alloc(unsigned size, unsigned align)
62 if (allocation->status == STATUS_FREE && 62 if (allocation->status == STATUS_FREE &&
63 allocation->size >= size + alignment) { 63 allocation->size >= size + alignment) {
64 if (allocation->size > size + alignment) { 64 if (allocation->size > size + alignment) {
65 struct intmem_allocation* alloc = 65 struct intmem_allocation* alloc;
66 (struct intmem_allocation*) 66 alloc = kmalloc(sizeof *alloc, GFP_ATOMIC);
67 kmalloc(sizeof *alloc, GFP_ATOMIC);
68 alloc->status = STATUS_FREE; 67 alloc->status = STATUS_FREE;
69 alloc->size = allocation->size - size - 68 alloc->size = allocation->size - size -
70 alignment; 69 alignment;
@@ -74,9 +73,7 @@ void* crisv32_intmem_alloc(unsigned size, unsigned align)
74 73
75 if (alignment) { 74 if (alignment) {
76 struct intmem_allocation *tmp; 75 struct intmem_allocation *tmp;
77 tmp = (struct intmem_allocation *) 76 tmp = kmalloc(sizeof *tmp, GFP_ATOMIC);
78 kmalloc(sizeof *tmp,
79 GFP_ATOMIC);
80 tmp->offset = allocation->offset; 77 tmp->offset = allocation->offset;
81 tmp->size = alignment; 78 tmp->size = alignment;
82 tmp->status = STATUS_FREE; 79 tmp->status = STATUS_FREE;