summaryrefslogtreecommitdiffstats
path: root/arch/cris/arch-v32/mm
diff options
context:
space:
mode:
authorJoe Perches <joe@perches.com>2010-06-07 20:50:33 -0700
committerJiri Kosina <jkosina@suse.cz>2010-06-16 17:57:46 +0200
commit2fda16d79316eb37a3e0e09f0084623905221be8 (patch)
treeeab1bc3fcc7acab325407e41032309b1bf8f4cf2 /arch/cris/arch-v32/mm
parentc20cbe46bd5c13444e30cefc997704514dc74cc5 (diff)
downloadblackbird-op-linux-2fda16d79316eb37a3e0e09f0084623905221be8.tar.gz
blackbird-op-linux-2fda16d79316eb37a3e0e09f0084623905221be8.zip
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)
{
static int initiated = 0;
if (!initiated) {
- struct intmem_allocation* alloc =
- (struct intmem_allocation*)kmalloc(sizeof *alloc, GFP_KERNEL);
+ struct intmem_allocation* alloc;
+ alloc = kmalloc(sizeof *alloc, GFP_KERNEL);
INIT_LIST_HEAD(&intmem_allocations);
intmem_virtual = ioremap(MEM_INTMEM_START + RESERVED_SIZE,
MEM_INTMEM_SIZE - RESERVED_SIZE);
@@ -62,9 +62,8 @@ 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*)
- kmalloc(sizeof *alloc, GFP_ATOMIC);
+ struct intmem_allocation* alloc;
+ alloc = kmalloc(sizeof *alloc, GFP_ATOMIC);
alloc->status = STATUS_FREE;
alloc->size = allocation->size - size -
alignment;
@@ -74,9 +73,7 @@ void* crisv32_intmem_alloc(unsigned size, unsigned align)
if (alignment) {
struct intmem_allocation *tmp;
- tmp = (struct intmem_allocation *)
- kmalloc(sizeof *tmp,
- GFP_ATOMIC);
+ tmp = kmalloc(sizeof *tmp, GFP_ATOMIC);
tmp->offset = allocation->offset;
tmp->size = alignment;
tmp->status = STATUS_FREE;
OpenPOWER on IntegriCloud