diff options
Diffstat (limited to 'arch/cris/arch-v32/mm/intmem.c')
-rw-r--r-- | arch/cris/arch-v32/mm/intmem.c | 13 |
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; |