Skip to content

Commit

Permalink
[PATCH] getting rid of all casts of k[cmz]alloc() calls
Browse files Browse the repository at this point in the history
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 <[email protected]>, Ian Molton <[email protected]>
Cc: Mikael Starvik <[email protected]>
Cc: Yoshinori Sato <[email protected]>
Cc: Roman Zippel <[email protected]>
Cc: Geert Uytterhoeven <[email protected]>
Cc: Ralf Baechle <[email protected]>
Cc: Paul Mackerras <[email protected]>
Cc: Kyle McMartin <[email protected]>
Cc: Benjamin Herrenschmidt <[email protected]>
Cc: Martin Schwidefsky <[email protected]>
Cc: "David S. Miller" <[email protected]>
Cc: Jeff Dike <[email protected]>
Cc: Greg KH <[email protected]>
Cc: Jens Axboe <[email protected]>
Cc: Paul Fulghum <[email protected]>
Cc: Alan Cox <[email protected]>
Cc: Karsten Keil <[email protected]>
Cc: Mauro Carvalho Chehab <[email protected]>
Cc: Jeff Garzik <[email protected]>
Cc: James Bottomley <[email protected]>
Cc: Ian Kent <[email protected]>
Cc: Steven French <[email protected]>
Cc: David Woodhouse <[email protected]>
Cc: Neil Brown <[email protected]>
Cc: Jaroslav Kysela <[email protected]>
Cc: Takashi Iwai <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
  • Loading branch information
Robert P. J. Day authored and Linus Torvalds committed Dec 13, 2006
1 parent 0743b86 commit 5cbded5
Show file tree
Hide file tree
Showing 172 changed files with 250 additions and 250 deletions.
2 changes: 1 addition & 1 deletion arch/arm/kernel/apm.c
Original file line number Diff line number Diff line change
Expand Up @@ -423,7 +423,7 @@ static int apm_open(struct inode * inode, struct file * filp)
{
struct apm_user *as;

as = (struct apm_user *)kzalloc(sizeof(*as), GFP_KERNEL);
as = kzalloc(sizeof(*as), GFP_KERNEL);
if (as) {
/*
* XXX - this is a tiny bit broken, when we consider BSD
Expand Down
2 changes: 1 addition & 1 deletion arch/arm/kernel/ecard.c
Original file line number Diff line number Diff line change
Expand Up @@ -353,7 +353,7 @@ int ecard_readchunk(struct in_chunk_dir *cd, ecard_t *ec, int id, int num)
}
if (c_id(&excd) == 0x80) { /* loader */
if (!ec->loader) {
ec->loader = (loader_t)kmalloc(c_len(&excd),
ec->loader = kmalloc(c_len(&excd),
GFP_KERNEL);
if (ec->loader)
ecard_readbytes(ec->loader, ec,
Expand Down
2 changes: 1 addition & 1 deletion arch/arm26/kernel/ecard.c
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,7 @@ int ecard_readchunk(struct in_chunk_dir *cd, ecard_t *ec, int id, int num)
}
if (c_id(&excd) == 0x80) { /* loader */
if (!ec->loader) {
ec->loader = (loader_t)kmalloc(c_len(&excd),
ec->loader = kmalloc(c_len(&excd),
GFP_KERNEL);
if (ec->loader)
ecard_readbytes(ec->loader, ec,
Expand Down
2 changes: 1 addition & 1 deletion arch/arm26/kernel/irq.c
Original file line number Diff line number Diff line change
Expand Up @@ -545,7 +545,7 @@ int request_irq(unsigned int irq, irqreturn_t (*handler)(int, void *, struct pt_
(irq_flags & IRQF_SHARED && !dev_id))
return -EINVAL;

action = (struct irqaction *)kmalloc(sizeof(struct irqaction), GFP_KERNEL);
action = kmalloc(sizeof(struct irqaction), GFP_KERNEL);
if (!action)
return -ENOMEM;

Expand Down
2 changes: 1 addition & 1 deletion arch/cris/arch-v10/drivers/axisflashmap.c
Original file line number Diff line number Diff line change
Expand Up @@ -516,7 +516,7 @@ static int __init init_axis_flash(void)
#else
struct mtd_info *mtd_ram;

mtd_ram = (struct mtd_info *)kmalloc(sizeof(struct mtd_info),
mtd_ram = kmalloc(sizeof(struct mtd_info),
GFP_KERNEL);
if (!mtd_ram) {
panic("axisflashmap couldn't allocate memory for "
Expand Down
2 changes: 1 addition & 1 deletion arch/cris/arch-v10/drivers/gpio.c
Original file line number Diff line number Diff line change
Expand Up @@ -440,7 +440,7 @@ gpio_open(struct inode *inode, struct file *filp)
if (p > GPIO_MINOR_LAST)
return -EINVAL;

priv = (struct gpio_private *)kmalloc(sizeof(struct gpio_private),
priv = kmalloc(sizeof(struct gpio_private),
GFP_KERNEL);

if (!priv)
Expand Down
2 changes: 1 addition & 1 deletion arch/cris/arch-v32/drivers/axisflashmap.c
Original file line number Diff line number Diff line change
Expand Up @@ -427,7 +427,7 @@ static int __init init_axis_flash(void)
#else
struct mtd_info *mtd_ram;

mtd_ram = (struct mtd_info *)kmalloc(sizeof(struct mtd_info),
mtd_ram = kmalloc(sizeof(struct mtd_info),
GFP_KERNEL);
if (!mtd_ram) {
panic("axisflashmap couldn't allocate memory for "
Expand Down
2 changes: 1 addition & 1 deletion arch/cris/arch-v32/drivers/gpio.c
Original file line number Diff line number Diff line change
Expand Up @@ -423,7 +423,7 @@ gpio_open(struct inode *inode, struct file *filp)
if (p > GPIO_MINOR_LAST)
return -EINVAL;

priv = (struct gpio_private *)kmalloc(sizeof(struct gpio_private),
priv = kmalloc(sizeof(struct gpio_private),
GFP_KERNEL);

if (!priv)
Expand Down
2 changes: 1 addition & 1 deletion arch/cris/arch-v32/kernel/signal.c
Original file line number Diff line number Diff line change
Expand Up @@ -686,7 +686,7 @@ keep_debug_flags(unsigned long oldccs, unsigned long oldspc,
int __init
cris_init_signal(void)
{
u16* data = (u16*)kmalloc(PAGE_SIZE, GFP_KERNEL);
u16* data = kmalloc(PAGE_SIZE, GFP_KERNEL);

/* This is movu.w __NR_sigreturn, r9; break 13; */
data[0] = 0x9c5f;
Expand Down
2 changes: 1 addition & 1 deletion arch/cris/kernel/profile.c
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ static int
__init init_cris_profile(void)
{
struct proc_dir_entry *entry;
sample_buffer = (char*)kmalloc(SAMPLE_BUFFER_SIZE, GFP_KERNEL);
sample_buffer = kmalloc(SAMPLE_BUFFER_SIZE, GFP_KERNEL);
sample_buffer_pos = sample_buffer;
entry = create_proc_entry("system_profile", S_IWUSR | S_IRUGO, NULL);
if (entry) {
Expand Down
2 changes: 1 addition & 1 deletion arch/h8300/kernel/ints.c
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ int request_irq(unsigned int irq,
return -EBUSY;

if (use_kmalloc)
irq_handle = (irq_handler_t *)kmalloc(sizeof(irq_handler_t), GFP_ATOMIC);
irq_handle = kmalloc(sizeof(irq_handler_t), GFP_ATOMIC);
else {
/* use bootmem allocater */
irq_handle = (irq_handler_t *)alloc_bootmem(sizeof(irq_handler_t));
Expand Down
2 changes: 1 addition & 1 deletion arch/h8300/platform/h8s/ints.c
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ int request_irq(unsigned int irq,
}

if (use_kmalloc)
irq_handle = (irq_handler_t *)kmalloc(sizeof(irq_handler_t), GFP_ATOMIC);
irq_handle = kmalloc(sizeof(irq_handler_t), GFP_ATOMIC);
else {
/* use bootmem allocater */
irq_handle = (irq_handler_t *)alloc_bootmem(sizeof(irq_handler_t));
Expand Down
2 changes: 1 addition & 1 deletion arch/i386/kernel/apm.c
Original file line number Diff line number Diff line change
Expand Up @@ -1604,7 +1604,7 @@ static int do_open(struct inode * inode, struct file * filp)
{
struct apm_user * as;

as = (struct apm_user *)kmalloc(sizeof(*as), GFP_KERNEL);
as = kmalloc(sizeof(*as), GFP_KERNEL);
if (as == NULL) {
printk(KERN_ERR "apm: cannot allocate struct of size %d bytes\n",
sizeof(*as));
Expand Down
2 changes: 1 addition & 1 deletion arch/ia64/sn/kernel/sn2/sn_hwperf.c
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ static void print_pci_topology(struct seq_file *s)
int e;

for (sz = PAGE_SIZE; sz < 16 * PAGE_SIZE; sz += PAGE_SIZE) {
if (!(p = (char *)kmalloc(sz, GFP_KERNEL)))
if (!(p = kmalloc(sz, GFP_KERNEL)))
break;
e = ia64_sn_ioif_get_pci_topology(__pa(p), sz);
if (e == SALRET_OK)
Expand Down
2 changes: 1 addition & 1 deletion arch/m68k/mm/kmap.c
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ static struct vm_struct *get_io_area(unsigned long size)
unsigned long addr;
struct vm_struct **p, *tmp, *area;

area = (struct vm_struct *)kmalloc(sizeof(*area), GFP_KERNEL);
area = kmalloc(sizeof(*area), GFP_KERNEL);
if (!area)
return NULL;
addr = KMAP_START;
Expand Down
2 changes: 1 addition & 1 deletion arch/mips/kernel/apm.c
Original file line number Diff line number Diff line change
Expand Up @@ -356,7 +356,7 @@ static int apm_open(struct inode * inode, struct file * filp)
{
struct apm_user *as;

as = (struct apm_user *)kzalloc(sizeof(*as), GFP_KERNEL);
as = kzalloc(sizeof(*as), GFP_KERNEL);
if (as) {
/*
* XXX - this is a tiny bit broken, when we consider BSD
Expand Down
2 changes: 1 addition & 1 deletion arch/parisc/hpux/sys_hpux.c
Original file line number Diff line number Diff line change
Expand Up @@ -475,7 +475,7 @@ int hpux_sysfs(int opcode, unsigned long arg1, unsigned long arg2)
printk(KERN_DEBUG "len of arg1 = %d\n", len);
if (len == 0)
return 0;
fsname = (char *) kmalloc(len, GFP_KERNEL);
fsname = kmalloc(len, GFP_KERNEL);
if ( !fsname ) {
printk(KERN_DEBUG "failed to kmalloc fsname\n");
return 0;
Expand Down
2 changes: 1 addition & 1 deletion arch/parisc/kernel/unwind.c
Original file line number Diff line number Diff line change
Expand Up @@ -343,7 +343,7 @@ void unwind_frame_init_from_blocked_task(struct unwind_frame_info *info, struct
struct pt_regs *r = &t->thread.regs;
struct pt_regs *r2;

r2 = (struct pt_regs *)kmalloc(sizeof(struct pt_regs), GFP_KERNEL);
r2 = kmalloc(sizeof(struct pt_regs), GFP_KERNEL);
if (!r2)
return;
*r2 = *r;
Expand Down
4 changes: 2 additions & 2 deletions arch/powerpc/kernel/nvram_64.c
Original file line number Diff line number Diff line change
Expand Up @@ -505,7 +505,7 @@ static int nvram_scan_partitions(void)
return -ENODEV;
total_size = ppc_md.nvram_size();

header = (char *) kmalloc(NVRAM_HEADER_LEN, GFP_KERNEL);
header = kmalloc(NVRAM_HEADER_LEN, GFP_KERNEL);
if (!header) {
printk(KERN_ERR "nvram_scan_partitions: Failed kmalloc\n");
return -ENOMEM;
Expand Down Expand Up @@ -574,7 +574,7 @@ static int __init nvram_init(void)
}

/* initialize our anchor for the nvram partition list */
nvram_part = (struct nvram_partition *) kmalloc(sizeof(struct nvram_partition), GFP_KERNEL);
nvram_part = kmalloc(sizeof(struct nvram_partition), GFP_KERNEL);
if (!nvram_part) {
printk(KERN_ERR "nvram_init: Failed kmalloc\n");
return -ENOMEM;
Expand Down
2 changes: 1 addition & 1 deletion arch/powerpc/kernel/pci_32.c
Original file line number Diff line number Diff line change
Expand Up @@ -670,7 +670,7 @@ pcibios_make_OF_bus_map(void)
struct pci_controller* hose;
struct property *map_prop;

pci_to_OF_bus_map = (u8*)kmalloc(pci_bus_count, GFP_KERNEL);
pci_to_OF_bus_map = kmalloc(pci_bus_count, GFP_KERNEL);
if (!pci_to_OF_bus_map) {
printk(KERN_ERR "Can't allocate OF bus map !\n");
return;
Expand Down
6 changes: 3 additions & 3 deletions arch/powerpc/mm/imalloc.c
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ static struct vm_struct * split_im_region(unsigned long v_addr,
struct vm_struct *vm2 = NULL;
struct vm_struct *new_vm = NULL;

vm1 = (struct vm_struct *) kmalloc(sizeof(*vm1), GFP_KERNEL);
vm1 = kmalloc(sizeof(*vm1), GFP_KERNEL);
if (vm1 == NULL) {
printk(KERN_ERR "%s() out of memory\n", __FUNCTION__);
return NULL;
Expand Down Expand Up @@ -172,7 +172,7 @@ static struct vm_struct * split_im_region(unsigned long v_addr,
* uppermost remainder, and use existing parent one for the
* lower remainder of parent range
*/
vm2 = (struct vm_struct *) kmalloc(sizeof(*vm2), GFP_KERNEL);
vm2 = kmalloc(sizeof(*vm2), GFP_KERNEL);
if (vm2 == NULL) {
printk(KERN_ERR "%s() out of memory\n", __FUNCTION__);
kfree(vm1);
Expand Down Expand Up @@ -206,7 +206,7 @@ static struct vm_struct * __add_new_im_area(unsigned long req_addr,
break;
}

area = (struct vm_struct *) kmalloc(sizeof(*area), GFP_KERNEL);
area = kmalloc(sizeof(*area), GFP_KERNEL);
if (!area)
return NULL;
area->flags = 0;
Expand Down
2 changes: 1 addition & 1 deletion arch/powerpc/platforms/pseries/eeh_cache.c
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ pci_addr_cache_insert(struct pci_dev *dev, unsigned long alo,
return piar;
}
}
piar = (struct pci_io_addr_range *)kmalloc(sizeof(struct pci_io_addr_range), GFP_ATOMIC);
piar = kmalloc(sizeof(struct pci_io_addr_range), GFP_ATOMIC);
if (!piar)
return NULL;

Expand Down
4 changes: 2 additions & 2 deletions arch/ppc/8260_io/fcc_enet.c
Original file line number Diff line number Diff line change
Expand Up @@ -1892,10 +1892,10 @@ init_fcc_param(fcc_info_t *fip, struct net_device *dev,
/* Allocate space for the buffer descriptors from regular memory.
* Initialize base addresses for the buffer descriptors.
*/
cep->rx_bd_base = (cbd_t *)kmalloc(sizeof(cbd_t) * RX_RING_SIZE,
cep->rx_bd_base = kmalloc(sizeof(cbd_t) * RX_RING_SIZE,
GFP_KERNEL | GFP_DMA);
ep->fen_genfcc.fcc_rbase = __pa(cep->rx_bd_base);
cep->tx_bd_base = (cbd_t *)kmalloc(sizeof(cbd_t) * TX_RING_SIZE,
cep->tx_bd_base = kmalloc(sizeof(cbd_t) * TX_RING_SIZE,
GFP_KERNEL | GFP_DMA);
ep->fen_genfcc.fcc_tbase = __pa(cep->tx_bd_base);

Expand Down
2 changes: 1 addition & 1 deletion arch/ppc/8xx_io/cs4218_tdm.c
Original file line number Diff line number Diff line change
Expand Up @@ -2601,7 +2601,7 @@ int __init tdm8xx_sound_init(void)
/* Initialize beep stuff */
orig_mksound = kd_mksound;
kd_mksound = cs_mksound;
beep_buf = (short *) kmalloc(BEEP_BUFLEN * 4, GFP_KERNEL);
beep_buf = kmalloc(BEEP_BUFLEN * 4, GFP_KERNEL);
if (beep_buf == NULL)
printk(KERN_WARNING "dmasound: no memory for "
"beep buffer\n");
Expand Down
8 changes: 4 additions & 4 deletions arch/s390/kernel/debug.c
Original file line number Diff line number Diff line change
Expand Up @@ -191,13 +191,13 @@ debug_areas_alloc(int pages_per_area, int nr_areas)
debug_entry_t*** areas;
int i,j;

areas = (debug_entry_t ***) kmalloc(nr_areas *
areas = kmalloc(nr_areas *
sizeof(debug_entry_t**),
GFP_KERNEL);
if (!areas)
goto fail_malloc_areas;
for (i = 0; i < nr_areas; i++) {
areas[i] = (debug_entry_t**) kmalloc(pages_per_area *
areas[i] = kmalloc(pages_per_area *
sizeof(debug_entry_t*),GFP_KERNEL);
if (!areas[i]) {
goto fail_malloc_areas2;
Expand Down Expand Up @@ -242,7 +242,7 @@ debug_info_alloc(char *name, int pages_per_area, int nr_areas, int buf_size,

/* alloc everything */

rc = (debug_info_t*) kmalloc(sizeof(debug_info_t), GFP_KERNEL);
rc = kmalloc(sizeof(debug_info_t), GFP_KERNEL);
if(!rc)
goto fail_malloc_rc;
rc->active_entries = kcalloc(nr_areas, sizeof(int), GFP_KERNEL);
Expand Down Expand Up @@ -634,7 +634,7 @@ debug_open(struct inode *inode, struct file *file)
rc = -ENOMEM;
goto out;
}
p_info = (file_private_info_t *) kmalloc(sizeof(file_private_info_t),
p_info = kmalloc(sizeof(file_private_info_t),
GFP_KERNEL);
if(!p_info){
if(debug_info_snapshot)
Expand Down
2 changes: 1 addition & 1 deletion arch/s390/kernel/s390_ext.c
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ int register_external_interrupt(__u16 code, ext_int_handler_t handler)
ext_int_info_t *p;
int index;

p = (ext_int_info_t *) kmalloc(sizeof(ext_int_info_t), GFP_ATOMIC);
p = kmalloc(sizeof(ext_int_info_t), GFP_ATOMIC);
if (p == NULL)
return -ENOMEM;
p->code = code;
Expand Down
4 changes: 2 additions & 2 deletions arch/sparc/kernel/irq.c
Original file line number Diff line number Diff line change
Expand Up @@ -425,7 +425,7 @@ int request_fast_irq(unsigned int irq,
}

if (action == NULL)
action = (struct irqaction *)kmalloc(sizeof(struct irqaction),
action = kmalloc(sizeof(struct irqaction),
GFP_ATOMIC);

if (!action) {
Expand Down Expand Up @@ -528,7 +528,7 @@ int request_irq(unsigned int irq,
}

if (action == NULL)
action = (struct irqaction *)kmalloc(sizeof(struct irqaction),
action = kmalloc(sizeof(struct irqaction),
GFP_ATOMIC);

if (!action) {
Expand Down
2 changes: 1 addition & 1 deletion arch/sparc/kernel/sun4d_irq.c
Original file line number Diff line number Diff line change
Expand Up @@ -327,7 +327,7 @@ int sun4d_request_irq(unsigned int irq,
}

if (action == NULL)
action = (struct irqaction *)kmalloc(sizeof(struct irqaction),
action = kmalloc(sizeof(struct irqaction),
GFP_ATOMIC);

if (!action) {
Expand Down
4 changes: 2 additions & 2 deletions arch/sparc64/kernel/sys_sunos32.c
Original file line number Diff line number Diff line change
Expand Up @@ -1055,7 +1055,7 @@ asmlinkage int sunos_msgsys(int op, u32 arg1, u32 arg2, u32 arg3, u32 arg4)
break;
case 2:
rval = -EFAULT;
kmbuf = (struct msgbuf *)kmalloc(sizeof(struct msgbuf) + arg3,
kmbuf = kmalloc(sizeof(struct msgbuf) + arg3,
GFP_KERNEL);
if (!kmbuf)
break;
Expand All @@ -1078,7 +1078,7 @@ asmlinkage int sunos_msgsys(int op, u32 arg1, u32 arg2, u32 arg3, u32 arg4)
break;
case 3:
rval = -EFAULT;
kmbuf = (struct msgbuf *)kmalloc(sizeof(struct msgbuf) + arg3,
kmbuf = kmalloc(sizeof(struct msgbuf) + arg3,
GFP_KERNEL);
if (!kmbuf || sunos_msgbuf_get((struct msgbuf32 __user *)(unsigned long)arg2,
kmbuf, arg3))
Expand Down
4 changes: 2 additions & 2 deletions arch/um/sys-i386/ldt.c
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ static long read_ldt_from_host(void __user * ptr, unsigned long bytecount)
struct ptrace_ldt ptrace_ldt = (struct ptrace_ldt) {
.func = 0,
.bytecount = bytecount,
.ptr = (void *)kmalloc(bytecount, GFP_KERNEL)};
.ptr = kmalloc(bytecount, GFP_KERNEL)};
u32 cpu;

if(ptrace_ldt.ptr == NULL)
Expand Down Expand Up @@ -426,7 +426,7 @@ void ldt_get_host_info(void)
host_ldt_entries = dummy_list;
else {
size = (size + 1) * sizeof(dummy_list[0]);
host_ldt_entries = (short *)kmalloc(size, GFP_KERNEL);
host_ldt_entries = kmalloc(size, GFP_KERNEL);
if(host_ldt_entries == NULL) {
printk("ldt_get_host_info: couldn't allocate host ldt list\n");
goto out_free;
Expand Down
4 changes: 2 additions & 2 deletions drivers/acorn/block/fd1772.c
Original file line number Diff line number Diff line change
Expand Up @@ -1549,12 +1549,12 @@ int fd1772_init(void)
#ifdef TRACKBUFFER
BufferDrive = BufferSide = BufferTrack = -1;
/* Atari uses 512 - I want to eventually cope with 1K sectors */
DMABuffer = (char *)kmalloc((FD1772_MAX_SECTORS+1)*512,GFP_KERNEL);
DMABuffer = kmalloc((FD1772_MAX_SECTORS+1)*512,GFP_KERNEL);
TrackBuffer = DMABuffer + 512;
#else
/* Allocate memory for the DMAbuffer - on the Atari this takes it
out of some special memory... */
DMABuffer = (char *) kmalloc(2048); /* Copes with pretty large sectors */
DMABuffer = kmalloc(2048); /* Copes with pretty large sectors */
#endif
err = -ENOMEM;
if (!DMAbuffer)
Expand Down
4 changes: 2 additions & 2 deletions drivers/atm/eni.c
Original file line number Diff line number Diff line change
Expand Up @@ -1832,7 +1832,7 @@ static int __devinit eni_start(struct atm_dev *dev)
/* initialize memory management */
buffer_mem = eni_dev->mem - (buf - eni_dev->ram);
eni_dev->free_list_size = buffer_mem/MID_MIN_BUF_SIZE/2;
eni_dev->free_list = (struct eni_free *) kmalloc(
eni_dev->free_list = kmalloc(
sizeof(struct eni_free)*(eni_dev->free_list_size+1),GFP_KERNEL);
if (!eni_dev->free_list) {
printk(KERN_ERR DEV_LABEL "(itf %d): couldn't get free page\n",
Expand Down Expand Up @@ -2232,7 +2232,7 @@ static int __devinit eni_init_one(struct pci_dev *pci_dev,
goto out0;
}

eni_dev = (struct eni_dev *) kmalloc(sizeof(struct eni_dev),GFP_KERNEL);
eni_dev = kmalloc(sizeof(struct eni_dev),GFP_KERNEL);
if (!eni_dev) goto out0;
if (!cpu_zeroes) {
cpu_zeroes = pci_alloc_consistent(pci_dev,ENI_ZEROES_SIZE,
Expand Down
2 changes: 1 addition & 1 deletion drivers/atm/he.c
Original file line number Diff line number Diff line change
Expand Up @@ -2351,7 +2351,7 @@ he_open(struct atm_vcc *vcc)

cid = he_mkcid(he_dev, vpi, vci);

he_vcc = (struct he_vcc *) kmalloc(sizeof(struct he_vcc), GFP_ATOMIC);
he_vcc = kmalloc(sizeof(struct he_vcc), GFP_ATOMIC);
if (he_vcc == NULL) {
hprintk("unable to allocate he_vcc during open\n");
return -ENOMEM;
Expand Down
Loading

0 comments on commit 5cbded5

Please sign in to comment.