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 /drivers | |
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>
Diffstat (limited to 'drivers')
109 files changed, 159 insertions, 159 deletions
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; |