* 2.6-mm swapped kmalloc args.
@ 2005-07-09 5:49 Dave Jones
2005-07-10 8:04 ` Michael Buesch
0 siblings, 1 reply; 2+ messages in thread
From: Dave Jones @ 2005-07-09 5:49 UTC (permalink / raw)
To: linux-kernel; +Cc: akpm
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);
tmp->offset = allocation->offset;
tmp->size = alignment;
tmp->status = STATUS_FREE;
--- 2.6-mm/drivers/scsi/aacraid/commctrl.c~ 2005-07-09 00:14:55 -04:00
+++ 2.6-mm/drivers/scsi/aacraid/commctrl.c 2005-07-09 00:15:04 -04:00
@@ -469,7 +469,7 @@ static int aac_send_raw_srb(struct aac_d
goto cleanup;
}
- user_srbcmd = kmalloc(GFP_KERNEL, fibsize);
+ user_srbcmd = kmalloc(fibsize, GFP_KERNEL);
if (!user_srbcmd) {
dprintk((KERN_DEBUG"aacraid: Could not make a copy of the srb\n"));
rcode = -ENOMEM;
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: 2.6-mm swapped kmalloc args.
2005-07-09 5:49 2.6-mm swapped kmalloc args Dave Jones
@ 2005-07-10 8:04 ` Michael Buesch
0 siblings, 0 replies; 2+ messages in thread
From: Michael Buesch @ 2005-07-10 8:04 UTC (permalink / raw)
To: Dave Jones, linux-kernel, akpm
[-- Attachment #1: Type: text/plain, Size: 1604 bytes --]
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
[-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --]
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2005-07-10 8:05 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-07-09 5:49 2.6-mm swapped kmalloc args Dave Jones
2005-07-10 8:04 ` Michael Buesch
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox