lkml.org 
[lkml]   [2005]   [Jul]   [10]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: 2.6-mm swapped kmalloc args.
Date
Quoting Dave Jones <davej@redhat.com>:
> Repeat after me Cris developers.. "Size, then flags." :-)
>
> aacraid suffers the same affliction. Yay for type-unsafe interfaces.
>
> Signed-off-by: Dave Jones <davej@redhat.com>
>
>
> --- 2.6-mm/arch/cris/arch-v32/mm/intmem.c~ 2005-07-09 00:13:54 -04:00
> +++ 2.6-mm/arch/cris/arch-v32/mm/intmem.c 2005-07-09 00:14:48 -04:00
> @@ -28,7 +28,7 @@ static void crisv32_intmem_init(void)
> static int initiated = 0;
> if (!initiated) {
> struct intmem_allocation* alloc =
> - (struct intmem_allocation*)kmalloc(GFP_KERNEL, sizeof *alloc);
> + (struct intmem_allocation*)kmalloc(sizeof *alloc, GFP_KERNEL);
> INIT_LIST_HEAD(&intmem_allocations);
> intmem_virtual = ioremap(MEM_INTMEM_START, MEM_INTMEM_SIZE);
> initiated = 1;
> @@ -57,7 +57,7 @@ void* crisv32_intmem_alloc(unsigned size
> if (allocation->size > size + alignment) {
> struct intmem_allocation* alloc =
> (struct intmem_allocation*)
> - kmalloc(GFP_ATOMIC, sizeof *alloc);
> + kmalloc(sizeof *alloc, GFP_ATOMIC);
> alloc->status = STATUS_FREE;
> alloc->size = allocation->size - size - alignment;
> alloc->offset = allocation->offset + size;
> @@ -66,7 +66,7 @@ void* crisv32_intmem_alloc(unsigned size
> if (alignment) {
> struct intmem_allocation* tmp;
> tmp = (struct intmem_allocation*)
> - kmalloc(GFP_ATOMIC, sizeof *tmp);
> + kmalloc(sizeof *tmp, GFP_ATOMIC);

What about also removing these void* to struct intmem_allocation* casts?

--
Greetings, Michael


[unhandled content-type:application/pgp-signature]
\
 
 \ /
  Last update: 2005-07-10 10:10    [W:0.036 / U:0.108 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site