Skip to contentSkip to conversation

2.6-mm swapped kmalloc args.

PATCH Dave Jones 2 participants 2 messages Jul 9, 2005 – Jul 10, 2005

Subsystems (2)
lore
Share & tools
lore

Dave Jones

author
#0 lore raw

Repeat after me Cris developers.. "Size, then flags." :-)

aacraid suffers the same affliction. Yay for type-unsafe interfaces.

arch/cris/arch-v32/mm/intmem.c renamed from arch/cris/arch-v32/mm/intmem.c~ +3 -3
@@ -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;
drivers/scsi/aacraid/commctrl.c renamed from drivers/scsi/aacraid/commctrl.c~ +1 -1
@@ -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;
#1 lore raw

Quoting Dave Jones <[email protected]>:

Quoted 28 lines

Repeat after me Cris developers.. "Size, then flags." :-)

aacraid suffers the same affliction. Yay for type-unsafe interfaces.

arch/cris/arch-v32/mm/intmem.c renamed from arch/cris/arch-v32/mm/intmem.c~ +2 -2
@@ -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;

arch/cris/arch-v32/mm/intmem.c void* crisv32_intmem_alloc(unsigned size · line 69

Quoted 5 lines
arch/cris/arch-v32/mm/intmem.c renamed from arch/cris/arch-v32/mm/intmem.c~ +1 -1
@@ -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?

Signature · 1 line
Greetings, Michael