diff options
author | Robert P. J. Day <rpjday@mindspring.com> | 2006-12-13 03:35:56 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.osdl.org> | 2006-12-13 12:05:58 -0500 |
commit | 5cbded585d129d0226cb48ac4202b253c781be26 (patch) | |
tree | fb24edc194a57ee81a3bf8a4dd8a95030dd0ad22 | |
parent | 0743b86800cf1dfbf96df4a438938127bbe4476c (diff) |
[PATCH] getting rid of all casts of k[cmz]alloc() calls
Run this:
#!/bin/sh
for f in $(grep -Erl "\([^\)]*\) *k[cmz]alloc" *) ; do
echo "De-casting $f..."
perl -pi -e "s/ ?= ?\([^\)]*\) *(k[cmz]alloc) *\(/ = \1\(/" $f
done
And then go through and reinstate those cases where code is casting pointers
to non-pointers.
And then drop a few hunks which conflicted with outstanding work.
Cc: Russell King <rmk@arm.linux.org.uk>, Ian Molton <spyro@f2s.com>
Cc: Mikael Starvik <starvik@axis.com>
Cc: Yoshinori Sato <ysato@users.sourceforge.jp>
Cc: Roman Zippel <zippel@linux-m68k.org>
Cc: Geert Uytterhoeven <geert@linux-m68k.org>
Cc: Ralf Baechle <ralf@linux-mips.org>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Kyle McMartin <kyle@mcmartin.ca>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: Martin Schwidefsky <schwidefsky@de.ibm.com>
Cc: "David S. Miller" <davem@davemloft.net>
Cc: Jeff Dike <jdike@addtoit.com>
Cc: Greg KH <greg@kroah.com>
Cc: Jens Axboe <jens.axboe@oracle.com>
Cc: Paul Fulghum <paulkf@microgate.com>
Cc: Alan Cox <alan@lxorguk.ukuu.org.uk>
Cc: Karsten Keil <kkeil@suse.de>
Cc: Mauro Carvalho Chehab <mchehab@infradead.org>
Cc: Jeff Garzik <jeff@garzik.org>
Cc: James Bottomley <James.Bottomley@steeleye.com>
Cc: Ian Kent <raven@themaw.net>
Cc: Steven French <sfrench@us.ibm.com>
Cc: David Woodhouse <dwmw2@infradead.org>
Cc: Neil Brown <neilb@cse.unsw.edu.au>
Cc: Jaroslav Kysela <perex@suse.cz>
Cc: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
172 files changed, 250 insertions, 250 deletions
diff --git a/arch/arm/kernel/apm.c b/arch/arm/kernel/apm.c index a11fb9a40c04..2c37b70b17ab 100644 --- a/arch/arm/kernel/apm.c +++ b/arch/arm/kernel/apm.c | |||
@@ -423,7 +423,7 @@ static int apm_open(struct inode * inode, struct file * filp) | |||
423 | { | 423 | { |
424 | struct apm_user *as; | 424 | struct apm_user *as; |
425 | 425 | ||
426 | as = (struct apm_user *)kzalloc(sizeof(*as), GFP_KERNEL); | 426 | as = kzalloc(sizeof(*as), GFP_KERNEL); |
427 | if (as) { | 427 | if (as) { |
428 | /* | 428 | /* |
429 | * XXX - this is a tiny bit broken, when we consider BSD | 429 | * XXX - this is a tiny bit broken, when we consider BSD |
diff --git a/arch/arm/kernel/ecard.c b/arch/arm/kernel/ecard.c index a786f769035d..71257e3d513f 100644 --- a/arch/arm/kernel/ecard.c +++ b/arch/arm/kernel/ecard.c | |||
@@ -353,7 +353,7 @@ int ecard_readchunk(struct in_chunk_dir *cd, ecard_t *ec, int id, int num) | |||
353 | } | 353 | } |
354 | if (c_id(&excd) == 0x80) { /* loader */ | 354 | if (c_id(&excd) == 0x80) { /* loader */ |
355 | if (!ec->loader) { | 355 | if (!ec->loader) { |
356 | ec->loader = (loader_t)kmalloc(c_len(&excd), | 356 | ec->loader = kmalloc(c_len(&excd), |
357 | GFP_KERNEL); | 357 | GFP_KERNEL); |
358 | if (ec->loader) | 358 | if (ec->loader) |
359 | ecard_readbytes(ec->loader, ec, | 359 | ecard_readbytes(ec->loader, ec, |
diff --git a/arch/arm26/kernel/ecard.c b/arch/arm26/kernel/ecard.c index 43dd41be71fb..9dbc17247c6f 100644 --- a/arch/arm26/kernel/ecard.c +++ b/arch/arm26/kernel/ecard.c | |||
@@ -215,7 +215,7 @@ int ecard_readchunk(struct in_chunk_dir *cd, ecard_t *ec, int id, int num) | |||
215 | } | 215 | } |
216 | if (c_id(&excd) == 0x80) { /* loader */ | 216 | if (c_id(&excd) == 0x80) { /* loader */ |
217 | if (!ec->loader) { | 217 | if (!ec->loader) { |
218 | ec->loader = (loader_t)kmalloc(c_len(&excd), | 218 | ec->loader = kmalloc(c_len(&excd), |
219 | GFP_KERNEL); | 219 | GFP_KERNEL); |
220 | if (ec->loader) | 220 | if (ec->loader) |
221 | ecard_readbytes(ec->loader, ec, | 221 | ecard_readbytes(ec->loader, ec, |
diff --git a/arch/arm26/kernel/irq.c b/arch/arm26/kernel/irq.c index d87d68b77d66..d53382c83bf9 100644 --- a/arch/arm26/kernel/irq.c +++ b/arch/arm26/kernel/irq.c | |||
@@ -545,7 +545,7 @@ int request_irq(unsigned int irq, irqreturn_t (*handler)(int, void *, struct pt_ | |||
545 | (irq_flags & IRQF_SHARED && !dev_id)) | 545 | (irq_flags & IRQF_SHARED && !dev_id)) |
546 | return -EINVAL; | 546 | return -EINVAL; |
547 | 547 | ||
548 | action = (struct irqaction *)kmalloc(sizeof(struct irqaction), GFP_KERNEL); | 548 | action = kmalloc(sizeof(struct irqaction), GFP_KERNEL); |
549 | if (!action) | 549 | if (!action) |
550 | return -ENOMEM; | 550 | return -ENOMEM; |
551 | 551 | ||
diff --git a/arch/cris/arch-v10/drivers/axisflashmap.c b/arch/cris/arch-v10/drivers/axisflashmap.c index 4fa81abab0c7..ffade19a14e6 100644 --- a/arch/cris/arch-v10/drivers/axisflashmap.c +++ b/arch/cris/arch-v10/drivers/axisflashmap.c | |||
@@ -516,7 +516,7 @@ static int __init init_axis_flash(void) | |||
516 | #else | 516 | #else |
517 | struct mtd_info *mtd_ram; | 517 | struct mtd_info *mtd_ram; |
518 | 518 | ||
519 | mtd_ram = (struct mtd_info *)kmalloc(sizeof(struct mtd_info), | 519 | mtd_ram = kmalloc(sizeof(struct mtd_info), |
520 | GFP_KERNEL); | 520 | GFP_KERNEL); |
521 | if (!mtd_ram) { | 521 | if (!mtd_ram) { |
522 | panic("axisflashmap couldn't allocate memory for " | 522 | panic("axisflashmap couldn't allocate memory for " |
diff --git a/arch/cris/arch-v10/drivers/gpio.c b/arch/cris/arch-v10/drivers/gpio.c index fcba6632ed7b..9aba18b931dd 100644 --- a/arch/cris/arch-v10/drivers/gpio.c +++ b/arch/cris/arch-v10/drivers/gpio.c | |||
@@ -440,7 +440,7 @@ gpio_open(struct inode *inode, struct file *filp) | |||
440 | if (p > GPIO_MINOR_LAST) | 440 | if (p > GPIO_MINOR_LAST) |
441 | return -EINVAL; | 441 | return -EINVAL; |
442 | 442 | ||
443 | priv = (struct gpio_private *)kmalloc(sizeof(struct gpio_private), | 443 | priv = kmalloc(sizeof(struct gpio_private), |
444 | GFP_KERNEL); | 444 | GFP_KERNEL); |
445 | 445 | ||
446 | if (!priv) | 446 | if (!priv) |
diff --git a/arch/cris/arch-v32/drivers/axisflashmap.c b/arch/cris/arch-v32/drivers/axisflashmap.c index 41952320e00a..5180d45412fc 100644 --- a/arch/cris/arch-v32/drivers/axisflashmap.c +++ b/arch/cris/arch-v32/drivers/axisflashmap.c | |||
@@ -427,7 +427,7 @@ static int __init init_axis_flash(void) | |||
427 | #else | 427 | #else |
428 | struct mtd_info *mtd_ram; | 428 | struct mtd_info *mtd_ram; |
429 | 429 | ||
430 | mtd_ram = (struct mtd_info *)kmalloc(sizeof(struct mtd_info), | 430 | mtd_ram = kmalloc(sizeof(struct mtd_info), |
431 | GFP_KERNEL); | 431 | GFP_KERNEL); |
432 | if (!mtd_ram) { | 432 | if (!mtd_ram) { |
433 | panic("axisflashmap couldn't allocate memory for " | 433 | panic("axisflashmap couldn't allocate memory for " |
diff --git a/arch/cris/arch-v32/drivers/gpio.c b/arch/cris/arch-v32/drivers/gpio.c index c3f876b4da6b..08d36f0955c6 100644 --- a/arch/cris/arch-v32/drivers/gpio.c +++ b/arch/cris/arch-v32/drivers/gpio.c | |||
@@ -423,7 +423,7 @@ gpio_open(struct inode *inode, struct file *filp) | |||
423 | if (p > GPIO_MINOR_LAST) | 423 | if (p > GPIO_MINOR_LAST) |
424 | return -EINVAL; | 424 | return -EINVAL; |
425 | 425 | ||
426 | priv = (struct gpio_private *)kmalloc(sizeof(struct gpio_private), | 426 | priv = kmalloc(sizeof(struct gpio_private), |
427 | GFP_KERNEL); | 427 | GFP_KERNEL); |
428 | 428 | ||
429 | if (!priv) | 429 | if (!priv) |
diff --git a/arch/cris/arch-v32/kernel/signal.c b/arch/cris/arch-v32/kernel/signal.c index 99e59b3eacf8..7cd6ac803409 100644 --- a/arch/cris/arch-v32/kernel/signal.c +++ b/arch/cris/arch-v32/kernel/signal.c | |||
@@ -686,7 +686,7 @@ keep_debug_flags(unsigned long oldccs, unsigned long oldspc, | |||
686 | int __init | 686 | int __init |
687 | cris_init_signal(void) | 687 | cris_init_signal(void) |
688 | { | 688 | { |
689 | u16* data = (u16*)kmalloc(PAGE_SIZE, GFP_KERNEL); | 689 | u16* data = kmalloc(PAGE_SIZE, GFP_KERNEL); |
690 | 690 | ||
691 | /* This is movu.w __NR_sigreturn, r9; break 13; */ | 691 | /* This is movu.w __NR_sigreturn, r9; break 13; */ |
692 | data[0] = 0x9c5f; | 692 | data[0] = 0x9c5f; |
diff --git a/arch/cris/kernel/profile.c b/arch/cris/kernel/profile.c index 69c52189f044..f60ab785f235 100644 --- a/arch/cris/kernel/profile.c +++ b/arch/cris/kernel/profile.c | |||
@@ -59,7 +59,7 @@ static int | |||
59 | __init init_cris_profile(void) | 59 | __init init_cris_profile(void) |
60 | { | 60 | { |
61 | struct proc_dir_entry *entry; | 61 | struct proc_dir_entry *entry; |
62 | sample_buffer = (char*)kmalloc(SAMPLE_BUFFER_SIZE, GFP_KERNEL); | 62 | sample_buffer = kmalloc(SAMPLE_BUFFER_SIZE, GFP_KERNEL); |
63 | sample_buffer_pos = sample_buffer; | 63 | sample_buffer_pos = sample_buffer; |
64 | entry = create_proc_entry("system_profile", S_IWUSR | S_IRUGO, NULL); | 64 | entry = create_proc_entry("system_profile", S_IWUSR | S_IRUGO, NULL); |
65 | if (entry) { | 65 | if (entry) { |
diff --git a/arch/h8300/kernel/ints.c b/arch/h8300/kernel/ints.c index 1bfc77e391d5..587ef7f4fcc7 100644 --- a/arch/h8300/kernel/ints.c +++ b/arch/h8300/kernel/ints.c | |||
@@ -141,7 +141,7 @@ int request_irq(unsigned int irq, | |||
141 | return -EBUSY; | 141 | return -EBUSY; |
142 | 142 | ||
143 | if (use_kmalloc) | 143 | if (use_kmalloc) |
144 | irq_handle = (irq_handler_t *)kmalloc(sizeof(irq_handler_t), GFP_ATOMIC); | 144 | irq_handle = kmalloc(sizeof(irq_handler_t), GFP_ATOMIC); |
145 | else { | 145 | else { |
146 | /* use bootmem allocater */ | 146 | /* use bootmem allocater */ |
147 | irq_handle = (irq_handler_t *)alloc_bootmem(sizeof(irq_handler_t)); | 147 | irq_handle = (irq_handler_t *)alloc_bootmem(sizeof(irq_handler_t)); |
diff --git a/arch/h8300/platform/h8s/ints.c b/arch/h8300/platform/h8s/ints.c index 270440de4610..567f681ddfec 100644 --- a/arch/h8300/platform/h8s/ints.c +++ b/arch/h8300/platform/h8s/ints.c | |||
@@ -176,7 +176,7 @@ int request_irq(unsigned int irq, | |||
176 | } | 176 | } |
177 | 177 | ||
178 | if (use_kmalloc) | 178 | if (use_kmalloc) |
179 | irq_handle = (irq_handler_t *)kmalloc(sizeof(irq_handler_t), GFP_ATOMIC); | 179 | irq_handle = kmalloc(sizeof(irq_handler_t), GFP_ATOMIC); |
180 | else { | 180 | else { |
181 | /* use bootmem allocater */ | 181 | /* use bootmem allocater */ |
182 | irq_handle = (irq_handler_t *)alloc_bootmem(sizeof(irq_handler_t)); | 182 | irq_handle = (irq_handler_t *)alloc_bootmem(sizeof(irq_handler_t)); |
diff --git a/arch/i386/kernel/apm.c b/arch/i386/kernel/apm.c index a97847da9ed5..b75cff25de4b 100644 --- a/arch/i386/kernel/apm.c +++ b/arch/i386/kernel/apm.c | |||
@@ -1604,7 +1604,7 @@ static int do_open(struct inode * inode, struct file * filp) | |||
1604 | { | 1604 | { |
1605 | struct apm_user * as; | 1605 | struct apm_user * as; |
1606 | 1606 | ||
1607 | as = (struct apm_user *)kmalloc(sizeof(*as), GFP_KERNEL); | 1607 | as = kmalloc(sizeof(*as), GFP_KERNEL); |
1608 | if (as == NULL) { | 1608 | if (as == NULL) { |
1609 | printk(KERN_ERR "apm: cannot allocate struct of size %d bytes\n", | 1609 | printk(KERN_ERR "apm: cannot allocate struct of size %d bytes\n", |
1610 | sizeof(*as)); | 1610 | sizeof(*as)); |
diff --git a/arch/ia64/sn/kernel/sn2/sn_hwperf.c b/arch/ia64/sn/kernel/sn2/sn_hwperf.c index 462ea178f49a..33367996d72d 100644 --- a/arch/ia64/sn/kernel/sn2/sn_hwperf.c +++ b/arch/ia64/sn/kernel/sn2/sn_hwperf.c | |||
@@ -189,7 +189,7 @@ static void print_pci_topology(struct seq_file *s) | |||
189 | int e; | 189 | int e; |
190 | 190 | ||
191 | for (sz = PAGE_SIZE; sz < 16 * PAGE_SIZE; sz += PAGE_SIZE) { | 191 | for (sz = PAGE_SIZE; sz < 16 * PAGE_SIZE; sz += PAGE_SIZE) { |
192 | if (!(p = (char *)kmalloc(sz, GFP_KERNEL))) | 192 | if (!(p = kmalloc(sz, GFP_KERNEL))) |
193 | break; | 193 | break; |
194 | e = ia64_sn_ioif_get_pci_topology(__pa(p), sz); | 194 | e = ia64_sn_ioif_get_pci_topology(__pa(p), sz); |
195 | if (e == SALRET_OK) | 195 | if (e == SALRET_OK) |
diff --git a/arch/m68k/mm/kmap.c b/arch/m68k/mm/kmap.c index b54ef1726c55..46b7d6035aab 100644 --- a/arch/m68k/mm/kmap.c +++ b/arch/m68k/mm/kmap.c | |||
@@ -59,7 +59,7 @@ static struct vm_struct *get_io_area(unsigned long size) | |||
59 | unsigned long addr; | 59 | unsigned long addr; |
60 | struct vm_struct **p, *tmp, *area; | 60 | struct vm_struct **p, *tmp, *area; |
61 | 61 | ||
62 | area = (struct vm_struct *)kmalloc(sizeof(*area), GFP_KERNEL); | 62 | area = kmalloc(sizeof(*area), GFP_KERNEL); |
63 | if (!area) | 63 | if (!area) |
64 | return NULL; | 64 | return NULL; |
65 | addr = KMAP_START; | 65 | addr = KMAP_START; |
diff --git a/arch/mips/kernel/apm.c b/arch/mips/kernel/apm.c index 528e731049c1..ba16d07588cb 100644 --- a/arch/mips/kernel/apm.c +++ b/arch/mips/kernel/apm.c | |||
@@ -356,7 +356,7 @@ static int apm_open(struct inode * inode, struct file * filp) | |||
356 | { | 356 | { |
357 | struct apm_user *as; | 357 | struct apm_user *as; |
358 | 358 | ||
359 | as = (struct apm_user *)kzalloc(sizeof(*as), GFP_KERNEL); | 359 | as = kzalloc(sizeof(*as), GFP_KERNEL); |
360 | if (as) { | 360 | if (as) { |
361 | /* | 361 | /* |
362 | * XXX - this is a tiny bit broken, when we consider BSD | 362 | * XXX - this is a tiny bit broken, when we consider BSD |
diff --git a/arch/parisc/hpux/sys_hpux.c b/arch/parisc/hpux/sys_hpux.c index d88309209f56..04c2ff444396 100644 --- a/arch/parisc/hpux/sys_hpux.c +++ b/arch/parisc/hpux/sys_hpux.c | |||
@@ -475,7 +475,7 @@ int hpux_sysfs(int opcode, unsigned long arg1, unsigned long arg2) | |||
475 | printk(KERN_DEBUG "len of arg1 = %d\n", len); | 475 | printk(KERN_DEBUG "len of arg1 = %d\n", len); |
476 | if (len == 0) | 476 | if (len == 0) |
477 | return 0; | 477 | return 0; |
478 | fsname = (char *) kmalloc(len, GFP_KERNEL); | 478 | fsname = kmalloc(len, GFP_KERNEL); |
479 | if ( !fsname ) { | 479 | if ( !fsname ) { |
480 | printk(KERN_DEBUG "failed to kmalloc fsname\n"); | 480 | printk(KERN_DEBUG "failed to kmalloc fsname\n"); |
481 | return 0; | 481 | return 0; |
diff --git a/arch/parisc/kernel/unwind.c b/arch/parisc/kernel/unwind.c index 920bdbf8404f..c10ab47d81fa 100644 --- a/arch/parisc/kernel/unwind.c +++ b/arch/parisc/kernel/unwind.c | |||
@@ -343,7 +343,7 @@ void unwind_frame_init_from_blocked_task(struct unwind_frame_info *info, struct | |||
343 | struct pt_regs *r = &t->thread.regs; | 343 | struct pt_regs *r = &t->thread.regs; |
344 | struct pt_regs *r2; | 344 | struct pt_regs *r2; |
345 | 345 | ||
346 | r2 = (struct pt_regs *)kmalloc(sizeof(struct pt_regs), GFP_KERNEL); | 346 | r2 = kmalloc(sizeof(struct pt_regs), GFP_KERNEL); |
347 | if (!r2) | 347 | if (!r2) |
348 | return; | 348 | return; |
349 | *r2 = *r; | 349 | *r2 = *r; |
diff --git a/arch/powerpc/kernel/nvram_64.c b/arch/powerpc/kernel/nvram_64.c index 6960f090991e..869cebbba967 100644 --- a/arch/powerpc/kernel/nvram_64.c +++ b/arch/powerpc/kernel/nvram_64.c | |||
@@ -505,7 +505,7 @@ static int nvram_scan_partitions(void) | |||
505 | return -ENODEV; | 505 | return -ENODEV; |
506 | total_size = ppc_md.nvram_size(); | 506 | total_size = ppc_md.nvram_size(); |
507 | 507 | ||
508 | header = (char *) kmalloc(NVRAM_HEADER_LEN, GFP_KERNEL); | 508 | header = kmalloc(NVRAM_HEADER_LEN, GFP_KERNEL); |
509 | if (!header) { | 509 | if (!header) { |
510 | printk(KERN_ERR "nvram_scan_partitions: Failed kmalloc\n"); | 510 | printk(KERN_ERR "nvram_scan_partitions: Failed kmalloc\n"); |
511 | return -ENOMEM; | 511 | return -ENOMEM; |
@@ -574,7 +574,7 @@ static int __init nvram_init(void) | |||
574 | } | 574 | } |
575 | 575 | ||
576 | /* initialize our anchor for the nvram partition list */ | 576 | /* initialize our anchor for the nvram partition list */ |
577 | nvram_part = (struct nvram_partition *) kmalloc(sizeof(struct nvram_partition), GFP_KERNEL); | 577 | nvram_part = kmalloc(sizeof(struct nvram_partition), GFP_KERNEL); |
578 | if (!nvram_part) { | 578 | if (!nvram_part) { |
579 | printk(KERN_ERR "nvram_init: Failed kmalloc\n"); | 579 | printk(KERN_ERR "nvram_init: Failed kmalloc\n"); |
580 | return -ENOMEM; | 580 | return -ENOMEM; |
diff --git a/arch/powerpc/kernel/pci_32.c b/arch/powerpc/kernel/pci_32.c index 8336deafc624..2847cd51a2d7 100644 --- a/arch/powerpc/kernel/pci_32.c +++ b/arch/powerpc/kernel/pci_32.c | |||
@@ -670,7 +670,7 @@ pcibios_make_OF_bus_map(void) | |||
670 | struct pci_controller* hose; | 670 | struct pci_controller* hose; |
671 | struct property *map_prop; | 671 | struct property *map_prop; |
672 | 672 | ||
673 | pci_to_OF_bus_map = (u8*)kmalloc(pci_bus_count, GFP_KERNEL); | 673 | pci_to_OF_bus_map = kmalloc(pci_bus_count, GFP_KERNEL); |
674 | if (!pci_to_OF_bus_map) { | 674 | if (!pci_to_OF_bus_map) { |
675 | printk(KERN_ERR "Can't allocate OF bus map !\n"); | 675 | printk(KERN_ERR "Can't allocate OF bus map !\n"); |
676 | return; | 676 | return; |
diff --git a/arch/powerpc/mm/imalloc.c b/arch/powerpc/mm/imalloc.c index add8c1a9af68..c831815c31f0 100644 --- a/arch/powerpc/mm/imalloc.c +++ b/arch/powerpc/mm/imalloc.c | |||
@@ -138,7 +138,7 @@ static struct vm_struct * split_im_region(unsigned long v_addr, | |||
138 | struct vm_struct *vm2 = NULL; | 138 | struct vm_struct *vm2 = NULL; |
139 | struct vm_struct *new_vm = NULL; | 139 | struct vm_struct *new_vm = NULL; |
140 | 140 | ||
141 | vm1 = (struct vm_struct *) kmalloc(sizeof(*vm1), GFP_KERNEL); | 141 | vm1 = kmalloc(sizeof(*vm1), GFP_KERNEL); |
142 | if (vm1 == NULL) { | 142 | if (vm1 == NULL) { |
143 | printk(KERN_ERR "%s() out of memory\n", __FUNCTION__); | 143 | printk(KERN_ERR "%s() out of memory\n", __FUNCTION__); |
144 | return NULL; | 144 | return NULL; |
@@ -172,7 +172,7 @@ static struct vm_struct * split_im_region(unsigned long v_addr, | |||
172 | * uppermost remainder, and use existing parent one for the | 172 | * uppermost remainder, and use existing parent one for the |
173 | * lower remainder of parent range | 173 | * lower remainder of parent range |
174 | */ | 174 | */ |
175 | vm2 = (struct vm_struct *) kmalloc(sizeof(*vm2), GFP_KERNEL); | 175 | vm2 = kmalloc(sizeof(*vm2), GFP_KERNEL); |
176 | if (vm2 == NULL) { | 176 | if (vm2 == NULL) { |
177 | printk(KERN_ERR "%s() out of memory\n", __FUNCTION__); | 177 | printk(KERN_ERR "%s() out of memory\n", __FUNCTION__); |
178 | kfree(vm1); | 178 | kfree(vm1); |
@@ -206,7 +206,7 @@ static struct vm_struct * __add_new_im_area(unsigned long req_addr, | |||
206 | break; | 206 | break; |
207 | } | 207 | } |
208 | 208 | ||
209 | area = (struct vm_struct *) kmalloc(sizeof(*area), GFP_KERNEL); | 209 | area = kmalloc(sizeof(*area), GFP_KERNEL); |
210 | if (!area) | 210 | if (!area) |
211 | return NULL; | 211 | return NULL; |
212 | area->flags = 0; | 212 | area->flags = 0; |
diff --git a/arch/powerpc/platforms/pseries/eeh_cache.c b/arch/powerpc/platforms/pseries/eeh_cache.c index b6b462d3c604..f2bae04424f8 100644 --- a/arch/powerpc/platforms/pseries/eeh_cache.c +++ b/arch/powerpc/platforms/pseries/eeh_cache.c | |||
@@ -153,7 +153,7 @@ pci_addr_cache_insert(struct pci_dev *dev, unsigned long alo, | |||
153 | return piar; | 153 | return piar; |
154 | } | 154 | } |
155 | } | 155 | } |
156 | piar = (struct pci_io_addr_range *)kmalloc(sizeof(struct pci_io_addr_range), GFP_ATOMIC); | 156 | piar = kmalloc(sizeof(struct pci_io_addr_range), GFP_ATOMIC); |
157 | if (!piar) | 157 | if (!piar) |
158 | return NULL; | 158 | return NULL; |
159 | 159 | ||
diff --git a/arch/ppc/8260_io/fcc_enet.c b/arch/ppc/8260_io/fcc_enet.c index 709952c25f29..06b84c372e58 100644 --- a/arch/ppc/8260_io/fcc_enet.c +++ b/arch/ppc/8260_io/fcc_enet.c | |||
@@ -1892,10 +1892,10 @@ init_fcc_param(fcc_info_t *fip, struct net_device *dev, | |||
1892 | /* Allocate space for the buffer descriptors from regular memory. | 1892 | /* Allocate space for the buffer descriptors from regular memory. |
1893 | * Initialize base addresses for the buffer descriptors. | 1893 | * Initialize base addresses for the buffer descriptors. |
1894 | */ | 1894 | */ |
1895 | cep->rx_bd_base = (cbd_t *)kmalloc(sizeof(cbd_t) * RX_RING_SIZE, | 1895 | cep->rx_bd_base = kmalloc(sizeof(cbd_t) * RX_RING_SIZE, |
1896 | GFP_KERNEL | GFP_DMA); | 1896 | GFP_KERNEL | GFP_DMA); |
1897 | ep->fen_genfcc.fcc_rbase = __pa(cep->rx_bd_base); | 1897 | ep->fen_genfcc.fcc_rbase = __pa(cep->rx_bd_base); |
1898 | cep->tx_bd_base = (cbd_t *)kmalloc(sizeof(cbd_t) * TX_RING_SIZE, | 1898 | cep->tx_bd_base = kmalloc(sizeof(cbd_t) * TX_RING_SIZE, |
1899 | GFP_KERNEL | GFP_DMA); | 1899 | GFP_KERNEL | GFP_DMA); |
1900 | ep->fen_genfcc.fcc_tbase = __pa(cep->tx_bd_base); | 1900 | ep->fen_genfcc.fcc_tbase = __pa(cep->tx_bd_base); |
1901 | 1901 | ||
diff --git a/arch/ppc/8xx_io/cs4218_tdm.c b/arch/ppc/8xx_io/cs4218_tdm.c index c71ef3c2e7bf..b7bb5f0b3c5f 100644 --- a/arch/ppc/8xx_io/cs4218_tdm.c +++ b/arch/ppc/8xx_io/cs4218_tdm.c | |||
@@ -2601,7 +2601,7 @@ int __init tdm8xx_sound_init(void) | |||
2601 | /* Initialize beep stuff */ | 2601 | /* Initialize beep stuff */ |
2602 | orig_mksound = kd_mksound; | 2602 | orig_mksound = kd_mksound; |
2603 | kd_mksound = cs_mksound; | 2603 | kd_mksound = cs_mksound; |
2604 | beep_buf = (short *) kmalloc(BEEP_BUFLEN * 4, GFP_KERNEL); | 2604 | beep_buf = kmalloc(BEEP_BUFLEN * 4, GFP_KERNEL); |
2605 | if (beep_buf == NULL) | 2605 | if (beep_buf == NULL) |
2606 | printk(KERN_WARNING "dmasound: no memory for " | 2606 | printk(KERN_WARNING "dmasound: no memory for " |
2607 | "beep buffer\n"); | 2607 | "beep buffer\n"); |
diff --git a/arch/s390/kernel/debug.c b/arch/s390/kernel/debug.c index ef5266fbce62..bb57bc0e3fc8 100644 --- a/arch/s390/kernel/debug.c +++ b/arch/s390/kernel/debug.c | |||
@@ -191,13 +191,13 @@ debug_areas_alloc(int pages_per_area, int nr_areas) | |||
191 | debug_entry_t*** areas; | 191 | debug_entry_t*** areas; |
192 | int i,j; | 192 | int i,j; |
193 | 193 | ||
194 | areas = (debug_entry_t ***) kmalloc(nr_areas * | 194 | areas = kmalloc(nr_areas * |
195 | sizeof(debug_entry_t**), | 195 | sizeof(debug_entry_t**), |
196 | GFP_KERNEL); | 196 | GFP_KERNEL); |
197 | if (!areas) | 197 | if (!areas) |
198 | goto fail_malloc_areas; | 198 | goto fail_malloc_areas; |
199 | for (i = 0; i < nr_areas; i++) { | 199 | for (i = 0; i < nr_areas; i++) { |
200 | areas[i] = (debug_entry_t**) kmalloc(pages_per_area * | 200 | areas[i] = kmalloc(pages_per_area * |
201 | sizeof(debug_entry_t*),GFP_KERNEL); | 201 | sizeof(debug_entry_t*),GFP_KERNEL); |
202 | if (!areas[i]) { | 202 | if (!areas[i]) { |
203 | goto fail_malloc_areas2; | 203 | goto fail_malloc_areas2; |
@@ -242,7 +242,7 @@ debug_info_alloc(char *name, int pages_per_area, int nr_areas, int buf_size, | |||
242 | 242 | ||
243 | /* alloc everything */ | 243 | /* alloc everything */ |
244 | 244 | ||
245 | rc = (debug_info_t*) kmalloc(sizeof(debug_info_t), GFP_KERNEL); | 245 | rc = kmalloc(sizeof(debug_info_t), GFP_KERNEL); |
246 | if(!rc) | 246 | if(!rc) |
247 | goto fail_malloc_rc; | 247 | goto fail_malloc_rc; |
248 | rc->active_entries = kcalloc(nr_areas, sizeof(int), GFP_KERNEL); | 248 | rc->active_entries = kcalloc(nr_areas, sizeof(int), GFP_KERNEL); |
@@ -634,7 +634,7 @@ found: | |||
634 | rc = -ENOMEM; | 634 | rc = -ENOMEM; |
635 | goto out; | 635 | goto out; |
636 | } | 636 | } |
637 | p_info = (file_private_info_t *) kmalloc(sizeof(file_private_info_t), | 637 | p_info = kmalloc(sizeof(file_private_info_t), |
638 | GFP_KERNEL); | 638 | GFP_KERNEL); |
639 | if(!p_info){ | 639 | if(!p_info){ |
640 | if(debug_info_snapshot) | 640 | if(debug_info_snapshot) |
diff --git a/arch/s390/kernel/s390_ext.c b/arch/s390/kernel/s390_ext.c index 4faf96f8a834..bc5beaa8f98e 100644 --- a/arch/s390/kernel/s390_ext.c +++ b/arch/s390/kernel/s390_ext.c | |||
@@ -37,7 +37,7 @@ int register_external_interrupt(__u16 code, ext_int_handler_t handler) | |||
37 | ext_int_info_t *p; | 37 | ext_int_info_t *p; |
38 | int index; | 38 | int index; |
39 | 39 | ||
40 | p = (ext_int_info_t *) kmalloc(sizeof(ext_int_info_t), GFP_ATOMIC); | 40 | p = kmalloc(sizeof(ext_int_info_t), GFP_ATOMIC); |
41 | if (p == NULL) | 41 | if (p == NULL) |
42 | return -ENOMEM; | 42 | return -ENOMEM; |
43 | p->code = code; | 43 | p->code = code; |
diff --git a/arch/sparc/kernel/irq.c b/arch/sparc/kernel/irq.c index c8cb211b9072..5b4841d067c1 100644 --- a/arch/sparc/kernel/irq.c +++ b/arch/sparc/kernel/irq.c | |||
@@ -425,7 +425,7 @@ int request_fast_irq(unsigned int irq, | |||
425 | } | 425 | } |
426 | 426 | ||
427 | if (action == NULL) | 427 | if (action == NULL) |
428 | action = (struct irqaction *)kmalloc(sizeof(struct irqaction), | 428 | action = kmalloc(sizeof(struct irqaction), |
429 | GFP_ATOMIC); | 429 | GFP_ATOMIC); |
430 | 430 | ||
431 | if (!action) { | 431 | if (!action) { |
@@ -528,7 +528,7 @@ int request_irq(unsigned int irq, | |||
528 | } | 528 | } |
529 | 529 | ||
530 | if (action == NULL) | 530 | if (action == NULL) |
531 | action = (struct irqaction *)kmalloc(sizeof(struct irqaction), | 531 | action = kmalloc(sizeof(struct irqaction), |
532 | GFP_ATOMIC); | 532 | GFP_ATOMIC); |
533 | 533 | ||
534 | if (!action) { | 534 | if (!action) { |
diff --git a/arch/sparc/kernel/sun4d_irq.c b/arch/sparc/kernel/sun4d_irq.c index cf1b8baa57ea..0e27e226e0e2 100644 --- a/arch/sparc/kernel/sun4d_irq.c +++ b/arch/sparc/kernel/sun4d_irq.c | |||
@@ -327,7 +327,7 @@ int sun4d_request_irq(unsigned int irq, | |||
327 | } | 327 | } |
328 | 328 | ||
329 | if (action == NULL) | 329 | if (action == NULL) |
330 | action = (struct irqaction *)kmalloc(sizeof(struct irqaction), | 330 | action = kmalloc(sizeof(struct irqaction), |
331 | GFP_ATOMIC); | 331 | GFP_ATOMIC); |
332 | 332 | ||
333 | if (!action) { | 333 | if (!action) { |
diff --git a/arch/sparc64/kernel/sys_sunos32.c b/arch/sparc64/kernel/sys_sunos32.c index 4446f66590fa..2ebc2c051383 100644 --- a/arch/sparc64/kernel/sys_sunos32.c +++ b/arch/sparc64/kernel/sys_sunos32.c | |||
@@ -1055,7 +1055,7 @@ asmlinkage int sunos_msgsys(int op, u32 arg1, u32 arg2, u32 arg3, u32 arg4) | |||
1055 | break; | 1055 | break; |
1056 | case 2: | 1056 | case 2: |
1057 | rval = -EFAULT; | 1057 | rval = -EFAULT; |
1058 | kmbuf = (struct msgbuf *)kmalloc(sizeof(struct msgbuf) + arg3, | 1058 | kmbuf = kmalloc(sizeof(struct msgbuf) + arg3, |
1059 | GFP_KERNEL); | 1059 | GFP_KERNEL); |
1060 | if (!kmbuf) | 1060 | if (!kmbuf) |
1061 | break; | 1061 | break; |
@@ -1078,7 +1078,7 @@ asmlinkage int sunos_msgsys(int op, u32 arg1, u32 arg2, u32 arg3, u32 arg4) | |||
1078 | break; | 1078 | break; |
1079 | case 3: | 1079 | case 3: |
1080 | rval = -EFAULT; | 1080 | rval = -EFAULT; |
1081 | kmbuf = (struct msgbuf *)kmalloc(sizeof(struct msgbuf) + arg3, | 1081 | kmbuf = kmalloc(sizeof(struct msgbuf) + arg3, |
1082 | GFP_KERNEL); | 1082 | GFP_KERNEL); |
1083 | if (!kmbuf || sunos_msgbuf_get((struct msgbuf32 __user *)(unsigned long)arg2, | 1083 | if (!kmbuf || sunos_msgbuf_get((struct msgbuf32 __user *)(unsigned long)arg2, |
1084 | kmbuf, arg3)) | 1084 | kmbuf, arg3)) |
diff --git a/arch/um/sys-i386/ldt.c b/arch/um/sys-i386/ldt.c index 49057d8bc668..5db7737df0ff 100644 --- a/arch/um/sys-i386/ldt.c +++ b/arch/um/sys-i386/ldt.c | |||
@@ -166,7 +166,7 @@ static long read_ldt_from_host(void __user * ptr, unsigned long bytecount) | |||
166 | struct ptrace_ldt ptrace_ldt = (struct ptrace_ldt) { | 166 | struct ptrace_ldt ptrace_ldt = (struct ptrace_ldt) { |
167 | .func = 0, | 167 | .func = 0, |
168 | .bytecount = bytecount, | 168 | .bytecount = bytecount, |
169 | .ptr = (void *)kmalloc(bytecount, GFP_KERNEL)}; | 169 | .ptr = kmalloc(bytecount, GFP_KERNEL)}; |
170 | u32 cpu; | 170 | u32 cpu; |
171 | 171 | ||
172 | if(ptrace_ldt.ptr == NULL) | 172 | if(ptrace_ldt.ptr == NULL) |
@@ -426,7 +426,7 @@ void ldt_get_host_info(void) | |||
426 | host_ldt_entries = dummy_list; | 426 | host_ldt_entries = dummy_list; |
427 | else { | 427 | else { |
428 | size = (size + 1) * sizeof(dummy_list[0]); | 428 | size = (size + 1) * sizeof(dummy_list[0]); |
429 | host_ldt_entries = (short *)kmalloc(size, GFP_KERNEL); | 429 | host_ldt_entries = kmalloc(size, GFP_KERNEL); |
430 | if(host_ldt_entries == NULL) { | 430 | if(host_ldt_entries == NULL) { |
431 | printk("ldt_get_host_info: couldn't allocate host ldt list\n"); | 431 | printk("ldt_get_host_info: couldn't allocate host ldt list\n"); |
432 | goto out_free; | 432 | goto out_free; |
diff --git a/drivers/acorn/block/fd1772.c b/drivers/acorn/block/fd1772.c index 048542341204..674bf81c6e66 100644 --- a/drivers/acorn/block/fd1772.c +++ b/drivers/acorn/block/fd1772.c | |||
@@ -1549,12 +1549,12 @@ int fd1772_init(void) | |||
1549 | #ifdef TRACKBUFFER | 1549 | #ifdef TRACKBUFFER |
1550 | BufferDrive = BufferSide = BufferTrack = -1; | 1550 | BufferDrive = BufferSide = BufferTrack = -1; |
1551 | /* Atari uses 512 - I want to eventually cope with 1K sectors */ | 1551 | /* Atari uses 512 - I want to eventually cope with 1K sectors */ |
1552 | DMABuffer = (char *)kmalloc((FD1772_MAX_SECTORS+1)*512,GFP_KERNEL); | 1552 | DMABuffer = kmalloc((FD1772_MAX_SECTORS+1)*512,GFP_KERNEL); |
1553 | TrackBuffer = DMABuffer + 512; | 1553 | TrackBuffer = DMABuffer + 512; |
1554 | #else | 1554 | #else |
1555 | /* Allocate memory for the DMAbuffer - on the Atari this takes it | 1555 | /* Allocate memory for the DMAbuffer - on the Atari this takes it |
1556 | out of some special memory... */ | 1556 | out of some special memory... */ |
1557 | DMABuffer = (char *) kmalloc(2048); /* Copes with pretty large sectors */ | 1557 | DMABuffer = kmalloc(2048); /* Copes with pretty large sectors */ |
1558 | #endif | 1558 | #endif |
1559 | err = -ENOMEM; | 1559 | err = -ENOMEM; |
1560 | if (!DMAbuffer) | 1560 | if (!DMAbuffer) |
diff --git a/drivers/atm/eni.c b/drivers/atm/eni.c index bc1b13c8f5d7..5aab7bd473ac 100644 --- a/drivers/atm/eni.c +++ b/drivers/atm/eni.c | |||
@@ -1832,7 +1832,7 @@ static int __devinit eni_start(struct atm_dev *dev) | |||
1832 | /* initialize memory management */ | 1832 | /* initialize memory management */ |
1833 | buffer_mem = eni_dev->mem - (buf - eni_dev->ram); | 1833 | buffer_mem = eni_dev->mem - (buf - eni_dev->ram); |
1834 | eni_dev->free_list_size = buffer_mem/MID_MIN_BUF_SIZE/2; | 1834 | eni_dev->free_list_size = buffer_mem/MID_MIN_BUF_SIZE/2; |
1835 | eni_dev->free_list = (struct eni_free *) kmalloc( | 1835 | eni_dev->free_list = kmalloc( |
1836 | sizeof(struct eni_free)*(eni_dev->free_list_size+1),GFP_KERNEL); | 1836 | sizeof(struct eni_free)*(eni_dev->free_list_size+1),GFP_KERNEL); |
1837 | if (!eni_dev->free_list) { | 1837 | if (!eni_dev->free_list) { |
1838 | printk(KERN_ERR DEV_LABEL "(itf %d): couldn't get free page\n", | 1838 | printk(KERN_ERR DEV_LABEL "(itf %d): couldn't get free page\n", |
@@ -2232,7 +2232,7 @@ static int __devinit eni_init_one(struct pci_dev *pci_dev, | |||
2232 | goto out0; | 2232 | goto out0; |
2233 | } | 2233 | } |
2234 | 2234 | ||
2235 | eni_dev = (struct eni_dev *) kmalloc(sizeof(struct eni_dev),GFP_KERNEL); | 2235 | eni_dev = kmalloc(sizeof(struct eni_dev),GFP_KERNEL); |
2236 | if (!eni_dev) goto out0; | 2236 | if (!eni_dev) goto out0; |
2237 | if (!cpu_zeroes) { | 2237 | if (!cpu_zeroes) { |
2238 | cpu_zeroes = pci_alloc_consistent(pci_dev,ENI_ZEROES_SIZE, | 2238 | cpu_zeroes = pci_alloc_consistent(pci_dev,ENI_ZEROES_SIZE, |
diff --git a/drivers/atm/he.c b/drivers/atm/he.c index 7d9b4e52f0bf..db33f6f4dd2a 100644 --- a/drivers/atm/he.c +++ b/drivers/atm/he.c | |||
@@ -2351,7 +2351,7 @@ he_open(struct atm_vcc *vcc) | |||
2351 | 2351 | ||
2352 | cid = he_mkcid(he_dev, vpi, vci); | 2352 | cid = he_mkcid(he_dev, vpi, vci); |
2353 | 2353 | ||
2354 | he_vcc = (struct he_vcc *) kmalloc(sizeof(struct he_vcc), GFP_ATOMIC); | 2354 | he_vcc = kmalloc(sizeof(struct he_vcc), GFP_ATOMIC); |
2355 | if (he_vcc == NULL) { | 2355 | if (he_vcc == NULL) { |
2356 | hprintk("unable to allocate he_vcc during open\n"); | 2356 | hprintk("unable to allocate he_vcc during open\n"); |
2357 | return -ENOMEM; | 2357 | return -ENOMEM; |
diff --git a/drivers/atm/lanai.c b/drivers/atm/lanai.c index 267825501dfe..09f477d4237a 100644 --- a/drivers/atm/lanai.c +++ b/drivers/atm/lanai.c | |||
@@ -2602,7 +2602,7 @@ static int __devinit lanai_init_one(struct pci_dev *pci, | |||
2602 | struct atm_dev *atmdev; | 2602 | struct atm_dev *atmdev; |
2603 | int result; | 2603 | int result; |
2604 | 2604 | ||
2605 | lanai = (struct lanai_dev *) kmalloc(sizeof(*lanai), GFP_KERNEL); | 2605 | lanai = kmalloc(sizeof(*lanai), GFP_KERNEL); |
2606 | if (lanai == NULL) { | 2606 | if (lanai == NULL) { |
2607 | printk(KERN_ERR DEV_LABEL | 2607 | printk(KERN_ERR DEV_LABEL |
2608 | ": couldn't allocate dev_data structure!\n"); | 2608 | ": couldn't allocate dev_data structure!\n"); |
diff --git a/drivers/atm/nicstar.c b/drivers/atm/nicstar.c index bd0904594805..aab9b3733d52 100644 --- a/drivers/atm/nicstar.c +++ b/drivers/atm/nicstar.c | |||
@@ -997,7 +997,7 @@ static scq_info *get_scq(int size, u32 scd) | |||
997 | if (size != VBR_SCQSIZE && size != CBR_SCQSIZE) | 997 | if (size != VBR_SCQSIZE && size != CBR_SCQSIZE) |
998 | return NULL; | 998 | return NULL; |
999 | 999 | ||
1000 | scq = (scq_info *) kmalloc(sizeof(scq_info), GFP_KERNEL); | 1000 | scq = kmalloc(sizeof(scq_info), GFP_KERNEL); |
1001 | if (scq == NULL) | 1001 | if (scq == NULL) |
1002 | return NULL; | 1002 | return NULL; |
1003 | scq->org = kmalloc(2 * size, GFP_KERNEL); | 1003 | scq->org = kmalloc(2 * size, GFP_KERNEL); |
@@ -1006,7 +1006,7 @@ static scq_info *get_scq(int size, u32 scd) | |||
1006 | kfree(scq); | 1006 | kfree(scq); |
1007 | return NULL; | 1007 | return NULL; |
1008 | } | 1008 | } |
1009 | scq->skb = (struct sk_buff **) kmalloc(sizeof(struct sk_buff *) * | 1009 | scq->skb = kmalloc(sizeof(struct sk_buff *) * |
1010 | (size / NS_SCQE_SIZE), GFP_KERNEL); | 1010 | (size / NS_SCQE_SIZE), GFP_KERNEL); |
1011 | if (scq->skb == NULL) | 1011 | if (scq->skb == NULL) |
1012 | { | 1012 | { |
diff --git a/drivers/atm/zatm.c b/drivers/atm/zatm.c index 7df0f373188e..756d4f760da3 100644 --- a/drivers/atm/zatm.c +++ b/drivers/atm/zatm.c | |||
@@ -996,7 +996,7 @@ static int start_tx(struct atm_dev *dev) | |||
996 | 996 | ||
997 | DPRINTK("start_tx\n"); | 997 | DPRINTK("start_tx\n"); |
998 | zatm_dev = ZATM_DEV(dev); | 998 | zatm_dev = ZATM_DEV(dev); |
999 | zatm_dev->tx_map = (struct atm_vcc **) kmalloc(sizeof(struct atm_vcc *)* | 999 | zatm_dev->tx_map = kmalloc(sizeof(struct atm_vcc *)* |
1000 | zatm_dev->chans,GFP_KERNEL); | 1000 | zatm_dev->chans,GFP_KERNEL); |
1001 | if (!zatm_dev->tx_map) return -ENOMEM; | 1001 | if (!zatm_dev->tx_map) return -ENOMEM; |
1002 | zatm_dev->tx_bw = ATM_OC3_PCR; | 1002 | zatm_dev->tx_bw = ATM_OC3_PCR; |
@@ -1591,7 +1591,7 @@ static int __devinit zatm_init_one(struct pci_dev *pci_dev, | |||
1591 | struct zatm_dev *zatm_dev; | 1591 | struct zatm_dev *zatm_dev; |
1592 | int ret = -ENOMEM; | 1592 | int ret = -ENOMEM; |
1593 | 1593 | ||
1594 | zatm_dev = (struct zatm_dev *) kmalloc(sizeof(*zatm_dev), GFP_KERNEL); | 1594 | zatm_dev = kmalloc(sizeof(*zatm_dev), GFP_KERNEL); |
1595 | if (!zatm_dev) { | 1595 | if (!zatm_dev) { |
1596 | printk(KERN_EMERG "%s: memory shortage\n", DEV_LABEL); | 1596 | printk(KERN_EMERG "%s: memory shortage\n", DEV_LABEL); |
1597 | goto out; | 1597 | goto out; |
diff --git a/drivers/base/dmapool.c b/drivers/base/dmapool.c index dbe0735f8c9e..f95d50277274 100644 --- a/drivers/base/dmapool.c +++ b/drivers/base/dmapool.c | |||
@@ -173,7 +173,7 @@ pool_alloc_page (struct dma_pool *pool, gfp_t mem_flags) | |||
173 | mapsize = (mapsize + BITS_PER_LONG - 1) / BITS_PER_LONG; | 173 | mapsize = (mapsize + BITS_PER_LONG - 1) / BITS_PER_LONG; |
174 | mapsize *= sizeof (long); | 174 | mapsize *= sizeof (long); |
175 | 175 | ||
176 | page = (struct dma_page *) kmalloc (mapsize + sizeof *page, mem_flags); | 176 | page = kmalloc(mapsize + sizeof *page, mem_flags); |
177 | if (!page) | 177 | if (!page) |
178 | return NULL; | 178 | return NULL; |
179 | page->vaddr = dma_alloc_coherent (pool->dev, | 179 | page->vaddr = dma_alloc_coherent (pool->dev, |
diff --git a/drivers/block/cciss.c b/drivers/block/cciss.c index 730f9693150e..acb2fa9cf6b1 100644 --- a/drivers/block/cciss.c +++ b/drivers/block/cciss.c | |||
@@ -1039,7 +1039,7 @@ static int cciss_ioctl(struct inode *inode, struct file *filep, | |||
1039 | status = -ENOMEM; | 1039 | status = -ENOMEM; |
1040 | goto cleanup1; | 1040 | goto cleanup1; |
1041 | } | 1041 | } |
1042 | buff_size = (int *)kmalloc(MAXSGENTRIES * sizeof(int), | 1042 | buff_size = kmalloc(MAXSGENTRIES * sizeof(int), |
1043 | GFP_KERNEL); | 1043 | GFP_KERNEL); |
1044 | if (!buff_size) { | 1044 | if (!buff_size) { |
1045 | status = -ENOMEM; | 1045 | status = -ENOMEM; |
diff --git a/drivers/block/cpqarray.c b/drivers/block/cpqarray.c index d5f519ebbc08..b94cd1c32131 100644 --- a/drivers/block/cpqarray.c +++ b/drivers/block/cpqarray.c | |||
@@ -1625,7 +1625,7 @@ static void start_fwbk(int ctlr) | |||
1625 | " processing\n"); | 1625 | " processing\n"); |
1626 | /* Command does not return anything, but idasend command needs a | 1626 | /* Command does not return anything, but idasend command needs a |
1627 | buffer */ | 1627 | buffer */ |
1628 | id_ctlr_buf = (id_ctlr_t *)kmalloc(sizeof(id_ctlr_t), GFP_KERNEL); | 1628 | id_ctlr_buf = kmalloc(sizeof(id_ctlr_t), GFP_KERNEL); |
1629 | if(id_ctlr_buf==NULL) | 1629 | if(id_ctlr_buf==NULL) |
1630 | { | 1630 | { |
1631 | printk(KERN_WARNING "cpqarray: Out of memory. " | 1631 | printk(KERN_WARNING "cpqarray: Out of memory. " |
@@ -1660,14 +1660,14 @@ static void getgeometry(int ctlr) | |||
1660 | 1660 | ||
1661 | info_p->log_drv_map = 0; | 1661 | info_p->log_drv_map = 0; |
1662 | 1662 | ||
1663 | id_ldrive = (id_log_drv_t *)kmalloc(sizeof(id_log_drv_t), GFP_KERNEL); | 1663 | id_ldrive = kmalloc(sizeof(id_log_drv_t), GFP_KERNEL); |
1664 | if(id_ldrive == NULL) | 1664 | if(id_ldrive == NULL) |
1665 | { | 1665 | { |
1666 | printk( KERN_ERR "cpqarray: out of memory.\n"); | 1666 | printk( KERN_ERR "cpqarray: out of memory.\n"); |
1667 | return; | 1667 | return; |
1668 | } | 1668 | } |
1669 | 1669 | ||
1670 | id_ctlr_buf = (id_ctlr_t *)kmalloc(sizeof(id_ctlr_t), GFP_KERNEL); | 1670 | id_ctlr_buf = kmalloc(sizeof(id_ctlr_t), GFP_KERNEL); |
1671 | if(id_ctlr_buf == NULL) | 1671 | if(id_ctlr_buf == NULL) |
1672 | { | 1672 | { |
1673 | kfree(id_ldrive); | 1673 | kfree(id_ldrive); |
@@ -1675,7 +1675,7 @@ static void getgeometry(int ctlr) | |||
1675 | return; | 1675 | return; |
1676 | } | 1676 | } |
1677 | 1677 | ||
1678 | id_lstatus_buf = (sense_log_drv_stat_t *)kmalloc(sizeof(sense_log_drv_stat_t), GFP_KERNEL); | 1678 | id_lstatus_buf = kmalloc(sizeof(sense_log_drv_stat_t), GFP_KERNEL); |
1679 | if(id_lstatus_buf == NULL) | 1679 | if(id_lstatus_buf == NULL) |
1680 | { | 1680 | { |
1681 | kfree(id_ctlr_buf); | 1681 | kfree(id_ctlr_buf); |
@@ -1684,7 +1684,7 @@ static void getgeometry(int ctlr) | |||
1684 | return; | 1684 | return; |
1685 | } | 1685 | } |
1686 | 1686 | ||
1687 | sense_config_buf = (config_t *)kmalloc(sizeof(config_t), GFP_KERNEL); | 1687 | sense_config_buf = kmalloc(sizeof(config_t), GFP_KERNEL); |
1688 | if(sense_config_buf == NULL) | 1688 | if(sense_config_buf == NULL) |
1689 | { | 1689 | { |
1690 | kfree(id_lstatus_buf); | 1690 | kfree(id_lstatus_buf); |
diff --git a/drivers/cdrom/cdrom.c b/drivers/cdrom/cdrom.c index 2df5cf4ec743..e4a2f8f3a1d7 100644 --- a/drivers/cdrom/cdrom.c +++ b/drivers/cdrom/cdrom.c | |||
@@ -1810,7 +1810,7 @@ static int dvd_read_disckey(struct cdrom_device_info *cdi, dvd_struct *s) | |||
1810 | 1810 | ||
1811 | size = sizeof(s->disckey.value) + 4; | 1811 | size = sizeof(s->disckey.value) + 4; |
1812 | 1812 | ||
1813 | if ((buf = (u_char *) kmalloc(size, GFP_KERNEL)) == NULL) | 1813 | if ((buf = kmalloc(size, GFP_KERNEL)) == NULL) |
1814 | return -ENOMEM; | 1814 | return -ENOMEM; |
1815 | 1815 | ||
1816 | init_cdrom_command(&cgc, buf, size, CGC_DATA_READ); | 1816 | init_cdrom_command(&cgc, buf, size, CGC_DATA_READ); |
@@ -1861,7 +1861,7 @@ static int dvd_read_manufact(struct cdrom_device_info *cdi, dvd_struct *s) | |||
1861 | 1861 | ||
1862 | size = sizeof(s->manufact.value) + 4; | 1862 | size = sizeof(s->manufact.value) + 4; |
1863 | 1863 | ||
1864 | if ((buf = (u_char *) kmalloc(size, GFP_KERNEL)) == NULL) | 1864 | if ((buf = kmalloc(size, GFP_KERNEL)) == NULL) |
1865 | return -ENOMEM; | 1865 | return -ENOMEM; |
1866 | 1866 | ||
1867 | init_cdrom_command(&cgc, buf, size, CGC_DATA_READ); | 1867 | init_cdrom_command(&cgc, buf, size, CGC_DATA_READ); |
@@ -2849,7 +2849,7 @@ static int mmc_ioctl(struct cdrom_device_info *cdi, unsigned int cmd, | |||
2849 | /* FIXME: we need upper bound checking, too!! */ | 2849 | /* FIXME: we need upper bound checking, too!! */ |
2850 | if (lba < 0) | 2850 | if (lba < 0) |
2851 | return -EINVAL; | 2851 | return -EINVAL; |
2852 | cgc.buffer = (char *) kmalloc(blocksize, GFP_KERNEL); | 2852 | cgc.buffer = kmalloc(blocksize, GFP_KERNEL); |
2853 | if (cgc.buffer == NULL) | 2853 | if (cgc.buffer == NULL) |
2854 | return -ENOMEM; | 2854 | return -ENOMEM; |
2855 | memset(&sense, 0, sizeof(sense)); | 2855 | memset(&sense, 0, sizeof(sense)); |
@@ -3031,7 +3031,7 @@ static int mmc_ioctl(struct cdrom_device_info *cdi, unsigned int cmd, | |||
3031 | int size = sizeof(dvd_struct); | 3031 | int size = sizeof(dvd_struct); |
3032 | if (!CDROM_CAN(CDC_DVD)) | 3032 | if (!CDROM_CAN(CDC_DVD)) |
3033 | return -ENOSYS; | 3033 | return -ENOSYS; |
3034 | if ((s = (dvd_struct *) kmalloc(size, GFP_KERNEL)) == NULL) | 3034 | if ((s = kmalloc(size, GFP_KERNEL)) == NULL) |
3035 | return -ENOMEM; | 3035 | return -ENOMEM; |
3036 | cdinfo(CD_DO_IOCTL, "entering DVD_READ_STRUCT\n"); | 3036 | cdinfo(CD_DO_IOCTL, "entering DVD_READ_STRUCT\n"); |
3037 | if (copy_from_user(s, (dvd_struct __user *)arg, size)) { | 3037 | if (copy_from_user(s, (dvd_struct __user *)arg, size)) { |
diff --git a/drivers/cdrom/cm206.c b/drivers/cdrom/cm206.c index e6d8e9ededea..b6c61bbb20e1 100644 --- a/drivers/cdrom/cm206.c +++ b/drivers/cdrom/cm206.c | |||
@@ -1420,7 +1420,7 @@ int __init cm206_init(void) | |||
1420 | return -EIO; | 1420 | return -EIO; |
1421 | } | 1421 | } |
1422 | printk(" adapter at 0x%x", cm206_base); | 1422 | printk(" adapter at 0x%x", cm206_base); |
1423 | cd = (struct cm206_struct *) kmalloc(size, GFP_KERNEL); | 1423 | cd = kmalloc(size, GFP_KERNEL); |
1424 | if (!cd) | 1424 | if (!cd) |
1425 | goto out_base; | 1425 | goto out_base; |
1426 | /* Now we have found the adaptor card, try to reset it. As we have | 1426 | /* Now we have found the adaptor card, try to reset it. As we have |
diff --git a/drivers/char/consolemap.c b/drivers/char/consolemap.c index 04a12027a740..b99b7561260d 100644 --- a/drivers/char/consolemap.c +++ b/drivers/char/consolemap.c | |||
@@ -443,7 +443,7 @@ int con_clear_unimap(struct vc_data *vc, struct unimapinit *ui) | |||
443 | p = (struct uni_pagedir *)*vc->vc_uni_pagedir_loc; | 443 | p = (struct uni_pagedir *)*vc->vc_uni_pagedir_loc; |
444 | if (p && p->readonly) return -EIO; | 444 | if (p && p->readonly) return -EIO; |
445 | if (!p || --p->refcount) { | 445 | if (!p || --p->refcount) { |
446 | q = (struct uni_pagedir *)kmalloc(sizeof(*p), GFP_KERNEL); | 446 | q = kmalloc(sizeof(*p), GFP_KERNEL); |
447 | if (!q) { | 447 | if (!q) { |
448 | if (p) p->refcount++; | 448 | if (p) p->refcount++; |
449 | return -ENOMEM; | 449 | return -ENOMEM; |
diff --git a/drivers/char/lcd.c b/drivers/char/lcd.c index da601fd6c07a..d649abbf0857 100644 --- a/drivers/char/lcd.c +++ b/drivers/char/lcd.c | |||
@@ -459,7 +459,7 @@ static int lcd_ioctl(struct inode *inode, struct file *file, | |||
459 | (&display, (struct lcd_display *) arg, | 459 | (&display, (struct lcd_display *) arg, |
460 | sizeof(struct lcd_display))) | 460 | sizeof(struct lcd_display))) |
461 | return -EFAULT; | 461 | return -EFAULT; |
462 | rom = (unsigned char *) kmalloc((128), GFP_ATOMIC); | 462 | rom = kmalloc((128), GFP_ATOMIC); |
463 | if (rom == NULL) { | 463 | if (rom == NULL) { |
464 | printk(KERN_ERR LCD "kmalloc() failed in %s\n", | 464 | printk(KERN_ERR LCD "kmalloc() failed in %s\n", |
465 | __FUNCTION__); | 465 | __FUNCTION__); |
diff --git a/drivers/char/lp.c b/drivers/char/lp.c index b70b5388b5a8..b51d08be0bcf 100644 --- a/drivers/char/lp.c +++ b/drivers/char/lp.c | |||
@@ -525,7 +525,7 @@ static int lp_open(struct inode * inode, struct file * file) | |||
525 | return -EIO; | 525 | return -EIO; |
526 | } | 526 | } |
527 | } | 527 | } |
528 | lp_table[minor].lp_buffer = (char *) kmalloc(LP_BUFFER_SIZE, GFP_KERNEL); | 528 | lp_table[minor].lp_buffer = kmalloc(LP_BUFFER_SIZE, GFP_KERNEL); |
529 | if (!lp_table[minor].lp_buffer) { | 529 | if (!lp_table[minor].lp_buffer) { |
530 | LP_F(minor) &= ~LP_BUSY; | 530 | LP_F(minor) &= ~LP_BUSY; |
531 | return -ENOMEM; | 531 | return -ENOMEM; |
diff --git a/drivers/char/pcmcia/synclink_cs.c b/drivers/char/pcmcia/synclink_cs.c index 5152cedd8878..f108c136800a 100644 --- a/drivers/char/pcmcia/synclink_cs.c +++ b/drivers/char/pcmcia/synclink_cs.c | |||
@@ -541,7 +541,7 @@ static int mgslpc_probe(struct pcmcia_device *link) | |||
541 | if (debug_level >= DEBUG_LEVEL_INFO) | 541 | if (debug_level >= DEBUG_LEVEL_INFO) |
542 | printk("mgslpc_attach\n"); | 542 | printk("mgslpc_attach\n"); |
543 | 543 | ||
544 | info = (MGSLPC_INFO *)kmalloc(sizeof(MGSLPC_INFO), GFP_KERNEL); | 544 | info = kmalloc(sizeof(MGSLPC_INFO), GFP_KERNEL); |
545 | if (!info) { | 545 | if (!info) { |
546 | printk("Error can't allocate device instance data\n"); | 546 | printk("Error can't allocate device instance data\n"); |
547 | return -ENOMEM; | 547 | return -ENOMEM; |
diff --git a/drivers/char/rio/riocmd.c b/drivers/char/rio/riocmd.c index 167ebc84e8d7..245f03195b7c 100644 --- a/drivers/char/rio/riocmd.c +++ b/drivers/char/rio/riocmd.c | |||
@@ -556,7 +556,7 @@ struct CmdBlk *RIOGetCmdBlk(void) | |||
556 | { | 556 | { |
557 | struct CmdBlk *CmdBlkP; | 557 | struct CmdBlk *CmdBlkP; |
558 | 558 | ||
559 | CmdBlkP = (struct CmdBlk *)kmalloc(sizeof(struct CmdBlk), GFP_ATOMIC); | 559 | CmdBlkP = kmalloc(sizeof(struct CmdBlk), GFP_ATOMIC); |
560 | if (CmdBlkP) | 560 | if (CmdBlkP) |
561 | memset(CmdBlkP, 0, sizeof(struct CmdBlk)); | 561 | memset(CmdBlkP, 0, sizeof(struct CmdBlk)); |
562 | return CmdBlkP; | 562 | return CmdBlkP; |
diff --git a/drivers/char/synclink.c b/drivers/char/synclink.c index acc6fab601cc..3fa625db9e4b 100644 --- a/drivers/char/synclink.c +++ b/drivers/char/synclink.c | |||
@@ -4332,7 +4332,7 @@ static struct mgsl_struct* mgsl_allocate_device(void) | |||
4332 | { | 4332 | { |
4333 | struct mgsl_struct *info; | 4333 | struct mgsl_struct *info; |
4334 | 4334 | ||
4335 | info = (struct mgsl_struct *)kmalloc(sizeof(struct mgsl_struct), | 4335 | info = kmalloc(sizeof(struct mgsl_struct), |
4336 | GFP_KERNEL); | 4336 | GFP_KERNEL); |
4337 | 4337 | ||
4338 | if (!info) { | 4338 | if (!info) { |
diff --git a/drivers/char/synclinkmp.c b/drivers/char/synclinkmp.c index 53e8ccf94fe3..8f4d67afe5bf 100644 --- a/drivers/char/synclinkmp.c +++ b/drivers/char/synclinkmp.c | |||
@@ -2730,7 +2730,7 @@ static int startup(SLMP_INFO * info) | |||
2730 | return 0; | 2730 | return 0; |
2731 | 2731 | ||
2732 | if (!info->tx_buf) { | 2732 | if (!info->tx_buf) { |
2733 | info->tx_buf = (unsigned char *)kmalloc(info->max_frame_size, GFP_KERNEL); | 2733 | info->tx_buf = kmalloc(info->max_frame_size, GFP_KERNEL); |
2734 | if (!info->tx_buf) { | 2734 | if (!info->tx_buf) { |
2735 | printk(KERN_ERR"%s(%d):%s can't allocate transmit buffer\n", | 2735 | printk(KERN_ERR"%s(%d):%s can't allocate transmit buffer\n", |
2736 | __FILE__,__LINE__,info->device_name); | 2736 | __FILE__,__LINE__,info->device_name); |
@@ -3798,7 +3798,7 @@ static SLMP_INFO *alloc_dev(int adapter_num, int port_num, struct pci_dev *pdev) | |||
3798 | { | 3798 | { |
3799 | SLMP_INFO *info; | 3799 | SLMP_INFO *info; |
3800 | 3800 | ||
3801 | info = (SLMP_INFO *)kmalloc(sizeof(SLMP_INFO), | 3801 | info = kmalloc(sizeof(SLMP_INFO), |
3802 | GFP_KERNEL); | 3802 | GFP_KERNEL); |
3803 | 3803 | ||
3804 | if (!info) { | 3804 | if (!info) { |
diff --git a/drivers/char/vt.c b/drivers/char/vt.c index a8239dac994f..06c32a3e3ca4 100644 --- a/drivers/char/vt.c +++ b/drivers/char/vt.c | |||
@@ -784,7 +784,7 @@ int vc_resize(struct vc_data *vc, unsigned int cols, unsigned int lines) | |||
784 | if (new_cols == vc->vc_cols && new_rows == vc->vc_rows) | 784 | if (new_cols == vc->vc_cols && new_rows == vc->vc_rows) |
785 | return 0; | 785 | return 0; |
786 | 786 | ||
787 | newscreen = (unsigned short *) kmalloc(new_screen_size, GFP_USER); | 787 | newscreen = kmalloc(new_screen_size, GFP_USER); |
788 | if (!newscreen) | 788 | if (!newscreen) |
789 | return -ENOMEM; | 789 | return -ENOMEM; |
790 | 790 | ||
diff --git a/drivers/char/vt_ioctl.c b/drivers/char/vt_ioctl.c index 311493e7b409..dc8368ebb1ac 100644 --- a/drivers/char/vt_ioctl.c +++ b/drivers/char/vt_ioctl.c | |||
@@ -129,7 +129,7 @@ do_kdsk_ioctl(int cmd, struct kbentry __user *user_kbe, int perm, struct kbd_str | |||
129 | !capable(CAP_SYS_RESOURCE)) | 129 | !capable(CAP_SYS_RESOURCE)) |
130 | return -EPERM; | 130 | return -EPERM; |
131 | 131 | ||
132 | key_map = (ushort *) kmalloc(sizeof(plain_map), | 132 | key_map = kmalloc(sizeof(plain_map), |
133 | GFP_KERNEL); | 133 | GFP_KERNEL); |
134 | if (!key_map) | 134 | if (!key_map) |
135 | return -ENOMEM; | 135 | return -ENOMEM; |
@@ -259,7 +259,7 @@ do_kdgkb_ioctl(int cmd, struct kbsentry __user *user_kdgkb, int perm) | |||
259 | sz = 256; | 259 | sz = 256; |
260 | while (sz < funcbufsize - funcbufleft + delta) | 260 | while (sz < funcbufsize - funcbufleft + delta) |
261 | sz <<= 1; | 261 | sz <<= 1; |
262 | fnw = (char *) kmalloc(sz, GFP_KERNEL); | 262 | fnw = kmalloc(sz, GFP_KERNEL); |
263 | if(!fnw) { | 263 | if(!fnw) { |
264 | ret = -ENOMEM; | 264 | ret = -ENOMEM; |
265 | goto reterr; | 265 | goto reterr; |
diff --git a/drivers/fc4/fc.c b/drivers/fc4/fc.c index ca4e67a022d0..22b62b3cd14e 100644 --- a/drivers/fc4/fc.c +++ b/drivers/fc4/fc.c | |||
@@ -266,7 +266,7 @@ static void fcp_report_map_done(fc_channel *fc, int i, int status) | |||
266 | printk ("FC: Bad magic from REPORT_AL_MAP on %s - %08x\n", fc->name, p->magic); | 266 | printk ("FC: Bad magic from REPORT_AL_MAP on %s - %08x\n", fc->name, p->magic); |
267 | fc->state = FC_STATE_OFFLINE; | 267 | fc->state = FC_STATE_OFFLINE; |
268 | } else { | 268 | } else { |
269 | fc->posmap = (fcp_posmap *)kzalloc(sizeof(fcp_posmap)+p->len, GFP_KERNEL); | 269 | fc->posmap = kzalloc(sizeof(fcp_posmap)+p->len, GFP_KERNEL); |
270 | if (!fc->posmap) { | 270 | if (!fc->posmap) { |
271 | printk("FC: Not enough memory, offlining channel\n"); | 271 | printk("FC: Not enough memory, offlining channel\n"); |
272 | fc->state = FC_STATE_OFFLINE; | 272 | fc->state = FC_STATE_OFFLINE; |
@@ -355,7 +355,7 @@ void fcp_register(fc_channel *fc, u8 type, int unregister) | |||
355 | for (i = fc->can_queue; i < fc->scsi_bitmap_end; i++) | 355 | for (i = fc->can_queue; i < fc->scsi_bitmap_end; i++) |
356 | set_bit (i, fc->scsi_bitmap); | 356 | set_bit (i, fc->scsi_bitmap); |
357 | fc->scsi_free = fc->can_queue; | 357 | fc->scsi_free = fc->can_queue; |
358 | fc->cmd_slots = (fcp_cmnd **)kzalloc(slots * sizeof(fcp_cmnd*), GFP_KERNEL); | 358 | fc->cmd_slots = kzalloc(slots * sizeof(fcp_cmnd*), GFP_KERNEL); |
359 | fc->abort_count = 0; | 359 | fc->abort_count = 0; |
360 | } else { | 360 | } else { |
361 | fc->scsi_name[0] = 0; | 361 | fc->scsi_name[0] = 0; |
@@ -933,7 +933,7 @@ int fcp_scsi_dev_reset(struct scsi_cmnd *SCpnt) | |||
933 | DECLARE_MUTEX_LOCKED(sem); | 933 | DECLARE_MUTEX_LOCKED(sem); |
934 | 934 | ||
935 | if (!fc->rst_pkt) { | 935 | if (!fc->rst_pkt) { |
936 | fc->rst_pkt = (struct scsi_cmnd *) kmalloc(sizeof(SCpnt), GFP_KERNEL); | 936 | fc->rst_pkt = kmalloc(sizeof(SCpnt), GFP_KERNEL); |
937 | if (!fc->rst_pkt) return FAILED; | 937 | if (!fc->rst_pkt) return FAILED; |
938 | 938 | ||
939 | fcmd = FCP_CMND(fc->rst_pkt); | 939 | fcmd = FCP_CMND(fc->rst_pkt); |
@@ -1107,7 +1107,7 @@ int fc_do_plogi(fc_channel *fc, unsigned char alpa, fc_wwn *node, fc_wwn *nport) | |||
1107 | logi *l; | 1107 | logi *l; |
1108 | int status; | 1108 | int status; |
1109 | 1109 | ||
1110 | l = (logi *)kzalloc(2 * sizeof(logi), GFP_KERNEL); | 1110 | l = kzalloc(2 * sizeof(logi), GFP_KERNEL); |
1111 | if (!l) return -ENOMEM; | 1111 | if (!l) return -ENOMEM; |
1112 | l->code = LS_PLOGI; | 1112 | l->code = LS_PLOGI; |
1113 | memcpy (&l->nport_wwn, &fc->wwn_nport, sizeof(fc_wwn)); | 1113 | memcpy (&l->nport_wwn, &fc->wwn_nport, sizeof(fc_wwn)); |
@@ -1141,7 +1141,7 @@ int fc_do_prli(fc_channel *fc, unsigned char alpa) | |||
1141 | prli *p; | 1141 | prli *p; |
1142 | int status; | 1142 | int status; |
1143 | 1143 | ||
1144 | p = (prli *)kzalloc(2 * sizeof(prli), GFP_KERNEL); | 1144 | p = kzalloc(2 * sizeof(prli), GFP_KERNEL); |
1145 | if (!p) return -ENOMEM; | 1145 | if (!p) return -ENOMEM; |
1146 | p->code = LS_PRLI; | 1146 | p->code = LS_PRLI; |
1147 | p->params[0] = 0x08002000; | 1147 | p->params[0] = 0x08002000; |
diff --git a/drivers/ide/ide-floppy.c b/drivers/ide/ide-floppy.c index e3a267622bb6..d33717c8afd4 100644 --- a/drivers/ide/ide-floppy.c +++ b/drivers/ide/ide-floppy.c | |||
@@ -2147,7 +2147,7 @@ static int ide_floppy_probe(ide_drive_t *drive) | |||
2147 | printk("ide-floppy: passing drive %s to ide-scsi emulation.\n", drive->name); | 2147 | printk("ide-floppy: passing drive %s to ide-scsi emulation.\n", drive->name); |
2148 | goto failed; | 2148 | goto failed; |
2149 | } | 2149 | } |
2150 | if ((floppy = (idefloppy_floppy_t *) kzalloc (sizeof (idefloppy_floppy_t), GFP_KERNEL)) == NULL) { | 2150 | if ((floppy = kzalloc(sizeof (idefloppy_floppy_t), GFP_KERNEL)) == NULL) { |
2151 | printk (KERN_ERR "ide-floppy: %s: Can't allocate a floppy structure\n", drive->name); | 2151 | printk (KERN_ERR "ide-floppy: %s: Can't allocate a floppy structure\n", drive->name); |
2152 | goto failed; | 2152 | goto failed; |
2153 | } | 2153 | } |
diff --git a/drivers/ide/ide-tape.c b/drivers/ide/ide-tape.c index e2f4bb549063..b3bcd1d7315e 100644 --- a/drivers/ide/ide-tape.c +++ b/drivers/ide/ide-tape.c | |||
@@ -2573,11 +2573,11 @@ static idetape_stage_t *__idetape_kmalloc_stage (idetape_tape_t *tape, int full, | |||
2573 | int pages = tape->pages_per_stage; | 2573 | int pages = tape->pages_per_stage; |
2574 | char *b_data = NULL; | 2574 | char *b_data = NULL; |
2575 | 2575 | ||
2576 | if ((stage = (idetape_stage_t *) kmalloc (sizeof (idetape_stage_t),GFP_KERNEL)) == NULL) | 2576 | if ((stage = kmalloc(sizeof (idetape_stage_t),GFP_KERNEL)) == NULL) |
2577 | return NULL; | 2577 | return NULL; |
2578 | stage->next = NULL; | 2578 | stage->next = NULL; |
2579 | 2579 | ||
2580 | bh = stage->bh = (struct idetape_bh *)kmalloc(sizeof(struct idetape_bh), GFP_KERNEL); | 2580 | bh = stage->bh = kmalloc(sizeof(struct idetape_bh), GFP_KERNEL); |
2581 | if (bh == NULL) | 2581 | if (bh == NULL) |
2582 | goto abort; | 2582 | goto abort; |
2583 | bh->b_reqnext = NULL; | 2583 | bh->b_reqnext = NULL; |
@@ -2607,7 +2607,7 @@ static idetape_stage_t *__idetape_kmalloc_stage (idetape_tape_t *tape, int full, | |||
2607 | continue; | 2607 | continue; |
2608 | } | 2608 | } |
2609 | prev_bh = bh; | 2609 | prev_bh = bh; |
2610 | if ((bh = (struct idetape_bh *)kmalloc(sizeof(struct idetape_bh), GFP_KERNEL)) == NULL) { | 2610 | if ((bh = kmalloc(sizeof(struct idetape_bh), GFP_KERNEL)) == NULL) { |
2611 | free_page((unsigned long) b_data); | 2611 | free_page((unsigned long) b_data); |
2612 | goto abort; | 2612 | goto abort; |
2613 | } | 2613 | } |
@@ -4860,7 +4860,7 @@ static int ide_tape_probe(ide_drive_t *drive) | |||
4860 | printk(KERN_WARNING "ide-tape: Use drive %s with ide-scsi emulation and osst.\n", drive->name); | 4860 | printk(KERN_WARNING "ide-tape: Use drive %s with ide-scsi emulation and osst.\n", drive->name); |
4861 | printk(KERN_WARNING "ide-tape: OnStream support will be removed soon from ide-tape!\n"); | 4861 | printk(KERN_WARNING "ide-tape: OnStream support will be removed soon from ide-tape!\n"); |
4862 | } | 4862 | } |
4863 | tape = (idetape_tape_t *) kzalloc (sizeof (idetape_tape_t), GFP_KERNEL); | 4863 | tape = kzalloc(sizeof (idetape_tape_t), GFP_KERNEL); |
4864 | if (tape == NULL) { | 4864 | if (tape == NULL) { |
4865 | printk(KERN_ERR "ide-tape: %s: Can't allocate a tape structure\n", drive->name); | 4865 | printk(KERN_ERR "ide-tape: %s: Can't allocate a tape structure\n", drive->name); |
4866 | goto failed; | 4866 | goto failed; |
diff --git a/drivers/isdn/act2000/act2000_isa.c b/drivers/isdn/act2000/act2000_isa.c index 3cac23739344..09ea50dd3459 100644 --- a/drivers/isdn/act2000/act2000_isa.c +++ b/drivers/isdn/act2000/act2000_isa.c | |||
@@ -408,7 +408,7 @@ act2000_isa_download(act2000_card * card, act2000_ddef __user * cb) | |||
408 | p = cblock.buffer; | 408 | p = cblock.buffer; |
409 | if (!access_ok(VERIFY_READ, p, length)) | 409 | if (!access_ok(VERIFY_READ, p, length)) |
410 | return -EFAULT; | 410 | return -EFAULT; |
411 | buf = (u_char *) kmalloc(1024, GFP_KERNEL); | 411 | buf = kmalloc(1024, GFP_KERNEL); |
412 | if (!buf) | 412 | if (!buf) |
413 | return -ENOMEM; | 413 | return -ENOMEM; |
414 | timeout = 0; | 414 | timeout = 0; |
diff --git a/drivers/isdn/capi/capidrv.c b/drivers/isdn/capi/capidrv.c index 097bfa7bc323..c4d438c17dab 100644 --- a/drivers/isdn/capi/capidrv.c +++ b/drivers/isdn/capi/capidrv.c | |||
@@ -2013,7 +2013,7 @@ static int capidrv_addcontr(u16 contr, struct capi_profile *profp) | |||
2013 | strcpy(card->name, id); | 2013 | strcpy(card->name, id); |
2014 | card->contrnr = contr; | 2014 | card->contrnr = contr; |
2015 | card->nbchan = profp->nbchannel; | 2015 | card->nbchan = profp->nbchannel; |
2016 | card->bchans = (capidrv_bchan *) kmalloc(sizeof(capidrv_bchan) * card->nbchan, GFP_ATOMIC); | 2016 | card->bchans = kmalloc(sizeof(capidrv_bchan) * card->nbchan, GFP_ATOMIC); |
2017 | if (!card->bchans) { | 2017 | if (!card->bchans) { |
2018 | printk(KERN_WARNING | 2018 | printk(KERN_WARNING |
2019 | "capidrv: (%s) Could not allocate bchan-structs.\n", id); | 2019 | "capidrv: (%s) Could not allocate bchan-structs.\n", id); |
diff --git a/drivers/isdn/divert/divert_procfs.c b/drivers/isdn/divert/divert_procfs.c index 399b316111f7..06967da7c4a8 100644 --- a/drivers/isdn/divert/divert_procfs.c +++ b/drivers/isdn/divert/divert_procfs.c | |||
@@ -45,7 +45,7 @@ put_info_buffer(char *cp) | |||
45 | return; | 45 | return; |
46 | if (!*cp) | 46 | if (!*cp) |
47 | return; | 47 | return; |
48 | if (!(ib = (struct divert_info *) kmalloc(sizeof(struct divert_info) + strlen(cp), GFP_ATOMIC))) | 48 | if (!(ib = kmalloc(sizeof(struct divert_info) + strlen(cp), GFP_ATOMIC))) |
49 | return; /* no memory */ | 49 | return; /* no memory */ |
50 | strcpy(ib->info_start, cp); /* set output string */ | 50 | strcpy(ib->info_start, cp); /* set output string */ |
51 | ib->next = NULL; | 51 | ib->next = NULL; |
diff --git a/drivers/isdn/divert/isdn_divert.c b/drivers/isdn/divert/isdn_divert.c index 03319ea5aa0c..7d97d54588d9 100644 --- a/drivers/isdn/divert/isdn_divert.c +++ b/drivers/isdn/divert/isdn_divert.c | |||
@@ -153,7 +153,7 @@ int cf_command(int drvid, int mode, | |||
153 | *ielenp = p - ielenp - 1; /* set total IE length */ | 153 | *ielenp = p - ielenp - 1; /* set total IE length */ |
154 | 154 | ||
155 | /* allocate mem for information struct */ | 155 | /* allocate mem for information struct */ |
156 | if (!(cs = (struct call_struc *) kmalloc(sizeof(struct call_struc), GFP_ATOMIC))) | 156 | if (!(cs = kmalloc(sizeof(struct call_struc), GFP_ATOMIC))) |
157 | return(-ENOMEM); /* no memory */ | 157 | return(-ENOMEM); /* no memory */ |
158 | init_timer(&cs->timer); | 158 | init_timer(&cs->timer); |
159 | cs->info[0] = '\0'; | 159 | cs->info[0] = '\0'; |
@@ -276,7 +276,7 @@ int insertrule(int idx, divert_rule *newrule) | |||
276 | { struct deflect_struc *ds,*ds1=NULL; | 276 | { struct deflect_struc *ds,*ds1=NULL; |
277 | unsigned long flags; | 277 | unsigned long flags; |
278 | 278 | ||
279 | if (!(ds = (struct deflect_struc *) kmalloc(sizeof(struct deflect_struc), | 279 | if (!(ds = kmalloc(sizeof(struct deflect_struc), |
280 | GFP_KERNEL))) | 280 | GFP_KERNEL))) |
281 | return(-ENOMEM); /* no memory */ | 281 | return(-ENOMEM); /* no memory */ |
282 | 282 | ||
@@ -451,7 +451,7 @@ static int isdn_divert_icall(isdn_ctrl *ic) | |||
451 | if (dv->rule.action == DEFLECT_PROCEED) | 451 | if (dv->rule.action == DEFLECT_PROCEED) |
452 | if ((!if_used) || ((!extern_wait_max) && (!dv->rule.waittime))) | 452 | if ((!if_used) || ((!extern_wait_max) && (!dv->rule.waittime))) |
453 | return(0); /* no external deflection needed */ | 453 | return(0); /* no external deflection needed */ |
454 | if (!(cs = (struct call_struc *) kmalloc(sizeof(struct call_struc), GFP_ATOMIC))) | 454 | if (!(cs = kmalloc(sizeof(struct call_struc), GFP_ATOMIC))) |
455 | return(0); /* no memory */ | 455 | return(0); /* no memory */ |
456 | init_timer(&cs->timer); | 456 | init_timer(&cs->timer); |
457 | cs->info[0] = '\0'; | 457 | cs->info[0] = '\0'; |
diff --git a/drivers/isdn/hysdn/hysdn_procconf.c b/drivers/isdn/hysdn/hysdn_procconf.c index 8e2b03889f3c..94a935089119 100644 --- a/drivers/isdn/hysdn/hysdn_procconf.c +++ b/drivers/isdn/hysdn/hysdn_procconf.c | |||
@@ -275,7 +275,7 @@ hysdn_conf_open(struct inode *ino, struct file *filep) | |||
275 | } else if ((filep->f_mode & (FMODE_READ | FMODE_WRITE)) == FMODE_READ) { | 275 | } else if ((filep->f_mode & (FMODE_READ | FMODE_WRITE)) == FMODE_READ) { |
276 | /* read access -> output card info data */ | 276 | /* read access -> output card info data */ |
277 | 277 | ||
278 | if (!(tmp = (char *) kmalloc(INFO_OUT_LEN * 2 + 2, GFP_KERNEL))) { | 278 | if (!(tmp = kmalloc(INFO_OUT_LEN * 2 + 2, GFP_KERNEL))) { |
279 | unlock_kernel(); | 279 | unlock_kernel(); |
280 | return (-EFAULT); /* out of memory */ | 280 | return (-EFAULT); /* out of memory */ |
281 | } | 281 | } |
diff --git a/drivers/isdn/hysdn/hysdn_proclog.c b/drivers/isdn/hysdn/hysdn_proclog.c index f241f5e551cb..375d956884d7 100644 --- a/drivers/isdn/hysdn/hysdn_proclog.c +++ b/drivers/isdn/hysdn/hysdn_proclog.c | |||
@@ -111,7 +111,7 @@ put_log_buffer(hysdn_card * card, char *cp) | |||
111 | if (pd->if_used <= 0) | 111 | if (pd->if_used <= 0) |
112 | return; /* no open file for read */ | 112 | return; /* no open file for read */ |
113 | 113 | ||
114 | if (!(ib = (struct log_data *) kmalloc(sizeof(struct log_data) + strlen(cp), GFP_ATOMIC))) | 114 | if (!(ib = kmalloc(sizeof(struct log_data) + strlen(cp), GFP_ATOMIC))) |
115 | return; /* no memory */ | 115 | return; /* no memory */ |
116 | strcpy(ib->log_start, cp); /* set output string */ | 116 | strcpy(ib->log_start, cp); /* set output string */ |
117 | ib->next = NULL; | 117 | ib->next = NULL; |
diff --git a/drivers/isdn/i4l/isdn_audio.c b/drivers/isdn/i4l/isdn_audio.c index 2cc56d6a9fae..fb350c567c6b 100644 --- a/drivers/isdn/i4l/isdn_audio.c +++ b/drivers/isdn/i4l/isdn_audio.c | |||
@@ -328,7 +328,7 @@ adpcm_state * | |||
328 | isdn_audio_adpcm_init(adpcm_state * s, int nbits) | 328 | isdn_audio_adpcm_init(adpcm_state * s, int nbits) |
329 | { | 329 | { |
330 | if (!s) | 330 | if (!s) |
331 | s = (adpcm_state *) kmalloc(sizeof(adpcm_state), GFP_ATOMIC); | 331 | s = kmalloc(sizeof(adpcm_state), GFP_ATOMIC); |
332 | if (s) { | 332 | if (s) { |
333 | s->a = 0; | 333 | s->a = 0; |
334 | s->d = 5; | 334 | s->d = 5; |
@@ -343,7 +343,7 @@ dtmf_state * | |||
343 | isdn_audio_dtmf_init(dtmf_state * s) | 343 | isdn_audio_dtmf_init(dtmf_state * s) |
344 | { | 344 | { |
345 | if (!s) | 345 | if (!s) |
346 | s = (dtmf_state *) kmalloc(sizeof(dtmf_state), GFP_ATOMIC); | 346 | s = kmalloc(sizeof(dtmf_state), GFP_ATOMIC); |
347 | if (s) { | 347 | if (s) { |
348 | s->idx = 0; | 348 | s->idx = 0; |
349 | s->last = ' '; | 349 | s->last = ' '; |
@@ -621,7 +621,7 @@ silence_state * | |||
621 | isdn_audio_silence_init(silence_state * s) | 621 | isdn_audio_silence_init(silence_state * s) |
622 | { | 622 | { |
623 | if (!s) | 623 | if (!s) |
624 | s = (silence_state *) kmalloc(sizeof(silence_state), GFP_ATOMIC); | 624 | s = kmalloc(sizeof(silence_state), GFP_ATOMIC); |
625 | if (s) { | 625 | if (s) { |
626 | s->idx = 0; | 626 | s->idx = 0; |
627 | s->state = 0; | 627 | s->state = 0; |
diff --git a/drivers/isdn/i4l/isdn_net.c b/drivers/isdn/i4l/isdn_net.c index c36c817578cb..838b3734e2b6 100644 --- a/drivers/isdn/i4l/isdn_net.c +++ b/drivers/isdn/i4l/isdn_net.c | |||
@@ -2948,7 +2948,7 @@ isdn_net_addphone(isdn_net_ioctl_phone * phone) | |||
2948 | isdn_net_phone *n; | 2948 | isdn_net_phone *n; |
2949 | 2949 | ||
2950 | if (p) { | 2950 | if (p) { |
2951 | if (!(n = (isdn_net_phone *) kmalloc(sizeof(isdn_net_phone), GFP_KERNEL))) | 2951 | if (!(n = kmalloc(sizeof(isdn_net_phone), GFP_KERNEL))) |
2952 | return -ENOMEM; | 2952 | return -ENOMEM; |
2953 | strcpy(n->num, phone->phone); | 2953 | strcpy(n->num, phone->phone); |
2954 | n->next = p->local->phone[phone->outgoing & 1]; | 2954 | n->next = p->local->phone[phone->outgoing & 1]; |
diff --git a/drivers/isdn/i4l/isdn_ppp.c b/drivers/isdn/i4l/isdn_ppp.c index 43811795b46b..1726131b20be 100644 --- a/drivers/isdn/i4l/isdn_ppp.c +++ b/drivers/isdn/i4l/isdn_ppp.c | |||
@@ -717,7 +717,7 @@ isdn_ppp_fill_rq(unsigned char *buf, int len, int proto, int slot) | |||
717 | printk(KERN_DEBUG "ippp: device not activated.\n"); | 717 | printk(KERN_DEBUG "ippp: device not activated.\n"); |
718 | return 0; | 718 | return 0; |
719 | } | 719 | } |
720 | nbuf = (unsigned char *) kmalloc(len + 4, GFP_ATOMIC); | 720 | nbuf = kmalloc(len + 4, GFP_ATOMIC); |
721 | if (!nbuf) { | 721 | if (!nbuf) { |
722 | printk(KERN_WARNING "ippp: Can't alloc buf\n"); | 722 | printk(KERN_WARNING "ippp: Can't alloc buf\n"); |
723 | return 0; | 723 | return 0; |
diff --git a/drivers/isdn/pcbit/layer2.c b/drivers/isdn/pcbit/layer2.c index 6ff85574e941..eafcce5e656a 100644 --- a/drivers/isdn/pcbit/layer2.c +++ b/drivers/isdn/pcbit/layer2.c | |||
@@ -100,7 +100,7 @@ pcbit_l2_write(struct pcbit_dev *dev, ulong msg, ushort refnum, | |||
100 | dev_kfree_skb(skb); | 100 | dev_kfree_skb(skb); |
101 | return -1; | 101 | return -1; |
102 | } | 102 | } |
103 | if ((frame = (struct frame_buf *) kmalloc(sizeof(struct frame_buf), | 103 | if ((frame = kmalloc(sizeof(struct frame_buf), |
104 | GFP_ATOMIC)) == NULL) { | 104 | GFP_ATOMIC)) == NULL) { |
105 | printk(KERN_WARNING "pcbit_2_write: kmalloc failed\n"); | 105 | printk(KERN_WARNING "pcbit_2_write: kmalloc failed\n"); |
106 | dev_kfree_skb(skb); | 106 | dev_kfree_skb(skb); |
diff --git a/drivers/macintosh/adb.c b/drivers/macintosh/adb.c index d43ea81d6df9..7cec6de5e2b0 100644 --- a/drivers/macintosh/adb.c +++ b/drivers/macintosh/adb.c | |||
@@ -828,7 +828,7 @@ static ssize_t adb_write(struct file *file, const char __user *buf, | |||
828 | if (!access_ok(VERIFY_READ, buf, count)) | 828 | if (!access_ok(VERIFY_READ, buf, count)) |
829 | return -EFAULT; | 829 | return -EFAULT; |
830 | 830 | ||
831 | req = (struct adb_request *) kmalloc(sizeof(struct adb_request), | 831 | req = kmalloc(sizeof(struct adb_request), |
832 | GFP_KERNEL); | 832 | GFP_KERNEL); |
833 | if (req == NULL) | 833 | if (req == NULL) |
834 | return -ENOMEM; | 834 | return -ENOMEM; |
diff --git a/drivers/macintosh/apm_emu.c b/drivers/macintosh/apm_emu.c index 8862a83b8d84..4300c628f8af 100644 --- a/drivers/macintosh/apm_emu.c +++ b/drivers/macintosh/apm_emu.c | |||
@@ -321,7 +321,7 @@ static int do_open(struct inode * inode, struct file * filp) | |||
321 | { | 321 | { |
322 | struct apm_user * as; | 322 | struct apm_user * as; |
323 | 323 | ||
324 | as = (struct apm_user *)kmalloc(sizeof(*as), GFP_KERNEL); | 324 | as = kmalloc(sizeof(*as), GFP_KERNEL); |
325 | if (as == NULL) { | 325 | if (as == NULL) { |
326 | printk(KERN_ERR "apm: cannot allocate struct of size %d bytes\n", | 326 | printk(KERN_ERR "apm: cannot allocate struct of size %d bytes\n", |
327 | sizeof(*as)); | 327 | sizeof(*as)); |
diff --git a/drivers/macintosh/via-pmu68k.c b/drivers/macintosh/via-pmu68k.c index d9986f3a3fbf..93e6ef9233f9 100644 --- a/drivers/macintosh/via-pmu68k.c +++ b/drivers/macintosh/via-pmu68k.c | |||
@@ -847,7 +847,7 @@ pbook_pci_save(void) | |||
847 | n_pbook_pci_saves = npci; | 847 | n_pbook_pci_saves = npci; |
848 | if (npci == 0) | 848 | if (npci == 0) |
849 | return; | 849 | return; |
850 | ps = (struct pci_save *) kmalloc(npci * sizeof(*ps), GFP_KERNEL); | 850 | ps = kmalloc(npci * sizeof(*ps), GFP_KERNEL); |
851 | pbook_pci_saves = ps; | 851 | pbook_pci_saves = ps; |
852 | if (ps == NULL) | 852 | if (ps == NULL) |
853 | return; | 853 | return; |
diff --git a/drivers/media/dvb/bt8xx/dst_ca.c b/drivers/media/dvb/bt8xx/dst_ca.c index 240ad084fa78..50bc32a8bd55 100644 --- a/drivers/media/dvb/bt8xx/dst_ca.c +++ b/drivers/media/dvb/bt8xx/dst_ca.c | |||
@@ -480,7 +480,7 @@ static int ca_send_message(struct dst_state *state, struct ca_msg *p_ca_message, | |||
480 | struct ca_msg *hw_buffer; | 480 | struct ca_msg *hw_buffer; |
481 | int result = 0; | 481 | int result = 0; |
482 | 482 | ||
483 | if ((hw_buffer = (struct ca_msg *) kmalloc(sizeof (struct ca_msg), GFP_KERNEL)) == NULL) { | 483 | if ((hw_buffer = kmalloc(sizeof (struct ca_msg), GFP_KERNEL)) == NULL) { |
484 | dprintk(verbose, DST_CA_ERROR, 1, " Memory allocation failure"); | 484 | dprintk(verbose, DST_CA_ERROR, 1, " Memory allocation failure"); |
485 | return -ENOMEM; | 485 | return -ENOMEM; |
486 | } | 486 | } |
diff --git a/drivers/media/dvb/bt8xx/dvb-bt8xx.c b/drivers/media/dvb/bt8xx/dvb-bt8xx.c index 80a85cb4975f..3e35931af35d 100644 --- a/drivers/media/dvb/bt8xx/dvb-bt8xx.c +++ b/drivers/media/dvb/bt8xx/dvb-bt8xx.c | |||
@@ -657,7 +657,7 @@ static void frontend_init(struct dvb_bt8xx_card *card, u32 type) | |||
657 | 657 | ||
658 | case BTTV_BOARD_TWINHAN_DST: | 658 | case BTTV_BOARD_TWINHAN_DST: |
659 | /* DST is not a frontend driver !!! */ | 659 | /* DST is not a frontend driver !!! */ |
660 | state = (struct dst_state *) kmalloc(sizeof (struct dst_state), GFP_KERNEL); | 660 | state = kmalloc(sizeof (struct dst_state), GFP_KERNEL); |
661 | if (!state) { | 661 | if (!state) { |
662 | printk("dvb_bt8xx: No memory\n"); | 662 | printk("dvb_bt8xx: No memory\n"); |
663 | break; | 663 | break; |
diff --git a/drivers/media/dvb/ttusb-dec/ttusbdecfe.c b/drivers/media/dvb/ttusb-dec/ttusbdecfe.c index 42f39a89bc4d..a6fb1d6a7b5d 100644 --- a/drivers/media/dvb/ttusb-dec/ttusbdecfe.c +++ b/drivers/media/dvb/ttusb-dec/ttusbdecfe.c | |||
@@ -195,7 +195,7 @@ struct dvb_frontend* ttusbdecfe_dvbt_attach(const struct ttusbdecfe_config* conf | |||
195 | struct ttusbdecfe_state* state = NULL; | 195 | struct ttusbdecfe_state* state = NULL; |
196 | 196 | ||
197 | /* allocate memory for the internal state */ | 197 | /* allocate memory for the internal state */ |
198 | state = (struct ttusbdecfe_state*) kmalloc(sizeof(struct ttusbdecfe_state), GFP_KERNEL); | 198 | state = kmalloc(sizeof(struct ttusbdecfe_state), GFP_KERNEL); |
199 | if (state == NULL) | 199 | if (state == NULL) |
200 | return NULL; | 200 | return NULL; |
201 | 201 | ||
@@ -215,7 +215,7 @@ struct dvb_frontend* ttusbdecfe_dvbs_attach(const struct ttusbdecfe_config* conf | |||
215 | struct ttusbdecfe_state* state = NULL; | 215 | struct ttusbdecfe_state* state = NULL; |
216 | 216 | ||
217 | /* allocate memory for the internal state */ | 217 | /* allocate memory for the internal state */ |
218 | state = (struct ttusbdecfe_state*) kmalloc(sizeof(struct ttusbdecfe_state), GFP_KERNEL); | 218 | state = kmalloc(sizeof(struct ttusbdecfe_state), GFP_KERNEL); |
219 | if (state == NULL) | 219 | if (state == NULL) |
220 | return NULL; | 220 | return NULL; |
221 | 221 | ||
diff --git a/drivers/media/video/dabusb.c b/drivers/media/video/dabusb.c index b1012e92ee04..917021fc2993 100644 --- a/drivers/media/video/dabusb.c +++ b/drivers/media/video/dabusb.c | |||
@@ -218,7 +218,7 @@ static int dabusb_alloc_buffers (pdabusb_t s) | |||
218 | pipesize, packets, transfer_buffer_length); | 218 | pipesize, packets, transfer_buffer_length); |
219 | 219 | ||
220 | while (buffers < (s->total_buffer_size << 10)) { | 220 | while (buffers < (s->total_buffer_size << 10)) { |
221 | b = (pbuff_t) kzalloc (sizeof (buff_t), GFP_KERNEL); | 221 | b = kzalloc(sizeof (buff_t), GFP_KERNEL); |
222 | if (!b) { | 222 | if (!b) { |
223 | err("kzalloc(sizeof(buff_t))==NULL"); | 223 | err("kzalloc(sizeof(buff_t))==NULL"); |
224 | goto err; | 224 | goto err; |
@@ -659,7 +659,7 @@ static int dabusb_ioctl (struct inode *inode, struct file *file, unsigned int cm | |||
659 | switch (cmd) { | 659 | switch (cmd) { |
660 | 660 | ||
661 | case IOCTL_DAB_BULK: | 661 | case IOCTL_DAB_BULK: |
662 | pbulk = (pbulk_transfer_t) kmalloc (sizeof (bulk_transfer_t), GFP_KERNEL); | 662 | pbulk = kmalloc(sizeof (bulk_transfer_t), GFP_KERNEL); |
663 | 663 | ||
664 | if (!pbulk) { | 664 | if (!pbulk) { |
665 | ret = -ENOMEM; | 665 | ret = -ENOMEM; |
diff --git a/drivers/media/video/planb.c b/drivers/media/video/planb.c index 368d6e219fa4..86d2884e16c6 100644 --- a/drivers/media/video/planb.c +++ b/drivers/media/video/planb.c | |||
@@ -138,7 +138,7 @@ static int grabbuf_alloc(struct planb *pb) | |||
138 | + MAX_LNUM | 138 | + MAX_LNUM |
139 | #endif /* PLANB_GSCANLINE */ | 139 | #endif /* PLANB_GSCANLINE */ |
140 | ); | 140 | ); |
141 | if ((pb->rawbuf = (unsigned char**) kmalloc (npage | 141 | if ((pb->rawbuf = kmalloc(npage |
142 | * sizeof(unsigned long), GFP_KERNEL)) == 0) | 142 | * sizeof(unsigned long), GFP_KERNEL)) == 0) |
143 | return -ENOMEM; | 143 | return -ENOMEM; |
144 | for (i = 0; i < npage; i++) { | 144 | for (i = 0; i < npage; i++) { |
diff --git a/drivers/media/video/usbvideo/usbvideo.c b/drivers/media/video/usbvideo/usbvideo.c index d8b88024bc2f..b560c9d7c516 100644 --- a/drivers/media/video/usbvideo/usbvideo.c +++ b/drivers/media/video/usbvideo/usbvideo.c | |||
@@ -690,7 +690,7 @@ int usbvideo_register( | |||
690 | } | 690 | } |
691 | 691 | ||
692 | base_size = num_cams * sizeof(struct uvd) + sizeof(struct usbvideo); | 692 | base_size = num_cams * sizeof(struct uvd) + sizeof(struct usbvideo); |
693 | cams = (struct usbvideo *) kzalloc(base_size, GFP_KERNEL); | 693 | cams = kzalloc(base_size, GFP_KERNEL); |
694 | if (cams == NULL) { | 694 | if (cams == NULL) { |
695 | err("Failed to allocate %d. bytes for usbvideo struct", base_size); | 695 | err("Failed to allocate %d. bytes for usbvideo struct", base_size); |
696 | return -ENOMEM; | 696 | return -ENOMEM; |
diff --git a/drivers/media/video/videocodec.c b/drivers/media/video/videocodec.c index 2ae3fb250630..290e64135650 100644 --- a/drivers/media/video/videocodec.c +++ b/drivers/media/video/videocodec.c | |||
@@ -346,7 +346,7 @@ videocodec_build_table (void) | |||
346 | size); | 346 | size); |
347 | 347 | ||
348 | kfree(videocodec_buf); | 348 | kfree(videocodec_buf); |
349 | videocodec_buf = (char *) kmalloc(size, GFP_KERNEL); | 349 | videocodec_buf = kmalloc(size, GFP_KERNEL); |
350 | 350 | ||
351 | i = 0; | 351 | i = 0; |
352 | i += scnprintf(videocodec_buf + i, size - 1, | 352 | i += scnprintf(videocodec_buf + i, size - 1, |
diff --git a/drivers/message/i2o/i2o_config.c b/drivers/message/i2o/i2o_config.c index 1de30d711671..e33d446e7493 100644 --- a/drivers/message/i2o/i2o_config.c +++ b/drivers/message/i2o/i2o_config.c | |||
@@ -186,7 +186,7 @@ static int i2o_cfg_parms(unsigned long arg, unsigned int type) | |||
186 | if (!dev) | 186 | if (!dev) |
187 | return -ENXIO; | 187 | return -ENXIO; |
188 | 188 | ||
189 | ops = (u8 *) kmalloc(kcmd.oplen, GFP_KERNEL); | 189 | ops = kmalloc(kcmd.oplen, GFP_KERNEL); |
190 | if (!ops) | 190 | if (!ops) |
191 | return -ENOMEM; | 191 | return -ENOMEM; |
192 | 192 | ||
@@ -199,7 +199,7 @@ static int i2o_cfg_parms(unsigned long arg, unsigned int type) | |||
199 | * It's possible to have a _very_ large table | 199 | * It's possible to have a _very_ large table |
200 | * and that the user asks for all of it at once... | 200 | * and that the user asks for all of it at once... |
201 | */ | 201 | */ |
202 | res = (u8 *) kmalloc(65536, GFP_KERNEL); | 202 | res = kmalloc(65536, GFP_KERNEL); |
203 | if (!res) { | 203 | if (!res) { |
204 | kfree(ops); | 204 | kfree(ops); |
205 | return -ENOMEM; | 205 | return -ENOMEM; |
diff --git a/drivers/mtd/devices/mtd_dataflash.c b/drivers/mtd/devices/mtd_dataflash.c index 5db716045927..0a7e86859bf1 100644 --- a/drivers/mtd/devices/mtd_dataflash.c +++ b/drivers/mtd/devices/mtd_dataflash.c | |||
@@ -459,7 +459,7 @@ add_dataflash(struct spi_device *spi, char *name, | |||
459 | struct mtd_info *device; | 459 | struct mtd_info *device; |
460 | struct flash_platform_data *pdata = spi->dev.platform_data; | 460 | struct flash_platform_data *pdata = spi->dev.platform_data; |
461 | 461 | ||
462 | priv = (struct dataflash *) kzalloc(sizeof *priv, GFP_KERNEL); | 462 | priv = kzalloc(sizeof *priv, GFP_KERNEL); |
463 | if (!priv) | 463 | if (!priv) |
464 | return -ENOMEM; | 464 | return -ENOMEM; |
465 | 465 | ||
diff --git a/drivers/net/appletalk/ipddp.c b/drivers/net/appletalk/ipddp.c index b98592a8bac8..f22e46dfd770 100644 --- a/drivers/net/appletalk/ipddp.c +++ b/drivers/net/appletalk/ipddp.c | |||
@@ -186,7 +186,7 @@ static int ipddp_xmit(struct sk_buff *skb, struct net_device *dev) | |||
186 | */ | 186 | */ |
187 | static int ipddp_create(struct ipddp_route *new_rt) | 187 | static int ipddp_create(struct ipddp_route *new_rt) |
188 | { | 188 | { |
189 | struct ipddp_route *rt =(struct ipddp_route*) kmalloc(sizeof(*rt), GFP_KERNEL); | 189 | struct ipddp_route *rt = kmalloc(sizeof(*rt), GFP_KERNEL); |
190 | 190 | ||
191 | if (rt == NULL) | 191 | if (rt == NULL) |
192 | return -ENOMEM; | 192 | return -ENOMEM; |
diff --git a/drivers/net/bsd_comp.c b/drivers/net/bsd_comp.c index bae1de1e7802..7845eaf6f29f 100644 --- a/drivers/net/bsd_comp.c +++ b/drivers/net/bsd_comp.c | |||
@@ -395,7 +395,7 @@ static void *bsd_alloc (unsigned char *options, int opt_len, int decomp) | |||
395 | * Allocate the main control structure for this instance. | 395 | * Allocate the main control structure for this instance. |
396 | */ | 396 | */ |
397 | maxmaxcode = MAXCODE(bits); | 397 | maxmaxcode = MAXCODE(bits); |
398 | db = (struct bsd_db *) kmalloc (sizeof (struct bsd_db), | 398 | db = kmalloc(sizeof (struct bsd_db), |
399 | GFP_KERNEL); | 399 | GFP_KERNEL); |
400 | if (!db) | 400 | if (!db) |
401 | { | 401 | { |
diff --git a/drivers/net/irda/donauboe.c b/drivers/net/irda/donauboe.c index 16620bd97fbf..11af0ae7510e 100644 --- a/drivers/net/irda/donauboe.c +++ b/drivers/net/irda/donauboe.c | |||
@@ -1603,7 +1603,7 @@ toshoboe_open (struct pci_dev *pci_dev, const struct pci_device_id *pdid) | |||
1603 | irda_qos_bits_to_value (&self->qos); | 1603 | irda_qos_bits_to_value (&self->qos); |
1604 | 1604 | ||
1605 | /* Allocate twice the size to guarantee alignment */ | 1605 | /* Allocate twice the size to guarantee alignment */ |
1606 | self->ringbuf = (void *) kmalloc (OBOE_RING_LEN << 1, GFP_KERNEL); | 1606 | self->ringbuf = kmalloc(OBOE_RING_LEN << 1, GFP_KERNEL); |
1607 | if (!self->ringbuf) | 1607 | if (!self->ringbuf) |
1608 | { | 1608 | { |
1609 | printk (KERN_ERR DRIVER_NAME ": can't allocate DMA buffers\n"); | 1609 | printk (KERN_ERR DRIVER_NAME ": can't allocate DMA buffers\n"); |
diff --git a/drivers/net/irda/irda-usb.c b/drivers/net/irda/irda-usb.c index 6e95645e7245..3ca1082ec776 100644 --- a/drivers/net/irda/irda-usb.c +++ b/drivers/net/irda/irda-usb.c | |||
@@ -1747,7 +1747,7 @@ static int irda_usb_probe(struct usb_interface *intf, | |||
1747 | /* Don't change this buffer size and allocation without doing | 1747 | /* Don't change this buffer size and allocation without doing |
1748 | * some heavy and complete testing. Don't ask why :-( | 1748 | * some heavy and complete testing. Don't ask why :-( |
1749 | * Jean II */ | 1749 | * Jean II */ |
1750 | self->speed_buff = (char *) kmalloc(IRDA_USB_SPEED_MTU, GFP_KERNEL); | 1750 | self->speed_buff = kmalloc(IRDA_USB_SPEED_MTU, GFP_KERNEL); |
1751 | if (self->speed_buff == NULL) | 1751 | if (self->speed_buff == NULL) |
1752 | goto err_out_3; | 1752 | goto err_out_3; |
1753 | 1753 | ||
diff --git a/drivers/net/irda/irport.c b/drivers/net/irda/irport.c index 654a68b490ae..3098960dc2a1 100644 --- a/drivers/net/irda/irport.c +++ b/drivers/net/irda/irport.c | |||
@@ -164,7 +164,7 @@ irport_open(int i, unsigned int iobase, unsigned int irq) | |||
164 | 164 | ||
165 | /* Allocate memory if needed */ | 165 | /* Allocate memory if needed */ |
166 | if (self->tx_buff.truesize > 0) { | 166 | if (self->tx_buff.truesize > 0) { |
167 | self->tx_buff.head = (__u8 *) kmalloc(self->tx_buff.truesize, | 167 | self->tx_buff.head = kmalloc(self->tx_buff.truesize, |
168 | GFP_KERNEL); | 168 | GFP_KERNEL); |
169 | if (self->tx_buff.head == NULL) { | 169 | if (self->tx_buff.head == NULL) { |
170 | IRDA_ERROR("%s(), can't allocate memory for " | 170 | IRDA_ERROR("%s(), can't allocate memory for " |
diff --git a/drivers/net/lp486e.c b/drivers/net/lp486e.c index b833016f1825..177c502f7385 100644 --- a/drivers/net/lp486e.c +++ b/drivers/net/lp486e.c | |||
@@ -884,7 +884,7 @@ static int i596_start_xmit (struct sk_buff *skb, struct net_device *dev) { | |||
884 | 884 | ||
885 | dev->trans_start = jiffies; | 885 | dev->trans_start = jiffies; |
886 | 886 | ||
887 | tx_cmd = (struct tx_cmd *) kmalloc ((sizeof (struct tx_cmd) + sizeof (struct i596_tbd)), GFP_ATOMIC); | 887 | tx_cmd = kmalloc((sizeof (struct tx_cmd) + sizeof (struct i596_tbd)), GFP_ATOMIC); |
888 | if (tx_cmd == NULL) { | 888 | if (tx_cmd == NULL) { |
889 | printk(KERN_WARNING "%s: i596_xmit Memory squeeze, dropping packet.\n", dev->name); | 889 | printk(KERN_WARNING "%s: i596_xmit Memory squeeze, dropping packet.\n", dev->name); |
890 | lp->stats.tx_dropped++; | 890 | lp->stats.tx_dropped++; |
@@ -1266,7 +1266,7 @@ static void set_multicast_list(struct net_device *dev) { | |||
1266 | if (dev->mc_count > 0) { | 1266 | if (dev->mc_count > 0) { |
1267 | struct dev_mc_list *dmi; | 1267 | struct dev_mc_list *dmi; |
1268 | char *cp; | 1268 | char *cp; |
1269 | cmd = (struct i596_cmd *)kmalloc(sizeof(struct i596_cmd)+2+dev->mc_count*6, GFP_ATOMIC); | 1269 | cmd = kmalloc(sizeof(struct i596_cmd)+2+dev->mc_count*6, GFP_ATOMIC); |
1270 | if (cmd == NULL) { | 1270 | if (cmd == NULL) { |
1271 | printk (KERN_ERR "%s: set_multicast Memory squeeze.\n", dev->name); | 1271 | printk (KERN_ERR "%s: set_multicast Memory squeeze.\n", dev->name); |
1272 | return; | 1272 | return; |
diff --git a/drivers/net/ppp_deflate.c b/drivers/net/ppp_deflate.c index f54c55242f4a..72c8d6628f58 100644 --- a/drivers/net/ppp_deflate.c +++ b/drivers/net/ppp_deflate.c | |||
@@ -121,7 +121,7 @@ static void *z_comp_alloc(unsigned char *options, int opt_len) | |||
121 | if (w_size < DEFLATE_MIN_SIZE || w_size > DEFLATE_MAX_SIZE) | 121 | if (w_size < DEFLATE_MIN_SIZE || w_size > DEFLATE_MAX_SIZE) |
122 | return NULL; | 122 | return NULL; |
123 | 123 | ||
124 | state = (struct ppp_deflate_state *) kmalloc(sizeof(*state), | 124 | state = kmalloc(sizeof(*state), |
125 | GFP_KERNEL); | 125 | GFP_KERNEL); |
126 | if (state == NULL) | 126 | if (state == NULL) |
127 | return NULL; | 127 | return NULL; |
@@ -341,7 +341,7 @@ static void *z_decomp_alloc(unsigned char *options, int opt_len) | |||
341 | if (w_size < DEFLATE_MIN_SIZE || w_size > DEFLATE_MAX_SIZE) | 341 | if (w_size < DEFLATE_MIN_SIZE || w_size > DEFLATE_MAX_SIZE) |
342 | return NULL; | 342 | return NULL; |
343 | 343 | ||
344 | state = (struct ppp_deflate_state *) kmalloc(sizeof(*state), GFP_KERNEL); | 344 | state = kmalloc(sizeof(*state), GFP_KERNEL); |
345 | if (state == NULL) | 345 | if (state == NULL) |
346 | return NULL; | 346 | return NULL; |
347 | 347 | ||
diff --git a/drivers/net/ppp_mppe.c b/drivers/net/ppp_mppe.c index f3655fd772f5..d5bdd2574659 100644 --- a/drivers/net/ppp_mppe.c +++ b/drivers/net/ppp_mppe.c | |||
@@ -200,7 +200,7 @@ static void *mppe_alloc(unsigned char *options, int optlen) | |||
200 | || options[0] != CI_MPPE || options[1] != CILEN_MPPE) | 200 | || options[0] != CI_MPPE || options[1] != CILEN_MPPE) |
201 | goto out; | 201 | goto out; |
202 | 202 | ||
203 | state = (struct ppp_mppe_state *) kmalloc(sizeof(*state), GFP_KERNEL); | 203 | state = kmalloc(sizeof(*state), GFP_KERNEL); |
204 | if (state == NULL) | 204 | if (state == NULL) |
205 | goto out; | 205 | goto out; |
206 | 206 | ||
diff --git a/drivers/net/slip.c b/drivers/net/slip.c index 39c2152a07f4..a0806d262fc6 100644 --- a/drivers/net/slip.c +++ b/drivers/net/slip.c | |||
@@ -229,10 +229,10 @@ static int sl_realloc_bufs(struct slip *sl, int mtu) | |||
229 | if (len < 576 * 2) | 229 | if (len < 576 * 2) |
230 | len = 576 * 2; | 230 | len = 576 * 2; |
231 | 231 | ||
232 | xbuff = (unsigned char *) kmalloc (len + 4, GFP_ATOMIC); | 232 | xbuff = kmalloc(len + 4, GFP_ATOMIC); |
233 | rbuff = (unsigned char *) kmalloc (len + 4, GFP_ATOMIC); | 233 | rbuff = kmalloc(len + 4, GFP_ATOMIC); |
234 | #ifdef SL_INCLUDE_CSLIP | 234 | #ifdef SL_INCLUDE_CSLIP |
235 | cbuff = (unsigned char *) kmalloc (len + 4, GFP_ATOMIC); | 235 | cbuff = kmalloc(len + 4, GFP_ATOMIC); |
236 | #endif | 236 | #endif |
237 | 237 | ||
238 | 238 | ||
diff --git a/drivers/net/wan/hostess_sv11.c b/drivers/net/wan/hostess_sv11.c index a4f735723c41..a02c5fb40567 100644 --- a/drivers/net/wan/hostess_sv11.c +++ b/drivers/net/wan/hostess_sv11.c | |||
@@ -231,7 +231,7 @@ static struct sv11_device *sv11_init(int iobase, int irq) | |||
231 | return NULL; | 231 | return NULL; |
232 | } | 232 | } |
233 | 233 | ||
234 | sv=(struct sv11_device *)kmalloc(sizeof(struct sv11_device), GFP_KERNEL); | 234 | sv = kmalloc(sizeof(struct sv11_device), GFP_KERNEL); |
235 | if(!sv) | 235 | if(!sv) |
236 | goto fail3; | 236 | goto fail3; |
237 | 237 | ||
diff --git a/drivers/net/wan/pc300_drv.c b/drivers/net/wan/pc300_drv.c index 36d1c3ff7078..62184dee377c 100644 --- a/drivers/net/wan/pc300_drv.c +++ b/drivers/net/wan/pc300_drv.c | |||
@@ -3455,7 +3455,7 @@ cpc_init_one(struct pci_dev *pdev, const struct pci_device_id *ent) | |||
3455 | if ((err = pci_enable_device(pdev)) < 0) | 3455 | if ((err = pci_enable_device(pdev)) < 0) |
3456 | return err; | 3456 | return err; |
3457 | 3457 | ||
3458 | card = (pc300_t *) kmalloc(sizeof(pc300_t), GFP_KERNEL); | 3458 | card = kmalloc(sizeof(pc300_t), GFP_KERNEL); |
3459 | if (card == NULL) { | 3459 | if (card == NULL) { |
3460 | printk("PC300 found at RAM 0x%016llx, " | 3460 | printk("PC300 found at RAM 0x%016llx, " |
3461 | "but could not allocate card structure.\n", | 3461 | "but could not allocate card structure.\n", |
diff --git a/drivers/net/wan/pc300_tty.c b/drivers/net/wan/pc300_tty.c index b2a23aed4428..5873c346e7e9 100644 --- a/drivers/net/wan/pc300_tty.c +++ b/drivers/net/wan/pc300_tty.c | |||
@@ -784,7 +784,7 @@ void cpc_tty_receive(pc300dev_t *pc300dev) | |||
784 | continue; | 784 | continue; |
785 | } | 785 | } |
786 | 786 | ||
787 | new = (st_cpc_rx_buf *)kmalloc(rx_len + sizeof(st_cpc_rx_buf), GFP_ATOMIC); | 787 | new = kmalloc(rx_len + sizeof(st_cpc_rx_buf), GFP_ATOMIC); |
788 | if (new == 0) { | 788 | if (new == 0) { |
789 | cpc_tty_rx_disc_frame(pc300chan); | 789 | cpc_tty_rx_disc_frame(pc300chan); |
790 | continue; | 790 | continue; |
diff --git a/drivers/net/wan/x25_asy.c b/drivers/net/wan/x25_asy.c index 9c3ccc669143..1c9edd97accd 100644 --- a/drivers/net/wan/x25_asy.c +++ b/drivers/net/wan/x25_asy.c | |||
@@ -123,8 +123,8 @@ static int x25_asy_change_mtu(struct net_device *dev, int newmtu) | |||
123 | unsigned char *xbuff, *rbuff; | 123 | unsigned char *xbuff, *rbuff; |
124 | int len = 2* newmtu; | 124 | int len = 2* newmtu; |
125 | 125 | ||
126 | xbuff = (unsigned char *) kmalloc (len + 4, GFP_ATOMIC); | 126 | xbuff = kmalloc(len + 4, GFP_ATOMIC); |
127 | rbuff = (unsigned char *) kmalloc (len + 4, GFP_ATOMIC); | 127 | rbuff = kmalloc(len + 4, GFP_ATOMIC); |
128 | 128 | ||
129 | if (xbuff == NULL || rbuff == NULL) | 129 | if (xbuff == NULL || rbuff == NULL) |
130 | { | 130 | { |
@@ -465,11 +465,11 @@ static int x25_asy_open(struct net_device *dev) | |||
465 | 465 | ||
466 | len = dev->mtu * 2; | 466 | len = dev->mtu * 2; |
467 | 467 | ||
468 | sl->rbuff = (unsigned char *) kmalloc(len + 4, GFP_KERNEL); | 468 | sl->rbuff = kmalloc(len + 4, GFP_KERNEL); |
469 | if (sl->rbuff == NULL) { | 469 | if (sl->rbuff == NULL) { |
470 | goto norbuff; | 470 | goto norbuff; |
471 | } | 471 | } |
472 | sl->xbuff = (unsigned char *) kmalloc(len + 4, GFP_KERNEL); | 472 | sl->xbuff = kmalloc(len + 4, GFP_KERNEL); |
473 | if (sl->xbuff == NULL) { | 473 | if (sl->xbuff == NULL) { |
474 | goto noxbuff; | 474 | goto noxbuff; |
475 | } | 475 | } |
diff --git a/drivers/net/wireless/hostap/hostap_ap.c b/drivers/net/wireless/hostap/hostap_ap.c index 974a8e5bec8b..efb8cf3bd8ad 100644 --- a/drivers/net/wireless/hostap/hostap_ap.c +++ b/drivers/net/wireless/hostap/hostap_ap.c | |||
@@ -1253,7 +1253,7 @@ static char * ap_auth_make_challenge(struct ap_data *ap) | |||
1253 | return NULL; | 1253 | return NULL; |
1254 | } | 1254 | } |
1255 | 1255 | ||
1256 | tmpbuf = (char *) kmalloc(WLAN_AUTH_CHALLENGE_LEN, GFP_ATOMIC); | 1256 | tmpbuf = kmalloc(WLAN_AUTH_CHALLENGE_LEN, GFP_ATOMIC); |
1257 | if (tmpbuf == NULL) { | 1257 | if (tmpbuf == NULL) { |
1258 | PDEBUG(DEBUG_AP, "AP: kmalloc failed for challenge\n"); | 1258 | PDEBUG(DEBUG_AP, "AP: kmalloc failed for challenge\n"); |
1259 | return NULL; | 1259 | return NULL; |
diff --git a/drivers/net/wireless/hostap/hostap_download.c b/drivers/net/wireless/hostap/hostap_download.c index 24fc387bba67..c7678e67697d 100644 --- a/drivers/net/wireless/hostap/hostap_download.c +++ b/drivers/net/wireless/hostap/hostap_download.c | |||
@@ -201,7 +201,7 @@ static u8 * prism2_read_pda(struct net_device *dev) | |||
201 | 0x7f0002 /* Intel PRO/Wireless 2011B (PCI) */, | 201 | 0x7f0002 /* Intel PRO/Wireless 2011B (PCI) */, |
202 | }; | 202 | }; |
203 | 203 | ||
204 | buf = (u8 *) kmalloc(PRISM2_PDA_SIZE, GFP_KERNEL); | 204 | buf = kmalloc(PRISM2_PDA_SIZE, GFP_KERNEL); |
205 | if (buf == NULL) | 205 | if (buf == NULL) |
206 | return NULL; | 206 | return NULL; |
207 | 207 | ||
diff --git a/drivers/net/wireless/hostap/hostap_hw.c b/drivers/net/wireless/hostap/hostap_hw.c index a394a23b9a20..3079378fb8cd 100644 --- a/drivers/net/wireless/hostap/hostap_hw.c +++ b/drivers/net/wireless/hostap/hostap_hw.c | |||
@@ -2252,7 +2252,7 @@ static int hostap_tx_compl_read(local_info_t *local, int error, | |||
2252 | if (txdesc->sw_support) { | 2252 | if (txdesc->sw_support) { |
2253 | len = le16_to_cpu(txdesc->data_len); | 2253 | len = le16_to_cpu(txdesc->data_len); |
2254 | if (len < PRISM2_DATA_MAXLEN) { | 2254 | if (len < PRISM2_DATA_MAXLEN) { |
2255 | *payload = (char *) kmalloc(len, GFP_ATOMIC); | 2255 | *payload = kmalloc(len, GFP_ATOMIC); |
2256 | if (*payload == NULL || | 2256 | if (*payload == NULL || |
2257 | hfa384x_from_bap(dev, BAP0, *payload, len)) { | 2257 | hfa384x_from_bap(dev, BAP0, *payload, len)) { |
2258 | PDEBUG(DEBUG_EXTRA, "%s: could not read TX " | 2258 | PDEBUG(DEBUG_EXTRA, "%s: could not read TX " |
diff --git a/drivers/net/wireless/hostap/hostap_ioctl.c b/drivers/net/wireless/hostap/hostap_ioctl.c index 3b7b8063ff1c..cb08bc5db2bd 100644 --- a/drivers/net/wireless/hostap/hostap_ioctl.c +++ b/drivers/net/wireless/hostap/hostap_ioctl.c | |||
@@ -3829,7 +3829,7 @@ static int prism2_ioctl_priv_hostapd(local_info_t *local, struct iw_point *p) | |||
3829 | p->length > PRISM2_HOSTAPD_MAX_BUF_SIZE || !p->pointer) | 3829 | p->length > PRISM2_HOSTAPD_MAX_BUF_SIZE || !p->pointer) |
3830 | return -EINVAL; | 3830 | return -EINVAL; |
3831 | 3831 | ||
3832 | param = (struct prism2_hostapd_param *) kmalloc(p->length, GFP_KERNEL); | 3832 | param = kmalloc(p->length, GFP_KERNEL); |
3833 | if (param == NULL) | 3833 | if (param == NULL) |
3834 | return -ENOMEM; | 3834 | return -ENOMEM; |
3835 | 3835 | ||
diff --git a/drivers/net/wireless/hostap/hostap_main.c b/drivers/net/wireless/hostap/hostap_main.c index 0796be9d9e77..04c19cefa1da 100644 --- a/drivers/net/wireless/hostap/hostap_main.c +++ b/drivers/net/wireless/hostap/hostap_main.c | |||
@@ -250,7 +250,7 @@ u16 hostap_tx_callback_register(local_info_t *local, | |||
250 | unsigned long flags; | 250 | unsigned long flags; |
251 | struct hostap_tx_callback_info *entry; | 251 | struct hostap_tx_callback_info *entry; |
252 | 252 | ||
253 | entry = (struct hostap_tx_callback_info *) kmalloc(sizeof(*entry), | 253 | entry = kmalloc(sizeof(*entry), |
254 | GFP_ATOMIC); | 254 | GFP_ATOMIC); |
255 | if (entry == NULL) | 255 | if (entry == NULL) |
256 | return 0; | 256 | return 0; |
diff --git a/drivers/net/wireless/ipw2100.c b/drivers/net/wireless/ipw2100.c index dd9ba4aad7bb..0e94fbbf7a94 100644 --- a/drivers/net/wireless/ipw2100.c +++ b/drivers/net/wireless/ipw2100.c | |||
@@ -2246,7 +2246,7 @@ static int ipw2100_snapshot_alloc(struct ipw2100_priv *priv) | |||
2246 | if (priv->snapshot[0]) | 2246 | if (priv->snapshot[0]) |
2247 | return 1; | 2247 | return 1; |
2248 | for (i = 0; i < 0x30; i++) { | 2248 | for (i = 0; i < 0x30; i++) { |
2249 | priv->snapshot[i] = (u8 *) kmalloc(0x1000, GFP_ATOMIC); | 2249 | priv->snapshot[i] = kmalloc(0x1000, GFP_ATOMIC); |
2250 | if (!priv->snapshot[i]) { | 2250 | if (!priv->snapshot[i]) { |
2251 | IPW_DEBUG_INFO("%s: Error allocating snapshot " | 2251 | IPW_DEBUG_INFO("%s: Error allocating snapshot " |
2252 | "buffer %d\n", priv->net_dev->name, i); | 2252 | "buffer %d\n", priv->net_dev->name, i); |
diff --git a/drivers/net/wireless/prism54/isl_ioctl.c b/drivers/net/wireless/prism54/isl_ioctl.c index 96606ed10076..838d510213c6 100644 --- a/drivers/net/wireless/prism54/isl_ioctl.c +++ b/drivers/net/wireless/prism54/isl_ioctl.c | |||
@@ -2775,7 +2775,7 @@ prism54_hostapd(struct net_device *ndev, struct iw_point *p) | |||
2775 | p->length > PRISM2_HOSTAPD_MAX_BUF_SIZE || !p->pointer) | 2775 | p->length > PRISM2_HOSTAPD_MAX_BUF_SIZE || !p->pointer) |
2776 | return -EINVAL; | 2776 | return -EINVAL; |
2777 | 2777 | ||
2778 | param = (struct prism2_hostapd_param *) kmalloc(p->length, GFP_KERNEL); | 2778 | param = kmalloc(p->length, GFP_KERNEL); |
2779 | if (param == NULL) | 2779 | if (param == NULL) |
2780 | return -ENOMEM; | 2780 | return -ENOMEM; |
2781 | 2781 | ||
diff --git a/drivers/net/wireless/wavelan_cs.c b/drivers/net/wireless/wavelan_cs.c index 233d906c08f0..5eb81638e846 100644 --- a/drivers/net/wireless/wavelan_cs.c +++ b/drivers/net/wireless/wavelan_cs.c | |||
@@ -603,7 +603,7 @@ static wavepoint_history *wl_new_wavepoint(unsigned short nwid, unsigned char se | |||
603 | if(lp->wavepoint_table.num_wavepoints==MAX_WAVEPOINTS) | 603 | if(lp->wavepoint_table.num_wavepoints==MAX_WAVEPOINTS) |
604 | return NULL; | 604 | return NULL; |
605 | 605 | ||
606 | new_wavepoint=(wavepoint_history *) kmalloc(sizeof(wavepoint_history),GFP_ATOMIC); | 606 | new_wavepoint = kmalloc(sizeof(wavepoint_history),GFP_ATOMIC); |
607 | if(new_wavepoint==NULL) | 607 | if(new_wavepoint==NULL) |
608 | return NULL; | 608 | return NULL; |
609 | 609 | ||
diff --git a/drivers/net/wireless/zd1211rw/zd_chip.c b/drivers/net/wireless/zd1211rw/zd_chip.c index 77e11ddad836..78ea72fb8f0c 100644 --- a/drivers/net/wireless/zd1211rw/zd_chip.c +++ b/drivers/net/wireless/zd1211rw/zd_chip.c | |||
@@ -101,7 +101,7 @@ int zd_ioread32v_locked(struct zd_chip *chip, u32 *values, const zd_addr_t *addr | |||
101 | 101 | ||
102 | /* Allocate a single memory block for values and addresses. */ | 102 | /* Allocate a single memory block for values and addresses. */ |
103 | count16 = 2*count; | 103 | count16 = 2*count; |
104 | a16 = (zd_addr_t *)kmalloc(count16 * (sizeof(zd_addr_t) + sizeof(u16)), | 104 | a16 = kmalloc(count16 * (sizeof(zd_addr_t) + sizeof(u16)), |
105 | GFP_NOFS); | 105 | GFP_NOFS); |
106 | if (!a16) { | 106 | if (!a16) { |
107 | dev_dbg_f(zd_chip_dev(chip), | 107 | dev_dbg_f(zd_chip_dev(chip), |
diff --git a/drivers/parisc/iosapic.c b/drivers/parisc/iosapic.c index 12bab64a62a1..6fb3f7979f21 100644 --- a/drivers/parisc/iosapic.c +++ b/drivers/parisc/iosapic.c | |||
@@ -874,7 +874,7 @@ void *iosapic_register(unsigned long hpa) | |||
874 | return NULL; | 874 | return NULL; |
875 | } | 875 | } |
876 | 876 | ||
877 | isi = (struct iosapic_info *)kzalloc(sizeof(struct iosapic_info), GFP_KERNEL); | 877 | isi = kzalloc(sizeof(struct iosapic_info), GFP_KERNEL); |
878 | if (!isi) { | 878 | if (!isi) { |
879 | BUG(); | 879 | BUG(); |
880 | return NULL; | 880 | return NULL; |
diff --git a/drivers/pci/hotplug/cpqphp_nvram.c b/drivers/pci/hotplug/cpqphp_nvram.c index 298a6cfd8406..ae5e974c45a7 100644 --- a/drivers/pci/hotplug/cpqphp_nvram.c +++ b/drivers/pci/hotplug/cpqphp_nvram.c | |||
@@ -520,7 +520,7 @@ int compaq_nvram_load (void __iomem *rom_start, struct controller *ctrl) | |||
520 | return 2; | 520 | return 2; |
521 | 521 | ||
522 | while (nummem--) { | 522 | while (nummem--) { |
523 | mem_node = (struct pci_resource*) kmalloc(sizeof(struct pci_resource), GFP_KERNEL); | 523 | mem_node = kmalloc(sizeof(struct pci_resource), GFP_KERNEL); |
524 | 524 | ||
525 | if (!mem_node) | 525 | if (!mem_node) |
526 | break; | 526 | break; |
@@ -548,7 +548,7 @@ int compaq_nvram_load (void __iomem *rom_start, struct controller *ctrl) | |||
548 | } | 548 | } |
549 | 549 | ||
550 | while (numpmem--) { | 550 | while (numpmem--) { |
551 | p_mem_node = (struct pci_resource*) kmalloc(sizeof(struct pci_resource), GFP_KERNEL); | 551 | p_mem_node = kmalloc(sizeof(struct pci_resource), GFP_KERNEL); |
552 | 552 | ||
553 | if (!p_mem_node) | 553 | if (!p_mem_node) |
554 | break; | 554 | break; |
@@ -576,7 +576,7 @@ int compaq_nvram_load (void __iomem *rom_start, struct controller *ctrl) | |||
576 | } | 576 | } |
577 | 577 | ||
578 | while (numio--) { | 578 | while (numio--) { |
579 | io_node = (struct pci_resource*) kmalloc(sizeof(struct pci_resource), GFP_KERNEL); | 579 | io_node = kmalloc(sizeof(struct pci_resource), GFP_KERNEL); |
580 | 580 | ||
581 | if (!io_node) | 581 | if (!io_node) |
582 | break; | 582 | break; |
@@ -604,7 +604,7 @@ int compaq_nvram_load (void __iomem *rom_start, struct controller *ctrl) | |||
604 | } | 604 | } |
605 | 605 | ||
606 | while (numbus--) { | 606 | while (numbus--) { |
607 | bus_node = (struct pci_resource*) kmalloc(sizeof(struct pci_resource), GFP_KERNEL); | 607 | bus_node = kmalloc(sizeof(struct pci_resource), GFP_KERNEL); |
608 | 608 | ||
609 | if (!bus_node) | 609 | if (!bus_node) |
610 | break; | 610 | break; |
diff --git a/drivers/pci/hotplug/pciehp_hpc.c b/drivers/pci/hotplug/pciehp_hpc.c index 6d3f580f2666..25d3aadfddbf 100644 --- a/drivers/pci/hotplug/pciehp_hpc.c +++ b/drivers/pci/hotplug/pciehp_hpc.c | |||
@@ -1320,7 +1320,7 @@ int pcie_init(struct controller * ctrl, struct pcie_device *dev) | |||
1320 | DBG_ENTER_ROUTINE | 1320 | DBG_ENTER_ROUTINE |
1321 | 1321 | ||
1322 | spin_lock_init(&list_lock); | 1322 | spin_lock_init(&list_lock); |
1323 | php_ctlr = (struct php_ctlr_state_s *) kmalloc(sizeof(struct php_ctlr_state_s), GFP_KERNEL); | 1323 | php_ctlr = kmalloc(sizeof(struct php_ctlr_state_s), GFP_KERNEL); |
1324 | 1324 | ||
1325 | if (!php_ctlr) { /* allocate controller state data */ | 1325 | if (!php_ctlr) { /* allocate controller state data */ |
1326 | err("%s: HPC controller memory allocation error!\n", __FUNCTION__); | 1326 | err("%s: HPC controller memory allocation error!\n", __FUNCTION__); |
diff --git a/drivers/pci/pcie/aer/aerdrv.c b/drivers/pci/pcie/aer/aerdrv.c index 55866b6b26fa..6f5fabbd14e5 100644 --- a/drivers/pci/pcie/aer/aerdrv.c +++ b/drivers/pci/pcie/aer/aerdrv.c | |||
@@ -148,7 +148,7 @@ static struct aer_rpc* aer_alloc_rpc(struct pcie_device *dev) | |||
148 | { | 148 | { |
149 | struct aer_rpc *rpc; | 149 | struct aer_rpc *rpc; |
150 | 150 | ||
151 | if (!(rpc = (struct aer_rpc *)kmalloc(sizeof(struct aer_rpc), | 151 | if (!(rpc = kmalloc(sizeof(struct aer_rpc), |
152 | GFP_KERNEL))) | 152 | GFP_KERNEL))) |
153 | return NULL; | 153 | return NULL; |
154 | 154 | ||
diff --git a/drivers/pnp/pnpbios/core.c b/drivers/pnp/pnpbios/core.c index b7fdb4d21a96..95738dbd5d45 100644 --- a/drivers/pnp/pnpbios/core.c +++ b/drivers/pnp/pnpbios/core.c | |||
@@ -109,7 +109,7 @@ static int pnp_dock_event(int dock, struct pnp_docking_station_info *info) | |||
109 | if (!current->fs->root) { | 109 | if (!current->fs->root) { |
110 | return -EAGAIN; | 110 | return -EAGAIN; |
111 | } | 111 | } |
112 | if (!(envp = (char **) kcalloc (20, sizeof (char *), GFP_KERNEL))) { | 112 | if (!(envp = kcalloc(20, sizeof (char *), GFP_KERNEL))) { |
113 | return -ENOMEM; | 113 | return -ENOMEM; |
114 | } | 114 | } |
115 | if (!(buf = kzalloc(256, GFP_KERNEL))) { | 115 | if (!(buf = kzalloc(256, GFP_KERNEL))) { |
diff --git a/drivers/s390/char/con3215.c b/drivers/s390/char/con3215.c index c9321b920e90..25b5d7a66417 100644 --- a/drivers/s390/char/con3215.c +++ b/drivers/s390/char/con3215.c | |||
@@ -688,7 +688,7 @@ raw3215_probe (struct ccw_device *cdev) | |||
688 | raw->cdev = cdev; | 688 | raw->cdev = cdev; |
689 | raw->inbuf = (char *) raw + sizeof(struct raw3215_info); | 689 | raw->inbuf = (char *) raw + sizeof(struct raw3215_info); |
690 | memset(raw, 0, sizeof(struct raw3215_info)); | 690 | memset(raw, 0, sizeof(struct raw3215_info)); |
691 | raw->buffer = (char *) kmalloc(RAW3215_BUFFER_SIZE, | 691 | raw->buffer = kmalloc(RAW3215_BUFFER_SIZE, |
692 | GFP_KERNEL|GFP_DMA); | 692 | GFP_KERNEL|GFP_DMA); |
693 | if (raw->buffer == NULL) { | 693 | if (raw->buffer == NULL) { |
694 | spin_lock(&raw3215_device_lock); | 694 | spin_lock(&raw3215_device_lock); |
diff --git a/drivers/s390/char/keyboard.c b/drivers/s390/char/keyboard.c index e3491a5f5219..3e86fd1756e5 100644 --- a/drivers/s390/char/keyboard.c +++ b/drivers/s390/char/keyboard.c | |||
@@ -377,7 +377,7 @@ do_kdsk_ioctl(struct kbd_data *kbd, struct kbentry __user *user_kbe, | |||
377 | if (!(key_map = kbd->key_maps[tmp.kb_table])) { | 377 | if (!(key_map = kbd->key_maps[tmp.kb_table])) { |
378 | int j; | 378 | int j; |
379 | 379 | ||
380 | key_map = (ushort *) kmalloc(sizeof(plain_map), | 380 | key_map = kmalloc(sizeof(plain_map), |
381 | GFP_KERNEL); | 381 | GFP_KERNEL); |
382 | if (!key_map) | 382 | if (!key_map) |
383 | return -ENOMEM; | 383 | return -ENOMEM; |
diff --git a/drivers/s390/char/sclp_cpi.c b/drivers/s390/char/sclp_cpi.c index 732dfbdb85c4..f7c10d954ec6 100644 --- a/drivers/s390/char/sclp_cpi.c +++ b/drivers/s390/char/sclp_cpi.c | |||
@@ -127,7 +127,7 @@ cpi_prepare_req(void) | |||
127 | struct cpi_sccb *sccb; | 127 | struct cpi_sccb *sccb; |
128 | struct cpi_evbuf *evb; | 128 | struct cpi_evbuf *evb; |
129 | 129 | ||
130 | req = (struct sclp_req *) kmalloc(sizeof(struct sclp_req), GFP_KERNEL); | 130 | req = kmalloc(sizeof(struct sclp_req), GFP_KERNEL); |
131 | if (req == NULL) | 131 | if (req == NULL) |
132 | return ERR_PTR(-ENOMEM); | 132 | return ERR_PTR(-ENOMEM); |
133 | sccb = (struct cpi_sccb *) __get_free_page(GFP_KERNEL | GFP_DMA); | 133 | sccb = (struct cpi_sccb *) __get_free_page(GFP_KERNEL | GFP_DMA); |
diff --git a/drivers/s390/crypto/zcrypt_cex2a.c b/drivers/s390/crypto/zcrypt_cex2a.c index a62b00083d0c..5bb13a9d0898 100644 --- a/drivers/s390/crypto/zcrypt_cex2a.c +++ b/drivers/s390/crypto/zcrypt_cex2a.c | |||
@@ -295,7 +295,7 @@ static long zcrypt_cex2a_modexpo(struct zcrypt_device *zdev, | |||
295 | struct completion work; | 295 | struct completion work; |
296 | int rc; | 296 | int rc; |
297 | 297 | ||
298 | ap_msg.message = (void *) kmalloc(CEX2A_MAX_MESSAGE_SIZE, GFP_KERNEL); | 298 | ap_msg.message = kmalloc(CEX2A_MAX_MESSAGE_SIZE, GFP_KERNEL); |
299 | if (!ap_msg.message) | 299 | if (!ap_msg.message) |
300 | return -ENOMEM; | 300 | return -ENOMEM; |
301 | ap_msg.psmid = (((unsigned long long) current->pid) << 32) + | 301 | ap_msg.psmid = (((unsigned long long) current->pid) << 32) + |
@@ -337,7 +337,7 @@ static long zcrypt_cex2a_modexpo_crt(struct zcrypt_device *zdev, | |||
337 | struct completion work; | 337 | struct completion work; |
338 | int rc; | 338 | int rc; |
339 | 339 | ||
340 | ap_msg.message = (void *) kmalloc(CEX2A_MAX_MESSAGE_SIZE, GFP_KERNEL); | 340 | ap_msg.message = kmalloc(CEX2A_MAX_MESSAGE_SIZE, GFP_KERNEL); |
341 | if (!ap_msg.message) | 341 | if (!ap_msg.message) |
342 | return -ENOMEM; | 342 | return -ENOMEM; |
343 | ap_msg.psmid = (((unsigned long long) current->pid) << 32) + | 343 | ap_msg.psmid = (((unsigned long long) current->pid) << 32) + |
diff --git a/drivers/s390/crypto/zcrypt_pcica.c b/drivers/s390/crypto/zcrypt_pcica.c index b6a4ecdc8025..32e37014345c 100644 --- a/drivers/s390/crypto/zcrypt_pcica.c +++ b/drivers/s390/crypto/zcrypt_pcica.c | |||
@@ -279,7 +279,7 @@ static long zcrypt_pcica_modexpo(struct zcrypt_device *zdev, | |||
279 | struct completion work; | 279 | struct completion work; |
280 | int rc; | 280 | int rc; |
281 | 281 | ||
282 | ap_msg.message = (void *) kmalloc(PCICA_MAX_MESSAGE_SIZE, GFP_KERNEL); | 282 | ap_msg.message = kmalloc(PCICA_MAX_MESSAGE_SIZE, GFP_KERNEL); |
283 | if (!ap_msg.message) | 283 | if (!ap_msg.message) |
284 | return -ENOMEM; | 284 | return -ENOMEM; |
285 | ap_msg.psmid = (((unsigned long long) current->pid) << 32) + | 285 | ap_msg.psmid = (((unsigned long long) current->pid) << 32) + |
@@ -321,7 +321,7 @@ static long zcrypt_pcica_modexpo_crt(struct zcrypt_device *zdev, | |||
321 | struct completion work; | 321 | struct completion work; |
322 | int rc; | 322 | int rc; |
323 | 323 | ||
324 | ap_msg.message = (void *) kmalloc(PCICA_MAX_MESSAGE_SIZE, GFP_KERNEL); | 324 | ap_msg.message = kmalloc(PCICA_MAX_MESSAGE_SIZE, GFP_KERNEL); |
325 | if (!ap_msg.message) | 325 | if (!ap_msg.message) |
326 | return -ENOMEM; | 326 | return -ENOMEM; |
327 | ap_msg.psmid = (((unsigned long long) current->pid) << 32) + | 327 | ap_msg.psmid = (((unsigned long long) current->pid) << 32) + |
diff --git a/drivers/s390/crypto/zcrypt_pcixcc.c b/drivers/s390/crypto/zcrypt_pcixcc.c index 2da8b9381407..b7153c1e15cd 100644 --- a/drivers/s390/crypto/zcrypt_pcixcc.c +++ b/drivers/s390/crypto/zcrypt_pcixcc.c | |||
@@ -717,7 +717,7 @@ long zcrypt_pcixcc_send_cprb(struct zcrypt_device *zdev, struct ica_xcRB *xcRB) | |||
717 | }; | 717 | }; |
718 | int rc; | 718 | int rc; |
719 | 719 | ||
720 | ap_msg.message = (void *) kmalloc(PCIXCC_MAX_XCRB_MESSAGE_SIZE, GFP_KERNEL); | 720 | ap_msg.message = kmalloc(PCIXCC_MAX_XCRB_MESSAGE_SIZE, GFP_KERNEL); |
721 | if (!ap_msg.message) | 721 | if (!ap_msg.message) |
722 | return -ENOMEM; | 722 | return -ENOMEM; |
723 | ap_msg.psmid = (((unsigned long long) current->pid) << 32) + | 723 | ap_msg.psmid = (((unsigned long long) current->pid) << 32) + |
diff --git a/drivers/s390/net/ctcmain.c b/drivers/s390/net/ctcmain.c index 3257c22dd79c..03cc263fe0da 100644 --- a/drivers/s390/net/ctcmain.c +++ b/drivers/s390/net/ctcmain.c | |||
@@ -1646,7 +1646,7 @@ add_channel(struct ccw_device *cdev, enum channel_types type) | |||
1646 | return -1; | 1646 | return -1; |
1647 | } | 1647 | } |
1648 | memset(ch, 0, sizeof (struct channel)); | 1648 | memset(ch, 0, sizeof (struct channel)); |
1649 | if ((ch->ccw = (struct ccw1 *) kmalloc(8*sizeof(struct ccw1), | 1649 | if ((ch->ccw = kmalloc(8*sizeof(struct ccw1), |
1650 | GFP_KERNEL | GFP_DMA)) == NULL) { | 1650 | GFP_KERNEL | GFP_DMA)) == NULL) { |
1651 | kfree(ch); | 1651 | kfree(ch); |
1652 | ctc_pr_warn("ctc: Out of memory in add_channel\n"); | 1652 | ctc_pr_warn("ctc: Out of memory in add_channel\n"); |
@@ -1693,7 +1693,7 @@ add_channel(struct ccw_device *cdev, enum channel_types type) | |||
1693 | return -1; | 1693 | return -1; |
1694 | } | 1694 | } |
1695 | fsm_newstate(ch->fsm, CH_STATE_IDLE); | 1695 | fsm_newstate(ch->fsm, CH_STATE_IDLE); |
1696 | if ((ch->irb = (struct irb *) kmalloc(sizeof (struct irb), | 1696 | if ((ch->irb = kmalloc(sizeof (struct irb), |
1697 | GFP_KERNEL)) == NULL) { | 1697 | GFP_KERNEL)) == NULL) { |
1698 | ctc_pr_warn("ctc: Out of memory in add_channel\n"); | 1698 | ctc_pr_warn("ctc: Out of memory in add_channel\n"); |
1699 | kfree_fsm(ch->fsm); | 1699 | kfree_fsm(ch->fsm); |
@@ -2535,7 +2535,7 @@ ctc_print_statistics(struct ctc_priv *priv) | |||
2535 | DBF_TEXT(trace, 4, __FUNCTION__); | 2535 | DBF_TEXT(trace, 4, __FUNCTION__); |
2536 | if (!priv) | 2536 | if (!priv) |
2537 | return; | 2537 | return; |
2538 | sbuf = (char *)kmalloc(2048, GFP_KERNEL); | 2538 | sbuf = kmalloc(2048, GFP_KERNEL); |
2539 | if (sbuf == NULL) | 2539 | if (sbuf == NULL) |
2540 | return; | 2540 | return; |
2541 | p = sbuf; | 2541 | p = sbuf; |
diff --git a/drivers/s390/net/iucv.c b/drivers/s390/net/iucv.c index 1476ce2b437c..229aeb5fc399 100644 --- a/drivers/s390/net/iucv.c +++ b/drivers/s390/net/iucv.c | |||
@@ -772,7 +772,7 @@ iucv_register_program (__u8 pgmname[16], | |||
772 | } | 772 | } |
773 | 773 | ||
774 | /* Allocate handler entry */ | 774 | /* Allocate handler entry */ |
775 | new_handler = (handler *)kmalloc(sizeof(handler), GFP_ATOMIC); | 775 | new_handler = kmalloc(sizeof(handler), GFP_ATOMIC); |
776 | if (new_handler == NULL) { | 776 | if (new_handler == NULL) { |
777 | printk(KERN_WARNING "%s: storage allocation for new handler " | 777 | printk(KERN_WARNING "%s: storage allocation for new handler " |
778 | "failed.\n", __FUNCTION__); | 778 | "failed.\n", __FUNCTION__); |
diff --git a/drivers/s390/scsi/zfcp_aux.c b/drivers/s390/scsi/zfcp_aux.c index 5d39b2df0cc4..85093b71f9fa 100644 --- a/drivers/s390/scsi/zfcp_aux.c +++ b/drivers/s390/scsi/zfcp_aux.c | |||
@@ -237,7 +237,7 @@ zfcp_device_setup(char *devstr) | |||
237 | return 0; | 237 | return 0; |
238 | 238 | ||
239 | len = strlen(devstr) + 1; | 239 | len = strlen(devstr) + 1; |
240 | str = (char *) kmalloc(len, GFP_KERNEL); | 240 | str = kmalloc(len, GFP_KERNEL); |
241 | if (!str) | 241 | if (!str) |
242 | goto err_out; | 242 | goto err_out; |
243 | memcpy(str, devstr, len); | 243 | memcpy(str, devstr, len); |
diff --git a/drivers/sbus/char/vfc_dev.c b/drivers/sbus/char/vfc_dev.c index 2722af5d3404..386e7de0b7e3 100644 --- a/drivers/sbus/char/vfc_dev.c +++ b/drivers/sbus/char/vfc_dev.c | |||
@@ -659,7 +659,7 @@ static int vfc_probe(void) | |||
659 | if (!cards) | 659 | if (!cards) |
660 | return -ENODEV; | 660 | return -ENODEV; |
661 | 661 | ||
662 | vfc_dev_lst = (struct vfc_dev **)kmalloc(sizeof(struct vfc_dev *) * | 662 | vfc_dev_lst = kmalloc(sizeof(struct vfc_dev *) * |
663 | (cards+1), | 663 | (cards+1), |
664 | GFP_KERNEL); | 664 | GFP_KERNEL); |
665 | if (vfc_dev_lst == NULL) | 665 | if (vfc_dev_lst == NULL) |
diff --git a/drivers/scsi/aacraid/aachba.c b/drivers/scsi/aacraid/aachba.c index ac108f9e2674..426cd6f49f5d 100644 --- a/drivers/scsi/aacraid/aachba.c +++ b/drivers/scsi/aacraid/aachba.c | |||
@@ -288,7 +288,7 @@ int aac_get_containers(struct aac_dev *dev) | |||
288 | 288 | ||
289 | if (maximum_num_containers < MAXIMUM_NUM_CONTAINERS) | 289 | if (maximum_num_containers < MAXIMUM_NUM_CONTAINERS) |
290 | maximum_num_containers = MAXIMUM_NUM_CONTAINERS; | 290 | maximum_num_containers = MAXIMUM_NUM_CONTAINERS; |
291 | fsa_dev_ptr = (struct fsa_dev_info *) kmalloc( | 291 | fsa_dev_ptr = kmalloc( |
292 | sizeof(*fsa_dev_ptr) * maximum_num_containers, GFP_KERNEL); | 292 | sizeof(*fsa_dev_ptr) * maximum_num_containers, GFP_KERNEL); |
293 | if (!fsa_dev_ptr) { | 293 | if (!fsa_dev_ptr) { |
294 | aac_fib_free(fibptr); | 294 | aac_fib_free(fibptr); |
diff --git a/drivers/scsi/aacraid/comminit.c b/drivers/scsi/aacraid/comminit.c index d5cf8b91a0e7..6d305b2f854e 100644 --- a/drivers/scsi/aacraid/comminit.c +++ b/drivers/scsi/aacraid/comminit.c | |||
@@ -386,7 +386,7 @@ struct aac_dev *aac_init_adapter(struct aac_dev *dev) | |||
386 | * Ok now init the communication subsystem | 386 | * Ok now init the communication subsystem |
387 | */ | 387 | */ |
388 | 388 | ||
389 | dev->queues = (struct aac_queue_block *) kmalloc(sizeof(struct aac_queue_block), GFP_KERNEL); | 389 | dev->queues = kmalloc(sizeof(struct aac_queue_block), GFP_KERNEL); |
390 | if (dev->queues == NULL) { | 390 | if (dev->queues == NULL) { |
391 | printk(KERN_ERR "Error could not allocate comm region.\n"); | 391 | printk(KERN_ERR "Error could not allocate comm region.\n"); |
392 | return NULL; | 392 | return NULL; |
diff --git a/drivers/scsi/aha1542.c b/drivers/scsi/aha1542.c index d7a61a6bdaae..1d239f6c0103 100644 --- a/drivers/scsi/aha1542.c +++ b/drivers/scsi/aha1542.c | |||
@@ -699,7 +699,7 @@ static int aha1542_queuecommand(Scsi_Cmnd * SCpnt, void (*done) (Scsi_Cmnd *)) | |||
699 | #endif | 699 | #endif |
700 | int i; | 700 | int i; |
701 | ccb[mbo].op = 2; /* SCSI Initiator Command w/scatter-gather */ | 701 | ccb[mbo].op = 2; /* SCSI Initiator Command w/scatter-gather */ |
702 | SCpnt->host_scribble = (unsigned char *) kmalloc(512, GFP_KERNEL | GFP_DMA); | 702 | SCpnt->host_scribble = kmalloc(512, GFP_KERNEL | GFP_DMA); |
703 | sgpnt = (struct scatterlist *) SCpnt->request_buffer; | 703 | sgpnt = (struct scatterlist *) SCpnt->request_buffer; |
704 | cptr = (struct chain *) SCpnt->host_scribble; | 704 | cptr = (struct chain *) SCpnt->host_scribble; |
705 | if (cptr == NULL) { | 705 | if (cptr == NULL) { |
diff --git a/drivers/scsi/aic7xxx_old.c b/drivers/scsi/aic7xxx_old.c index 46eed10b25d9..7d1fec620948 100644 --- a/drivers/scsi/aic7xxx_old.c +++ b/drivers/scsi/aic7xxx_old.c | |||
@@ -2565,7 +2565,7 @@ aic7xxx_allocate_scb(struct aic7xxx_host *p) | |||
2565 | } | 2565 | } |
2566 | } | 2566 | } |
2567 | scb_count = min( (i-1), p->scb_data->maxscbs - p->scb_data->numscbs); | 2567 | scb_count = min( (i-1), p->scb_data->maxscbs - p->scb_data->numscbs); |
2568 | scb_ap = (struct aic7xxx_scb *)kmalloc(sizeof (struct aic7xxx_scb) * scb_count | 2568 | scb_ap = kmalloc(sizeof (struct aic7xxx_scb) * scb_count |
2569 | + sizeof(struct aic7xxx_scb_dma), GFP_ATOMIC); | 2569 | + sizeof(struct aic7xxx_scb_dma), GFP_ATOMIC); |
2570 | if (scb_ap == NULL) | 2570 | if (scb_ap == NULL) |
2571 | return(0); | 2571 | return(0); |
diff --git a/drivers/scsi/dc395x.c b/drivers/scsi/dc395x.c index e95b367d09ed..a965ed3548d5 100644 --- a/drivers/scsi/dc395x.c +++ b/drivers/scsi/dc395x.c | |||
@@ -4319,7 +4319,7 @@ static int __devinit adapter_sg_tables_alloc(struct AdapterCtlBlk *acb) | |||
4319 | 4319 | ||
4320 | dprintkdbg(DBG_1, "Allocate %i pages for SG tables\n", pages); | 4320 | dprintkdbg(DBG_1, "Allocate %i pages for SG tables\n", pages); |
4321 | while (pages--) { | 4321 | while (pages--) { |
4322 | ptr = (struct SGentry *)kmalloc(PAGE_SIZE, GFP_KERNEL); | 4322 | ptr = kmalloc(PAGE_SIZE, GFP_KERNEL); |
4323 | if (!ptr) { | 4323 | if (!ptr) { |
4324 | adapter_sg_tables_free(acb); | 4324 | adapter_sg_tables_free(acb); |
4325 | return 1; | 4325 | return 1; |
diff --git a/drivers/scsi/dpt_i2o.c b/drivers/scsi/dpt_i2o.c index 60b1b434eba7..365db537a28d 100644 --- a/drivers/scsi/dpt_i2o.c +++ b/drivers/scsi/dpt_i2o.c | |||
@@ -297,7 +297,7 @@ static void adpt_inquiry(adpt_hba* pHba) | |||
297 | s32 rcode; | 297 | s32 rcode; |
298 | 298 | ||
299 | memset(msg, 0, sizeof(msg)); | 299 | memset(msg, 0, sizeof(msg)); |
300 | buf = (u8*)kmalloc(80,GFP_KERNEL|ADDR32); | 300 | buf = kmalloc(80,GFP_KERNEL|ADDR32); |
301 | if(!buf){ | 301 | if(!buf){ |
302 | printk(KERN_ERR"%s: Could not allocate buffer\n",pHba->name); | 302 | printk(KERN_ERR"%s: Could not allocate buffer\n",pHba->name); |
303 | return; | 303 | return; |
@@ -1311,7 +1311,7 @@ static s32 adpt_i2o_reset_hba(adpt_hba* pHba) | |||
1311 | schedule_timeout_uninterruptible(1); | 1311 | schedule_timeout_uninterruptible(1); |
1312 | } while (m == EMPTY_QUEUE); | 1312 | } while (m == EMPTY_QUEUE); |
1313 | 1313 | ||
1314 | status = (u8*)kmalloc(4, GFP_KERNEL|ADDR32); | 1314 | status = kmalloc(4, GFP_KERNEL|ADDR32); |
1315 | if(status == NULL) { | 1315 | if(status == NULL) { |
1316 | adpt_send_nop(pHba, m); | 1316 | adpt_send_nop(pHba, m); |
1317 | printk(KERN_ERR"IOP reset failed - no free memory.\n"); | 1317 | printk(KERN_ERR"IOP reset failed - no free memory.\n"); |
@@ -1444,7 +1444,7 @@ static int adpt_i2o_parse_lct(adpt_hba* pHba) | |||
1444 | } | 1444 | } |
1445 | continue; | 1445 | continue; |
1446 | } | 1446 | } |
1447 | d = (struct i2o_device *)kmalloc(sizeof(struct i2o_device), GFP_KERNEL); | 1447 | d = kmalloc(sizeof(struct i2o_device), GFP_KERNEL); |
1448 | if(d==NULL) | 1448 | if(d==NULL) |
1449 | { | 1449 | { |
1450 | printk(KERN_CRIT"%s: Out of memory for I2O device data.\n",pHba->name); | 1450 | printk(KERN_CRIT"%s: Out of memory for I2O device data.\n",pHba->name); |
@@ -2425,7 +2425,7 @@ static s32 adpt_i2o_reparse_lct(adpt_hba* pHba) | |||
2425 | pDev = pDev->next_lun; | 2425 | pDev = pDev->next_lun; |
2426 | } | 2426 | } |
2427 | if(!pDev ) { // Something new add it | 2427 | if(!pDev ) { // Something new add it |
2428 | d = (struct i2o_device *)kmalloc(sizeof(struct i2o_device), GFP_KERNEL); | 2428 | d = kmalloc(sizeof(struct i2o_device), GFP_KERNEL); |
2429 | if(d==NULL) | 2429 | if(d==NULL) |
2430 | { | 2430 | { |
2431 | printk(KERN_CRIT "Out of memory for I2O device data.\n"); | 2431 | printk(KERN_CRIT "Out of memory for I2O device data.\n"); |
@@ -2728,7 +2728,7 @@ static s32 adpt_i2o_init_outbound_q(adpt_hba* pHba) | |||
2728 | 2728 | ||
2729 | kfree(pHba->reply_pool); | 2729 | kfree(pHba->reply_pool); |
2730 | 2730 | ||
2731 | pHba->reply_pool = (u32*)kmalloc(pHba->reply_fifo_size * REPLY_FRAME_SIZE * 4, GFP_KERNEL|ADDR32); | 2731 | pHba->reply_pool = kmalloc(pHba->reply_fifo_size * REPLY_FRAME_SIZE * 4, GFP_KERNEL|ADDR32); |
2732 | if(!pHba->reply_pool){ | 2732 | if(!pHba->reply_pool){ |
2733 | printk(KERN_ERR"%s: Could not allocate reply pool\n",pHba->name); | 2733 | printk(KERN_ERR"%s: Could not allocate reply pool\n",pHba->name); |
2734 | return -1; | 2734 | return -1; |
diff --git a/drivers/scsi/initio.c b/drivers/scsi/initio.c index f160357e37a6..d561663fb4e4 100644 --- a/drivers/scsi/initio.c +++ b/drivers/scsi/initio.c | |||
@@ -2828,7 +2828,7 @@ static int i91u_detect(struct scsi_host_template * tpnt) | |||
2828 | 2828 | ||
2829 | for (; tul_num_scb >= MAX_TARGETS + 3; tul_num_scb--) { | 2829 | for (; tul_num_scb >= MAX_TARGETS + 3; tul_num_scb--) { |
2830 | i = tul_num_ch * tul_num_scb * sizeof(SCB); | 2830 | i = tul_num_ch * tul_num_scb * sizeof(SCB); |
2831 | if ((tul_scb = (SCB *) kmalloc(i, GFP_ATOMIC | GFP_DMA)) != NULL) | 2831 | if ((tul_scb = kmalloc(i, GFP_ATOMIC | GFP_DMA)) != NULL) |
2832 | break; | 2832 | break; |
2833 | } | 2833 | } |
2834 | if (tul_scb == NULL) { | 2834 | if (tul_scb == NULL) { |
diff --git a/drivers/scsi/osst.c b/drivers/scsi/osst.c index 824fe080d1dc..7d2311067903 100644 --- a/drivers/scsi/osst.c +++ b/drivers/scsi/osst.c | |||
@@ -5777,7 +5777,7 @@ static int osst_probe(struct device *dev) | |||
5777 | dev_num = i; | 5777 | dev_num = i; |
5778 | 5778 | ||
5779 | /* allocate a struct osst_tape for this device */ | 5779 | /* allocate a struct osst_tape for this device */ |
5780 | tpnt = (struct osst_tape *)kmalloc(sizeof(struct osst_tape), GFP_ATOMIC); | 5780 | tpnt = kmalloc(sizeof(struct osst_tape), GFP_ATOMIC); |
5781 | if (tpnt == NULL) { | 5781 | if (tpnt == NULL) { |
5782 | write_unlock(&os_scsi_tapes_lock); | 5782 | write_unlock(&os_scsi_tapes_lock); |
5783 | printk(KERN_ERR "osst :E: Can't allocate device descriptor, device not attached.\n"); | 5783 | printk(KERN_ERR "osst :E: Can't allocate device descriptor, device not attached.\n"); |
diff --git a/drivers/scsi/pluto.c b/drivers/scsi/pluto.c index aa60a5f1fbc3..3b2e1a53e6e2 100644 --- a/drivers/scsi/pluto.c +++ b/drivers/scsi/pluto.c | |||
@@ -117,7 +117,7 @@ int __init pluto_detect(struct scsi_host_template *tpnt) | |||
117 | #endif | 117 | #endif |
118 | return 0; | 118 | return 0; |
119 | } | 119 | } |
120 | fcs = (struct ctrl_inquiry *) kmalloc (sizeof (struct ctrl_inquiry) * fcscount, GFP_DMA); | 120 | fcs = kmalloc(sizeof (struct ctrl_inquiry) * fcscount, GFP_DMA); |
121 | if (!fcs) { | 121 | if (!fcs) { |
122 | printk ("PLUTO: Not enough memory to probe\n"); | 122 | printk ("PLUTO: Not enough memory to probe\n"); |
123 | return 0; | 123 | return 0; |
diff --git a/drivers/scsi/sr_ioctl.c b/drivers/scsi/sr_ioctl.c index d1268cb46837..0578ba42718b 100644 --- a/drivers/scsi/sr_ioctl.c +++ b/drivers/scsi/sr_ioctl.c | |||
@@ -546,7 +546,7 @@ int sr_is_xa(Scsi_CD *cd) | |||
546 | if (!xa_test) | 546 | if (!xa_test) |
547 | return 0; | 547 | return 0; |
548 | 548 | ||
549 | raw_sector = (unsigned char *) kmalloc(2048, GFP_KERNEL | SR_GFP_DMA(cd)); | 549 | raw_sector = kmalloc(2048, GFP_KERNEL | SR_GFP_DMA(cd)); |
550 | if (!raw_sector) | 550 | if (!raw_sector) |
551 | return -ENOMEM; | 551 | return -ENOMEM; |
552 | if (0 == sr_read_sector(cd, cd->ms_offset + 16, | 552 | if (0 == sr_read_sector(cd, cd->ms_offset + 16, |
diff --git a/drivers/scsi/sr_vendor.c b/drivers/scsi/sr_vendor.c index a3e9d0f2eb5b..4eb3da996b36 100644 --- a/drivers/scsi/sr_vendor.c +++ b/drivers/scsi/sr_vendor.c | |||
@@ -117,7 +117,7 @@ int sr_set_blocklength(Scsi_CD *cd, int blocklength) | |||
117 | density = (blocklength > 2048) ? 0x81 : 0x83; | 117 | density = (blocklength > 2048) ? 0x81 : 0x83; |
118 | #endif | 118 | #endif |
119 | 119 | ||
120 | buffer = (unsigned char *) kmalloc(512, GFP_KERNEL | GFP_DMA); | 120 | buffer = kmalloc(512, GFP_KERNEL | GFP_DMA); |
121 | if (!buffer) | 121 | if (!buffer) |
122 | return -ENOMEM; | 122 | return -ENOMEM; |
123 | 123 | ||
@@ -164,7 +164,7 @@ int sr_cd_check(struct cdrom_device_info *cdi) | |||
164 | if (cd->cdi.mask & CDC_MULTI_SESSION) | 164 | if (cd->cdi.mask & CDC_MULTI_SESSION) |
165 | return 0; | 165 | return 0; |
166 | 166 | ||
167 | buffer = (unsigned char *) kmalloc(512, GFP_KERNEL | GFP_DMA); | 167 | buffer = kmalloc(512, GFP_KERNEL | GFP_DMA); |
168 | if (!buffer) | 168 | if (!buffer) |
169 | return -ENOMEM; | 169 | return -ENOMEM; |
170 | 170 | ||
diff --git a/drivers/usb/gadget/serial.c b/drivers/usb/gadget/serial.c index 5516c59ed5ec..2d12bf9f19d6 100644 --- a/drivers/usb/gadget/serial.c +++ b/drivers/usb/gadget/serial.c | |||
@@ -2195,7 +2195,7 @@ static struct gs_buf *gs_buf_alloc(unsigned int size, gfp_t kmalloc_flags) | |||
2195 | if (size == 0) | 2195 | if (size == 0) |
2196 | return NULL; | 2196 | return NULL; |
2197 | 2197 | ||
2198 | gb = (struct gs_buf *)kmalloc(sizeof(struct gs_buf), kmalloc_flags); | 2198 | gb = kmalloc(sizeof(struct gs_buf), kmalloc_flags); |
2199 | if (gb == NULL) | 2199 | if (gb == NULL) |
2200 | return NULL; | 2200 | return NULL; |
2201 | 2201 | ||
diff --git a/drivers/usb/host/hc_crisv10.c b/drivers/usb/host/hc_crisv10.c index 9325e46a68c0..282d82efc0b0 100644 --- a/drivers/usb/host/hc_crisv10.c +++ b/drivers/usb/host/hc_crisv10.c | |||
@@ -365,7 +365,7 @@ static inline struct urb *urb_list_first(int epid) | |||
365 | /* Adds an urb_entry last in the list for this epid. */ | 365 | /* Adds an urb_entry last in the list for this epid. */ |
366 | static inline void urb_list_add(struct urb *urb, int epid) | 366 | static inline void urb_list_add(struct urb *urb, int epid) |
367 | { | 367 | { |
368 | urb_entry_t *urb_entry = (urb_entry_t *)kmalloc(sizeof(urb_entry_t), KMALLOC_FLAG); | 368 | urb_entry_t *urb_entry = kmalloc(sizeof(urb_entry_t), KMALLOC_FLAG); |
369 | assert(urb_entry); | 369 | assert(urb_entry); |
370 | 370 | ||
371 | urb_entry->urb = urb; | 371 | urb_entry->urb = urb; |
diff --git a/drivers/usb/misc/auerswald.c b/drivers/usb/misc/auerswald.c index c703f73e1655..6c7f3efb1d40 100644 --- a/drivers/usb/misc/auerswald.c +++ b/drivers/usb/misc/auerswald.c | |||
@@ -766,7 +766,7 @@ static int auerbuf_setup (pauerbufctl_t bcp, unsigned int numElements, unsigned | |||
766 | bep->bufp = kmalloc (bufsize, GFP_KERNEL); | 766 | bep->bufp = kmalloc (bufsize, GFP_KERNEL); |
767 | if (!bep->bufp) | 767 | if (!bep->bufp) |
768 | goto bl_fail; | 768 | goto bl_fail; |
769 | bep->dr = (struct usb_ctrlrequest *) kmalloc (sizeof (struct usb_ctrlrequest), GFP_KERNEL); | 769 | bep->dr = kmalloc(sizeof (struct usb_ctrlrequest), GFP_KERNEL); |
770 | if (!bep->dr) | 770 | if (!bep->dr) |
771 | goto bl_fail; | 771 | goto bl_fail; |
772 | bep->urbp = usb_alloc_urb (0, GFP_KERNEL); | 772 | bep->urbp = usb_alloc_urb (0, GFP_KERNEL); |
@@ -1969,7 +1969,7 @@ static int auerswald_probe (struct usb_interface *intf, | |||
1969 | info("device is a %s", cp->dev_desc); | 1969 | info("device is a %s", cp->dev_desc); |
1970 | 1970 | ||
1971 | /* get the maximum allowed control transfer length */ | 1971 | /* get the maximum allowed control transfer length */ |
1972 | pbuf = (__le16 *) kmalloc (2, GFP_KERNEL); /* use an allocated buffer because of urb target */ | 1972 | pbuf = kmalloc(2, GFP_KERNEL); /* use an allocated buffer because of urb target */ |
1973 | if (!pbuf) { | 1973 | if (!pbuf) { |
1974 | err( "out of memory"); | 1974 | err( "out of memory"); |
1975 | goto pfail; | 1975 | goto pfail; |
diff --git a/drivers/usb/serial/cypress_m8.c b/drivers/usb/serial/cypress_m8.c index a1fdb85b8c0a..45cdf9bc43b2 100644 --- a/drivers/usb/serial/cypress_m8.c +++ b/drivers/usb/serial/cypress_m8.c | |||
@@ -1493,7 +1493,7 @@ static struct cypress_buf *cypress_buf_alloc(unsigned int size) | |||
1493 | if (size == 0) | 1493 | if (size == 0) |
1494 | return NULL; | 1494 | return NULL; |
1495 | 1495 | ||
1496 | cb = (struct cypress_buf *)kmalloc(sizeof(struct cypress_buf), GFP_KERNEL); | 1496 | cb = kmalloc(sizeof(struct cypress_buf), GFP_KERNEL); |
1497 | if (cb == NULL) | 1497 | if (cb == NULL) |
1498 | return NULL; | 1498 | return NULL; |
1499 | 1499 | ||
diff --git a/drivers/usb/serial/digi_acceleport.c b/drivers/usb/serial/digi_acceleport.c index 9d9ea874639c..efd9ce3f931f 100644 --- a/drivers/usb/serial/digi_acceleport.c +++ b/drivers/usb/serial/digi_acceleport.c | |||
@@ -1681,7 +1681,7 @@ dbg( "digi_startup: TOP" ); | |||
1681 | for( i=0; i<serial->type->num_ports+1; i++ ) { | 1681 | for( i=0; i<serial->type->num_ports+1; i++ ) { |
1682 | 1682 | ||
1683 | /* allocate port private structure */ | 1683 | /* allocate port private structure */ |
1684 | priv = (struct digi_port *)kmalloc( sizeof(struct digi_port), | 1684 | priv = kmalloc( sizeof(struct digi_port), |
1685 | GFP_KERNEL ); | 1685 | GFP_KERNEL ); |
1686 | if( priv == (struct digi_port *)0 ) { | 1686 | if( priv == (struct digi_port *)0 ) { |
1687 | while( --i >= 0 ) | 1687 | while( --i >= 0 ) |
@@ -1714,7 +1714,7 @@ dbg( "digi_startup: TOP" ); | |||
1714 | } | 1714 | } |
1715 | 1715 | ||
1716 | /* allocate serial private structure */ | 1716 | /* allocate serial private structure */ |
1717 | serial_priv = (struct digi_serial *)kmalloc( sizeof(struct digi_serial), | 1717 | serial_priv = kmalloc( sizeof(struct digi_serial), |
1718 | GFP_KERNEL ); | 1718 | GFP_KERNEL ); |
1719 | if( serial_priv == (struct digi_serial *)0 ) { | 1719 | if( serial_priv == (struct digi_serial *)0 ) { |
1720 | for( i=0; i<serial->type->num_ports+1; i++ ) | 1720 | for( i=0; i<serial->type->num_ports+1; i++ ) |
diff --git a/drivers/usb/serial/io_ti.c b/drivers/usb/serial/io_ti.c index 2da2684e0809..980285c0233a 100644 --- a/drivers/usb/serial/io_ti.c +++ b/drivers/usb/serial/io_ti.c | |||
@@ -2811,7 +2811,7 @@ static struct edge_buf *edge_buf_alloc(unsigned int size) | |||
2811 | if (size == 0) | 2811 | if (size == 0) |
2812 | return NULL; | 2812 | return NULL; |
2813 | 2813 | ||
2814 | eb = (struct edge_buf *)kmalloc(sizeof(struct edge_buf), GFP_KERNEL); | 2814 | eb = kmalloc(sizeof(struct edge_buf), GFP_KERNEL); |
2815 | if (eb == NULL) | 2815 | if (eb == NULL) |
2816 | return NULL; | 2816 | return NULL; |
2817 | 2817 | ||
diff --git a/drivers/usb/serial/ipaq.c b/drivers/usb/serial/ipaq.c index d72cf8bc7f76..42f757a5b876 100644 --- a/drivers/usb/serial/ipaq.c +++ b/drivers/usb/serial/ipaq.c | |||
@@ -595,7 +595,7 @@ static int ipaq_open(struct usb_serial_port *port, struct file *filp) | |||
595 | 595 | ||
596 | bytes_in = 0; | 596 | bytes_in = 0; |
597 | bytes_out = 0; | 597 | bytes_out = 0; |
598 | priv = (struct ipaq_private *)kmalloc(sizeof(struct ipaq_private), GFP_KERNEL); | 598 | priv = kmalloc(sizeof(struct ipaq_private), GFP_KERNEL); |
599 | if (priv == NULL) { | 599 | if (priv == NULL) { |
600 | err("%s - Out of memory", __FUNCTION__); | 600 | err("%s - Out of memory", __FUNCTION__); |
601 | return -ENOMEM; | 601 | return -ENOMEM; |
diff --git a/drivers/usb/serial/kobil_sct.c b/drivers/usb/serial/kobil_sct.c index e284d6c0fd35..62bea0c923bd 100644 --- a/drivers/usb/serial/kobil_sct.c +++ b/drivers/usb/serial/kobil_sct.c | |||
@@ -269,7 +269,7 @@ static int kobil_open (struct usb_serial_port *port, struct file *filp) | |||
269 | } | 269 | } |
270 | 270 | ||
271 | // allocate memory for write_urb transfer buffer | 271 | // allocate memory for write_urb transfer buffer |
272 | port->write_urb->transfer_buffer = (unsigned char *) kmalloc(write_urb_transfer_buffer_length, GFP_KERNEL); | 272 | port->write_urb->transfer_buffer = kmalloc(write_urb_transfer_buffer_length, GFP_KERNEL); |
273 | if (! port->write_urb->transfer_buffer) { | 273 | if (! port->write_urb->transfer_buffer) { |
274 | kfree(transfer_buffer); | 274 | kfree(transfer_buffer); |
275 | usb_free_urb(port->write_urb); | 275 | usb_free_urb(port->write_urb); |
@@ -696,7 +696,7 @@ static int kobil_ioctl(struct usb_serial_port *port, struct file *file, | |||
696 | return 0; | 696 | return 0; |
697 | 697 | ||
698 | case TCFLSH: // 0x540B | 698 | case TCFLSH: // 0x540B |
699 | transfer_buffer = (unsigned char *) kmalloc(transfer_buffer_length, GFP_KERNEL); | 699 | transfer_buffer = kmalloc(transfer_buffer_length, GFP_KERNEL); |
700 | if (! transfer_buffer) { | 700 | if (! transfer_buffer) { |
701 | return -ENOBUFS; | 701 | return -ENOBUFS; |
702 | } | 702 | } |
diff --git a/drivers/usb/serial/pl2303.c b/drivers/usb/serial/pl2303.c index d124d780e42e..5dc2ac9afa90 100644 --- a/drivers/usb/serial/pl2303.c +++ b/drivers/usb/serial/pl2303.c | |||
@@ -159,7 +159,7 @@ static struct pl2303_buf *pl2303_buf_alloc(unsigned int size) | |||
159 | if (size == 0) | 159 | if (size == 0) |
160 | return NULL; | 160 | return NULL; |
161 | 161 | ||
162 | pb = (struct pl2303_buf *)kmalloc(sizeof(struct pl2303_buf), GFP_KERNEL); | 162 | pb = kmalloc(sizeof(struct pl2303_buf), GFP_KERNEL); |
163 | if (pb == NULL) | 163 | if (pb == NULL) |
164 | return NULL; | 164 | return NULL; |
165 | 165 | ||
diff --git a/drivers/usb/serial/ti_usb_3410_5052.c b/drivers/usb/serial/ti_usb_3410_5052.c index f42eb9ea6405..83189005c6fb 100644 --- a/drivers/usb/serial/ti_usb_3410_5052.c +++ b/drivers/usb/serial/ti_usb_3410_5052.c | |||
@@ -1710,7 +1710,7 @@ static struct circ_buf *ti_buf_alloc(void) | |||
1710 | { | 1710 | { |
1711 | struct circ_buf *cb; | 1711 | struct circ_buf *cb; |
1712 | 1712 | ||
1713 | cb = (struct circ_buf *)kmalloc(sizeof(struct circ_buf), GFP_KERNEL); | 1713 | cb = kmalloc(sizeof(struct circ_buf), GFP_KERNEL); |
1714 | if (cb == NULL) | 1714 | if (cb == NULL) |
1715 | return NULL; | 1715 | return NULL; |
1716 | 1716 | ||
diff --git a/drivers/usb/serial/whiteheat.c b/drivers/usb/serial/whiteheat.c index dc45e58e2b8c..5483d8564c1b 100644 --- a/drivers/usb/serial/whiteheat.c +++ b/drivers/usb/serial/whiteheat.c | |||
@@ -416,7 +416,7 @@ static int whiteheat_attach (struct usb_serial *serial) | |||
416 | for (i = 0; i < serial->num_ports; i++) { | 416 | for (i = 0; i < serial->num_ports; i++) { |
417 | port = serial->port[i]; | 417 | port = serial->port[i]; |
418 | 418 | ||
419 | info = (struct whiteheat_private *)kmalloc(sizeof(struct whiteheat_private), GFP_KERNEL); | 419 | info = kmalloc(sizeof(struct whiteheat_private), GFP_KERNEL); |
420 | if (info == NULL) { | 420 | if (info == NULL) { |
421 | err("%s: Out of memory for port structures\n", serial->type->description); | 421 | err("%s: Out of memory for port structures\n", serial->type->description); |
422 | goto no_private; | 422 | goto no_private; |
@@ -487,7 +487,7 @@ static int whiteheat_attach (struct usb_serial *serial) | |||
487 | usb_set_serial_port_data(port, info); | 487 | usb_set_serial_port_data(port, info); |
488 | } | 488 | } |
489 | 489 | ||
490 | command_info = (struct whiteheat_command_private *)kmalloc(sizeof(struct whiteheat_command_private), GFP_KERNEL); | 490 | command_info = kmalloc(sizeof(struct whiteheat_command_private), GFP_KERNEL); |
491 | if (command_info == NULL) { | 491 | if (command_info == NULL) { |
492 | err("%s: Out of memory for port structures\n", serial->type->description); | 492 | err("%s: Out of memory for port structures\n", serial->type->description); |
493 | goto no_command_private; | 493 | goto no_command_private; |
diff --git a/drivers/usb/storage/sddr09.c b/drivers/usb/storage/sddr09.c index fb8bacaae27c..e3528eca29a5 100644 --- a/drivers/usb/storage/sddr09.c +++ b/drivers/usb/storage/sddr09.c | |||
@@ -646,7 +646,7 @@ sddr09_read_sg_test_only(struct us_data *us) { | |||
646 | return result; | 646 | return result; |
647 | } | 647 | } |
648 | 648 | ||
649 | buf = (unsigned char *) kmalloc(bulklen, GFP_NOIO); | 649 | buf = kmalloc(bulklen, GFP_NOIO); |
650 | if (!buf) | 650 | if (!buf) |
651 | return -ENOMEM; | 651 | return -ENOMEM; |
652 | 652 | ||
diff --git a/drivers/video/amba-clcd.c b/drivers/video/amba-clcd.c index 6761b68c35e9..6c9dc2e69c82 100644 --- a/drivers/video/amba-clcd.c +++ b/drivers/video/amba-clcd.c | |||
@@ -447,7 +447,7 @@ static int clcdfb_probe(struct amba_device *dev, void *id) | |||
447 | goto out; | 447 | goto out; |
448 | } | 448 | } |
449 | 449 | ||
450 | fb = (struct clcd_fb *) kmalloc(sizeof(struct clcd_fb), GFP_KERNEL); | 450 | fb = kmalloc(sizeof(struct clcd_fb), GFP_KERNEL); |
451 | if (!fb) { | 451 | if (!fb) { |
452 | printk(KERN_INFO "CLCD: could not allocate new clcd_fb struct\n"); | 452 | printk(KERN_INFO "CLCD: could not allocate new clcd_fb struct\n"); |
453 | ret = -ENOMEM; | 453 | ret = -ENOMEM; |
diff --git a/drivers/video/matrox/i2c-matroxfb.c b/drivers/video/matrox/i2c-matroxfb.c index 797b42305b0f..fe28848e7b52 100644 --- a/drivers/video/matrox/i2c-matroxfb.c +++ b/drivers/video/matrox/i2c-matroxfb.c | |||
@@ -146,7 +146,7 @@ static void* i2c_matroxfb_probe(struct matrox_fb_info* minfo) { | |||
146 | unsigned long flags; | 146 | unsigned long flags; |
147 | struct matroxfb_dh_maven_info* m2info; | 147 | struct matroxfb_dh_maven_info* m2info; |
148 | 148 | ||
149 | m2info = (struct matroxfb_dh_maven_info*)kmalloc(sizeof(*m2info), GFP_KERNEL); | 149 | m2info = kmalloc(sizeof(*m2info), GFP_KERNEL); |
150 | if (!m2info) | 150 | if (!m2info) |
151 | return NULL; | 151 | return NULL; |
152 | 152 | ||
diff --git a/drivers/video/matrox/matroxfb_base.c b/drivers/video/matrox/matroxfb_base.c index e9b4115fcad0..cb2aa402ddfd 100644 --- a/drivers/video/matrox/matroxfb_base.c +++ b/drivers/video/matrox/matroxfb_base.c | |||
@@ -2028,7 +2028,7 @@ static int matroxfb_probe(struct pci_dev* pdev, const struct pci_device_id* dumm | |||
2028 | } | 2028 | } |
2029 | 2029 | ||
2030 | #ifdef CONFIG_FB_MATROX_MULTIHEAD | 2030 | #ifdef CONFIG_FB_MATROX_MULTIHEAD |
2031 | minfo = (struct matrox_fb_info*)kmalloc(sizeof(*minfo), GFP_KERNEL); | 2031 | minfo = kmalloc(sizeof(*minfo), GFP_KERNEL); |
2032 | if (!minfo) | 2032 | if (!minfo) |
2033 | return -1; | 2033 | return -1; |
2034 | #else | 2034 | #else |
diff --git a/drivers/video/matrox/matroxfb_crtc2.c b/drivers/video/matrox/matroxfb_crtc2.c index 27eb4bb4f89f..2c9801090fae 100644 --- a/drivers/video/matrox/matroxfb_crtc2.c +++ b/drivers/video/matrox/matroxfb_crtc2.c | |||
@@ -694,7 +694,7 @@ static void* matroxfb_crtc2_probe(struct matrox_fb_info* minfo) { | |||
694 | /* hardware is CRTC2 incapable... */ | 694 | /* hardware is CRTC2 incapable... */ |
695 | if (!ACCESS_FBINFO(devflags.crtc2)) | 695 | if (!ACCESS_FBINFO(devflags.crtc2)) |
696 | return NULL; | 696 | return NULL; |
697 | m2info = (struct matroxfb_dh_fb_info*)kmalloc(sizeof(*m2info), GFP_KERNEL); | 697 | m2info = kmalloc(sizeof(*m2info), GFP_KERNEL); |
698 | if (!m2info) { | 698 | if (!m2info) { |
699 | printk(KERN_ERR "matroxfb_crtc2: Not enough memory for CRTC2 control structs\n"); | 699 | printk(KERN_ERR "matroxfb_crtc2: Not enough memory for CRTC2 control structs\n"); |
700 | return NULL; | 700 | return NULL; |
diff --git a/fs/autofs4/inode.c b/fs/autofs4/inode.c index 9c48250fd726..e8f6c5ad3e90 100644 --- a/fs/autofs4/inode.c +++ b/fs/autofs4/inode.c | |||
@@ -313,7 +313,7 @@ int autofs4_fill_super(struct super_block *s, void *data, int silent) | |||
313 | struct autofs_sb_info *sbi; | 313 | struct autofs_sb_info *sbi; |
314 | struct autofs_info *ino; | 314 | struct autofs_info *ino; |
315 | 315 | ||
316 | sbi = (struct autofs_sb_info *) kmalloc(sizeof(*sbi), GFP_KERNEL); | 316 | sbi = kmalloc(sizeof(*sbi), GFP_KERNEL); |
317 | if ( !sbi ) | 317 | if ( !sbi ) |
318 | goto fail_unlock; | 318 | goto fail_unlock; |
319 | DPRINTK("starting up, sbi = %p",sbi); | 319 | DPRINTK("starting up, sbi = %p",sbi); |
diff --git a/fs/befs/btree.c b/fs/befs/btree.c index 81b042ee24e6..af5bb93276f8 100644 --- a/fs/befs/btree.c +++ b/fs/befs/btree.c | |||
@@ -260,7 +260,7 @@ befs_btree_find(struct super_block *sb, befs_data_stream * ds, | |||
260 | goto error; | 260 | goto error; |
261 | } | 261 | } |
262 | 262 | ||
263 | this_node = (befs_btree_node *) kmalloc(sizeof (befs_btree_node), | 263 | this_node = kmalloc(sizeof (befs_btree_node), |
264 | GFP_NOFS); | 264 | GFP_NOFS); |
265 | if (!this_node) { | 265 | if (!this_node) { |
266 | befs_error(sb, "befs_btree_find() failed to allocate %u " | 266 | befs_error(sb, "befs_btree_find() failed to allocate %u " |
diff --git a/fs/befs/debug.c b/fs/befs/debug.c index e831a8f30849..b8e304a0661e 100644 --- a/fs/befs/debug.c +++ b/fs/befs/debug.c | |||
@@ -28,7 +28,7 @@ void | |||
28 | befs_error(const struct super_block *sb, const char *fmt, ...) | 28 | befs_error(const struct super_block *sb, const char *fmt, ...) |
29 | { | 29 | { |
30 | va_list args; | 30 | va_list args; |
31 | char *err_buf = (char *) kmalloc(ERRBUFSIZE, GFP_KERNEL); | 31 | char *err_buf = kmalloc(ERRBUFSIZE, GFP_KERNEL); |
32 | if (err_buf == NULL) { | 32 | if (err_buf == NULL) { |
33 | printk(KERN_ERR "could not allocate %d bytes\n", ERRBUFSIZE); | 33 | printk(KERN_ERR "could not allocate %d bytes\n", ERRBUFSIZE); |
34 | return; | 34 | return; |
@@ -46,7 +46,7 @@ void | |||
46 | befs_warning(const struct super_block *sb, const char *fmt, ...) | 46 | befs_warning(const struct super_block *sb, const char *fmt, ...) |
47 | { | 47 | { |
48 | va_list args; | 48 | va_list args; |
49 | char *err_buf = (char *) kmalloc(ERRBUFSIZE, GFP_KERNEL); | 49 | char *err_buf = kmalloc(ERRBUFSIZE, GFP_KERNEL); |
50 | if (err_buf == NULL) { | 50 | if (err_buf == NULL) { |
51 | printk(KERN_ERR "could not allocate %d bytes\n", ERRBUFSIZE); | 51 | printk(KERN_ERR "could not allocate %d bytes\n", ERRBUFSIZE); |
52 | return; | 52 | return; |
@@ -70,7 +70,7 @@ befs_debug(const struct super_block *sb, const char *fmt, ...) | |||
70 | char *err_buf = NULL; | 70 | char *err_buf = NULL; |
71 | 71 | ||
72 | if (BEFS_SB(sb)->mount_opts.debug) { | 72 | if (BEFS_SB(sb)->mount_opts.debug) { |
73 | err_buf = (char *) kmalloc(ERRBUFSIZE, GFP_KERNEL); | 73 | err_buf = kmalloc(ERRBUFSIZE, GFP_KERNEL); |
74 | if (err_buf == NULL) { | 74 | if (err_buf == NULL) { |
75 | printk(KERN_ERR "could not allocate %d bytes\n", | 75 | printk(KERN_ERR "could not allocate %d bytes\n", |
76 | ERRBUFSIZE); | 76 | ERRBUFSIZE); |
diff --git a/fs/binfmt_misc.c b/fs/binfmt_misc.c index 00687ea62738..c2e08252af35 100644 --- a/fs/binfmt_misc.c +++ b/fs/binfmt_misc.c | |||
@@ -311,7 +311,7 @@ static Node *create_entry(const char __user *buffer, size_t count) | |||
311 | 311 | ||
312 | err = -ENOMEM; | 312 | err = -ENOMEM; |
313 | memsize = sizeof(Node) + count + 8; | 313 | memsize = sizeof(Node) + count + 8; |
314 | e = (Node *) kmalloc(memsize, GFP_USER); | 314 | e = kmalloc(memsize, GFP_USER); |
315 | if (!e) | 315 | if (!e) |
316 | goto out; | 316 | goto out; |
317 | 317 | ||
diff --git a/fs/cifs/cifssmb.c b/fs/cifs/cifssmb.c index 098790eb2aa1..472e33e0f3cf 100644 --- a/fs/cifs/cifssmb.c +++ b/fs/cifs/cifssmb.c | |||
@@ -4876,7 +4876,7 @@ int CIFSSMBNotify(const int xid, struct cifsTconInfo *tcon, | |||
4876 | } else { | 4876 | } else { |
4877 | /* Add file to outstanding requests */ | 4877 | /* Add file to outstanding requests */ |
4878 | /* BB change to kmem cache alloc */ | 4878 | /* BB change to kmem cache alloc */ |
4879 | dnotify_req = (struct dir_notify_req *) kmalloc( | 4879 | dnotify_req = kmalloc( |
4880 | sizeof(struct dir_notify_req), | 4880 | sizeof(struct dir_notify_req), |
4881 | GFP_KERNEL); | 4881 | GFP_KERNEL); |
4882 | if(dnotify_req) { | 4882 | if(dnotify_req) { |
diff --git a/fs/jffs/inode-v23.c b/fs/jffs/inode-v23.c index 7b40c69f44eb..43baa1afa021 100644 --- a/fs/jffs/inode-v23.c +++ b/fs/jffs/inode-v23.c | |||
@@ -818,7 +818,7 @@ jffs_mkdir(struct inode *dir, struct dentry *dentry, int mode) | |||
818 | 818 | ||
819 | D1({ | 819 | D1({ |
820 | int len = dentry->d_name.len; | 820 | int len = dentry->d_name.len; |
821 | char *_name = (char *) kmalloc(len + 1, GFP_KERNEL); | 821 | char *_name = kmalloc(len + 1, GFP_KERNEL); |
822 | memcpy(_name, dentry->d_name.name, len); | 822 | memcpy(_name, dentry->d_name.name, len); |
823 | _name[len] = '\0'; | 823 | _name[len] = '\0'; |
824 | printk("***jffs_mkdir(): dir = 0x%p, name = \"%s\", " | 824 | printk("***jffs_mkdir(): dir = 0x%p, name = \"%s\", " |
@@ -964,7 +964,7 @@ jffs_remove(struct inode *dir, struct dentry *dentry, int type) | |||
964 | D1({ | 964 | D1({ |
965 | int len = dentry->d_name.len; | 965 | int len = dentry->d_name.len; |
966 | const char *name = dentry->d_name.name; | 966 | const char *name = dentry->d_name.name; |
967 | char *_name = (char *) kmalloc(len + 1, GFP_KERNEL); | 967 | char *_name = kmalloc(len + 1, GFP_KERNEL); |
968 | memcpy(_name, name, len); | 968 | memcpy(_name, name, len); |
969 | _name[len] = '\0'; | 969 | _name[len] = '\0'; |
970 | printk("***jffs_remove(): file = \"%s\", ino = %ld\n", _name, dentry->d_inode->i_ino); | 970 | printk("***jffs_remove(): file = \"%s\", ino = %ld\n", _name, dentry->d_inode->i_ino); |
diff --git a/fs/jffs/intrep.c b/fs/jffs/intrep.c index d0e783f199ea..6dd18911b44c 100644 --- a/fs/jffs/intrep.c +++ b/fs/jffs/intrep.c | |||
@@ -436,7 +436,7 @@ jffs_checksum_flash(struct mtd_info *mtd, loff_t start, int size, __u32 *result) | |||
436 | int i, length; | 436 | int i, length; |
437 | 437 | ||
438 | /* Allocate read buffer */ | 438 | /* Allocate read buffer */ |
439 | read_buf = (__u8 *) kmalloc (sizeof(__u8) * 4096, GFP_KERNEL); | 439 | read_buf = kmalloc(sizeof(__u8) * 4096, GFP_KERNEL); |
440 | if (!read_buf) { | 440 | if (!read_buf) { |
441 | printk(KERN_NOTICE "kmalloc failed in jffs_checksum_flash()\n"); | 441 | printk(KERN_NOTICE "kmalloc failed in jffs_checksum_flash()\n"); |
442 | return -ENOMEM; | 442 | return -ENOMEM; |
@@ -744,11 +744,11 @@ static int check_partly_erased_sectors(struct jffs_fmcontrol *fmc){ | |||
744 | 744 | ||
745 | 745 | ||
746 | /* Allocate read buffers */ | 746 | /* Allocate read buffers */ |
747 | read_buf1 = (__u8 *) kmalloc (sizeof(__u8) * READ_AHEAD_BYTES, GFP_KERNEL); | 747 | read_buf1 = kmalloc(sizeof(__u8) * READ_AHEAD_BYTES, GFP_KERNEL); |
748 | if (!read_buf1) | 748 | if (!read_buf1) |
749 | return -ENOMEM; | 749 | return -ENOMEM; |
750 | 750 | ||
751 | read_buf2 = (__u8 *) kmalloc (sizeof(__u8) * READ_AHEAD_BYTES, GFP_KERNEL); | 751 | read_buf2 = kmalloc(sizeof(__u8) * READ_AHEAD_BYTES, GFP_KERNEL); |
752 | if (!read_buf2) { | 752 | if (!read_buf2) { |
753 | kfree(read_buf1); | 753 | kfree(read_buf1); |
754 | return -ENOMEM; | 754 | return -ENOMEM; |
@@ -876,7 +876,7 @@ jffs_scan_flash(struct jffs_control *c) | |||
876 | } | 876 | } |
877 | 877 | ||
878 | /* Allocate read buffer */ | 878 | /* Allocate read buffer */ |
879 | read_buf = (__u8 *) kmalloc (sizeof(__u8) * 4096, GFP_KERNEL); | 879 | read_buf = kmalloc(sizeof(__u8) * 4096, GFP_KERNEL); |
880 | if (!read_buf) { | 880 | if (!read_buf) { |
881 | flash_safe_release(fmc->mtd); | 881 | flash_safe_release(fmc->mtd); |
882 | return -ENOMEM; | 882 | return -ENOMEM; |
@@ -1463,7 +1463,7 @@ jffs_insert_node(struct jffs_control *c, struct jffs_file *f, | |||
1463 | kfree(f->name); | 1463 | kfree(f->name); |
1464 | DJM(no_name--); | 1464 | DJM(no_name--); |
1465 | } | 1465 | } |
1466 | if (!(f->name = (char *) kmalloc(raw_inode->nsize + 1, | 1466 | if (!(f->name = kmalloc(raw_inode->nsize + 1, |
1467 | GFP_KERNEL))) { | 1467 | GFP_KERNEL))) { |
1468 | return -ENOMEM; | 1468 | return -ENOMEM; |
1469 | } | 1469 | } |
@@ -1737,7 +1737,7 @@ jffs_find_child(struct jffs_file *dir, const char *name, int len) | |||
1737 | printk("jffs_find_child(): Found \"%s\".\n", f->name); | 1737 | printk("jffs_find_child(): Found \"%s\".\n", f->name); |
1738 | } | 1738 | } |
1739 | else { | 1739 | else { |
1740 | char *copy = (char *) kmalloc(len + 1, GFP_KERNEL); | 1740 | char *copy = kmalloc(len + 1, GFP_KERNEL); |
1741 | if (copy) { | 1741 | if (copy) { |
1742 | memcpy(copy, name, len); | 1742 | memcpy(copy, name, len); |
1743 | copy[len] = '\0'; | 1743 | copy[len] = '\0'; |
@@ -2627,7 +2627,7 @@ jffs_print_tree(struct jffs_file *first_file, int indent) | |||
2627 | return; | 2627 | return; |
2628 | } | 2628 | } |
2629 | 2629 | ||
2630 | if (!(space = (char *) kmalloc(indent + 1, GFP_KERNEL))) { | 2630 | if (!(space = kmalloc(indent + 1, GFP_KERNEL))) { |
2631 | printk("jffs_print_tree(): Out of memory!\n"); | 2631 | printk("jffs_print_tree(): Out of memory!\n"); |
2632 | return; | 2632 | return; |
2633 | } | 2633 | } |
diff --git a/fs/jfs/jfs_dtree.c b/fs/jfs/jfs_dtree.c index 47bc0b5d1324..6d62f3222892 100644 --- a/fs/jfs/jfs_dtree.c +++ b/fs/jfs/jfs_dtree.c | |||
@@ -3777,12 +3777,12 @@ static int ciGetLeafPrefixKey(dtpage_t * lp, int li, dtpage_t * rp, | |||
3777 | struct component_name lkey; | 3777 | struct component_name lkey; |
3778 | struct component_name rkey; | 3778 | struct component_name rkey; |
3779 | 3779 | ||
3780 | lkey.name = (wchar_t *) kmalloc((JFS_NAME_MAX + 1) * sizeof(wchar_t), | 3780 | lkey.name = kmalloc((JFS_NAME_MAX + 1) * sizeof(wchar_t), |
3781 | GFP_KERNEL); | 3781 | GFP_KERNEL); |
3782 | if (lkey.name == NULL) | 3782 | if (lkey.name == NULL) |
3783 | return -ENOMEM; | 3783 | return -ENOMEM; |
3784 | 3784 | ||
3785 | rkey.name = (wchar_t *) kmalloc((JFS_NAME_MAX + 1) * sizeof(wchar_t), | 3785 | rkey.name = kmalloc((JFS_NAME_MAX + 1) * sizeof(wchar_t), |
3786 | GFP_KERNEL); | 3786 | GFP_KERNEL); |
3787 | if (rkey.name == NULL) { | 3787 | if (rkey.name == NULL) { |
3788 | kfree(lkey.name); | 3788 | kfree(lkey.name); |
diff --git a/fs/jfs/jfs_imap.c b/fs/jfs/jfs_imap.c index ee9b473b7b80..53f63b47a6d3 100644 --- a/fs/jfs/jfs_imap.c +++ b/fs/jfs/jfs_imap.c | |||
@@ -120,7 +120,7 @@ int diMount(struct inode *ipimap) | |||
120 | * allocate/initialize the in-memory inode map control structure | 120 | * allocate/initialize the in-memory inode map control structure |
121 | */ | 121 | */ |
122 | /* allocate the in-memory inode map control structure. */ | 122 | /* allocate the in-memory inode map control structure. */ |
123 | imap = (struct inomap *) kmalloc(sizeof(struct inomap), GFP_KERNEL); | 123 | imap = kmalloc(sizeof(struct inomap), GFP_KERNEL); |
124 | if (imap == NULL) { | 124 | if (imap == NULL) { |
125 | jfs_err("diMount: kmalloc returned NULL!"); | 125 | jfs_err("diMount: kmalloc returned NULL!"); |
126 | return -ENOMEM; | 126 | return -ENOMEM; |
diff --git a/fs/lockd/svcshare.c b/fs/lockd/svcshare.c index 6220dc2a3f2c..068886de4dda 100644 --- a/fs/lockd/svcshare.c +++ b/fs/lockd/svcshare.c | |||
@@ -39,7 +39,7 @@ nlmsvc_share_file(struct nlm_host *host, struct nlm_file *file, | |||
39 | return nlm_lck_denied; | 39 | return nlm_lck_denied; |
40 | } | 40 | } |
41 | 41 | ||
42 | share = (struct nlm_share *) kmalloc(sizeof(*share) + oh->len, | 42 | share = kmalloc(sizeof(*share) + oh->len, |
43 | GFP_KERNEL); | 43 | GFP_KERNEL); |
44 | if (share == NULL) | 44 | if (share == NULL) |
45 | return nlm_lck_denied_nolocks; | 45 | return nlm_lck_denied_nolocks; |
diff --git a/fs/nfs/nfs4proc.c b/fs/nfs/nfs4proc.c index ee458aeab24a..b3fd29baadc3 100644 --- a/fs/nfs/nfs4proc.c +++ b/fs/nfs/nfs4proc.c | |||
@@ -1877,7 +1877,7 @@ static int nfs4_proc_unlink_setup(struct rpc_message *msg, struct dentry *dir, | |||
1877 | struct nfs_server *server = NFS_SERVER(dir->d_inode); | 1877 | struct nfs_server *server = NFS_SERVER(dir->d_inode); |
1878 | struct unlink_desc *up; | 1878 | struct unlink_desc *up; |
1879 | 1879 | ||
1880 | up = (struct unlink_desc *) kmalloc(sizeof(*up), GFP_KERNEL); | 1880 | up = kmalloc(sizeof(*up), GFP_KERNEL); |
1881 | if (!up) | 1881 | if (!up) |
1882 | return -ENOMEM; | 1882 | return -ENOMEM; |
1883 | 1883 | ||
diff --git a/fs/reiserfs/xattr_acl.c b/fs/reiserfs/xattr_acl.c index 97ae1b92bc47..5296a29cc5eb 100644 --- a/fs/reiserfs/xattr_acl.c +++ b/fs/reiserfs/xattr_acl.c | |||
@@ -135,7 +135,7 @@ static void *posix_acl_to_disk(const struct posix_acl *acl, size_t * size) | |||
135 | int n; | 135 | int n; |
136 | 136 | ||
137 | *size = reiserfs_acl_size(acl->a_count); | 137 | *size = reiserfs_acl_size(acl->a_count); |
138 | ext_acl = (reiserfs_acl_header *) kmalloc(sizeof(reiserfs_acl_header) + | 138 | ext_acl = kmalloc(sizeof(reiserfs_acl_header) + |
139 | acl->a_count * | 139 | acl->a_count * |
140 | sizeof(reiserfs_acl_entry), | 140 | sizeof(reiserfs_acl_entry), |
141 | GFP_NOFS); | 141 | GFP_NOFS); |
diff --git a/include/asm-avr32/pgalloc.h b/include/asm-avr32/pgalloc.h index 7492cfb92ced..bb82e70cde8d 100644 --- a/include/asm-avr32/pgalloc.h +++ b/include/asm-avr32/pgalloc.h | |||
@@ -28,7 +28,7 @@ static __inline__ void pmd_populate(struct mm_struct *mm, pmd_t *pmd, | |||
28 | static __inline__ pgd_t *pgd_alloc(struct mm_struct *mm) | 28 | static __inline__ pgd_t *pgd_alloc(struct mm_struct *mm) |
29 | { | 29 | { |
30 | unsigned int pgd_size = (USER_PTRS_PER_PGD * sizeof(pgd_t)); | 30 | unsigned int pgd_size = (USER_PTRS_PER_PGD * sizeof(pgd_t)); |
31 | pgd_t *pgd = (pgd_t *)kmalloc(pgd_size, GFP_KERNEL); | 31 | pgd_t *pgd = kmalloc(pgd_size, GFP_KERNEL); |
32 | 32 | ||
33 | if (pgd) | 33 | if (pgd) |
34 | memset(pgd, 0, pgd_size); | 34 | memset(pgd, 0, pgd_size); |
diff --git a/include/asm-sh64/pgalloc.h b/include/asm-sh64/pgalloc.h index b29dd468817e..cb803e56cb64 100644 --- a/include/asm-sh64/pgalloc.h +++ b/include/asm-sh64/pgalloc.h | |||
@@ -41,7 +41,7 @@ static inline void pgd_init(unsigned long page) | |||
41 | static inline pgd_t *get_pgd_slow(void) | 41 | static inline pgd_t *get_pgd_slow(void) |
42 | { | 42 | { |
43 | unsigned int pgd_size = (USER_PTRS_PER_PGD * sizeof(pgd_t)); | 43 | unsigned int pgd_size = (USER_PTRS_PER_PGD * sizeof(pgd_t)); |
44 | pgd_t *ret = (pgd_t *)kmalloc(pgd_size, GFP_KERNEL); | 44 | pgd_t *ret = kmalloc(pgd_size, GFP_KERNEL); |
45 | return ret; | 45 | return ret; |
46 | } | 46 | } |
47 | 47 | ||
diff --git a/include/linux/coda_linux.h b/include/linux/coda_linux.h index be512cc98791..4c2632a8d31b 100644 --- a/include/linux/coda_linux.h +++ b/include/linux/coda_linux.h | |||
@@ -64,7 +64,7 @@ void coda_sysctl_clean(void); | |||
64 | 64 | ||
65 | #define CODA_ALLOC(ptr, cast, size) do { \ | 65 | #define CODA_ALLOC(ptr, cast, size) do { \ |
66 | if (size < PAGE_SIZE) \ | 66 | if (size < PAGE_SIZE) \ |
67 | ptr = (cast)kmalloc((unsigned long) size, GFP_KERNEL); \ | 67 | ptr = kmalloc((unsigned long) size, GFP_KERNEL); \ |
68 | else \ | 68 | else \ |
69 | ptr = (cast)vmalloc((unsigned long) size); \ | 69 | ptr = (cast)vmalloc((unsigned long) size); \ |
70 | if (!ptr) \ | 70 | if (!ptr) \ |
diff --git a/ipc/msgutil.c b/ipc/msgutil.c index 0992616eeed6..c82c215693d7 100644 --- a/ipc/msgutil.c +++ b/ipc/msgutil.c | |||
@@ -36,7 +36,7 @@ struct msg_msg *load_msg(const void __user *src, int len) | |||
36 | if (alen > DATALEN_MSG) | 36 | if (alen > DATALEN_MSG) |
37 | alen = DATALEN_MSG; | 37 | alen = DATALEN_MSG; |
38 | 38 | ||
39 | msg = (struct msg_msg *)kmalloc(sizeof(*msg) + alen, GFP_KERNEL); | 39 | msg = kmalloc(sizeof(*msg) + alen, GFP_KERNEL); |
40 | if (msg == NULL) | 40 | if (msg == NULL) |
41 | return ERR_PTR(-ENOMEM); | 41 | return ERR_PTR(-ENOMEM); |
42 | 42 | ||
@@ -56,7 +56,7 @@ struct msg_msg *load_msg(const void __user *src, int len) | |||
56 | alen = len; | 56 | alen = len; |
57 | if (alen > DATALEN_SEG) | 57 | if (alen > DATALEN_SEG) |
58 | alen = DATALEN_SEG; | 58 | alen = DATALEN_SEG; |
59 | seg = (struct msg_msgseg *)kmalloc(sizeof(*seg) + alen, | 59 | seg = kmalloc(sizeof(*seg) + alen, |
60 | GFP_KERNEL); | 60 | GFP_KERNEL); |
61 | if (seg == NULL) { | 61 | if (seg == NULL) { |
62 | err = -ENOMEM; | 62 | err = -ENOMEM; |
diff --git a/net/tipc/config.c b/net/tipc/config.c index 458a2c46cef3..baf55c459c8b 100644 --- a/net/tipc/config.c +++ b/net/tipc/config.c | |||
@@ -208,7 +208,7 @@ static void cfg_cmd_event(struct tipc_cmd_msg *msg, | |||
208 | 208 | ||
209 | if (mng.link_subscriptions > 64) | 209 | if (mng.link_subscriptions > 64) |
210 | break; | 210 | break; |
211 | sub = (struct subscr_data *)kmalloc(sizeof(*sub), | 211 | sub = kmalloc(sizeof(*sub), |
212 | GFP_ATOMIC); | 212 | GFP_ATOMIC); |
213 | if (sub == NULL) { | 213 | if (sub == NULL) { |
214 | warn("Memory squeeze; dropped remote link subscription\n"); | 214 | warn("Memory squeeze; dropped remote link subscription\n"); |
diff --git a/sound/core/oss/mixer_oss.c b/sound/core/oss/mixer_oss.c index f4c67042e3ac..3391f2a9b4d1 100644 --- a/sound/core/oss/mixer_oss.c +++ b/sound/core/oss/mixer_oss.c | |||
@@ -1023,7 +1023,7 @@ static int snd_mixer_oss_build_input(struct snd_mixer_oss *mixer, struct snd_mix | |||
1023 | } | 1023 | } |
1024 | up_read(&mixer->card->controls_rwsem); | 1024 | up_read(&mixer->card->controls_rwsem); |
1025 | if (slot.present != 0) { | 1025 | if (slot.present != 0) { |
1026 | pslot = (struct slot *)kmalloc(sizeof(slot), GFP_KERNEL); | 1026 | pslot = kmalloc(sizeof(slot), GFP_KERNEL); |
1027 | if (! pslot) | 1027 | if (! pslot) |
1028 | return -ENOMEM; | 1028 | return -ENOMEM; |
1029 | *pslot = slot; | 1029 | *pslot = slot; |
diff --git a/sound/oss/ad1848.c b/sound/oss/ad1848.c index 0ffa9970bf0f..7cf9913a47b2 100644 --- a/sound/oss/ad1848.c +++ b/sound/oss/ad1848.c | |||
@@ -1992,7 +1992,7 @@ int ad1848_init (char *name, struct resource *ports, int irq, int dma_playback, | |||
1992 | devc->audio_flags |= DMA_DUPLEX; | 1992 | devc->audio_flags |= DMA_DUPLEX; |
1993 | } | 1993 | } |
1994 | 1994 | ||
1995 | portc = (ad1848_port_info *) kmalloc(sizeof(ad1848_port_info), GFP_KERNEL); | 1995 | portc = kmalloc(sizeof(ad1848_port_info), GFP_KERNEL); |
1996 | if(portc==NULL) { | 1996 | if(portc==NULL) { |
1997 | release_region(devc->base, 4); | 1997 | release_region(devc->base, 4); |
1998 | return -1; | 1998 | return -1; |
diff --git a/sound/oss/cs4232.c b/sound/oss/cs4232.c index b6924c7f1484..de40e21bf279 100644 --- a/sound/oss/cs4232.c +++ b/sound/oss/cs4232.c | |||
@@ -408,7 +408,7 @@ static int __init cs4232_pnp_probe(struct pnp_dev *dev, const struct pnp_device_ | |||
408 | { | 408 | { |
409 | struct address_info *isapnpcfg; | 409 | struct address_info *isapnpcfg; |
410 | 410 | ||
411 | isapnpcfg=(struct address_info*)kmalloc(sizeof(*isapnpcfg),GFP_KERNEL); | 411 | isapnpcfg = kmalloc(sizeof(*isapnpcfg),GFP_KERNEL); |
412 | if (!isapnpcfg) | 412 | if (!isapnpcfg) |
413 | return -ENOMEM; | 413 | return -ENOMEM; |
414 | 414 | ||
diff --git a/sound/oss/emu10k1/audio.c b/sound/oss/emu10k1/audio.c index 49f902f35c28..efcf589d7083 100644 --- a/sound/oss/emu10k1/audio.c +++ b/sound/oss/emu10k1/audio.c | |||
@@ -1139,7 +1139,7 @@ static int emu10k1_audio_open(struct inode *inode, struct file *file) | |||
1139 | 1139 | ||
1140 | match: | 1140 | match: |
1141 | 1141 | ||
1142 | wave_dev = (struct emu10k1_wavedevice *) kmalloc(sizeof(struct emu10k1_wavedevice), GFP_KERNEL); | 1142 | wave_dev = kmalloc(sizeof(struct emu10k1_wavedevice), GFP_KERNEL); |
1143 | 1143 | ||
1144 | if (wave_dev == NULL) { | 1144 | if (wave_dev == NULL) { |
1145 | ERROR(); | 1145 | ERROR(); |
@@ -1155,7 +1155,7 @@ match: | |||
1155 | /* Recording */ | 1155 | /* Recording */ |
1156 | struct wiinst *wiinst; | 1156 | struct wiinst *wiinst; |
1157 | 1157 | ||
1158 | if ((wiinst = (struct wiinst *) kmalloc(sizeof(struct wiinst), GFP_KERNEL)) == NULL) { | 1158 | if ((wiinst = kmalloc(sizeof(struct wiinst), GFP_KERNEL)) == NULL) { |
1159 | ERROR(); | 1159 | ERROR(); |
1160 | kfree(wave_dev); | 1160 | kfree(wave_dev); |
1161 | return -ENOMEM; | 1161 | return -ENOMEM; |
@@ -1211,7 +1211,7 @@ match: | |||
1211 | struct woinst *woinst; | 1211 | struct woinst *woinst; |
1212 | int i; | 1212 | int i; |
1213 | 1213 | ||
1214 | if ((woinst = (struct woinst *) kmalloc(sizeof(struct woinst), GFP_KERNEL)) == NULL) { | 1214 | if ((woinst = kmalloc(sizeof(struct woinst), GFP_KERNEL)) == NULL) { |
1215 | ERROR(); | 1215 | ERROR(); |
1216 | kfree(wave_dev); | 1216 | kfree(wave_dev); |
1217 | return -ENOMEM; | 1217 | return -ENOMEM; |
diff --git a/sound/oss/emu10k1/cardmi.c b/sound/oss/emu10k1/cardmi.c index 0545814cc67d..57674f8c8a2e 100644 --- a/sound/oss/emu10k1/cardmi.c +++ b/sound/oss/emu10k1/cardmi.c | |||
@@ -157,7 +157,7 @@ int emu10k1_mpuin_add_buffer(struct emu10k1_mpuin *card_mpuin, struct midi_hdr * | |||
157 | midihdr->flags |= MIDIBUF_INQUEUE; /* set */ | 157 | midihdr->flags |= MIDIBUF_INQUEUE; /* set */ |
158 | midihdr->flags &= ~MIDIBUF_DONE; /* clear */ | 158 | midihdr->flags &= ~MIDIBUF_DONE; /* clear */ |
159 | 159 | ||
160 | if ((midiq = (struct midi_queue *) kmalloc(sizeof(struct midi_queue), GFP_ATOMIC)) == NULL) { | 160 | if ((midiq = kmalloc(sizeof(struct midi_queue), GFP_ATOMIC)) == NULL) { |
161 | /* Message lost */ | 161 | /* Message lost */ |
162 | return -1; | 162 | return -1; |
163 | } | 163 | } |
diff --git a/sound/oss/emu10k1/cardmo.c b/sound/oss/emu10k1/cardmo.c index 5938d31f9e21..a8cc75db3e45 100644 --- a/sound/oss/emu10k1/cardmo.c +++ b/sound/oss/emu10k1/cardmo.c | |||
@@ -117,7 +117,7 @@ int emu10k1_mpuout_add_buffer(struct emu10k1_card *card, struct midi_hdr *midihd | |||
117 | midihdr->flags |= MIDIBUF_INQUEUE; | 117 | midihdr->flags |= MIDIBUF_INQUEUE; |
118 | midihdr->flags &= ~MIDIBUF_DONE; | 118 | midihdr->flags &= ~MIDIBUF_DONE; |
119 | 119 | ||
120 | if ((midiq = (struct midi_queue *) kmalloc(sizeof(struct midi_queue), GFP_KERNEL)) == NULL) { | 120 | if ((midiq = kmalloc(sizeof(struct midi_queue), GFP_KERNEL)) == NULL) { |
121 | /* Message lost */ | 121 | /* Message lost */ |
122 | return -1; | 122 | return -1; |
123 | } | 123 | } |
diff --git a/sound/oss/emu10k1/midi.c b/sound/oss/emu10k1/midi.c index 8ac77df86397..cca3dad2bdf4 100644 --- a/sound/oss/emu10k1/midi.c +++ b/sound/oss/emu10k1/midi.c | |||
@@ -58,7 +58,7 @@ static int midiin_add_buffer(struct emu10k1_mididevice *midi_dev, struct midi_hd | |||
58 | { | 58 | { |
59 | struct midi_hdr *midihdr; | 59 | struct midi_hdr *midihdr; |
60 | 60 | ||
61 | if ((midihdr = (struct midi_hdr *) kmalloc(sizeof(struct midi_hdr), GFP_KERNEL)) == NULL) { | 61 | if ((midihdr = kmalloc(sizeof(struct midi_hdr), GFP_KERNEL)) == NULL) { |
62 | ERROR(); | 62 | ERROR(); |
63 | return -EINVAL; | 63 | return -EINVAL; |
64 | } | 64 | } |
@@ -128,7 +128,7 @@ match: | |||
128 | mutex_lock(&card->open_sem); | 128 | mutex_lock(&card->open_sem); |
129 | } | 129 | } |
130 | 130 | ||
131 | if ((midi_dev = (struct emu10k1_mididevice *) kmalloc(sizeof(*midi_dev), GFP_KERNEL)) == NULL) | 131 | if ((midi_dev = kmalloc(sizeof(*midi_dev), GFP_KERNEL)) == NULL) |
132 | return -EINVAL; | 132 | return -EINVAL; |
133 | 133 | ||
134 | midi_dev->card = card; | 134 | midi_dev->card = card; |
@@ -328,7 +328,7 @@ static ssize_t emu10k1_midi_write(struct file *file, const char __user *buffer, | |||
328 | if (!access_ok(VERIFY_READ, buffer, count)) | 328 | if (!access_ok(VERIFY_READ, buffer, count)) |
329 | return -EFAULT; | 329 | return -EFAULT; |
330 | 330 | ||
331 | if ((midihdr = (struct midi_hdr *) kmalloc(sizeof(struct midi_hdr), GFP_KERNEL)) == NULL) | 331 | if ((midihdr = kmalloc(sizeof(struct midi_hdr), GFP_KERNEL)) == NULL) |
332 | return -EINVAL; | 332 | return -EINVAL; |
333 | 333 | ||
334 | midihdr->bufferlength = count; | 334 | midihdr->bufferlength = count; |
@@ -490,7 +490,7 @@ int emu10k1_seq_midi_open(int dev, int mode, | |||
490 | 490 | ||
491 | DPF(2, "emu10k1_seq_midi_open()\n"); | 491 | DPF(2, "emu10k1_seq_midi_open()\n"); |
492 | 492 | ||
493 | if ((midi_dev = (struct emu10k1_mididevice *) kmalloc(sizeof(*midi_dev), GFP_KERNEL)) == NULL) | 493 | if ((midi_dev = kmalloc(sizeof(*midi_dev), GFP_KERNEL)) == NULL) |
494 | return -EINVAL; | 494 | return -EINVAL; |
495 | 495 | ||
496 | midi_dev->card = card; | 496 | midi_dev->card = card; |
@@ -540,7 +540,7 @@ int emu10k1_seq_midi_out(int dev, unsigned char midi_byte) | |||
540 | 540 | ||
541 | card = midi_devs[dev]->devc; | 541 | card = midi_devs[dev]->devc; |
542 | 542 | ||
543 | if ((midihdr = (struct midi_hdr *) kmalloc(sizeof(struct midi_hdr), GFP_KERNEL)) == NULL) | 543 | if ((midihdr = kmalloc(sizeof(struct midi_hdr), GFP_KERNEL)) == NULL) |
544 | return -EINVAL; | 544 | return -EINVAL; |
545 | 545 | ||
546 | midihdr->bufferlength = 1; | 546 | midihdr->bufferlength = 1; |
diff --git a/sound/oss/emu10k1/mixer.c b/sound/oss/emu10k1/mixer.c index cbcaaa34189a..6419796c2ed7 100644 --- a/sound/oss/emu10k1/mixer.c +++ b/sound/oss/emu10k1/mixer.c | |||
@@ -194,7 +194,7 @@ static int emu10k1_private_mixer(struct emu10k1_card *card, unsigned int cmd, un | |||
194 | 194 | ||
195 | case SOUND_MIXER_PRIVATE3: | 195 | case SOUND_MIXER_PRIVATE3: |
196 | 196 | ||
197 | ctl = (struct mixer_private_ioctl *) kmalloc(sizeof(struct mixer_private_ioctl), GFP_KERNEL); | 197 | ctl = kmalloc(sizeof(struct mixer_private_ioctl), GFP_KERNEL); |
198 | if (ctl == NULL) | 198 | if (ctl == NULL) |
199 | return -ENOMEM; | 199 | return -ENOMEM; |
200 | 200 | ||
diff --git a/sound/oss/hal2.c b/sound/oss/hal2.c index 784bdd707055..d18286ccc14d 100644 --- a/sound/oss/hal2.c +++ b/sound/oss/hal2.c | |||
@@ -1435,7 +1435,7 @@ static int hal2_init_card(struct hal2_card **phal2, struct hpc3_regs *hpc3) | |||
1435 | int ret = 0; | 1435 | int ret = 0; |
1436 | struct hal2_card *hal2; | 1436 | struct hal2_card *hal2; |
1437 | 1437 | ||
1438 | hal2 = (struct hal2_card *) kmalloc(sizeof(struct hal2_card), GFP_KERNEL); | 1438 | hal2 = kmalloc(sizeof(struct hal2_card), GFP_KERNEL); |
1439 | if (!hal2) | 1439 | if (!hal2) |
1440 | return -ENOMEM; | 1440 | return -ENOMEM; |
1441 | memset(hal2, 0, sizeof(struct hal2_card)); | 1441 | memset(hal2, 0, sizeof(struct hal2_card)); |
diff --git a/sound/oss/mpu401.c b/sound/oss/mpu401.c index e96220541971..2796c0ef985f 100644 --- a/sound/oss/mpu401.c +++ b/sound/oss/mpu401.c | |||
@@ -1023,7 +1023,7 @@ int attach_mpu401(struct address_info *hw_config, struct module *owner) | |||
1023 | devc->capabilities |= MPU_CAP_INTLG; /* Supports intelligent mode */ | 1023 | devc->capabilities |= MPU_CAP_INTLG; /* Supports intelligent mode */ |
1024 | 1024 | ||
1025 | 1025 | ||
1026 | mpu401_synth_operations[m] = (struct synth_operations *)kmalloc(sizeof(struct synth_operations), GFP_KERNEL); | 1026 | mpu401_synth_operations[m] = kmalloc(sizeof(struct synth_operations), GFP_KERNEL); |
1027 | 1027 | ||
1028 | if (mpu401_synth_operations[m] == NULL) | 1028 | if (mpu401_synth_operations[m] == NULL) |
1029 | { | 1029 | { |
diff --git a/sound/oss/opl3.c b/sound/oss/opl3.c index 4799bc77f987..2e8cfa5481f2 100644 --- a/sound/oss/opl3.c +++ b/sound/oss/opl3.c | |||
@@ -166,7 +166,7 @@ int opl3_detect(int ioaddr, int *osp) | |||
166 | return 0; | 166 | return 0; |
167 | } | 167 | } |
168 | 168 | ||
169 | devc = (struct opl_devinfo *)kmalloc(sizeof(*devc), GFP_KERNEL); | 169 | devc = kmalloc(sizeof(*devc), GFP_KERNEL); |
170 | 170 | ||
171 | if (devc == NULL) | 171 | if (devc == NULL) |
172 | { | 172 | { |
diff --git a/sound/oss/sb_common.c b/sound/oss/sb_common.c index 440537c72604..07cbacf63824 100644 --- a/sound/oss/sb_common.c +++ b/sound/oss/sb_common.c | |||
@@ -625,7 +625,7 @@ int sb_dsp_detect(struct address_info *hw_config, int pci, int pciio, struct sb_ | |||
625 | */ | 625 | */ |
626 | 626 | ||
627 | 627 | ||
628 | detected_devc = (sb_devc *)kmalloc(sizeof(sb_devc), GFP_KERNEL); | 628 | detected_devc = kmalloc(sizeof(sb_devc), GFP_KERNEL); |
629 | if (detected_devc == NULL) | 629 | if (detected_devc == NULL) |
630 | { | 630 | { |
631 | printk(KERN_ERR "sb: Can't allocate memory for device information\n"); | 631 | printk(KERN_ERR "sb: Can't allocate memory for device information\n"); |
diff --git a/sound/oss/sb_midi.c b/sound/oss/sb_midi.c index 2e3bc045caba..8b796704e112 100644 --- a/sound/oss/sb_midi.c +++ b/sound/oss/sb_midi.c | |||
@@ -173,7 +173,7 @@ void sb_dsp_midi_init(sb_devc * devc, struct module *owner) | |||
173 | return; | 173 | return; |
174 | } | 174 | } |
175 | std_midi_synth.midi_dev = devc->my_mididev = dev; | 175 | std_midi_synth.midi_dev = devc->my_mididev = dev; |
176 | midi_devs[dev] = (struct midi_operations *)kmalloc(sizeof(struct midi_operations), GFP_KERNEL); | 176 | midi_devs[dev] = kmalloc(sizeof(struct midi_operations), GFP_KERNEL); |
177 | if (midi_devs[dev] == NULL) | 177 | if (midi_devs[dev] == NULL) |
178 | { | 178 | { |
179 | printk(KERN_WARNING "Sound Blaster: failed to allocate MIDI memory.\n"); | 179 | printk(KERN_WARNING "Sound Blaster: failed to allocate MIDI memory.\n"); |
@@ -189,7 +189,7 @@ void sb_dsp_midi_init(sb_devc * devc, struct module *owner) | |||
189 | midi_devs[dev]->devc = devc; | 189 | midi_devs[dev]->devc = devc; |
190 | 190 | ||
191 | 191 | ||
192 | midi_devs[dev]->converter = (struct synth_operations *)kmalloc(sizeof(struct synth_operations), GFP_KERNEL); | 192 | midi_devs[dev]->converter = kmalloc(sizeof(struct synth_operations), GFP_KERNEL); |
193 | if (midi_devs[dev]->converter == NULL) | 193 | if (midi_devs[dev]->converter == NULL) |
194 | { | 194 | { |
195 | printk(KERN_WARNING "Sound Blaster: failed to allocate MIDI memory.\n"); | 195 | printk(KERN_WARNING "Sound Blaster: failed to allocate MIDI memory.\n"); |
diff --git a/sound/oss/sb_mixer.c b/sound/oss/sb_mixer.c index 238e2cf44b08..fad1a4f25ad6 100644 --- a/sound/oss/sb_mixer.c +++ b/sound/oss/sb_mixer.c | |||
@@ -734,7 +734,7 @@ int sb_mixer_init(sb_devc * devc, struct module *owner) | |||
734 | if (m == -1) | 734 | if (m == -1) |
735 | return 0; | 735 | return 0; |
736 | 736 | ||
737 | mixer_devs[m] = (struct mixer_operations *)kmalloc(sizeof(struct mixer_operations), GFP_KERNEL); | 737 | mixer_devs[m] = kmalloc(sizeof(struct mixer_operations), GFP_KERNEL); |
738 | if (mixer_devs[m] == NULL) | 738 | if (mixer_devs[m] == NULL) |
739 | { | 739 | { |
740 | printk(KERN_ERR "sb_mixer: Can't allocate memory\n"); | 740 | printk(KERN_ERR "sb_mixer: Can't allocate memory\n"); |
diff --git a/sound/oss/v_midi.c b/sound/oss/v_midi.c index d952b2264da1..103940fd5b4f 100644 --- a/sound/oss/v_midi.c +++ b/sound/oss/v_midi.c | |||
@@ -183,7 +183,7 @@ static void __init attach_v_midi (struct address_info *hw_config) | |||
183 | return; | 183 | return; |
184 | } | 184 | } |
185 | 185 | ||
186 | m=(struct vmidi_memory *)kmalloc(sizeof(struct vmidi_memory), GFP_KERNEL); | 186 | m = kmalloc(sizeof(struct vmidi_memory), GFP_KERNEL); |
187 | if (m == NULL) | 187 | if (m == NULL) |
188 | { | 188 | { |
189 | printk(KERN_WARNING "Loopback MIDI: Failed to allocate memory\n"); | 189 | printk(KERN_WARNING "Loopback MIDI: Failed to allocate memory\n"); |
diff --git a/sound/oss/waveartist.c b/sound/oss/waveartist.c index c5bf363d32c2..26a7c6af95bc 100644 --- a/sound/oss/waveartist.c +++ b/sound/oss/waveartist.c | |||
@@ -1267,7 +1267,7 @@ static int __init waveartist_init(wavnc_info *devc) | |||
1267 | conf_printf2(dev_name, devc->hw.io_base, devc->hw.irq, | 1267 | conf_printf2(dev_name, devc->hw.io_base, devc->hw.irq, |
1268 | devc->hw.dma, devc->hw.dma2); | 1268 | devc->hw.dma, devc->hw.dma2); |
1269 | 1269 | ||
1270 | portc = (wavnc_port_info *)kmalloc(sizeof(wavnc_port_info), GFP_KERNEL); | 1270 | portc = kmalloc(sizeof(wavnc_port_info), GFP_KERNEL); |
1271 | if (portc == NULL) | 1271 | if (portc == NULL) |
1272 | goto nomem; | 1272 | goto nomem; |
1273 | 1273 | ||