]> pilppa.com Git - linux-2.6-omap-h63xx.git/commitdiff
[PATCH] getting rid of all casts of k[cmz]alloc() calls
authorRobert P. J. Day <rpjday@mindspring.com>
Wed, 13 Dec 2006 08:35:56 +0000 (00:35 -0800)
committerLinus Torvalds <torvalds@woody.osdl.org>
Wed, 13 Dec 2006 17:05:58 +0000 (09:05 -0800)
Run this:

#!/bin/sh
for f in $(grep -Erl "\([^\)]*\) *k[cmz]alloc" *) ; do
  echo "De-casting $f..."
  perl -pi -e "s/ ?= ?\([^\)]*\) *(k[cmz]alloc) *\(/ = \1\(/" $f
done

And then go through and reinstate those cases where code is casting pointers
to non-pointers.

And then drop a few hunks which conflicted with outstanding work.

Cc: Russell King <rmk@arm.linux.org.uk>, Ian Molton <spyro@f2s.com>
Cc: Mikael Starvik <starvik@axis.com>
Cc: Yoshinori Sato <ysato@users.sourceforge.jp>
Cc: Roman Zippel <zippel@linux-m68k.org>
Cc: Geert Uytterhoeven <geert@linux-m68k.org>
Cc: Ralf Baechle <ralf@linux-mips.org>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Kyle McMartin <kyle@mcmartin.ca>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: Martin Schwidefsky <schwidefsky@de.ibm.com>
Cc: "David S. Miller" <davem@davemloft.net>
Cc: Jeff Dike <jdike@addtoit.com>
Cc: Greg KH <greg@kroah.com>
Cc: Jens Axboe <jens.axboe@oracle.com>
Cc: Paul Fulghum <paulkf@microgate.com>
Cc: Alan Cox <alan@lxorguk.ukuu.org.uk>
Cc: Karsten Keil <kkeil@suse.de>
Cc: Mauro Carvalho Chehab <mchehab@infradead.org>
Cc: Jeff Garzik <jeff@garzik.org>
Cc: James Bottomley <James.Bottomley@steeleye.com>
Cc: Ian Kent <raven@themaw.net>
Cc: Steven French <sfrench@us.ibm.com>
Cc: David Woodhouse <dwmw2@infradead.org>
Cc: Neil Brown <neilb@cse.unsw.edu.au>
Cc: Jaroslav Kysela <perex@suse.cz>
Cc: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
172 files changed:
arch/arm/kernel/apm.c
arch/arm/kernel/ecard.c
arch/arm26/kernel/ecard.c
arch/arm26/kernel/irq.c
arch/cris/arch-v10/drivers/axisflashmap.c
arch/cris/arch-v10/drivers/gpio.c
arch/cris/arch-v32/drivers/axisflashmap.c
arch/cris/arch-v32/drivers/gpio.c
arch/cris/arch-v32/kernel/signal.c
arch/cris/kernel/profile.c
arch/h8300/kernel/ints.c
arch/h8300/platform/h8s/ints.c
arch/i386/kernel/apm.c
arch/ia64/sn/kernel/sn2/sn_hwperf.c
arch/m68k/mm/kmap.c
arch/mips/kernel/apm.c
arch/parisc/hpux/sys_hpux.c
arch/parisc/kernel/unwind.c
arch/powerpc/kernel/nvram_64.c
arch/powerpc/kernel/pci_32.c
arch/powerpc/mm/imalloc.c
arch/powerpc/platforms/pseries/eeh_cache.c
arch/ppc/8260_io/fcc_enet.c
arch/ppc/8xx_io/cs4218_tdm.c
arch/s390/kernel/debug.c
arch/s390/kernel/s390_ext.c
arch/sparc/kernel/irq.c
arch/sparc/kernel/sun4d_irq.c
arch/sparc64/kernel/sys_sunos32.c
arch/um/sys-i386/ldt.c
drivers/acorn/block/fd1772.c
drivers/atm/eni.c
drivers/atm/he.c
drivers/atm/lanai.c
drivers/atm/nicstar.c
drivers/atm/zatm.c
drivers/base/dmapool.c
drivers/block/cciss.c
drivers/block/cpqarray.c
drivers/cdrom/cdrom.c
drivers/cdrom/cm206.c
drivers/char/consolemap.c
drivers/char/lcd.c
drivers/char/lp.c
drivers/char/pcmcia/synclink_cs.c
drivers/char/rio/riocmd.c
drivers/char/synclink.c
drivers/char/synclinkmp.c
drivers/char/vt.c
drivers/char/vt_ioctl.c
drivers/fc4/fc.c
drivers/ide/ide-floppy.c
drivers/ide/ide-tape.c
drivers/isdn/act2000/act2000_isa.c
drivers/isdn/capi/capidrv.c
drivers/isdn/divert/divert_procfs.c
drivers/isdn/divert/isdn_divert.c
drivers/isdn/hysdn/hysdn_procconf.c
drivers/isdn/hysdn/hysdn_proclog.c
drivers/isdn/i4l/isdn_audio.c
drivers/isdn/i4l/isdn_net.c
drivers/isdn/i4l/isdn_ppp.c
drivers/isdn/pcbit/layer2.c
drivers/macintosh/adb.c
drivers/macintosh/apm_emu.c
drivers/macintosh/via-pmu68k.c
drivers/media/dvb/bt8xx/dst_ca.c
drivers/media/dvb/bt8xx/dvb-bt8xx.c
drivers/media/dvb/ttusb-dec/ttusbdecfe.c
drivers/media/video/dabusb.c
drivers/media/video/planb.c
drivers/media/video/usbvideo/usbvideo.c
drivers/media/video/videocodec.c
drivers/message/i2o/i2o_config.c
drivers/mtd/devices/mtd_dataflash.c
drivers/net/appletalk/ipddp.c
drivers/net/bsd_comp.c
drivers/net/irda/donauboe.c
drivers/net/irda/irda-usb.c
drivers/net/irda/irport.c
drivers/net/lp486e.c
drivers/net/ppp_deflate.c
drivers/net/ppp_mppe.c
drivers/net/slip.c
drivers/net/wan/hostess_sv11.c
drivers/net/wan/pc300_drv.c
drivers/net/wan/pc300_tty.c
drivers/net/wan/x25_asy.c
drivers/net/wireless/hostap/hostap_ap.c
drivers/net/wireless/hostap/hostap_download.c
drivers/net/wireless/hostap/hostap_hw.c
drivers/net/wireless/hostap/hostap_ioctl.c
drivers/net/wireless/hostap/hostap_main.c
drivers/net/wireless/ipw2100.c
drivers/net/wireless/prism54/isl_ioctl.c
drivers/net/wireless/wavelan_cs.c
drivers/net/wireless/zd1211rw/zd_chip.c
drivers/parisc/iosapic.c
drivers/pci/hotplug/cpqphp_nvram.c
drivers/pci/hotplug/pciehp_hpc.c
drivers/pci/pcie/aer/aerdrv.c
drivers/pnp/pnpbios/core.c
drivers/s390/char/con3215.c
drivers/s390/char/keyboard.c
drivers/s390/char/sclp_cpi.c
drivers/s390/crypto/zcrypt_cex2a.c
drivers/s390/crypto/zcrypt_pcica.c
drivers/s390/crypto/zcrypt_pcixcc.c
drivers/s390/net/ctcmain.c
drivers/s390/net/iucv.c
drivers/s390/scsi/zfcp_aux.c
drivers/sbus/char/vfc_dev.c
drivers/scsi/aacraid/aachba.c
drivers/scsi/aacraid/comminit.c
drivers/scsi/aha1542.c
drivers/scsi/aic7xxx_old.c
drivers/scsi/dc395x.c
drivers/scsi/dpt_i2o.c
drivers/scsi/initio.c
drivers/scsi/osst.c
drivers/scsi/pluto.c
drivers/scsi/sr_ioctl.c
drivers/scsi/sr_vendor.c
drivers/usb/gadget/serial.c
drivers/usb/host/hc_crisv10.c
drivers/usb/misc/auerswald.c
drivers/usb/serial/cypress_m8.c
drivers/usb/serial/digi_acceleport.c
drivers/usb/serial/io_ti.c
drivers/usb/serial/ipaq.c
drivers/usb/serial/kobil_sct.c
drivers/usb/serial/pl2303.c
drivers/usb/serial/ti_usb_3410_5052.c
drivers/usb/serial/whiteheat.c
drivers/usb/storage/sddr09.c
drivers/video/amba-clcd.c
drivers/video/matrox/i2c-matroxfb.c
drivers/video/matrox/matroxfb_base.c
drivers/video/matrox/matroxfb_crtc2.c
fs/autofs4/inode.c
fs/befs/btree.c
fs/befs/debug.c
fs/binfmt_misc.c
fs/cifs/cifssmb.c
fs/jffs/inode-v23.c
fs/jffs/intrep.c
fs/jfs/jfs_dtree.c
fs/jfs/jfs_imap.c
fs/lockd/svcshare.c
fs/nfs/nfs4proc.c
fs/reiserfs/xattr_acl.c
include/asm-avr32/pgalloc.h
include/asm-sh64/pgalloc.h
include/linux/coda_linux.h
ipc/msgutil.c
net/tipc/config.c
sound/core/oss/mixer_oss.c
sound/oss/ad1848.c
sound/oss/cs4232.c
sound/oss/emu10k1/audio.c
sound/oss/emu10k1/cardmi.c
sound/oss/emu10k1/cardmo.c
sound/oss/emu10k1/midi.c
sound/oss/emu10k1/mixer.c
sound/oss/hal2.c
sound/oss/mpu401.c
sound/oss/opl3.c
sound/oss/sb_common.c
sound/oss/sb_midi.c
sound/oss/sb_mixer.c
sound/oss/v_midi.c
sound/oss/waveartist.c

index a11fb9a40c04f0c16e9d46e1e2d17cfbe934b91c..2c37b70b17ab45087ff7c43d30aea6006d3f4e81 100644 (file)
@@ -423,7 +423,7 @@ static int apm_open(struct inode * inode, struct file * filp)
 {
        struct apm_user *as;
 
-       as = (struct apm_user *)kzalloc(sizeof(*as), GFP_KERNEL);
+       as = kzalloc(sizeof(*as), GFP_KERNEL);
        if (as) {
                /*
                 * XXX - this is a tiny bit broken, when we consider BSD
index a786f769035d1a8c46197dae1124b40345dddb32..71257e3d513f4604ed1d01c3db5eb8fb565bcf47 100644 (file)
@@ -353,7 +353,7 @@ int ecard_readchunk(struct in_chunk_dir *cd, ecard_t *ec, int id, int num)
                }
                if (c_id(&excd) == 0x80) { /* loader */
                        if (!ec->loader) {
-                               ec->loader = (loader_t)kmalloc(c_len(&excd),
+                               ec->loader = kmalloc(c_len(&excd),
                                                               GFP_KERNEL);
                                if (ec->loader)
                                        ecard_readbytes(ec->loader, ec,
index 43dd41be71fb80ac1ac7f0898924c77902b9bd5f..9dbc17247c6fdfd6a3b00b2fdc734b02aaae02f9 100644 (file)
@@ -215,7 +215,7 @@ int ecard_readchunk(struct in_chunk_dir *cd, ecard_t *ec, int id, int num)
                }
                if (c_id(&excd) == 0x80) { /* loader */
                        if (!ec->loader) {
-                               ec->loader = (loader_t)kmalloc(c_len(&excd),
+                               ec->loader = kmalloc(c_len(&excd),
                                                               GFP_KERNEL);
                                if (ec->loader)
                                        ecard_readbytes(ec->loader, ec,
index d87d68b77d6678d97cbf2df175cca889b5e09123..d53382c83bf9fdb05ddfb66122313bfda0e9268a 100644 (file)
@@ -545,7 +545,7 @@ int request_irq(unsigned int irq, irqreturn_t (*handler)(int, void *, struct pt_
            (irq_flags & IRQF_SHARED && !dev_id))
                return -EINVAL;
 
-       action = (struct irqaction *)kmalloc(sizeof(struct irqaction), GFP_KERNEL);
+       action = kmalloc(sizeof(struct irqaction), GFP_KERNEL);
        if (!action)
                return -ENOMEM;
 
index 4fa81abab0c762f62c1a92f9884f9769ff6c4780..ffade19a14e6f0b974dbea77034bacc329ebd795 100644 (file)
@@ -516,7 +516,7 @@ static int __init init_axis_flash(void)
 #else
                struct mtd_info *mtd_ram;
 
-               mtd_ram = (struct mtd_info *)kmalloc(sizeof(struct mtd_info),
+               mtd_ram = kmalloc(sizeof(struct mtd_info),
                                                     GFP_KERNEL);
                if (!mtd_ram) {
                        panic("axisflashmap couldn't allocate memory for "
index fcba6632ed7b72ef774f423bd3dae1012ca3104b..9aba18b931dddcf91c01d44452079a0442b3cde3 100644 (file)
@@ -440,7 +440,7 @@ gpio_open(struct inode *inode, struct file *filp)
        if (p > GPIO_MINOR_LAST)
                return -EINVAL;
 
-       priv = (struct gpio_private *)kmalloc(sizeof(struct gpio_private), 
+       priv = kmalloc(sizeof(struct gpio_private),
                                              GFP_KERNEL);
 
        if (!priv)
index 41952320e00ab67f911cc82b3faa5a629218e6ba..5180d45412fc55db169dc132988e5f7b93cadedc 100644 (file)
@@ -427,7 +427,7 @@ static int __init init_axis_flash(void)
 #else
                struct mtd_info *mtd_ram;
 
-               mtd_ram = (struct mtd_info *)kmalloc(sizeof(struct mtd_info),
+               mtd_ram = kmalloc(sizeof(struct mtd_info),
                                                     GFP_KERNEL);
                if (!mtd_ram) {
                        panic("axisflashmap couldn't allocate memory for "
index c3f876b4da6b4210d1aafa814549bd626b944d04..08d36f0955c6789ced9bafa4283cf99546a69ef2 100644 (file)
@@ -423,7 +423,7 @@ gpio_open(struct inode *inode, struct file *filp)
        if (p > GPIO_MINOR_LAST)
                return -EINVAL;
 
-       priv = (struct gpio_private *)kmalloc(sizeof(struct gpio_private),
+       priv = kmalloc(sizeof(struct gpio_private),
                                              GFP_KERNEL);
 
        if (!priv)
index 99e59b3eacf8fd5cd4616108873be9afbc460401..7cd6ac80340940300defd4f75ce48be1629461e9 100644 (file)
@@ -686,7 +686,7 @@ keep_debug_flags(unsigned long oldccs, unsigned long oldspc,
 int __init
 cris_init_signal(void)
 {
-       u16* data = (u16*)kmalloc(PAGE_SIZE, GFP_KERNEL);
+       u16* data = kmalloc(PAGE_SIZE, GFP_KERNEL);
 
        /* This is movu.w __NR_sigreturn, r9; break 13; */
        data[0] = 0x9c5f;
index 69c52189f044702cce5f4db9cc1c19e2a4fd7af2..f60ab785f235dbd105ca7a40a467409fcc2636bf 100644 (file)
@@ -59,7 +59,7 @@ static int
 __init init_cris_profile(void)
 {
   struct proc_dir_entry *entry;
-  sample_buffer = (char*)kmalloc(SAMPLE_BUFFER_SIZE, GFP_KERNEL);
+  sample_buffer = kmalloc(SAMPLE_BUFFER_SIZE, GFP_KERNEL);
   sample_buffer_pos = sample_buffer;
   entry = create_proc_entry("system_profile", S_IWUSR | S_IRUGO, NULL);
   if (entry) {
index 1bfc77e391d5ade64e9b71c7848c804d5022f2b9..587ef7f4fcc777394d7d8fc08cd80f9974077cff 100644 (file)
@@ -141,7 +141,7 @@ int request_irq(unsigned int irq,
                return -EBUSY;
 
        if (use_kmalloc)
-               irq_handle = (irq_handler_t *)kmalloc(sizeof(irq_handler_t), GFP_ATOMIC);
+               irq_handle = kmalloc(sizeof(irq_handler_t), GFP_ATOMIC);
        else {
                /* use bootmem allocater */
                irq_handle = (irq_handler_t *)alloc_bootmem(sizeof(irq_handler_t));
index 270440de4610c3eb7187e93d304328a05aa405bc..567f681ddfec4051aafe0e8cc4d90dcfbb389653 100644 (file)
@@ -176,7 +176,7 @@ int request_irq(unsigned int irq,
        }               
 
        if (use_kmalloc)
-               irq_handle = (irq_handler_t *)kmalloc(sizeof(irq_handler_t), GFP_ATOMIC);
+               irq_handle = kmalloc(sizeof(irq_handler_t), GFP_ATOMIC);
        else {
                /* use bootmem allocater */
                irq_handle = (irq_handler_t *)alloc_bootmem(sizeof(irq_handler_t));
index a97847da9ed59e85508ace8f5a77be90260d8c6a..b75cff25de4b105b7c4c510d4de9752f053c2488 100644 (file)
@@ -1604,7 +1604,7 @@ static int do_open(struct inode * inode, struct file * filp)
 {
        struct apm_user *       as;
 
-       as = (struct apm_user *)kmalloc(sizeof(*as), GFP_KERNEL);
+       as = kmalloc(sizeof(*as), GFP_KERNEL);
        if (as == NULL) {
                printk(KERN_ERR "apm: cannot allocate struct of size %d bytes\n",
                       sizeof(*as));
index 462ea178f49abadfed37375141629013fda98e62..33367996d72d595b180179977b4a20e6c3b929bc 100644 (file)
@@ -189,7 +189,7 @@ static void print_pci_topology(struct seq_file *s)
        int e;
 
        for (sz = PAGE_SIZE; sz < 16 * PAGE_SIZE; sz += PAGE_SIZE) {
-               if (!(p = (char *)kmalloc(sz, GFP_KERNEL)))
+               if (!(p = kmalloc(sz, GFP_KERNEL)))
                        break;
                e = ia64_sn_ioif_get_pci_topology(__pa(p), sz);
                if (e == SALRET_OK)
index b54ef1726c557f827665ae3055eb2c1f8868c2c7..46b7d6035aabaab6a299f5c2cef9fee411c96bb4 100644 (file)
@@ -59,7 +59,7 @@ static struct vm_struct *get_io_area(unsigned long size)
        unsigned long addr;
        struct vm_struct **p, *tmp, *area;
 
-       area = (struct vm_struct *)kmalloc(sizeof(*area), GFP_KERNEL);
+       area = kmalloc(sizeof(*area), GFP_KERNEL);
        if (!area)
                return NULL;
        addr = KMAP_START;
index 528e731049c123c2a77886d573a2001458405901..ba16d07588cb88ad540d04ab307df20cd3d2283c 100644 (file)
@@ -356,7 +356,7 @@ static int apm_open(struct inode * inode, struct file * filp)
 {
        struct apm_user *as;
 
-       as = (struct apm_user *)kzalloc(sizeof(*as), GFP_KERNEL);
+       as = kzalloc(sizeof(*as), GFP_KERNEL);
        if (as) {
                /*
                 * XXX - this is a tiny bit broken, when we consider BSD
index d88309209f568815de1aa3bba81f2744fba2c4ac..04c2ff444396b56cb38438c65c217bc6f9980e0b 100644 (file)
@@ -475,7 +475,7 @@ int hpux_sysfs(int opcode, unsigned long arg1, unsigned long arg2)
                printk(KERN_DEBUG "len of arg1 = %d\n", len);
                if (len == 0)
                        return 0;
-               fsname = (char *) kmalloc(len, GFP_KERNEL);
+               fsname = kmalloc(len, GFP_KERNEL);
                if ( !fsname ) {
                        printk(KERN_DEBUG "failed to kmalloc fsname\n");
                        return 0;
index 920bdbf8404fa3c50768c7d628c4cb9d0cf174f1..c10ab47d81fabc434f1e938194ee5a4fe92c523c 100644 (file)
@@ -343,7 +343,7 @@ void unwind_frame_init_from_blocked_task(struct unwind_frame_info *info, struct
        struct pt_regs *r = &t->thread.regs;
        struct pt_regs *r2;
 
-       r2 = (struct pt_regs *)kmalloc(sizeof(struct pt_regs), GFP_KERNEL);
+       r2 = kmalloc(sizeof(struct pt_regs), GFP_KERNEL);
        if (!r2)
                return;
        *r2 = *r;
index 6960f090991ed2fcabc318bd1743a04c6d9550d4..869cebbba967cf6f56b54a80550034e801f303ae 100644 (file)
@@ -505,7 +505,7 @@ static int nvram_scan_partitions(void)
                return -ENODEV;
        total_size = ppc_md.nvram_size();
        
-       header = (char *) kmalloc(NVRAM_HEADER_LEN, GFP_KERNEL);
+       header = kmalloc(NVRAM_HEADER_LEN, GFP_KERNEL);
        if (!header) {
                printk(KERN_ERR "nvram_scan_partitions: Failed kmalloc\n");
                return -ENOMEM;
@@ -574,7 +574,7 @@ static int __init nvram_init(void)
        }
        
        /* initialize our anchor for the nvram partition list */
-       nvram_part = (struct nvram_partition *) kmalloc(sizeof(struct nvram_partition), GFP_KERNEL);
+       nvram_part = kmalloc(sizeof(struct nvram_partition), GFP_KERNEL);
        if (!nvram_part) {
                printk(KERN_ERR "nvram_init: Failed kmalloc\n");
                return -ENOMEM;
index 8336deafc624fd7973c9a36e412787f890e8aeb1..2847cd51a2d7c8c3dbee81184494d1dbc37ebcbe 100644 (file)
@@ -670,7 +670,7 @@ pcibios_make_OF_bus_map(void)
        struct pci_controller* hose;
        struct property *map_prop;
 
-       pci_to_OF_bus_map = (u8*)kmalloc(pci_bus_count, GFP_KERNEL);
+       pci_to_OF_bus_map = kmalloc(pci_bus_count, GFP_KERNEL);
        if (!pci_to_OF_bus_map) {
                printk(KERN_ERR "Can't allocate OF bus map !\n");
                return;
index add8c1a9af68ae12db88b1501f7b3f5d1c2ad1e4..c831815c31f0e5a1c572e19a5a3c706721ee8b9a 100644 (file)
@@ -138,7 +138,7 @@ static struct vm_struct * split_im_region(unsigned long v_addr,
        struct vm_struct *vm2 = NULL;
        struct vm_struct *new_vm = NULL;
        
-       vm1 = (struct vm_struct *) kmalloc(sizeof(*vm1), GFP_KERNEL);
+       vm1 = kmalloc(sizeof(*vm1), GFP_KERNEL);
        if (vm1 == NULL) {
                printk(KERN_ERR "%s() out of memory\n", __FUNCTION__);
                return NULL;
@@ -172,7 +172,7 @@ static struct vm_struct * split_im_region(unsigned long v_addr,
                 * uppermost remainder, and use existing parent one for the
                 * lower remainder of parent range
                 */
-               vm2 = (struct vm_struct *) kmalloc(sizeof(*vm2), GFP_KERNEL);
+               vm2 = kmalloc(sizeof(*vm2), GFP_KERNEL);
                if (vm2 == NULL) {
                        printk(KERN_ERR "%s() out of memory\n", __FUNCTION__);
                        kfree(vm1);
@@ -206,7 +206,7 @@ static struct vm_struct * __add_new_im_area(unsigned long req_addr,
                        break;
        }
        
-       area = (struct vm_struct *) kmalloc(sizeof(*area), GFP_KERNEL);
+       area = kmalloc(sizeof(*area), GFP_KERNEL);
        if (!area)
                return NULL;
        area->flags = 0;
index b6b462d3c6046540cd51824f4f524125fd5f0f4b..f2bae04424f8a3933e8b49a4a261c7147de3ec75 100644 (file)
@@ -153,7 +153,7 @@ pci_addr_cache_insert(struct pci_dev *dev, unsigned long alo,
                        return piar;
                }
        }
-       piar = (struct pci_io_addr_range *)kmalloc(sizeof(struct pci_io_addr_range), GFP_ATOMIC);
+       piar = kmalloc(sizeof(struct pci_io_addr_range), GFP_ATOMIC);
        if (!piar)
                return NULL;
 
index 709952c25f2948c197acdbc6947c3b2493f2b1d1..06b84c372e58d2a4c23826ee1347db67d391cad2 100644 (file)
@@ -1892,10 +1892,10 @@ init_fcc_param(fcc_info_t *fip, struct net_device *dev,
        /* Allocate space for the buffer descriptors from regular memory.
         * Initialize base addresses for the buffer descriptors.
         */
-       cep->rx_bd_base = (cbd_t *)kmalloc(sizeof(cbd_t) * RX_RING_SIZE,
+       cep->rx_bd_base = kmalloc(sizeof(cbd_t) * RX_RING_SIZE,
                        GFP_KERNEL | GFP_DMA);
        ep->fen_genfcc.fcc_rbase = __pa(cep->rx_bd_base);
-       cep->tx_bd_base = (cbd_t *)kmalloc(sizeof(cbd_t) * TX_RING_SIZE,
+       cep->tx_bd_base = kmalloc(sizeof(cbd_t) * TX_RING_SIZE,
                        GFP_KERNEL | GFP_DMA);
        ep->fen_genfcc.fcc_tbase = __pa(cep->tx_bd_base);
 
index c71ef3c2e7bf4459dbf565e70287a8b01e6e96fa..b7bb5f0b3c5f68a56fa0dde50392daec418c778f 100644 (file)
@@ -2601,7 +2601,7 @@ int __init tdm8xx_sound_init(void)
        /* Initialize beep stuff */
        orig_mksound = kd_mksound;
        kd_mksound = cs_mksound;
-       beep_buf = (short *) kmalloc(BEEP_BUFLEN * 4, GFP_KERNEL);
+       beep_buf = kmalloc(BEEP_BUFLEN * 4, GFP_KERNEL);
        if (beep_buf == NULL)
                printk(KERN_WARNING "dmasound: no memory for "
                       "beep buffer\n");
index ef5266fbce62105e2574dc916ab87dbba2f08b70..bb57bc0e3fc8d760a17a75cd555d29bd6683dcda 100644 (file)
@@ -191,13 +191,13 @@ debug_areas_alloc(int pages_per_area, int nr_areas)
        debug_entry_t*** areas;
        int i,j;
 
-       areas = (debug_entry_t ***) kmalloc(nr_areas *
+       areas = kmalloc(nr_areas *
                                        sizeof(debug_entry_t**),
                                        GFP_KERNEL);
        if (!areas)
                goto fail_malloc_areas;
        for (i = 0; i < nr_areas; i++) {
-               areas[i] = (debug_entry_t**) kmalloc(pages_per_area *
+               areas[i] = kmalloc(pages_per_area *
                                sizeof(debug_entry_t*),GFP_KERNEL);
                if (!areas[i]) {
                        goto fail_malloc_areas2;
@@ -242,7 +242,7 @@ debug_info_alloc(char *name, int pages_per_area, int nr_areas, int buf_size,
 
        /* alloc everything */
 
-       rc = (debug_info_t*) kmalloc(sizeof(debug_info_t), GFP_KERNEL);
+       rc = kmalloc(sizeof(debug_info_t), GFP_KERNEL);
        if(!rc)
                goto fail_malloc_rc;
        rc->active_entries = kcalloc(nr_areas, sizeof(int), GFP_KERNEL);
@@ -634,7 +634,7 @@ found:
                rc = -ENOMEM;
                goto out;
        }
-       p_info = (file_private_info_t *) kmalloc(sizeof(file_private_info_t),
+       p_info = kmalloc(sizeof(file_private_info_t),
                                                GFP_KERNEL);
        if(!p_info){
                if(debug_info_snapshot)
index 4faf96f8a83414ddf7f36eb46aa8bb21b4e50b90..bc5beaa8f98e13a0278dad9e612b9d41bef48383 100644 (file)
@@ -37,7 +37,7 @@ int register_external_interrupt(__u16 code, ext_int_handler_t handler)
         ext_int_info_t *p;
         int index;
 
-       p = (ext_int_info_t *) kmalloc(sizeof(ext_int_info_t), GFP_ATOMIC);
+       p = kmalloc(sizeof(ext_int_info_t), GFP_ATOMIC);
         if (p == NULL)
                 return -ENOMEM;
         p->code = code;
index c8cb211b90728741877f0326a96803c37ba07527..5b4841d067c16ccf906149fd3c73b87ea5d16325 100644 (file)
@@ -425,7 +425,7 @@ int request_fast_irq(unsigned int irq,
        }
        
        if (action == NULL)
-           action = (struct irqaction *)kmalloc(sizeof(struct irqaction),
+           action = kmalloc(sizeof(struct irqaction),
                                                 GFP_ATOMIC);
        
        if (!action) { 
@@ -528,7 +528,7 @@ int request_irq(unsigned int irq,
        }
        
        if (action == NULL)
-               action = (struct irqaction *)kmalloc(sizeof(struct irqaction),
+               action = kmalloc(sizeof(struct irqaction),
                                                     GFP_ATOMIC);
        
        if (!action) { 
index cf1b8baa57eafd4c8b9ae3f7e45fdab3564aa6a1..0e27e226e0e2e1a291f9a79fde94dd9a4511cc7c 100644 (file)
@@ -327,7 +327,7 @@ int sun4d_request_irq(unsigned int irq,
        }
        
        if (action == NULL)
-               action = (struct irqaction *)kmalloc(sizeof(struct irqaction),
+               action = kmalloc(sizeof(struct irqaction),
                                                     GFP_ATOMIC);
        
        if (!action) { 
index 4446f66590fac2f10485b76e11b3f3c6752499ce..2ebc2c0513832ad64ec09b9266d245eef0028622 100644 (file)
@@ -1055,7 +1055,7 @@ asmlinkage int sunos_msgsys(int op, u32 arg1, u32 arg2, u32 arg3, u32 arg4)
                break;
        case 2:
                rval = -EFAULT;
-               kmbuf = (struct msgbuf *)kmalloc(sizeof(struct msgbuf) + arg3,
+               kmbuf = kmalloc(sizeof(struct msgbuf) + arg3,
                                                 GFP_KERNEL);
                if (!kmbuf)
                        break;
@@ -1078,7 +1078,7 @@ asmlinkage int sunos_msgsys(int op, u32 arg1, u32 arg2, u32 arg3, u32 arg4)
                break;
        case 3:
                rval = -EFAULT;
-               kmbuf = (struct msgbuf *)kmalloc(sizeof(struct msgbuf) + arg3,
+               kmbuf = kmalloc(sizeof(struct msgbuf) + arg3,
                                                 GFP_KERNEL);
                if (!kmbuf || sunos_msgbuf_get((struct msgbuf32 __user *)(unsigned long)arg2,
                                               kmbuf, arg3))
index 49057d8bc668b88a5ac4a45a3559171253abfaed..5db7737df0ff1bc594856588b592c860a023c006 100644 (file)
@@ -166,7 +166,7 @@ static long read_ldt_from_host(void __user * ptr, unsigned long bytecount)
        struct ptrace_ldt ptrace_ldt = (struct ptrace_ldt) {
                        .func = 0,
                        .bytecount = bytecount,
-                       .ptr = (void *)kmalloc(bytecount, GFP_KERNEL)};
+                       .ptr = kmalloc(bytecount, GFP_KERNEL)};
        u32 cpu;
 
        if(ptrace_ldt.ptr == NULL)
@@ -426,7 +426,7 @@ void ldt_get_host_info(void)
                host_ldt_entries = dummy_list;
        else {
                size = (size + 1) * sizeof(dummy_list[0]);
-               host_ldt_entries = (short *)kmalloc(size, GFP_KERNEL);
+               host_ldt_entries = kmalloc(size, GFP_KERNEL);
                if(host_ldt_entries == NULL) {
                        printk("ldt_get_host_info: couldn't allocate host ldt list\n");
                        goto out_free;
index 048542341204e716bc24e721914a240cf781426e..674bf81c6e660040ab8d0136ecebd4e9f84aad66 100644 (file)
@@ -1549,12 +1549,12 @@ int fd1772_init(void)
 #ifdef TRACKBUFFER
        BufferDrive = BufferSide = BufferTrack = -1;
        /* Atari uses 512 - I want to eventually cope with 1K sectors */
-       DMABuffer = (char *)kmalloc((FD1772_MAX_SECTORS+1)*512,GFP_KERNEL);
+       DMABuffer = kmalloc((FD1772_MAX_SECTORS+1)*512,GFP_KERNEL);
        TrackBuffer = DMABuffer + 512;
 #else
        /* Allocate memory for the DMAbuffer - on the Atari this takes it
           out of some special memory... */
-       DMABuffer = (char *) kmalloc(2048);     /* Copes with pretty large sectors */
+       DMABuffer = kmalloc(2048);      /* Copes with pretty large sectors */
 #endif
        err = -ENOMEM;
        if (!DMAbuffer)
index bc1b13c8f5d717893661d12ee0fad2512175c91b..5aab7bd473ac9325d5e327597ec474d059199184 100644 (file)
@@ -1832,7 +1832,7 @@ static int __devinit eni_start(struct atm_dev *dev)
        /* initialize memory management */
        buffer_mem = eni_dev->mem - (buf - eni_dev->ram);
        eni_dev->free_list_size = buffer_mem/MID_MIN_BUF_SIZE/2;
-       eni_dev->free_list = (struct eni_free *) kmalloc(
+       eni_dev->free_list = kmalloc(
            sizeof(struct eni_free)*(eni_dev->free_list_size+1),GFP_KERNEL);
        if (!eni_dev->free_list) {
                printk(KERN_ERR DEV_LABEL "(itf %d): couldn't get free page\n",
@@ -2232,7 +2232,7 @@ static int __devinit eni_init_one(struct pci_dev *pci_dev,
                goto out0;
        }
 
-       eni_dev = (struct eni_dev *) kmalloc(sizeof(struct eni_dev),GFP_KERNEL);
+       eni_dev = kmalloc(sizeof(struct eni_dev),GFP_KERNEL);
        if (!eni_dev) goto out0;
        if (!cpu_zeroes) {
                cpu_zeroes = pci_alloc_consistent(pci_dev,ENI_ZEROES_SIZE,
index 7d9b4e52f0bf4c985f1766fe2f88c35c78ea6c32..db33f6f4dd2a5517302e22fc5575c43c1a28413e 100644 (file)
@@ -2351,7 +2351,7 @@ he_open(struct atm_vcc *vcc)
 
        cid = he_mkcid(he_dev, vpi, vci);
 
-       he_vcc = (struct he_vcc *) kmalloc(sizeof(struct he_vcc), GFP_ATOMIC);
+       he_vcc = kmalloc(sizeof(struct he_vcc), GFP_ATOMIC);
        if (he_vcc == NULL) {
                hprintk("unable to allocate he_vcc during open\n");
                return -ENOMEM;
index 267825501dfe61570ed12300b45be52590bf5f89..09f477d4237a5f553d711748dab5ff953f3255b3 100644 (file)
@@ -2602,7 +2602,7 @@ static int __devinit lanai_init_one(struct pci_dev *pci,
        struct atm_dev *atmdev;
        int result;
 
-       lanai = (struct lanai_dev *) kmalloc(sizeof(*lanai), GFP_KERNEL);
+       lanai = kmalloc(sizeof(*lanai), GFP_KERNEL);
        if (lanai == NULL) {
                printk(KERN_ERR DEV_LABEL
                       ": couldn't allocate dev_data structure!\n");
index bd09045948054ab836fe3b14f9f0384a85b08f86..aab9b3733d52197c5d9373dae1310fae01bd436f 100644 (file)
@@ -997,7 +997,7 @@ static scq_info *get_scq(int size, u32 scd)
    if (size != VBR_SCQSIZE && size != CBR_SCQSIZE)
       return NULL;
 
-   scq = (scq_info *) kmalloc(sizeof(scq_info), GFP_KERNEL);
+   scq = kmalloc(sizeof(scq_info), GFP_KERNEL);
    if (scq == NULL)
       return NULL;
    scq->org = kmalloc(2 * size, GFP_KERNEL);
@@ -1006,7 +1006,7 @@ static scq_info *get_scq(int size, u32 scd)
       kfree(scq);
       return NULL;
    }
-   scq->skb = (struct sk_buff **) kmalloc(sizeof(struct sk_buff *) *
+   scq->skb = kmalloc(sizeof(struct sk_buff *) *
                                           (size / NS_SCQE_SIZE), GFP_KERNEL);
    if (scq->skb == NULL)
    {
index 7df0f373188eaad68253ff3d56a466752436e6b6..756d4f760da3b11f901ccbcedba6fc14d6bf18ad 100644 (file)
@@ -996,7 +996,7 @@ static int start_tx(struct atm_dev *dev)
 
        DPRINTK("start_tx\n");
        zatm_dev = ZATM_DEV(dev);
-       zatm_dev->tx_map = (struct atm_vcc **) kmalloc(sizeof(struct atm_vcc *)*
+       zatm_dev->tx_map = kmalloc(sizeof(struct atm_vcc *)*
            zatm_dev->chans,GFP_KERNEL);
        if (!zatm_dev->tx_map) return -ENOMEM;
        zatm_dev->tx_bw = ATM_OC3_PCR;
@@ -1591,7 +1591,7 @@ static int __devinit zatm_init_one(struct pci_dev *pci_dev,
        struct zatm_dev *zatm_dev;
        int ret = -ENOMEM;
 
-       zatm_dev = (struct zatm_dev *) kmalloc(sizeof(*zatm_dev), GFP_KERNEL);
+       zatm_dev = kmalloc(sizeof(*zatm_dev), GFP_KERNEL);
        if (!zatm_dev) {
                printk(KERN_EMERG "%s: memory shortage\n", DEV_LABEL);
                goto out;
index dbe0735f8c9e6bab0446ea0278cd749e3ea98630..f95d502772740d9fa653379f185e002742d9abf4 100644 (file)
@@ -173,7 +173,7 @@ pool_alloc_page (struct dma_pool *pool, gfp_t mem_flags)
        mapsize = (mapsize + BITS_PER_LONG - 1) / BITS_PER_LONG;
        mapsize *= sizeof (long);
 
-       page = (struct dma_page *) kmalloc (mapsize + sizeof *page, mem_flags);
+       page = kmalloc(mapsize + sizeof *page, mem_flags);
        if (!page)
                return NULL;
        page->vaddr = dma_alloc_coherent (pool->dev,
index 730f9693150eeeb5e59188c30dad77e3b59d5ccd..acb2fa9cf6b1a161c77ac61e3603699333f9f143 100644 (file)
@@ -1039,7 +1039,7 @@ static int cciss_ioctl(struct inode *inode, struct file *filep,
                                status = -ENOMEM;
                                goto cleanup1;
                        }
-                       buff_size = (int *)kmalloc(MAXSGENTRIES * sizeof(int),
+                       buff_size = kmalloc(MAXSGENTRIES * sizeof(int),
                                                   GFP_KERNEL);
                        if (!buff_size) {
                                status = -ENOMEM;
index d5f519ebbc0842d4b6eb194bc18a83f4ec8d020b..b94cd1c321313c17f8a068ef5144ce87102bf3e9 100644 (file)
@@ -1625,7 +1625,7 @@ static void start_fwbk(int ctlr)
                " processing\n");
        /* Command does not return anything, but idasend command needs a 
                buffer */
-       id_ctlr_buf = (id_ctlr_t *)kmalloc(sizeof(id_ctlr_t), GFP_KERNEL);
+       id_ctlr_buf = kmalloc(sizeof(id_ctlr_t), GFP_KERNEL);
        if(id_ctlr_buf==NULL)
        {
                printk(KERN_WARNING "cpqarray: Out of memory. "
@@ -1660,14 +1660,14 @@ static void getgeometry(int ctlr)
 
        info_p->log_drv_map = 0;        
        
-       id_ldrive = (id_log_drv_t *)kmalloc(sizeof(id_log_drv_t), GFP_KERNEL);
+       id_ldrive = kmalloc(sizeof(id_log_drv_t), GFP_KERNEL);
        if(id_ldrive == NULL)
        {
                printk( KERN_ERR "cpqarray:  out of memory.\n");
                return;
        }
 
-       id_ctlr_buf = (id_ctlr_t *)kmalloc(sizeof(id_ctlr_t), GFP_KERNEL);
+       id_ctlr_buf = kmalloc(sizeof(id_ctlr_t), GFP_KERNEL);
        if(id_ctlr_buf == NULL)
        {
                kfree(id_ldrive);
@@ -1675,7 +1675,7 @@ static void getgeometry(int ctlr)
                return;
        }
 
-       id_lstatus_buf = (sense_log_drv_stat_t *)kmalloc(sizeof(sense_log_drv_stat_t), GFP_KERNEL);
+       id_lstatus_buf = kmalloc(sizeof(sense_log_drv_stat_t), GFP_KERNEL);
        if(id_lstatus_buf == NULL)
        {
                kfree(id_ctlr_buf);
@@ -1684,7 +1684,7 @@ static void getgeometry(int ctlr)
                return;
        }
 
-       sense_config_buf = (config_t *)kmalloc(sizeof(config_t), GFP_KERNEL);
+       sense_config_buf = kmalloc(sizeof(config_t), GFP_KERNEL);
        if(sense_config_buf == NULL)
        {
                kfree(id_lstatus_buf);
index 2df5cf4ec7432ee98d4daad48cc799c7b9657575..e4a2f8f3a1d764f909910dfd03c4b55e2e24f17c 100644 (file)
@@ -1810,7 +1810,7 @@ static int dvd_read_disckey(struct cdrom_device_info *cdi, dvd_struct *s)
 
        size = sizeof(s->disckey.value) + 4;
 
-       if ((buf = (u_char *) kmalloc(size, GFP_KERNEL)) == NULL)
+       if ((buf = kmalloc(size, GFP_KERNEL)) == NULL)
                return -ENOMEM;
 
        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)
 
        size = sizeof(s->manufact.value) + 4;
 
-       if ((buf = (u_char *) kmalloc(size, GFP_KERNEL)) == NULL)
+       if ((buf = kmalloc(size, GFP_KERNEL)) == NULL)
                return -ENOMEM;
 
        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,
                /* FIXME: we need upper bound checking, too!! */
                if (lba < 0)
                        return -EINVAL;
-               cgc.buffer = (char *) kmalloc(blocksize, GFP_KERNEL);
+               cgc.buffer = kmalloc(blocksize, GFP_KERNEL);
                if (cgc.buffer == NULL)
                        return -ENOMEM;
                memset(&sense, 0, sizeof(sense));
@@ -3031,7 +3031,7 @@ static int mmc_ioctl(struct cdrom_device_info *cdi, unsigned int cmd,
                int size = sizeof(dvd_struct);
                if (!CDROM_CAN(CDC_DVD))
                        return -ENOSYS;
-               if ((s = (dvd_struct *) kmalloc(size, GFP_KERNEL)) == NULL)
+               if ((s = kmalloc(size, GFP_KERNEL)) == NULL)
                        return -ENOMEM;
                cdinfo(CD_DO_IOCTL, "entering DVD_READ_STRUCT\n"); 
                if (copy_from_user(s, (dvd_struct __user *)arg, size)) {
index e6d8e9ededeaeb57e562e84ad5987f89c8262f0c..b6c61bbb20e135adbba310b0d4f7cb5ea54d41d8 100644 (file)
@@ -1420,7 +1420,7 @@ int __init cm206_init(void)
                return -EIO;
        }
        printk(" adapter at 0x%x", cm206_base);
-       cd = (struct cm206_struct *) kmalloc(size, GFP_KERNEL);
+       cd = kmalloc(size, GFP_KERNEL);
        if (!cd)
                goto out_base;
        /* Now we have found the adaptor card, try to reset it. As we have
index 04a12027a740a57dea956fd3abbba1785739500e..b99b7561260dca1eeea4472bb95f3a087c9f688a 100644 (file)
@@ -443,7 +443,7 @@ int con_clear_unimap(struct vc_data *vc, struct unimapinit *ui)
        p = (struct uni_pagedir *)*vc->vc_uni_pagedir_loc;
        if (p && p->readonly) return -EIO;
        if (!p || --p->refcount) {
-               q = (struct uni_pagedir *)kmalloc(sizeof(*p), GFP_KERNEL);
+               q = kmalloc(sizeof(*p), GFP_KERNEL);
                if (!q) {
                        if (p) p->refcount++;
                        return -ENOMEM;
index da601fd6c07ae24424350dc77541fb695c9ad15c..d649abbf08574595d2e270cd488ea478c2405ac9 100644 (file)
@@ -459,7 +459,7 @@ static int lcd_ioctl(struct inode *inode, struct file *file,
                            (&display, (struct lcd_display *) arg,
                             sizeof(struct lcd_display)))
                                return -EFAULT;
-                       rom = (unsigned char *) kmalloc((128), GFP_ATOMIC);
+                       rom = kmalloc((128), GFP_ATOMIC);
                        if (rom == NULL) {
                                printk(KERN_ERR LCD "kmalloc() failed in %s\n",
                                                __FUNCTION__);
index b70b5388b5a81774b5050574cbd2383de0662455..b51d08be0bcfe5b908b6f4145823005657140e27 100644 (file)
@@ -525,7 +525,7 @@ static int lp_open(struct inode * inode, struct file * file)
                        return -EIO;
                }
        }
-       lp_table[minor].lp_buffer = (char *) kmalloc(LP_BUFFER_SIZE, GFP_KERNEL);
+       lp_table[minor].lp_buffer = kmalloc(LP_BUFFER_SIZE, GFP_KERNEL);
        if (!lp_table[minor].lp_buffer) {
                LP_F(minor) &= ~LP_BUSY;
                return -ENOMEM;
index 5152cedd8878ff235bcbe2a0b0a2d593e7ed08dd..f108c136800a2ef3b2fcb990cc3d8aabf83b6ffe 100644 (file)
@@ -541,7 +541,7 @@ static int mgslpc_probe(struct pcmcia_device *link)
     if (debug_level >= DEBUG_LEVEL_INFO)
            printk("mgslpc_attach\n");
 
-    info = (MGSLPC_INFO *)kmalloc(sizeof(MGSLPC_INFO), GFP_KERNEL);
+    info = kmalloc(sizeof(MGSLPC_INFO), GFP_KERNEL);
     if (!info) {
            printk("Error can't allocate device instance data\n");
            return -ENOMEM;
index 167ebc84e8d7361d35577ce59d4a74379437c0c4..245f03195b7c6da9ce7f664e974664617b4baf33 100644 (file)
@@ -556,7 +556,7 @@ struct CmdBlk *RIOGetCmdBlk(void)
 {
        struct CmdBlk *CmdBlkP;
 
-       CmdBlkP = (struct CmdBlk *)kmalloc(sizeof(struct CmdBlk), GFP_ATOMIC);
+       CmdBlkP = kmalloc(sizeof(struct CmdBlk), GFP_ATOMIC);
        if (CmdBlkP)
                memset(CmdBlkP, 0, sizeof(struct CmdBlk));
        return CmdBlkP;
index acc6fab601ccaa6f592052595a3587810607c522..3fa625db9e4b133b6caf258ed442d2675dad18c5 100644 (file)
@@ -4332,7 +4332,7 @@ static struct mgsl_struct* mgsl_allocate_device(void)
 {
        struct mgsl_struct *info;
        
-       info = (struct mgsl_struct *)kmalloc(sizeof(struct mgsl_struct),
+       info = kmalloc(sizeof(struct mgsl_struct),
                 GFP_KERNEL);
                 
        if (!info) {
index 53e8ccf94fe33be05e76f7d3f1b6c7a6b8a2f394..8f4d67afe5bf99fe1daea30940640b2c1cbbbe72 100644 (file)
@@ -2730,7 +2730,7 @@ static int startup(SLMP_INFO * info)
                return 0;
 
        if (!info->tx_buf) {
-               info->tx_buf = (unsigned char *)kmalloc(info->max_frame_size, GFP_KERNEL);
+               info->tx_buf = kmalloc(info->max_frame_size, GFP_KERNEL);
                if (!info->tx_buf) {
                        printk(KERN_ERR"%s(%d):%s can't allocate transmit buffer\n",
                                __FILE__,__LINE__,info->device_name);
@@ -3798,7 +3798,7 @@ static SLMP_INFO *alloc_dev(int adapter_num, int port_num, struct pci_dev *pdev)
 {
        SLMP_INFO *info;
 
-       info = (SLMP_INFO *)kmalloc(sizeof(SLMP_INFO),
+       info = kmalloc(sizeof(SLMP_INFO),
                 GFP_KERNEL);
 
        if (!info) {
index a8239dac994fee2264bf638bd3f5bff3176f446f..06c32a3e3ca42603df7470008711d9cc7b4fa5e1 100644 (file)
@@ -784,7 +784,7 @@ int vc_resize(struct vc_data *vc, unsigned int cols, unsigned int lines)
        if (new_cols == vc->vc_cols && new_rows == vc->vc_rows)
                return 0;
 
-       newscreen = (unsigned short *) kmalloc(new_screen_size, GFP_USER);
+       newscreen = kmalloc(new_screen_size, GFP_USER);
        if (!newscreen)
                return -ENOMEM;
 
index 311493e7b40991558fc3a6e05767d2a4e1da9d7d..dc8368ebb1ac932c2a8b18427b7197bdab371d82 100644 (file)
@@ -129,7 +129,7 @@ do_kdsk_ioctl(int cmd, struct kbentry __user *user_kbe, int perm, struct kbd_str
                            !capable(CAP_SYS_RESOURCE))
                                return -EPERM;
 
-                       key_map = (ushort *) kmalloc(sizeof(plain_map),
+                       key_map = kmalloc(sizeof(plain_map),
                                                     GFP_KERNEL);
                        if (!key_map)
                                return -ENOMEM;
@@ -259,7 +259,7 @@ do_kdgkb_ioctl(int cmd, struct kbsentry __user *user_kdgkb, int perm)
                    sz = 256;
                    while (sz < funcbufsize - funcbufleft + delta)
                      sz <<= 1;
-                   fnw = (char *) kmalloc(sz, GFP_KERNEL);
+                   fnw = kmalloc(sz, GFP_KERNEL);
                    if(!fnw) {
                      ret = -ENOMEM;
                      goto reterr;
index ca4e67a022d0eaa56edf97a1da2fbe63a1d70d3b..22b62b3cd14e5538f3b8e273c525c5586154b784 100644 (file)
@@ -266,7 +266,7 @@ static void fcp_report_map_done(fc_channel *fc, int i, int status)
                        printk ("FC: Bad magic from REPORT_AL_MAP on %s - %08x\n", fc->name, p->magic);
                        fc->state = FC_STATE_OFFLINE;
                } else {
-                       fc->posmap = (fcp_posmap *)kzalloc(sizeof(fcp_posmap)+p->len, GFP_KERNEL);
+                       fc->posmap = kzalloc(sizeof(fcp_posmap)+p->len, GFP_KERNEL);
                        if (!fc->posmap) {
                                printk("FC: Not enough memory, offlining channel\n");
                                fc->state = FC_STATE_OFFLINE;
@@ -355,7 +355,7 @@ void fcp_register(fc_channel *fc, u8 type, int unregister)
                        for (i = fc->can_queue; i < fc->scsi_bitmap_end; i++)
                                set_bit (i, fc->scsi_bitmap);
                        fc->scsi_free = fc->can_queue;
-                       fc->cmd_slots = (fcp_cmnd **)kzalloc(slots * sizeof(fcp_cmnd*), GFP_KERNEL);
+                       fc->cmd_slots = kzalloc(slots * sizeof(fcp_cmnd*), GFP_KERNEL);
                        fc->abort_count = 0;
                } else {
                        fc->scsi_name[0] = 0;
@@ -933,7 +933,7 @@ int fcp_scsi_dev_reset(struct scsi_cmnd *SCpnt)
         DECLARE_MUTEX_LOCKED(sem);
 
        if (!fc->rst_pkt) {
-               fc->rst_pkt = (struct scsi_cmnd *) kmalloc(sizeof(SCpnt), GFP_KERNEL);
+               fc->rst_pkt = kmalloc(sizeof(SCpnt), GFP_KERNEL);
                if (!fc->rst_pkt) return FAILED;
                
                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)
        logi *l;
        int status;
 
-       l = (logi *)kzalloc(2 * sizeof(logi), GFP_KERNEL);
+       l = kzalloc(2 * sizeof(logi), GFP_KERNEL);
        if (!l) return -ENOMEM;
        l->code = LS_PLOGI;
        memcpy (&l->nport_wwn, &fc->wwn_nport, sizeof(fc_wwn));
@@ -1141,7 +1141,7 @@ int fc_do_prli(fc_channel *fc, unsigned char alpa)
        prli *p;
        int status;
 
-       p = (prli *)kzalloc(2 * sizeof(prli), GFP_KERNEL);
+       p = kzalloc(2 * sizeof(prli), GFP_KERNEL);
        if (!p) return -ENOMEM;
        p->code = LS_PRLI;
        p->params[0] = 0x08002000;
index e3a267622bb6073fdcb5911dfca2c4178bdf670f..d33717c8afd466731855e4a42f01d65c9ee85b2e 100644 (file)
@@ -2147,7 +2147,7 @@ static int ide_floppy_probe(ide_drive_t *drive)
                printk("ide-floppy: passing drive %s to ide-scsi emulation.\n", drive->name);
                goto failed;
        }
-       if ((floppy = (idefloppy_floppy_t *) kzalloc (sizeof (idefloppy_floppy_t), GFP_KERNEL)) == NULL) {
+       if ((floppy = kzalloc(sizeof (idefloppy_floppy_t), GFP_KERNEL)) == NULL) {
                printk (KERN_ERR "ide-floppy: %s: Can't allocate a floppy structure\n", drive->name);
                goto failed;
        }
index e2f4bb5490638de5c1326dc863c322417c99002b..b3bcd1d7315e8780e6d74885a0d1f39862270162 100644 (file)
@@ -2573,11 +2573,11 @@ static idetape_stage_t *__idetape_kmalloc_stage (idetape_tape_t *tape, int full,
        int pages = tape->pages_per_stage;
        char *b_data = NULL;
 
-       if ((stage = (idetape_stage_t *) kmalloc (sizeof (idetape_stage_t),GFP_KERNEL)) == NULL)
+       if ((stage = kmalloc(sizeof (idetape_stage_t),GFP_KERNEL)) == NULL)
                return NULL;
        stage->next = NULL;
 
-       bh = stage->bh = (struct idetape_bh *)kmalloc(sizeof(struct idetape_bh), GFP_KERNEL);
+       bh = stage->bh = kmalloc(sizeof(struct idetape_bh), GFP_KERNEL);
        if (bh == NULL)
                goto abort;
        bh->b_reqnext = NULL;
@@ -2607,7 +2607,7 @@ static idetape_stage_t *__idetape_kmalloc_stage (idetape_tape_t *tape, int full,
                        continue;
                }
                prev_bh = bh;
-               if ((bh = (struct idetape_bh *)kmalloc(sizeof(struct idetape_bh), GFP_KERNEL)) == NULL) {
+               if ((bh = kmalloc(sizeof(struct idetape_bh), GFP_KERNEL)) == NULL) {
                        free_page((unsigned long) b_data);
                        goto abort;
                }
@@ -4860,7 +4860,7 @@ static int ide_tape_probe(ide_drive_t *drive)
                printk(KERN_WARNING "ide-tape: Use drive %s with ide-scsi emulation and osst.\n", drive->name);
                printk(KERN_WARNING "ide-tape: OnStream support will be removed soon from ide-tape!\n");
        }
-       tape = (idetape_tape_t *) kzalloc (sizeof (idetape_tape_t), GFP_KERNEL);
+       tape = kzalloc(sizeof (idetape_tape_t), GFP_KERNEL);
        if (tape == NULL) {
                printk(KERN_ERR "ide-tape: %s: Can't allocate a tape structure\n", drive->name);
                goto failed;
index 3cac23739344cbae32ecf27b50c6b6f4da987535..09ea50dd3459d536a6a4f9414f6a56a8be3f2758 100644 (file)
@@ -408,7 +408,7 @@ act2000_isa_download(act2000_card * card, act2000_ddef __user * cb)
         p = cblock.buffer;
         if (!access_ok(VERIFY_READ, p, length))
                 return -EFAULT;
-        buf = (u_char *) kmalloc(1024, GFP_KERNEL);
+        buf = kmalloc(1024, GFP_KERNEL);
         if (!buf)
                 return -ENOMEM;
         timeout = 0;
index 097bfa7bc323ad1738893ea00adfab252a4abd19..c4d438c17dabf0cd1a1bbb06a1fda9953cce25e2 100644 (file)
@@ -2013,7 +2013,7 @@ static int capidrv_addcontr(u16 contr, struct capi_profile *profp)
        strcpy(card->name, id);
        card->contrnr = contr;
        card->nbchan = profp->nbchannel;
-       card->bchans = (capidrv_bchan *) kmalloc(sizeof(capidrv_bchan) * card->nbchan, GFP_ATOMIC);
+       card->bchans = kmalloc(sizeof(capidrv_bchan) * card->nbchan, GFP_ATOMIC);
        if (!card->bchans) {
                printk(KERN_WARNING
                "capidrv: (%s) Could not allocate bchan-structs.\n", id);
index 399b316111f72db4a292e71f4b52470a0fe1ec05..06967da7c4a8fd0ee13ce94a8d46cfda8797051d 100644 (file)
@@ -45,7 +45,7 @@ put_info_buffer(char *cp)
                return;
        if (!*cp)
                return;
-       if (!(ib = (struct divert_info *) kmalloc(sizeof(struct divert_info) + strlen(cp), GFP_ATOMIC)))
+       if (!(ib = kmalloc(sizeof(struct divert_info) + strlen(cp), GFP_ATOMIC)))
                 return;        /* no memory */
        strcpy(ib->info_start, cp);     /* set output string */
        ib->next = NULL;
index 03319ea5aa0cdf8e6445f29909746bbfe7d53454..7d97d54588d9425501c4805e3157c07158d6b67b 100644 (file)
@@ -153,7 +153,7 @@ int cf_command(int drvid, int mode,
   *ielenp = p - ielenp - 1; /* set total IE length */ 
 
   /* allocate mem for information struct */  
-  if (!(cs = (struct call_struc *) kmalloc(sizeof(struct call_struc), GFP_ATOMIC))) 
+  if (!(cs = kmalloc(sizeof(struct call_struc), GFP_ATOMIC)))
              return(-ENOMEM); /* no memory */
   init_timer(&cs->timer);
   cs->info[0] = '\0';
@@ -276,7 +276,7 @@ int insertrule(int idx, divert_rule *newrule)
 { struct deflect_struc *ds,*ds1=NULL;
   unsigned long flags;
 
-  if (!(ds = (struct deflect_struc *) kmalloc(sizeof(struct deflect_struc), 
+  if (!(ds = kmalloc(sizeof(struct deflect_struc),
                                               GFP_KERNEL))) 
     return(-ENOMEM); /* no memory */
 
@@ -451,7 +451,7 @@ static int isdn_divert_icall(isdn_ctrl *ic)
            if (dv->rule.action == DEFLECT_PROCEED)
            if ((!if_used) || ((!extern_wait_max) && (!dv->rule.waittime))) 
               return(0); /* no external deflection needed */  
-           if (!(cs = (struct call_struc *) kmalloc(sizeof(struct call_struc), GFP_ATOMIC))) 
+           if (!(cs = kmalloc(sizeof(struct call_struc), GFP_ATOMIC)))
              return(0); /* no memory */
            init_timer(&cs->timer);
            cs->info[0] = '\0';
index 8e2b03889f3cb0a6b6a8174eac5d7ef0ee34fe5f..94a935089119b48d1d5f14e51ed195caeda1fc2a 100644 (file)
@@ -275,7 +275,7 @@ hysdn_conf_open(struct inode *ino, struct file *filep)
        } else if ((filep->f_mode & (FMODE_READ | FMODE_WRITE)) == FMODE_READ) {
                /* read access -> output card info data */
 
-               if (!(tmp = (char *) kmalloc(INFO_OUT_LEN * 2 + 2, GFP_KERNEL))) {
+               if (!(tmp = kmalloc(INFO_OUT_LEN * 2 + 2, GFP_KERNEL))) {
                        unlock_kernel();
                        return (-EFAULT);       /* out of memory */
                }
index f241f5e551cbf9a803d70fea08beac008b7b99d9..375d956884d73faa0c6168c56fa37748a0610dd9 100644 (file)
@@ -111,7 +111,7 @@ put_log_buffer(hysdn_card * card, char *cp)
        if (pd->if_used <= 0)
                return;         /* no open file for read */
 
-       if (!(ib = (struct log_data *) kmalloc(sizeof(struct log_data) + strlen(cp), GFP_ATOMIC)))
+       if (!(ib = kmalloc(sizeof(struct log_data) + strlen(cp), GFP_ATOMIC)))
                 return;        /* no memory */
        strcpy(ib->log_start, cp);      /* set output string */
        ib->next = NULL;
index 2cc56d6a9fae76758e5a2e5f71a84bd4a25dffcf..fb350c567c6ba01c768c87845ed37c70db6a79b2 100644 (file)
@@ -328,7 +328,7 @@ adpcm_state *
 isdn_audio_adpcm_init(adpcm_state * s, int nbits)
 {
        if (!s)
-               s = (adpcm_state *) kmalloc(sizeof(adpcm_state), GFP_ATOMIC);
+               s = kmalloc(sizeof(adpcm_state), GFP_ATOMIC);
        if (s) {
                s->a = 0;
                s->d = 5;
@@ -343,7 +343,7 @@ dtmf_state *
 isdn_audio_dtmf_init(dtmf_state * s)
 {
        if (!s)
-               s = (dtmf_state *) kmalloc(sizeof(dtmf_state), GFP_ATOMIC);
+               s = kmalloc(sizeof(dtmf_state), GFP_ATOMIC);
        if (s) {
                s->idx = 0;
                s->last = ' ';
@@ -621,7 +621,7 @@ silence_state *
 isdn_audio_silence_init(silence_state * s)
 {
        if (!s)
-               s = (silence_state *) kmalloc(sizeof(silence_state), GFP_ATOMIC);
+               s = kmalloc(sizeof(silence_state), GFP_ATOMIC);
        if (s) {
                s->idx = 0;
                s->state = 0;
index c36c817578cbe65608b745da7b48c1338c6814f5..838b3734e2b6d82cf2bda00072399167077da68a 100644 (file)
@@ -2948,7 +2948,7 @@ isdn_net_addphone(isdn_net_ioctl_phone * phone)
        isdn_net_phone *n;
 
        if (p) {
-               if (!(n = (isdn_net_phone *) kmalloc(sizeof(isdn_net_phone), GFP_KERNEL)))
+               if (!(n = kmalloc(sizeof(isdn_net_phone), GFP_KERNEL)))
                        return -ENOMEM;
                strcpy(n->num, phone->phone);
                n->next = p->local->phone[phone->outgoing & 1];
index 43811795b46bfb31bdd947e7998e73a487588234..1726131b20be1ed00e2161515582abc89c4de0b2 100644 (file)
@@ -717,7 +717,7 @@ isdn_ppp_fill_rq(unsigned char *buf, int len, int proto, int slot)
                printk(KERN_DEBUG "ippp: device not activated.\n");
                return 0;
        }
-       nbuf = (unsigned char *) kmalloc(len + 4, GFP_ATOMIC);
+       nbuf = kmalloc(len + 4, GFP_ATOMIC);
        if (!nbuf) {
                printk(KERN_WARNING "ippp: Can't alloc buf\n");
                return 0;
index 6ff85574e941ff5ee6b27549a43f45248cd6319f..eafcce5e656a7a796bba72c222ea33ab3ba413ad 100644 (file)
@@ -100,7 +100,7 @@ pcbit_l2_write(struct pcbit_dev *dev, ulong msg, ushort refnum,
                dev_kfree_skb(skb);
                return -1;
        }
-       if ((frame = (struct frame_buf *) kmalloc(sizeof(struct frame_buf),
+       if ((frame = kmalloc(sizeof(struct frame_buf),
                                                  GFP_ATOMIC)) == NULL) {
                printk(KERN_WARNING "pcbit_2_write: kmalloc failed\n");
                dev_kfree_skb(skb);
index d43ea81d6df9bcae26441a61edba92349d5308a1..7cec6de5e2b0704b1a74cfa0d4851d7dda72f983 100644 (file)
@@ -828,7 +828,7 @@ static ssize_t adb_write(struct file *file, const char __user *buf,
        if (!access_ok(VERIFY_READ, buf, count))
                return -EFAULT;
 
-       req = (struct adb_request *) kmalloc(sizeof(struct adb_request),
+       req = kmalloc(sizeof(struct adb_request),
                                             GFP_KERNEL);
        if (req == NULL)
                return -ENOMEM;
index 8862a83b8d8480451453fc7e6625350ce7f46cb2..4300c628f8af813d58113273f1402baba69bd87c 100644 (file)
@@ -321,7 +321,7 @@ static int do_open(struct inode * inode, struct file * filp)
 {
        struct apm_user *       as;
 
-       as = (struct apm_user *)kmalloc(sizeof(*as), GFP_KERNEL);
+       as = kmalloc(sizeof(*as), GFP_KERNEL);
        if (as == NULL) {
                printk(KERN_ERR "apm: cannot allocate struct of size %d bytes\n",
                       sizeof(*as));
index d9986f3a3fbf37c29b815e51ab9c44b015d43a7b..93e6ef9233f9ec6bdb9632c06db15e301e666c9c 100644 (file)
@@ -847,7 +847,7 @@ pbook_pci_save(void)
        n_pbook_pci_saves = npci;
        if (npci == 0)
                return;
-       ps = (struct pci_save *) kmalloc(npci * sizeof(*ps), GFP_KERNEL);
+       ps = kmalloc(npci * sizeof(*ps), GFP_KERNEL);
        pbook_pci_saves = ps;
        if (ps == NULL)
                return;
index 240ad084fa787ae4f5dc07b0acf47f25d2554b5c..50bc32a8bd5533921a9af2923cf618728a18db8b 100644 (file)
@@ -480,7 +480,7 @@ static int ca_send_message(struct dst_state *state, struct ca_msg *p_ca_message,
        struct ca_msg *hw_buffer;
        int result = 0;
 
-       if ((hw_buffer = (struct ca_msg *) kmalloc(sizeof (struct ca_msg), GFP_KERNEL)) == NULL) {
+       if ((hw_buffer = kmalloc(sizeof (struct ca_msg), GFP_KERNEL)) == NULL) {
                dprintk(verbose, DST_CA_ERROR, 1, " Memory allocation failure");
                return -ENOMEM;
        }
index 80a85cb4975fb6d28e95f9a9cefc0d1223dc2140..3e35931af35d13cd70d14f04eb5ec9fe26cd7db1 100644 (file)
@@ -657,7 +657,7 @@ static void frontend_init(struct dvb_bt8xx_card *card, u32 type)
 
        case BTTV_BOARD_TWINHAN_DST:
                /*      DST is not a frontend driver !!!                */
-               state = (struct dst_state *) kmalloc(sizeof (struct dst_state), GFP_KERNEL);
+               state = kmalloc(sizeof (struct dst_state), GFP_KERNEL);
                if (!state) {
                        printk("dvb_bt8xx: No memory\n");
                        break;
index 42f39a89bc4d7a05c039e68515394e9b2c59fedc..a6fb1d6a7b5dd168394933b9abb609ae3c7f6c19 100644 (file)
@@ -195,7 +195,7 @@ struct dvb_frontend* ttusbdecfe_dvbt_attach(const struct ttusbdecfe_config* conf
        struct ttusbdecfe_state* state = NULL;
 
        /* allocate memory for the internal state */
-       state = (struct ttusbdecfe_state*) kmalloc(sizeof(struct ttusbdecfe_state), GFP_KERNEL);
+       state = kmalloc(sizeof(struct ttusbdecfe_state), GFP_KERNEL);
        if (state == NULL)
                return NULL;
 
@@ -215,7 +215,7 @@ struct dvb_frontend* ttusbdecfe_dvbs_attach(const struct ttusbdecfe_config* conf
        struct ttusbdecfe_state* state = NULL;
 
        /* allocate memory for the internal state */
-       state = (struct ttusbdecfe_state*) kmalloc(sizeof(struct ttusbdecfe_state), GFP_KERNEL);
+       state = kmalloc(sizeof(struct ttusbdecfe_state), GFP_KERNEL);
        if (state == NULL)
                return NULL;
 
index b1012e92ee04e4b2e524ab44f1f883ad83b21342..917021fc29933ab373ba7641c03d1923bee56026 100644 (file)
@@ -218,7 +218,7 @@ static int dabusb_alloc_buffers (pdabusb_t s)
                 pipesize, packets, transfer_buffer_length);
 
        while (buffers < (s->total_buffer_size << 10)) {
-               b = (pbuff_t) kzalloc (sizeof (buff_t), GFP_KERNEL);
+               b = kzalloc(sizeof (buff_t), GFP_KERNEL);
                if (!b) {
                        err("kzalloc(sizeof(buff_t))==NULL");
                        goto err;
@@ -659,7 +659,7 @@ static int dabusb_ioctl (struct inode *inode, struct file *file, unsigned int cm
        switch (cmd) {
 
        case IOCTL_DAB_BULK:
-               pbulk = (pbulk_transfer_t) kmalloc (sizeof (bulk_transfer_t), GFP_KERNEL);
+               pbulk = kmalloc(sizeof (bulk_transfer_t), GFP_KERNEL);
 
                if (!pbulk) {
                        ret = -ENOMEM;
index 368d6e219fa43b767e2072c1c01a5169ad9f3e6e..86d2884e16c688a5af9c43717f6f7b0a4f379b9b 100644 (file)
@@ -138,7 +138,7 @@ static int grabbuf_alloc(struct planb *pb)
                + MAX_LNUM
 #endif /* PLANB_GSCANLINE */
                );
-       if ((pb->rawbuf = (unsigned char**) kmalloc (npage
+       if ((pb->rawbuf = kmalloc(npage
                                * sizeof(unsigned long), GFP_KERNEL)) == 0)
                return -ENOMEM;
        for (i = 0; i < npage; i++) {
index d8b88024bc2fa4ad93015b70078704e41ab78ffb..b560c9d7c5168f492809ddab1308d64fab75e297 100644 (file)
@@ -690,7 +690,7 @@ int usbvideo_register(
        }
 
        base_size = num_cams * sizeof(struct uvd) + sizeof(struct usbvideo);
-       cams = (struct usbvideo *) kzalloc(base_size, GFP_KERNEL);
+       cams = kzalloc(base_size, GFP_KERNEL);
        if (cams == NULL) {
                err("Failed to allocate %d. bytes for usbvideo struct", base_size);
                return -ENOMEM;
index 2ae3fb250630be9dd7f51dfa82e6b61e36375ae1..290e641356502fd8c87a95bc2649831d669c4b76 100644 (file)
@@ -346,7 +346,7 @@ videocodec_build_table (void)
                size);
 
        kfree(videocodec_buf);
-       videocodec_buf = (char *) kmalloc(size, GFP_KERNEL);
+       videocodec_buf = kmalloc(size, GFP_KERNEL);
 
        i = 0;
        i += scnprintf(videocodec_buf + i, size - 1,
index 1de30d711671ce91ae354027fe36f9b2e2e508fb..e33d446e74939df3875e619e59fde8ae638c13d0 100644 (file)
@@ -186,7 +186,7 @@ static int i2o_cfg_parms(unsigned long arg, unsigned int type)
        if (!dev)
                return -ENXIO;
 
-       ops = (u8 *) kmalloc(kcmd.oplen, GFP_KERNEL);
+       ops = kmalloc(kcmd.oplen, GFP_KERNEL);
        if (!ops)
                return -ENOMEM;
 
@@ -199,7 +199,7 @@ static int i2o_cfg_parms(unsigned long arg, unsigned int type)
         * It's possible to have a _very_ large table
         * and that the user asks for all of it at once...
         */
-       res = (u8 *) kmalloc(65536, GFP_KERNEL);
+       res = kmalloc(65536, GFP_KERNEL);
        if (!res) {
                kfree(ops);
                return -ENOMEM;
index 5db71604592789492a5718150d9659d1d0455b77..0a7e86859bf10677de7d3bc4227d84ed098303ba 100644 (file)
@@ -459,7 +459,7 @@ add_dataflash(struct spi_device *spi, char *name,
        struct mtd_info                 *device;
        struct flash_platform_data      *pdata = spi->dev.platform_data;
 
-       priv = (struct dataflash *) kzalloc(sizeof *priv, GFP_KERNEL);
+       priv = kzalloc(sizeof *priv, GFP_KERNEL);
        if (!priv)
                return -ENOMEM;
 
index b98592a8bac8034fb899c6b7f6c452be1b1bb68e..f22e46dfd770681c2772b1b9d904811e55e33475 100644 (file)
@@ -186,7 +186,7 @@ static int ipddp_xmit(struct sk_buff *skb, struct net_device *dev)
  */
 static int ipddp_create(struct ipddp_route *new_rt)
 {
-        struct ipddp_route *rt =(struct ipddp_route*) kmalloc(sizeof(*rt), GFP_KERNEL);
+        struct ipddp_route *rt = kmalloc(sizeof(*rt), GFP_KERNEL);
 
         if (rt == NULL)
                 return -ENOMEM;
index bae1de1e78025ff05dbe12e8827ce49a0f38c9ca..7845eaf6f29f9f38a4d2b6ad9b5aa56496c82568 100644 (file)
@@ -395,7 +395,7 @@ static void *bsd_alloc (unsigned char *options, int opt_len, int decomp)
  * Allocate the main control structure for this instance.
  */
     maxmaxcode = MAXCODE(bits);
-    db         = (struct bsd_db *) kmalloc (sizeof (struct bsd_db),
+    db         = kmalloc(sizeof (struct bsd_db),
                                            GFP_KERNEL);
     if (!db)
       {
index 16620bd97fbf71c60738762927fb1a2c4ebd0f25..11af0ae7510e0823d033629a3bdf15f1a6175f2c 100644 (file)
@@ -1603,7 +1603,7 @@ toshoboe_open (struct pci_dev *pci_dev, const struct pci_device_id *pdid)
   irda_qos_bits_to_value (&self->qos);
 
   /* Allocate twice the size to guarantee alignment */
-  self->ringbuf = (void *) kmalloc (OBOE_RING_LEN << 1, GFP_KERNEL);
+  self->ringbuf = kmalloc(OBOE_RING_LEN << 1, GFP_KERNEL);
   if (!self->ringbuf)
     {
       printk (KERN_ERR DRIVER_NAME ": can't allocate DMA buffers\n");
index 6e95645e72459b7aee4d06c39a532026f6565662..3ca1082ec7764b9b831e51c55745c2f43ef7b37c 100644 (file)
@@ -1747,7 +1747,7 @@ static int irda_usb_probe(struct usb_interface *intf,
        /* Don't change this buffer size and allocation without doing
         * some heavy and complete testing. Don't ask why :-(
         * Jean II */
-       self->speed_buff = (char *) kmalloc(IRDA_USB_SPEED_MTU, GFP_KERNEL);
+       self->speed_buff = kmalloc(IRDA_USB_SPEED_MTU, GFP_KERNEL);
        if (self->speed_buff == NULL) 
                goto err_out_3;
 
index 654a68b490ae6011f7810e968c8426e382b69872..3098960dc2a134ce97df39c125a0ba2492c01b75 100644 (file)
@@ -164,7 +164,7 @@ irport_open(int i, unsigned int iobase, unsigned int irq)
        
        /* Allocate memory if needed */
        if (self->tx_buff.truesize > 0) {
-               self->tx_buff.head = (__u8 *) kmalloc(self->tx_buff.truesize, 
+               self->tx_buff.head = kmalloc(self->tx_buff.truesize,
                                                      GFP_KERNEL);
                if (self->tx_buff.head == NULL) {
                        IRDA_ERROR("%s(), can't allocate memory for "
index b833016f1825fecf5b5008d4cb626ae15241be46..177c502f73857d38ef4a52ada04d0f56065b93ba 100644 (file)
@@ -884,7 +884,7 @@ static int i596_start_xmit (struct sk_buff *skb, struct net_device *dev) {
 
        dev->trans_start = jiffies;
 
-       tx_cmd = (struct tx_cmd *) kmalloc ((sizeof (struct tx_cmd) + sizeof (struct i596_tbd)), GFP_ATOMIC);
+       tx_cmd = kmalloc((sizeof (struct tx_cmd) + sizeof (struct i596_tbd)), GFP_ATOMIC);
        if (tx_cmd == NULL) {
                printk(KERN_WARNING "%s: i596_xmit Memory squeeze, dropping packet.\n", dev->name);
                lp->stats.tx_dropped++;
@@ -1266,7 +1266,7 @@ static void set_multicast_list(struct net_device *dev) {
        if (dev->mc_count > 0) {
                struct dev_mc_list *dmi;
                char *cp;
-               cmd = (struct i596_cmd *)kmalloc(sizeof(struct i596_cmd)+2+dev->mc_count*6, GFP_ATOMIC);
+               cmd = kmalloc(sizeof(struct i596_cmd)+2+dev->mc_count*6, GFP_ATOMIC);
                if (cmd == NULL) {
                        printk (KERN_ERR "%s: set_multicast Memory squeeze.\n", dev->name);
                        return;
index f54c55242f4a26922c8c1414b6c4308209b99e9f..72c8d6628f583a041023dfab6a90d7922e101cf8 100644 (file)
@@ -121,7 +121,7 @@ static void *z_comp_alloc(unsigned char *options, int opt_len)
        if (w_size < DEFLATE_MIN_SIZE || w_size > DEFLATE_MAX_SIZE)
                return NULL;
 
-       state = (struct ppp_deflate_state *) kmalloc(sizeof(*state),
+       state = kmalloc(sizeof(*state),
                                                     GFP_KERNEL);
        if (state == NULL)
                return NULL;
@@ -341,7 +341,7 @@ static void *z_decomp_alloc(unsigned char *options, int opt_len)
        if (w_size < DEFLATE_MIN_SIZE || w_size > DEFLATE_MAX_SIZE)
                return NULL;
 
-       state = (struct ppp_deflate_state *) kmalloc(sizeof(*state), GFP_KERNEL);
+       state = kmalloc(sizeof(*state), GFP_KERNEL);
        if (state == NULL)
                return NULL;
 
index f3655fd772f5b765c7f0e33fb693480a255135ae..d5bdd25746591a8b0bb47b2dca226b3fbca34fcf 100644 (file)
@@ -200,7 +200,7 @@ static void *mppe_alloc(unsigned char *options, int optlen)
            || options[0] != CI_MPPE || options[1] != CILEN_MPPE)
                goto out;
 
-       state = (struct ppp_mppe_state *) kmalloc(sizeof(*state), GFP_KERNEL);
+       state = kmalloc(sizeof(*state), GFP_KERNEL);
        if (state == NULL)
                goto out;
 
index 39c2152a07f426a9676263f6391a742c5d41ef89..a0806d262fc6530c1e72c2c75b14a999cc74e529 100644 (file)
@@ -229,10 +229,10 @@ static int sl_realloc_bufs(struct slip *sl, int mtu)
        if (len < 576 * 2)
                len = 576 * 2;
 
-       xbuff = (unsigned char *) kmalloc (len + 4, GFP_ATOMIC);
-       rbuff = (unsigned char *) kmalloc (len + 4, GFP_ATOMIC);
+       xbuff = kmalloc(len + 4, GFP_ATOMIC);
+       rbuff = kmalloc(len + 4, GFP_ATOMIC);
 #ifdef SL_INCLUDE_CSLIP
-       cbuff = (unsigned char *) kmalloc (len + 4, GFP_ATOMIC);
+       cbuff = kmalloc(len + 4, GFP_ATOMIC);
 #endif
 
 
index a4f735723c4100ad2a7df897f8868f4e1a4b2b93..a02c5fb40567eb59b73daabd5f93b8d063720e60 100644 (file)
@@ -231,7 +231,7 @@ static struct sv11_device *sv11_init(int iobase, int irq)
                return NULL;
        }
        
-       sv=(struct sv11_device *)kmalloc(sizeof(struct sv11_device), GFP_KERNEL);
+       sv = kmalloc(sizeof(struct sv11_device), GFP_KERNEL);
        if(!sv)
                goto fail3;
                        
index 36d1c3ff7078d28c91827e5af3d99644df09c0e0..62184dee377c5961c33b30179ba8784ea45185c1 100644 (file)
@@ -3455,7 +3455,7 @@ cpc_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
        if ((err = pci_enable_device(pdev)) < 0)
                return err;
 
-       card = (pc300_t *) kmalloc(sizeof(pc300_t), GFP_KERNEL);
+       card = kmalloc(sizeof(pc300_t), GFP_KERNEL);
        if (card == NULL) {
                printk("PC300 found at RAM 0x%016llx, "
                       "but could not allocate card structure.\n",
index b2a23aed4428576b5dc55adfc60db4588f6e001f..5873c346e7e9ee25ee53f3679982407c6b99d0eb 100644 (file)
@@ -784,7 +784,7 @@ void cpc_tty_receive(pc300dev_t *pc300dev)
                        continue;
                } 
                
-               new = (st_cpc_rx_buf *)kmalloc(rx_len + sizeof(st_cpc_rx_buf), GFP_ATOMIC);
+               new = kmalloc(rx_len + sizeof(st_cpc_rx_buf), GFP_ATOMIC);
                if (new == 0) {
                        cpc_tty_rx_disc_frame(pc300chan);
                        continue;
index 9c3ccc6691435b7b5ac96a266566fa8d6f93e8bb..1c9edd97accd679a816a66aa6e2a8cbb422c6d30 100644 (file)
@@ -123,8 +123,8 @@ static int x25_asy_change_mtu(struct net_device *dev, int newmtu)
        unsigned char *xbuff, *rbuff;
        int len = 2* newmtu;
 
-       xbuff = (unsigned char *) kmalloc (len + 4, GFP_ATOMIC);
-       rbuff = (unsigned char *) kmalloc (len + 4, GFP_ATOMIC);
+       xbuff = kmalloc(len + 4, GFP_ATOMIC);
+       rbuff = kmalloc(len + 4, GFP_ATOMIC);
 
        if (xbuff == NULL || rbuff == NULL)  
        {
@@ -465,11 +465,11 @@ static int x25_asy_open(struct net_device *dev)
 
        len = dev->mtu * 2;
 
-       sl->rbuff = (unsigned char *) kmalloc(len + 4, GFP_KERNEL);
+       sl->rbuff = kmalloc(len + 4, GFP_KERNEL);
        if (sl->rbuff == NULL)   {
                goto norbuff;
        }
-       sl->xbuff = (unsigned char *) kmalloc(len + 4, GFP_KERNEL);
+       sl->xbuff = kmalloc(len + 4, GFP_KERNEL);
        if (sl->xbuff == NULL)   {
                goto noxbuff;
        }
index 974a8e5bec8b493b6061a6433fa02fabdf5d1094..efb8cf3bd8ad6c0eaebc789fd2b8caf787d48d88 100644 (file)
@@ -1253,7 +1253,7 @@ static char * ap_auth_make_challenge(struct ap_data *ap)
                        return NULL;
        }
 
-       tmpbuf = (char *) kmalloc(WLAN_AUTH_CHALLENGE_LEN, GFP_ATOMIC);
+       tmpbuf = kmalloc(WLAN_AUTH_CHALLENGE_LEN, GFP_ATOMIC);
        if (tmpbuf == NULL) {
                PDEBUG(DEBUG_AP, "AP: kmalloc failed for challenge\n");
                return NULL;
index 24fc387bba6753255caee927c78352a6bcc2a2fc..c7678e67697dc435ebf721f13b253058aafb1bf0 100644 (file)
@@ -201,7 +201,7 @@ static u8 * prism2_read_pda(struct net_device *dev)
                0x7f0002 /* Intel PRO/Wireless 2011B (PCI) */,
        };
 
-       buf = (u8 *) kmalloc(PRISM2_PDA_SIZE, GFP_KERNEL);
+       buf = kmalloc(PRISM2_PDA_SIZE, GFP_KERNEL);
        if (buf == NULL)
                return NULL;
 
index a394a23b9a20090ae54922a774725d2848cdd332..3079378fb8cd284effe9f0285a3a81c5f8af1392 100644 (file)
@@ -2252,7 +2252,7 @@ static int hostap_tx_compl_read(local_info_t *local, int error,
        if (txdesc->sw_support) {
                len = le16_to_cpu(txdesc->data_len);
                if (len < PRISM2_DATA_MAXLEN) {
-                       *payload = (char *) kmalloc(len, GFP_ATOMIC);
+                       *payload = kmalloc(len, GFP_ATOMIC);
                        if (*payload == NULL ||
                            hfa384x_from_bap(dev, BAP0, *payload, len)) {
                                PDEBUG(DEBUG_EXTRA, "%s: could not read TX "
index 3b7b8063ff1c7803eb18fb3ba48039ee5c65077f..cb08bc5db2bd52b3b14b11fd6e3408d27c72b963 100644 (file)
@@ -3829,7 +3829,7 @@ static int prism2_ioctl_priv_hostapd(local_info_t *local, struct iw_point *p)
            p->length > PRISM2_HOSTAPD_MAX_BUF_SIZE || !p->pointer)
                return -EINVAL;
 
-       param = (struct prism2_hostapd_param *) kmalloc(p->length, GFP_KERNEL);
+       param = kmalloc(p->length, GFP_KERNEL);
        if (param == NULL)
                return -ENOMEM;
 
index 0796be9d9e77b2644901285a75db9250dc6e732b..04c19cefa1da4dad3f1e4da8d9d241199e622af2 100644 (file)
@@ -250,7 +250,7 @@ u16 hostap_tx_callback_register(local_info_t *local,
        unsigned long flags;
        struct hostap_tx_callback_info *entry;
 
-       entry = (struct hostap_tx_callback_info *) kmalloc(sizeof(*entry),
+       entry = kmalloc(sizeof(*entry),
                                                           GFP_ATOMIC);
        if (entry == NULL)
                return 0;
index dd9ba4aad7bb402b080518351f87db32da015f83..0e94fbbf7a941801eb1bbf2051323fe15f793eb4 100644 (file)
@@ -2246,7 +2246,7 @@ static int ipw2100_snapshot_alloc(struct ipw2100_priv *priv)
        if (priv->snapshot[0])
                return 1;
        for (i = 0; i < 0x30; i++) {
-               priv->snapshot[i] = (u8 *) kmalloc(0x1000, GFP_ATOMIC);
+               priv->snapshot[i] = kmalloc(0x1000, GFP_ATOMIC);
                if (!priv->snapshot[i]) {
                        IPW_DEBUG_INFO("%s: Error allocating snapshot "
                                       "buffer %d\n", priv->net_dev->name, i);
index 96606ed100761bca80fc5a04524f2b5fc0868959..838d510213c60ef74b3e6c1e04d24b156e27db01 100644 (file)
@@ -2775,7 +2775,7 @@ prism54_hostapd(struct net_device *ndev, struct iw_point *p)
            p->length > PRISM2_HOSTAPD_MAX_BUF_SIZE || !p->pointer)
                return -EINVAL;
 
-       param = (struct prism2_hostapd_param *) kmalloc(p->length, GFP_KERNEL);
+       param = kmalloc(p->length, GFP_KERNEL);
        if (param == NULL)
                return -ENOMEM;
 
index 233d906c08f0eed014e14a3395fe31ff562cd7b4..5eb81638e8467a1ff7b516a33aa9888941839f31 100644 (file)
@@ -603,7 +603,7 @@ static wavepoint_history *wl_new_wavepoint(unsigned short nwid, unsigned char se
   if(lp->wavepoint_table.num_wavepoints==MAX_WAVEPOINTS)
     return NULL;
   
-  new_wavepoint=(wavepoint_history *) kmalloc(sizeof(wavepoint_history),GFP_ATOMIC);
+  new_wavepoint = kmalloc(sizeof(wavepoint_history),GFP_ATOMIC);
   if(new_wavepoint==NULL)
     return NULL;
   
index 77e11ddad836d135f444d53f567262686d408c96..78ea72fb8f0ce9a3de74d6fd594442d90527ee4d 100644 (file)
@@ -101,7 +101,7 @@ int zd_ioread32v_locked(struct zd_chip *chip, u32 *values, const zd_addr_t *addr
 
        /* Allocate a single memory block for values and addresses. */
        count16 = 2*count;
-       a16 = (zd_addr_t *)kmalloc(count16 * (sizeof(zd_addr_t) + sizeof(u16)),
+       a16 = kmalloc(count16 * (sizeof(zd_addr_t) + sizeof(u16)),
                                   GFP_NOFS);
        if (!a16) {
                dev_dbg_f(zd_chip_dev(chip),
index 12bab64a62a15da1d1f853a0fa203cc268c6d311..6fb3f7979f21b89043bb3cc90d16240d110c590d 100644 (file)
@@ -874,7 +874,7 @@ void *iosapic_register(unsigned long hpa)
                return NULL;
        }
 
-       isi = (struct iosapic_info *)kzalloc(sizeof(struct iosapic_info), GFP_KERNEL);
+       isi = kzalloc(sizeof(struct iosapic_info), GFP_KERNEL);
        if (!isi) {
                BUG();
                return NULL;
index 298a6cfd84069fce3845a9ad9c14989449a9450d..ae5e974c45a794aa0a16c968ac1eb21b69c84b8e 100644 (file)
@@ -520,7 +520,7 @@ int compaq_nvram_load (void __iomem *rom_start, struct controller *ctrl)
                        return 2;
 
                while (nummem--) {
-                       mem_node = (struct pci_resource*) kmalloc(sizeof(struct pci_resource), GFP_KERNEL);
+                       mem_node = kmalloc(sizeof(struct pci_resource), GFP_KERNEL);
 
                        if (!mem_node)
                                break;
@@ -548,7 +548,7 @@ int compaq_nvram_load (void __iomem *rom_start, struct controller *ctrl)
                }
 
                while (numpmem--) {
-                       p_mem_node = (struct pci_resource*) kmalloc(sizeof(struct pci_resource), GFP_KERNEL);
+                       p_mem_node = kmalloc(sizeof(struct pci_resource), GFP_KERNEL);
 
                        if (!p_mem_node)
                                break;
@@ -576,7 +576,7 @@ int compaq_nvram_load (void __iomem *rom_start, struct controller *ctrl)
                }
 
                while (numio--) {
-                       io_node = (struct pci_resource*) kmalloc(sizeof(struct pci_resource), GFP_KERNEL);
+                       io_node = kmalloc(sizeof(struct pci_resource), GFP_KERNEL);
 
                        if (!io_node)
                                break;
@@ -604,7 +604,7 @@ int compaq_nvram_load (void __iomem *rom_start, struct controller *ctrl)
                }
 
                while (numbus--) {
-                       bus_node = (struct pci_resource*) kmalloc(sizeof(struct pci_resource), GFP_KERNEL);
+                       bus_node = kmalloc(sizeof(struct pci_resource), GFP_KERNEL);
 
                        if (!bus_node)
                                break;
index 6d3f580f2666a07135ac6e5a6a0050df62062e31..25d3aadfddbf8c13b2e642c37cbd8641d34213a0 100644 (file)
@@ -1320,7 +1320,7 @@ int pcie_init(struct controller * ctrl, struct pcie_device *dev)
        DBG_ENTER_ROUTINE
        
        spin_lock_init(&list_lock);     
-       php_ctlr = (struct php_ctlr_state_s *) kmalloc(sizeof(struct php_ctlr_state_s), GFP_KERNEL);
+       php_ctlr = kmalloc(sizeof(struct php_ctlr_state_s), GFP_KERNEL);
 
        if (!php_ctlr) {        /* allocate controller state data */
                err("%s: HPC controller memory allocation error!\n", __FUNCTION__);
index 55866b6b26fac755d6ba194fedf875965d71b060..6f5fabbd14e58f77453c112e9c77850af1d38b52 100644 (file)
@@ -148,7 +148,7 @@ static struct aer_rpc* aer_alloc_rpc(struct pcie_device *dev)
 {
        struct aer_rpc *rpc;
 
-       if (!(rpc = (struct aer_rpc *)kmalloc(sizeof(struct aer_rpc),
+       if (!(rpc = kmalloc(sizeof(struct aer_rpc),
                GFP_KERNEL)))
                return NULL;
 
index b7fdb4d21a965dd6fc7b22f240fd3f3506d1c840..95738dbd5d4555cec6428595b06ce72cd32aa8be 100644 (file)
@@ -109,7 +109,7 @@ static int pnp_dock_event(int dock, struct pnp_docking_station_info *info)
        if (!current->fs->root) {
                return -EAGAIN;
        }
-       if (!(envp = (char **) kcalloc (20, sizeof (char *), GFP_KERNEL))) {
+       if (!(envp = kcalloc(20, sizeof (char *), GFP_KERNEL))) {
                return -ENOMEM;
        }
        if (!(buf = kzalloc(256, GFP_KERNEL))) {
index c9321b920e904d3bf0b1fb006d78381898c718b3..25b5d7a6641796fc272b41428917146a2dcd3215 100644 (file)
@@ -688,7 +688,7 @@ raw3215_probe (struct ccw_device *cdev)
        raw->cdev = cdev;
        raw->inbuf = (char *) raw + sizeof(struct raw3215_info);
        memset(raw, 0, sizeof(struct raw3215_info));
-       raw->buffer = (char *) kmalloc(RAW3215_BUFFER_SIZE,
+       raw->buffer = kmalloc(RAW3215_BUFFER_SIZE,
                                       GFP_KERNEL|GFP_DMA);
        if (raw->buffer == NULL) {
                spin_lock(&raw3215_device_lock);
index e3491a5f52196eeedbad1d7ee3a16f35cd3c2184..3e86fd1756e5dc5b43df29fb6c7fd480fd2160b4 100644 (file)
@@ -377,7 +377,7 @@ do_kdsk_ioctl(struct kbd_data *kbd, struct kbentry __user *user_kbe,
                if (!(key_map = kbd->key_maps[tmp.kb_table])) {
                        int j;
 
-                       key_map = (ushort *) kmalloc(sizeof(plain_map),
+                       key_map = kmalloc(sizeof(plain_map),
                                                     GFP_KERNEL);
                        if (!key_map)
                                return -ENOMEM;
index 732dfbdb85c45860c575e7c6667fbdfc3d35c0b8..f7c10d954ec604219069d540900959e522b0352c 100644 (file)
@@ -127,7 +127,7 @@ cpi_prepare_req(void)
        struct cpi_sccb *sccb;
        struct cpi_evbuf *evb;
 
-       req = (struct sclp_req *) kmalloc(sizeof(struct sclp_req), GFP_KERNEL);
+       req = kmalloc(sizeof(struct sclp_req), GFP_KERNEL);
        if (req == NULL)
                return ERR_PTR(-ENOMEM);
        sccb = (struct cpi_sccb *) __get_free_page(GFP_KERNEL | GFP_DMA);
index a62b00083d0cb04df308241d61de289f86666eb7..5bb13a9d08989b0544b1fc2bb23af1b296c45f44 100644 (file)
@@ -295,7 +295,7 @@ static long zcrypt_cex2a_modexpo(struct zcrypt_device *zdev,
        struct completion work;
        int rc;
 
-       ap_msg.message = (void *) kmalloc(CEX2A_MAX_MESSAGE_SIZE, GFP_KERNEL);
+       ap_msg.message = kmalloc(CEX2A_MAX_MESSAGE_SIZE, GFP_KERNEL);
        if (!ap_msg.message)
                return -ENOMEM;
        ap_msg.psmid = (((unsigned long long) current->pid) << 32) +
@@ -337,7 +337,7 @@ static long zcrypt_cex2a_modexpo_crt(struct zcrypt_device *zdev,
        struct completion work;
        int rc;
 
-       ap_msg.message = (void *) kmalloc(CEX2A_MAX_MESSAGE_SIZE, GFP_KERNEL);
+       ap_msg.message = kmalloc(CEX2A_MAX_MESSAGE_SIZE, GFP_KERNEL);
        if (!ap_msg.message)
                return -ENOMEM;
        ap_msg.psmid = (((unsigned long long) current->pid) << 32) +
index b6a4ecdc80257152a1244d46eb5a2fc0365fe5cd..32e37014345c60fb02e803d2d25866aeac815fd7 100644 (file)
@@ -279,7 +279,7 @@ static long zcrypt_pcica_modexpo(struct zcrypt_device *zdev,
        struct completion work;
        int rc;
 
-       ap_msg.message = (void *) kmalloc(PCICA_MAX_MESSAGE_SIZE, GFP_KERNEL);
+       ap_msg.message = kmalloc(PCICA_MAX_MESSAGE_SIZE, GFP_KERNEL);
        if (!ap_msg.message)
                return -ENOMEM;
        ap_msg.psmid = (((unsigned long long) current->pid) << 32) +
@@ -321,7 +321,7 @@ static long zcrypt_pcica_modexpo_crt(struct zcrypt_device *zdev,
        struct completion work;
        int rc;
 
-       ap_msg.message = (void *) kmalloc(PCICA_MAX_MESSAGE_SIZE, GFP_KERNEL);
+       ap_msg.message = kmalloc(PCICA_MAX_MESSAGE_SIZE, GFP_KERNEL);
        if (!ap_msg.message)
                return -ENOMEM;
        ap_msg.psmid = (((unsigned long long) current->pid) << 32) +
index 2da8b9381407eee5e1c56425835e7b8f18353f3f..b7153c1e15cdea786c2fb7c9d453213aaddda39d 100644 (file)
@@ -717,7 +717,7 @@ long zcrypt_pcixcc_send_cprb(struct zcrypt_device *zdev, struct ica_xcRB *xcRB)
        };
        int rc;
 
-       ap_msg.message = (void *) kmalloc(PCIXCC_MAX_XCRB_MESSAGE_SIZE, GFP_KERNEL);
+       ap_msg.message = kmalloc(PCIXCC_MAX_XCRB_MESSAGE_SIZE, GFP_KERNEL);
        if (!ap_msg.message)
                return -ENOMEM;
        ap_msg.psmid = (((unsigned long long) current->pid) << 32) +
index 3257c22dd79cc014f2787567addb0aec31c2a787..03cc263fe0daf6d1e835a6617bbadc69fa297258 100644 (file)
@@ -1646,7 +1646,7 @@ add_channel(struct ccw_device *cdev, enum channel_types type)
                return -1;
        }
        memset(ch, 0, sizeof (struct channel));
-       if ((ch->ccw = (struct ccw1 *) kmalloc(8*sizeof(struct ccw1),
+       if ((ch->ccw = kmalloc(8*sizeof(struct ccw1),
                                               GFP_KERNEL | GFP_DMA)) == NULL) {
                kfree(ch);
                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)
                return -1;
        }
        fsm_newstate(ch->fsm, CH_STATE_IDLE);
-       if ((ch->irb = (struct irb *) kmalloc(sizeof (struct irb),
+       if ((ch->irb = kmalloc(sizeof (struct irb),
                                              GFP_KERNEL)) == NULL) {
                ctc_pr_warn("ctc: Out of memory in add_channel\n");
                kfree_fsm(ch->fsm);
@@ -2535,7 +2535,7 @@ ctc_print_statistics(struct ctc_priv *priv)
        DBF_TEXT(trace, 4, __FUNCTION__);
        if (!priv)
                return;
-       sbuf = (char *)kmalloc(2048, GFP_KERNEL);
+       sbuf = kmalloc(2048, GFP_KERNEL);
        if (sbuf == NULL)
                return;
        p = sbuf;
index 1476ce2b437cb498f7e47b680767b71cdd80f99e..229aeb5fc399b79cf34bd4c5a68f174e16c58b68 100644 (file)
@@ -772,7 +772,7 @@ iucv_register_program (__u8 pgmname[16],
        }
 
        /* Allocate handler entry */
-       new_handler = (handler *)kmalloc(sizeof(handler), GFP_ATOMIC);
+       new_handler = kmalloc(sizeof(handler), GFP_ATOMIC);
        if (new_handler == NULL) {
                printk(KERN_WARNING "%s: storage allocation for new handler "
                       "failed.\n", __FUNCTION__);
index 5d39b2df0cc43fdcb49417641bdbb606f3e18ff0..85093b71f9fa52ebc9f0f95716c16f840111a926 100644 (file)
@@ -237,7 +237,7 @@ zfcp_device_setup(char *devstr)
                return 0;
 
        len = strlen(devstr) + 1;
-       str = (char *) kmalloc(len, GFP_KERNEL);
+       str = kmalloc(len, GFP_KERNEL);
        if (!str)
                goto err_out;
        memcpy(str, devstr, len);
index 2722af5d340428402e9085ba5421d4eee115e1cf..386e7de0b7e3c47a38efdda9ed01def8fc6839d6 100644 (file)
@@ -659,7 +659,7 @@ static int vfc_probe(void)
        if (!cards)
                return -ENODEV;
 
-       vfc_dev_lst = (struct vfc_dev **)kmalloc(sizeof(struct vfc_dev *) *
+       vfc_dev_lst = kmalloc(sizeof(struct vfc_dev *) *
                                                 (cards+1),
                                                 GFP_KERNEL);
        if (vfc_dev_lst == NULL)
index ac108f9e26741c544daa6c8756ff8a512a1b6fd2..426cd6f49f5db6ad1ddcd01de7bbd2e7850d3b47 100644 (file)
@@ -288,7 +288,7 @@ int aac_get_containers(struct aac_dev *dev)
 
        if (maximum_num_containers < MAXIMUM_NUM_CONTAINERS)
                maximum_num_containers = MAXIMUM_NUM_CONTAINERS;
-       fsa_dev_ptr = (struct fsa_dev_info *) kmalloc(
+       fsa_dev_ptr = kmalloc(
          sizeof(*fsa_dev_ptr) * maximum_num_containers, GFP_KERNEL);
        if (!fsa_dev_ptr) {
                aac_fib_free(fibptr);
index d5cf8b91a0e7ad4ccc93e77d8b5ec45d8cad2292..6d305b2f854e2fad06e869ac05c996351cb21c7e 100644 (file)
@@ -386,7 +386,7 @@ struct aac_dev *aac_init_adapter(struct aac_dev *dev)
         *      Ok now init the communication subsystem
         */
 
-       dev->queues = (struct aac_queue_block *) kmalloc(sizeof(struct aac_queue_block), GFP_KERNEL);
+       dev->queues = kmalloc(sizeof(struct aac_queue_block), GFP_KERNEL);
        if (dev->queues == NULL) {
                printk(KERN_ERR "Error could not allocate comm region.\n");
                return NULL;
index d7a61a6bdaae0720362b306d33fc489a790841f5..1d239f6c01030e4450df42918fd313f362e1da5c 100644 (file)
@@ -699,7 +699,7 @@ static int aha1542_queuecommand(Scsi_Cmnd * SCpnt, void (*done) (Scsi_Cmnd *))
 #endif
                int i;
                ccb[mbo].op = 2;        /* SCSI Initiator Command  w/scatter-gather */
-               SCpnt->host_scribble = (unsigned char *) kmalloc(512, GFP_KERNEL | GFP_DMA);
+               SCpnt->host_scribble = kmalloc(512, GFP_KERNEL | GFP_DMA);
                sgpnt = (struct scatterlist *) SCpnt->request_buffer;
                cptr = (struct chain *) SCpnt->host_scribble;
                if (cptr == NULL) {
index 46eed10b25d95db126f5bbe38be66c52d8791407..7d1fec620948bd11f1c90c043fbb88b450a5b6e1 100644 (file)
@@ -2565,7 +2565,7 @@ aic7xxx_allocate_scb(struct aic7xxx_host *p)
       }
     }
     scb_count = min( (i-1), p->scb_data->maxscbs - p->scb_data->numscbs);
-    scb_ap = (struct aic7xxx_scb *)kmalloc(sizeof (struct aic7xxx_scb) * scb_count
+    scb_ap = kmalloc(sizeof (struct aic7xxx_scb) * scb_count
                                           + sizeof(struct aic7xxx_scb_dma), GFP_ATOMIC);
     if (scb_ap == NULL)
       return(0);
index e95b367d09edd739af8e1739a8d9ed2a1b8d20aa..a965ed3548d5583fd2ac56d343b0e8d5a0f64d08 100644 (file)
@@ -4319,7 +4319,7 @@ static int __devinit adapter_sg_tables_alloc(struct AdapterCtlBlk *acb)
 
        dprintkdbg(DBG_1, "Allocate %i pages for SG tables\n", pages);
        while (pages--) {
-               ptr = (struct SGentry *)kmalloc(PAGE_SIZE, GFP_KERNEL);
+               ptr = kmalloc(PAGE_SIZE, GFP_KERNEL);
                if (!ptr) {
                        adapter_sg_tables_free(acb);
                        return 1;
index 60b1b434eba75adac8707f014da4d2c95868ceaf..365db537a28da81ddee1d7a1403a50ddc02a0383 100644 (file)
@@ -297,7 +297,7 @@ static void adpt_inquiry(adpt_hba* pHba)
        s32 rcode;
 
        memset(msg, 0, sizeof(msg));
-       buf = (u8*)kmalloc(80,GFP_KERNEL|ADDR32);
+       buf = kmalloc(80,GFP_KERNEL|ADDR32);
        if(!buf){
                printk(KERN_ERR"%s: Could not allocate buffer\n",pHba->name);
                return;
@@ -1311,7 +1311,7 @@ static s32 adpt_i2o_reset_hba(adpt_hba* pHba)
                schedule_timeout_uninterruptible(1);
        } while (m == EMPTY_QUEUE);
 
-       status = (u8*)kmalloc(4, GFP_KERNEL|ADDR32);
+       status = kmalloc(4, GFP_KERNEL|ADDR32);
        if(status == NULL) {
                adpt_send_nop(pHba, m);
                printk(KERN_ERR"IOP reset failed - no free memory.\n");
@@ -1444,7 +1444,7 @@ static int adpt_i2o_parse_lct(adpt_hba* pHba)
                        }
                        continue;
                }
-               d = (struct i2o_device *)kmalloc(sizeof(struct i2o_device), GFP_KERNEL);
+               d = kmalloc(sizeof(struct i2o_device), GFP_KERNEL);
                if(d==NULL)
                {
                        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)
                                pDev = pDev->next_lun;
                        }
                        if(!pDev ) { // Something new add it
-                               d = (struct i2o_device *)kmalloc(sizeof(struct i2o_device), GFP_KERNEL);
+                               d = kmalloc(sizeof(struct i2o_device), GFP_KERNEL);
                                if(d==NULL)
                                {
                                        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)
 
        kfree(pHba->reply_pool);
 
-       pHba->reply_pool = (u32*)kmalloc(pHba->reply_fifo_size * REPLY_FRAME_SIZE * 4, GFP_KERNEL|ADDR32);
+       pHba->reply_pool = kmalloc(pHba->reply_fifo_size * REPLY_FRAME_SIZE * 4, GFP_KERNEL|ADDR32);
        if(!pHba->reply_pool){
                printk(KERN_ERR"%s: Could not allocate reply pool\n",pHba->name);
                return -1;
index f160357e37a6f065b18f68cc1df2cc463455bbd4..d561663fb4e41cfcce5716a9be8adf362a10f7a6 100644 (file)
@@ -2828,7 +2828,7 @@ static int i91u_detect(struct scsi_host_template * tpnt)
 
        for (; tul_num_scb >= MAX_TARGETS + 3; tul_num_scb--) {
                i = tul_num_ch * tul_num_scb * sizeof(SCB);
-               if ((tul_scb = (SCB *) kmalloc(i, GFP_ATOMIC | GFP_DMA)) != NULL)
+               if ((tul_scb = kmalloc(i, GFP_ATOMIC | GFP_DMA)) != NULL)
                        break;
        }
        if (tul_scb == NULL) {
index 824fe080d1dc2b9d0b2e1a35b2e1a64464e615b9..7d231106790308999b22b5276718cec47f369cb2 100644 (file)
@@ -5777,7 +5777,7 @@ static int osst_probe(struct device *dev)
        dev_num = i;
 
        /* allocate a struct osst_tape for this device */
-       tpnt = (struct osst_tape *)kmalloc(sizeof(struct osst_tape), GFP_ATOMIC);
+       tpnt = kmalloc(sizeof(struct osst_tape), GFP_ATOMIC);
        if (tpnt == NULL) {
                write_unlock(&os_scsi_tapes_lock);
                printk(KERN_ERR "osst :E: Can't allocate device descriptor, device not attached.\n");
index aa60a5f1fbc3b5b639cf0123900b0ba862a36518..3b2e1a53e6e2df3e63dbf153e42ae516e33be652 100644 (file)
@@ -117,7 +117,7 @@ int __init pluto_detect(struct scsi_host_template *tpnt)
 #endif
                        return 0;
        }
-       fcs = (struct ctrl_inquiry *) kmalloc (sizeof (struct ctrl_inquiry) * fcscount, GFP_DMA);
+       fcs = kmalloc(sizeof (struct ctrl_inquiry) * fcscount, GFP_DMA);
        if (!fcs) {
                printk ("PLUTO: Not enough memory to probe\n");
                return 0;
index d1268cb46837b258cd721f992546c7f1084d6345..0578ba42718b125ead70d8a9d599934d18f5e1fe 100644 (file)
@@ -546,7 +546,7 @@ int sr_is_xa(Scsi_CD *cd)
        if (!xa_test)
                return 0;
 
-       raw_sector = (unsigned char *) kmalloc(2048, GFP_KERNEL | SR_GFP_DMA(cd));
+       raw_sector = kmalloc(2048, GFP_KERNEL | SR_GFP_DMA(cd));
        if (!raw_sector)
                return -ENOMEM;
        if (0 == sr_read_sector(cd, cd->ms_offset + 16,
index a3e9d0f2eb5ba2da67f6431e68888487ac93158d..4eb3da996b369518edb0a1efa924f5c97657a614 100644 (file)
@@ -117,7 +117,7 @@ int sr_set_blocklength(Scsi_CD *cd, int blocklength)
                density = (blocklength > 2048) ? 0x81 : 0x83;
 #endif
 
-       buffer = (unsigned char *) kmalloc(512, GFP_KERNEL | GFP_DMA);
+       buffer = kmalloc(512, GFP_KERNEL | GFP_DMA);
        if (!buffer)
                return -ENOMEM;
 
@@ -164,7 +164,7 @@ int sr_cd_check(struct cdrom_device_info *cdi)
        if (cd->cdi.mask & CDC_MULTI_SESSION)
                return 0;
 
-       buffer = (unsigned char *) kmalloc(512, GFP_KERNEL | GFP_DMA);
+       buffer = kmalloc(512, GFP_KERNEL | GFP_DMA);
        if (!buffer)
                return -ENOMEM;
 
index 5516c59ed5ec28d6ea1dc864fd8a9ebd504bdd56..2d12bf9f19d64efecc95b991c94697dc921f7295 100644 (file)
@@ -2195,7 +2195,7 @@ static struct gs_buf *gs_buf_alloc(unsigned int size, gfp_t kmalloc_flags)
        if (size == 0)
                return NULL;
 
-       gb = (struct gs_buf *)kmalloc(sizeof(struct gs_buf), kmalloc_flags);
+       gb = kmalloc(sizeof(struct gs_buf), kmalloc_flags);
        if (gb == NULL)
                return NULL;
 
index 9325e46a68c03d847386a5d3884d8cc163039828..282d82efc0b0a0e8280884ad7a041e3561b7bf80 100644 (file)
@@ -365,7 +365,7 @@ static inline struct urb *urb_list_first(int epid)
 /* Adds an urb_entry last in the list for this epid. */
 static inline void urb_list_add(struct urb *urb, int epid)
 {
-       urb_entry_t *urb_entry = (urb_entry_t *)kmalloc(sizeof(urb_entry_t), KMALLOC_FLAG);
+       urb_entry_t *urb_entry = kmalloc(sizeof(urb_entry_t), KMALLOC_FLAG);
        assert(urb_entry);
 
        urb_entry->urb = urb;
index c703f73e16550211652c86fc1d37be2e30bead47..6c7f3efb1d40d71a74e8e8296c81f187e1264860 100644 (file)
@@ -766,7 +766,7 @@ static int auerbuf_setup (pauerbufctl_t bcp, unsigned int numElements, unsigned
                 bep->bufp = kmalloc (bufsize, GFP_KERNEL);
                 if (!bep->bufp)
                        goto bl_fail;
-                bep->dr = (struct usb_ctrlrequest *) kmalloc (sizeof (struct usb_ctrlrequest), GFP_KERNEL);
+                bep->dr = kmalloc(sizeof (struct usb_ctrlrequest), GFP_KERNEL);
                 if (!bep->dr)
                        goto bl_fail;
                 bep->urbp = usb_alloc_urb (0, GFP_KERNEL);
@@ -1969,7 +1969,7 @@ static int auerswald_probe (struct usb_interface *intf,
        info("device is a %s", cp->dev_desc);
 
         /* get the maximum allowed control transfer length */
-        pbuf = (__le16 *) kmalloc (2, GFP_KERNEL);    /* use an allocated buffer because of urb target */
+        pbuf = kmalloc(2, GFP_KERNEL);    /* use an allocated buffer because of urb target */
         if (!pbuf) {
                err( "out of memory");
                goto pfail;
index a1fdb85b8c0ae91225c447f5cb79b6c19792e991..45cdf9bc43b2bd01ae9daa5bb10f8949386a1cce 100644 (file)
@@ -1493,7 +1493,7 @@ static struct cypress_buf *cypress_buf_alloc(unsigned int size)
        if (size == 0)
                return NULL;
 
-       cb = (struct cypress_buf *)kmalloc(sizeof(struct cypress_buf), GFP_KERNEL);
+       cb = kmalloc(sizeof(struct cypress_buf), GFP_KERNEL);
        if (cb == NULL)
                return NULL;
 
index 9d9ea874639ce047bc3ac855d4b94abd020fa254..efd9ce3f931f48430787149fbbc0a329f7118ccd 100644 (file)
@@ -1681,7 +1681,7 @@ dbg( "digi_startup: TOP" );
        for( i=0; i<serial->type->num_ports+1; i++ ) {
 
                /* allocate port private structure */
-               priv = (struct digi_port *)kmalloc( sizeof(struct digi_port),
+               priv = kmalloc( sizeof(struct digi_port),
                        GFP_KERNEL );
                if( priv == (struct digi_port *)0 ) {
                        while( --i >= 0 )
@@ -1714,7 +1714,7 @@ dbg( "digi_startup: TOP" );
        }
 
        /* allocate serial private structure */
-       serial_priv = (struct digi_serial *)kmalloc( sizeof(struct digi_serial),
+       serial_priv = kmalloc( sizeof(struct digi_serial),
                GFP_KERNEL );
        if( serial_priv == (struct digi_serial *)0 ) {
                for( i=0; i<serial->type->num_ports+1; i++ )
index 2da2684e080982a4f72c91ee3c26b9c79a85568b..980285c0233a049cfca9d1acc01a4ecff6e858c2 100644 (file)
@@ -2811,7 +2811,7 @@ static struct edge_buf *edge_buf_alloc(unsigned int size)
        if (size == 0)
                return NULL;
 
-       eb = (struct edge_buf *)kmalloc(sizeof(struct edge_buf), GFP_KERNEL);
+       eb = kmalloc(sizeof(struct edge_buf), GFP_KERNEL);
        if (eb == NULL)
                return NULL;
 
index d72cf8bc7f76be74678eccdc4df280aabfff57c5..42f757a5b876e621da94472c53506bf9401a37fc 100644 (file)
@@ -595,7 +595,7 @@ static int ipaq_open(struct usb_serial_port *port, struct file *filp)
 
        bytes_in = 0;
        bytes_out = 0;
-       priv = (struct ipaq_private *)kmalloc(sizeof(struct ipaq_private), GFP_KERNEL);
+       priv = kmalloc(sizeof(struct ipaq_private), GFP_KERNEL);
        if (priv == NULL) {
                err("%s - Out of memory", __FUNCTION__);
                return -ENOMEM;
index e284d6c0fd35b03f5f42c97ff6af5358463bd1a3..62bea0c923bd25e52a5a8ef956971eefea07ec91 100644 (file)
@@ -269,7 +269,7 @@ static int kobil_open (struct usb_serial_port *port, struct file *filp)
        }
 
        // allocate memory for write_urb transfer buffer
-       port->write_urb->transfer_buffer = (unsigned char *) kmalloc(write_urb_transfer_buffer_length, GFP_KERNEL);
+       port->write_urb->transfer_buffer = kmalloc(write_urb_transfer_buffer_length, GFP_KERNEL);
        if (! port->write_urb->transfer_buffer) {
                kfree(transfer_buffer);
                usb_free_urb(port->write_urb);
@@ -696,7 +696,7 @@ static int  kobil_ioctl(struct usb_serial_port *port, struct file *file,
                return 0;
 
        case TCFLSH:   // 0x540B
-               transfer_buffer = (unsigned char *) kmalloc(transfer_buffer_length, GFP_KERNEL);
+               transfer_buffer = kmalloc(transfer_buffer_length, GFP_KERNEL);
                if (! transfer_buffer) {
                        return -ENOBUFS;
                }
index d124d780e42e27703216908337f011094d181c4c..5dc2ac9afa90b01a210d1993c05b3dea47323309 100644 (file)
@@ -159,7 +159,7 @@ static struct pl2303_buf *pl2303_buf_alloc(unsigned int size)
        if (size == 0)
                return NULL;
 
-       pb = (struct pl2303_buf *)kmalloc(sizeof(struct pl2303_buf), GFP_KERNEL);
+       pb = kmalloc(sizeof(struct pl2303_buf), GFP_KERNEL);
        if (pb == NULL)
                return NULL;
 
index f42eb9ea64052a1a9d6dc90ee59966fc392a9c90..83189005c6fbb400e353167b2d16b3b64db7fdba 100644 (file)
@@ -1710,7 +1710,7 @@ static struct circ_buf *ti_buf_alloc(void)
 {
        struct circ_buf *cb;
 
-       cb = (struct circ_buf *)kmalloc(sizeof(struct circ_buf), GFP_KERNEL);
+       cb = kmalloc(sizeof(struct circ_buf), GFP_KERNEL);
        if (cb == NULL)
                return NULL;
 
index dc45e58e2b8c88892e92bcecacc5fdba32a839ee..5483d8564c1b9b42015e39ffc264366fdac95d24 100644 (file)
@@ -416,7 +416,7 @@ static int whiteheat_attach (struct usb_serial *serial)
        for (i = 0; i < serial->num_ports; i++) {
                port = serial->port[i];
 
-               info = (struct whiteheat_private *)kmalloc(sizeof(struct whiteheat_private), GFP_KERNEL);
+               info = kmalloc(sizeof(struct whiteheat_private), GFP_KERNEL);
                if (info == NULL) {
                        err("%s: Out of memory for port structures\n", serial->type->description);
                        goto no_private;
@@ -487,7 +487,7 @@ static int whiteheat_attach (struct usb_serial *serial)
                usb_set_serial_port_data(port, info);
        }
 
-       command_info = (struct whiteheat_command_private *)kmalloc(sizeof(struct whiteheat_command_private), GFP_KERNEL);
+       command_info = kmalloc(sizeof(struct whiteheat_command_private), GFP_KERNEL);
        if (command_info == NULL) {
                err("%s: Out of memory for port structures\n", serial->type->description);
                goto no_command_private;
index fb8bacaae27cbcb5eaaf6f845fc5e10dc8ddaa7f..e3528eca29a54d7ddb67866cc66261db95d18b20 100644 (file)
@@ -646,7 +646,7 @@ sddr09_read_sg_test_only(struct us_data *us) {
                return result;
        }
 
-       buf = (unsigned char *) kmalloc(bulklen, GFP_NOIO);
+       buf = kmalloc(bulklen, GFP_NOIO);
        if (!buf)
                return -ENOMEM;
 
index 6761b68c35e97182046e1774d1755ef810423bb7..6c9dc2e69c82f69d5a24a7e590fab50070451b9c 100644 (file)
@@ -447,7 +447,7 @@ static int clcdfb_probe(struct amba_device *dev, void *id)
                goto out;
        }
 
-       fb = (struct clcd_fb *) kmalloc(sizeof(struct clcd_fb), GFP_KERNEL);
+       fb = kmalloc(sizeof(struct clcd_fb), GFP_KERNEL);
        if (!fb) {
                printk(KERN_INFO "CLCD: could not allocate new clcd_fb struct\n");
                ret = -ENOMEM;
index 797b42305b0ff4f2e4485799e5e2ed0e9470acdb..fe28848e7b52e201f128d58b56f1a50c23a23526 100644 (file)
@@ -146,7 +146,7 @@ static void* i2c_matroxfb_probe(struct matrox_fb_info* minfo) {
        unsigned long flags;
        struct matroxfb_dh_maven_info* m2info;
 
-       m2info = (struct matroxfb_dh_maven_info*)kmalloc(sizeof(*m2info), GFP_KERNEL);
+       m2info = kmalloc(sizeof(*m2info), GFP_KERNEL);
        if (!m2info)
                return NULL;
 
index e9b4115fcad0208891bfe672159453e40f3db1ea..cb2aa402ddfd93eb0b180f9a05c74909c2be859a 100644 (file)
@@ -2028,7 +2028,7 @@ static int matroxfb_probe(struct pci_dev* pdev, const struct pci_device_id* dumm
        }
 
 #ifdef CONFIG_FB_MATROX_MULTIHEAD
-       minfo = (struct matrox_fb_info*)kmalloc(sizeof(*minfo), GFP_KERNEL);
+       minfo = kmalloc(sizeof(*minfo), GFP_KERNEL);
        if (!minfo)
                return -1;
 #else
index 27eb4bb4f89fe2000aa2dbeda19a3c1a40a3387c..2c9801090faeaa89e95b0c9d2a1ad3822052cc61 100644 (file)
@@ -694,7 +694,7 @@ static void* matroxfb_crtc2_probe(struct matrox_fb_info* minfo) {
        /* hardware is CRTC2 incapable... */
        if (!ACCESS_FBINFO(devflags.crtc2))
                return NULL;
-       m2info = (struct matroxfb_dh_fb_info*)kmalloc(sizeof(*m2info), GFP_KERNEL);
+       m2info = kmalloc(sizeof(*m2info), GFP_KERNEL);
        if (!m2info) {
                printk(KERN_ERR "matroxfb_crtc2: Not enough memory for CRTC2 control structs\n");
                return NULL;
index 9c48250fd726406fc040816c96b4fa42e8d305ce..e8f6c5ad3e904a785c9a8fb73eac9af0b0b18633 100644 (file)
@@ -313,7 +313,7 @@ int autofs4_fill_super(struct super_block *s, void *data, int silent)
        struct autofs_sb_info *sbi;
        struct autofs_info *ino;
 
-       sbi = (struct autofs_sb_info *) kmalloc(sizeof(*sbi), GFP_KERNEL);
+       sbi = kmalloc(sizeof(*sbi), GFP_KERNEL);
        if ( !sbi )
                goto fail_unlock;
        DPRINTK("starting up, sbi = %p",sbi);
index 81b042ee24e650339445504e5e83a9ecda9ca384..af5bb93276f855ab6a3bdc8ec9cf632be8b5e22c 100644 (file)
@@ -260,7 +260,7 @@ befs_btree_find(struct super_block *sb, befs_data_stream * ds,
                goto error;
        }
 
-       this_node = (befs_btree_node *) kmalloc(sizeof (befs_btree_node),
+       this_node = kmalloc(sizeof (befs_btree_node),
                                                GFP_NOFS);
        if (!this_node) {
                befs_error(sb, "befs_btree_find() failed to allocate %u "
index e831a8f30849a98a088d46394742cc3b4c476182..b8e304a0661e473ba7b44ca74ceebd3e8f228c52 100644 (file)
@@ -28,7 +28,7 @@ void
 befs_error(const struct super_block *sb, const char *fmt, ...)
 {
        va_list args;
-       char *err_buf = (char *) kmalloc(ERRBUFSIZE, GFP_KERNEL);
+       char *err_buf = kmalloc(ERRBUFSIZE, GFP_KERNEL);
        if (err_buf == NULL) {
                printk(KERN_ERR "could not allocate %d bytes\n", ERRBUFSIZE);
                return;
@@ -46,7 +46,7 @@ void
 befs_warning(const struct super_block *sb, const char *fmt, ...)
 {
        va_list args;
-       char *err_buf = (char *) kmalloc(ERRBUFSIZE, GFP_KERNEL);
+       char *err_buf = kmalloc(ERRBUFSIZE, GFP_KERNEL);
        if (err_buf == NULL) {
                printk(KERN_ERR "could not allocate %d bytes\n", ERRBUFSIZE);
                return;
@@ -70,7 +70,7 @@ befs_debug(const struct super_block *sb, const char *fmt, ...)
        char *err_buf = NULL;
 
        if (BEFS_SB(sb)->mount_opts.debug) {
-               err_buf = (char *) kmalloc(ERRBUFSIZE, GFP_KERNEL);
+               err_buf = kmalloc(ERRBUFSIZE, GFP_KERNEL);
                if (err_buf == NULL) {
                        printk(KERN_ERR "could not allocate %d bytes\n",
                                ERRBUFSIZE);
index 00687ea627385b11f0d03249b8bd038b380165ca..c2e08252af35d5dd3140ff32d1cf79bbfd3521c7 100644 (file)
@@ -311,7 +311,7 @@ static Node *create_entry(const char __user *buffer, size_t count)
 
        err = -ENOMEM;
        memsize = sizeof(Node) + count + 8;
-       e = (Node *) kmalloc(memsize, GFP_USER);
+       e = kmalloc(memsize, GFP_USER);
        if (!e)
                goto out;
 
index 098790eb2aa161967538c91b734c3fe45fa5d8b7..472e33e0f3cfd7fc3914d8dc78b41b82fa91aa64 100644 (file)
@@ -4876,7 +4876,7 @@ int CIFSSMBNotify(const int xid, struct cifsTconInfo *tcon,
        } else {
                /* Add file to outstanding requests */
                /* BB change to kmem cache alloc */     
-               dnotify_req = (struct dir_notify_req *) kmalloc(
+               dnotify_req = kmalloc(
                                                sizeof(struct dir_notify_req),
                                                 GFP_KERNEL);
                if(dnotify_req) {
index 7b40c69f44ebb07bd60edd7a44ece0b29c4e9e76..43baa1afa0218842ce0ded1007cec8d9f8c5ecf5 100644 (file)
@@ -818,7 +818,7 @@ jffs_mkdir(struct inode *dir, struct dentry *dentry, int mode)
 
        D1({
                int len = dentry->d_name.len;
-               char *_name = (char *) kmalloc(len + 1, GFP_KERNEL);
+               char *_name = kmalloc(len + 1, GFP_KERNEL);
                memcpy(_name, dentry->d_name.name, len);
                _name[len] = '\0';
                printk("***jffs_mkdir(): dir = 0x%p, name = \"%s\", "
@@ -964,7 +964,7 @@ jffs_remove(struct inode *dir, struct dentry *dentry, int type)
        D1({
                int len = dentry->d_name.len;
                const char *name = dentry->d_name.name;
-               char *_name = (char *) kmalloc(len + 1, GFP_KERNEL);
+               char *_name = kmalloc(len + 1, GFP_KERNEL);
                memcpy(_name, name, len);
                _name[len] = '\0';
                printk("***jffs_remove(): file = \"%s\", ino = %ld\n", _name, dentry->d_inode->i_ino);
index d0e783f199eafd0a76e42b6f97cc01385d89cbea..6dd18911b44ced8c830caa4a5181fad7bf9cef02 100644 (file)
@@ -436,7 +436,7 @@ jffs_checksum_flash(struct mtd_info *mtd, loff_t start, int size, __u32 *result)
        int i, length;
 
        /* Allocate read buffer */
-       read_buf = (__u8 *) kmalloc (sizeof(__u8) * 4096, GFP_KERNEL);
+       read_buf = kmalloc(sizeof(__u8) * 4096, GFP_KERNEL);
        if (!read_buf) {
                printk(KERN_NOTICE "kmalloc failed in jffs_checksum_flash()\n");
                return -ENOMEM;
@@ -744,11 +744,11 @@ static int check_partly_erased_sectors(struct jffs_fmcontrol *fmc){
 
 
        /* Allocate read buffers */
-       read_buf1 = (__u8 *) kmalloc (sizeof(__u8) * READ_AHEAD_BYTES, GFP_KERNEL);
+       read_buf1 = kmalloc(sizeof(__u8) * READ_AHEAD_BYTES, GFP_KERNEL);
        if (!read_buf1)
                return -ENOMEM;
 
-       read_buf2 = (__u8 *) kmalloc (sizeof(__u8) * READ_AHEAD_BYTES, GFP_KERNEL);
+       read_buf2 = kmalloc(sizeof(__u8) * READ_AHEAD_BYTES, GFP_KERNEL);
        if (!read_buf2) {
                kfree(read_buf1);
                return -ENOMEM;
@@ -876,7 +876,7 @@ jffs_scan_flash(struct jffs_control *c)
        }
 
        /* Allocate read buffer */
-       read_buf = (__u8 *) kmalloc (sizeof(__u8) * 4096, GFP_KERNEL);
+       read_buf = kmalloc(sizeof(__u8) * 4096, GFP_KERNEL);
        if (!read_buf) {
                flash_safe_release(fmc->mtd);
                return -ENOMEM;
@@ -1463,7 +1463,7 @@ jffs_insert_node(struct jffs_control *c, struct jffs_file *f,
                        kfree(f->name);
                        DJM(no_name--);
                }
-               if (!(f->name = (char *) kmalloc(raw_inode->nsize + 1,
+               if (!(f->name = kmalloc(raw_inode->nsize + 1,
                                                 GFP_KERNEL))) {
                        return -ENOMEM;
                }
@@ -1737,7 +1737,7 @@ jffs_find_child(struct jffs_file *dir, const char *name, int len)
                printk("jffs_find_child(): Found \"%s\".\n", f->name);
        }
        else {
-               char *copy = (char *) kmalloc(len + 1, GFP_KERNEL);
+               char *copy = kmalloc(len + 1, GFP_KERNEL);
                if (copy) {
                        memcpy(copy, name, len);
                        copy[len] = '\0';
@@ -2627,7 +2627,7 @@ jffs_print_tree(struct jffs_file *first_file, int indent)
                return;
        }
 
-       if (!(space = (char *) kmalloc(indent + 1, GFP_KERNEL))) {
+       if (!(space = kmalloc(indent + 1, GFP_KERNEL))) {
                printk("jffs_print_tree(): Out of memory!\n");
                return;
        }
index 47bc0b5d13242c69e8ceb344d837769bb623a929..6d62f3222892cd1fd6c74ce679c724f941e0bda2 100644 (file)
@@ -3777,12 +3777,12 @@ static int ciGetLeafPrefixKey(dtpage_t * lp, int li, dtpage_t * rp,
        struct component_name lkey;
        struct component_name rkey;
 
-       lkey.name = (wchar_t *) kmalloc((JFS_NAME_MAX + 1) * sizeof(wchar_t),
+       lkey.name = kmalloc((JFS_NAME_MAX + 1) * sizeof(wchar_t),
                                        GFP_KERNEL);
        if (lkey.name == NULL)
                return -ENOMEM;
 
-       rkey.name = (wchar_t *) kmalloc((JFS_NAME_MAX + 1) * sizeof(wchar_t),
+       rkey.name = kmalloc((JFS_NAME_MAX + 1) * sizeof(wchar_t),
                                        GFP_KERNEL);
        if (rkey.name == NULL) {
                kfree(lkey.name);
index ee9b473b7b808d7866dfd95db09d775576977943..53f63b47a6d34ec818543ac3a40cb356fb92c24f 100644 (file)
@@ -120,7 +120,7 @@ int diMount(struct inode *ipimap)
         * allocate/initialize the in-memory inode map control structure
         */
        /* allocate the in-memory inode map control structure. */
-       imap = (struct inomap *) kmalloc(sizeof(struct inomap), GFP_KERNEL);
+       imap = kmalloc(sizeof(struct inomap), GFP_KERNEL);
        if (imap == NULL) {
                jfs_err("diMount: kmalloc returned NULL!");
                return -ENOMEM;
index 6220dc2a3f2c246e31817902a674648321fd6873..068886de4dda19b176ab2340da64269c05d87da1 100644 (file)
@@ -39,7 +39,7 @@ nlmsvc_share_file(struct nlm_host *host, struct nlm_file *file,
                        return nlm_lck_denied;
        }
 
-       share = (struct nlm_share *) kmalloc(sizeof(*share) + oh->len,
+       share = kmalloc(sizeof(*share) + oh->len,
                                                GFP_KERNEL);
        if (share == NULL)
                return nlm_lck_denied_nolocks;
index ee458aeab24a5ef1ebc1ad8aad1410cd2d64abd9..b3fd29baadc391ff61c822bde3e056e8b3b339e3 100644 (file)
@@ -1877,7 +1877,7 @@ static int nfs4_proc_unlink_setup(struct rpc_message *msg, struct dentry *dir,
        struct nfs_server *server = NFS_SERVER(dir->d_inode);
        struct unlink_desc *up;
 
-       up = (struct unlink_desc *) kmalloc(sizeof(*up), GFP_KERNEL);
+       up = kmalloc(sizeof(*up), GFP_KERNEL);
        if (!up)
                return -ENOMEM;
        
index 97ae1b92bc47d0088a10ff3b1bc6433a70f05bda..5296a29cc5eb51779169525a149a98b3206ed0ad 100644 (file)
@@ -135,7 +135,7 @@ static void *posix_acl_to_disk(const struct posix_acl *acl, size_t * size)
        int n;
 
        *size = reiserfs_acl_size(acl->a_count);
-       ext_acl = (reiserfs_acl_header *) kmalloc(sizeof(reiserfs_acl_header) +
+       ext_acl = kmalloc(sizeof(reiserfs_acl_header) +
                                                  acl->a_count *
                                                  sizeof(reiserfs_acl_entry),
                                                  GFP_NOFS);
index 7492cfb92ceddfabcd8eefacf1cea392c06b9b51..bb82e70cde8d048fb01c3594b0233ba8c9d83fbd 100644 (file)
@@ -28,7 +28,7 @@ static __inline__ void pmd_populate(struct mm_struct *mm, pmd_t *pmd,
 static __inline__ pgd_t *pgd_alloc(struct mm_struct *mm)
 {
        unsigned int pgd_size = (USER_PTRS_PER_PGD * sizeof(pgd_t));
-       pgd_t *pgd = (pgd_t *)kmalloc(pgd_size, GFP_KERNEL);
+       pgd_t *pgd = kmalloc(pgd_size, GFP_KERNEL);
 
        if (pgd)
                memset(pgd, 0, pgd_size);
index b29dd468817e63dd7111b12fd03acd1400115969..cb803e56cb64a20c1d3cba3271177212e05dcd5e 100644 (file)
@@ -41,7 +41,7 @@ static inline void pgd_init(unsigned long page)
 static inline pgd_t *get_pgd_slow(void)
 {
        unsigned int pgd_size = (USER_PTRS_PER_PGD * sizeof(pgd_t));
-       pgd_t *ret = (pgd_t *)kmalloc(pgd_size, GFP_KERNEL);
+       pgd_t *ret = kmalloc(pgd_size, GFP_KERNEL);
        return ret;
 }
 
index be512cc98791a31b85c0317e6f2b19e1e90c3631..4c2632a8d31b97a4fe3cdac74669a106f359e116 100644 (file)
@@ -64,7 +64,7 @@ void coda_sysctl_clean(void);
 
 #define CODA_ALLOC(ptr, cast, size) do { \
     if (size < PAGE_SIZE) \
-        ptr = (cast)kmalloc((unsigned long) size, GFP_KERNEL); \
+        ptr = kmalloc((unsigned long) size, GFP_KERNEL); \
     else \
         ptr = (cast)vmalloc((unsigned long) size); \
     if (!ptr) \
index 0992616eeed6fee540337d595800667db4bf838d..c82c215693d7c9c54ae93dfa90d7f162085900d5 100644 (file)
@@ -36,7 +36,7 @@ struct msg_msg *load_msg(const void __user *src, int len)
        if (alen > DATALEN_MSG)
                alen = DATALEN_MSG;
 
-       msg = (struct msg_msg *)kmalloc(sizeof(*msg) + alen, GFP_KERNEL);
+       msg = kmalloc(sizeof(*msg) + alen, GFP_KERNEL);
        if (msg == NULL)
                return ERR_PTR(-ENOMEM);
 
@@ -56,7 +56,7 @@ struct msg_msg *load_msg(const void __user *src, int len)
                alen = len;
                if (alen > DATALEN_SEG)
                        alen = DATALEN_SEG;
-               seg = (struct msg_msgseg *)kmalloc(sizeof(*seg) + alen,
+               seg = kmalloc(sizeof(*seg) + alen,
                                                 GFP_KERNEL);
                if (seg == NULL) {
                        err = -ENOMEM;
index 458a2c46cef3d5a022947fbe85350bacdda17317..baf55c459c8bc15b2e2b514642656889a1e123a2 100644 (file)
@@ -208,7 +208,7 @@ static void cfg_cmd_event(struct tipc_cmd_msg *msg,
 
                        if (mng.link_subscriptions > 64)
                                break;
-                       sub = (struct subscr_data *)kmalloc(sizeof(*sub),
+                       sub = kmalloc(sizeof(*sub),
                                                            GFP_ATOMIC);
                        if (sub == NULL) {
                                warn("Memory squeeze; dropped remote link subscription\n");
index f4c67042e3ac16ba72bb6effe6a2e93550fc7bf5..3391f2a9b4d167150114deec246ce3cc7082978e 100644 (file)
@@ -1023,7 +1023,7 @@ static int snd_mixer_oss_build_input(struct snd_mixer_oss *mixer, struct snd_mix
        }
        up_read(&mixer->card->controls_rwsem);
        if (slot.present != 0) {
-               pslot = (struct slot *)kmalloc(sizeof(slot), GFP_KERNEL);
+               pslot = kmalloc(sizeof(slot), GFP_KERNEL);
                if (! pslot)
                        return -ENOMEM;
                *pslot = slot;
index 0ffa9970bf0ff307cee68b9698c3bffc63f3eee9..7cf9913a47b26ca4e3adb02a25e2538542913463 100644 (file)
@@ -1992,7 +1992,7 @@ int ad1848_init (char *name, struct resource *ports, int irq, int dma_playback,
                        devc->audio_flags |= DMA_DUPLEX;
        }
 
-       portc = (ad1848_port_info *) kmalloc(sizeof(ad1848_port_info), GFP_KERNEL);
+       portc = kmalloc(sizeof(ad1848_port_info), GFP_KERNEL);
        if(portc==NULL) {
                release_region(devc->base, 4);
                return -1;
index b6924c7f1484f5c6c01f1684d3654dec21f7f0fe..de40e21bf2798c6d248de7f8dbf6d0fc643cf0ab 100644 (file)
@@ -408,7 +408,7 @@ static int __init cs4232_pnp_probe(struct pnp_dev *dev, const struct pnp_device_
 {
        struct address_info *isapnpcfg;
 
-       isapnpcfg=(struct address_info*)kmalloc(sizeof(*isapnpcfg),GFP_KERNEL);
+       isapnpcfg = kmalloc(sizeof(*isapnpcfg),GFP_KERNEL);
        if (!isapnpcfg)
                return -ENOMEM;
 
index 49f902f35c280a32d6441bcb6f1808fe811f1e46..efcf589d7083401450d2c743d36b65e5cedbf6ee 100644 (file)
@@ -1139,7 +1139,7 @@ static int emu10k1_audio_open(struct inode *inode, struct file *file)
 
 match:
 
-       wave_dev = (struct emu10k1_wavedevice *) kmalloc(sizeof(struct emu10k1_wavedevice), GFP_KERNEL);
+       wave_dev = kmalloc(sizeof(struct emu10k1_wavedevice), GFP_KERNEL);
 
        if (wave_dev == NULL) { 
                ERROR();
@@ -1155,7 +1155,7 @@ match:
                /* Recording */
                struct wiinst *wiinst;
 
-               if ((wiinst = (struct wiinst *) kmalloc(sizeof(struct wiinst), GFP_KERNEL)) == NULL) {
+               if ((wiinst = kmalloc(sizeof(struct wiinst), GFP_KERNEL)) == NULL) {
                        ERROR();
                        kfree(wave_dev);
                        return -ENOMEM;
@@ -1211,7 +1211,7 @@ match:
                struct woinst *woinst;
                int i;
 
-               if ((woinst = (struct woinst *) kmalloc(sizeof(struct woinst), GFP_KERNEL)) == NULL) {
+               if ((woinst = kmalloc(sizeof(struct woinst), GFP_KERNEL)) == NULL) {
                        ERROR();
                        kfree(wave_dev);
                        return -ENOMEM;
index 0545814cc67dc08a0da0776356df6ebfc34fff76..57674f8c8a2e73f1f5a5dc95ec90d87d63393271 100644 (file)
@@ -157,7 +157,7 @@ int emu10k1_mpuin_add_buffer(struct emu10k1_mpuin *card_mpuin, struct midi_hdr *
        midihdr->flags |= MIDIBUF_INQUEUE;      /* set */
        midihdr->flags &= ~MIDIBUF_DONE;        /* clear */
 
-       if ((midiq = (struct midi_queue *) kmalloc(sizeof(struct midi_queue), GFP_ATOMIC)) == NULL) {
+       if ((midiq = kmalloc(sizeof(struct midi_queue), GFP_ATOMIC)) == NULL) {
                /* Message lost */
                return -1;
        }
index 5938d31f9e219d4ea81de5b5c07734f4bf3a4530..a8cc75db3e45274a3ed9e3f644d8f0f8296be391 100644 (file)
@@ -117,7 +117,7 @@ int emu10k1_mpuout_add_buffer(struct emu10k1_card *card, struct midi_hdr *midihd
        midihdr->flags |= MIDIBUF_INQUEUE;
        midihdr->flags &= ~MIDIBUF_DONE;
 
-       if ((midiq = (struct midi_queue *) kmalloc(sizeof(struct midi_queue), GFP_KERNEL)) == NULL) {
+       if ((midiq = kmalloc(sizeof(struct midi_queue), GFP_KERNEL)) == NULL) {
                /* Message lost */
                return -1;
        }
index 8ac77df86397134c3087e0b87b0eeae1ede96946..cca3dad2bdf4bf2550f48668286687cb1dc33ed1 100644 (file)
@@ -58,7 +58,7 @@ static int midiin_add_buffer(struct emu10k1_mididevice *midi_dev, struct midi_hd
 {
        struct midi_hdr *midihdr;
 
-       if ((midihdr = (struct midi_hdr *) kmalloc(sizeof(struct midi_hdr), GFP_KERNEL)) == NULL) {
+       if ((midihdr = kmalloc(sizeof(struct midi_hdr), GFP_KERNEL)) == NULL) {
                ERROR();
                return -EINVAL;
        }
@@ -128,7 +128,7 @@ match:
                mutex_lock(&card->open_sem);
        }
 
-       if ((midi_dev = (struct emu10k1_mididevice *) kmalloc(sizeof(*midi_dev), GFP_KERNEL)) == NULL)
+       if ((midi_dev = kmalloc(sizeof(*midi_dev), GFP_KERNEL)) == NULL)
                return -EINVAL;
 
        midi_dev->card = card;
@@ -328,7 +328,7 @@ static ssize_t emu10k1_midi_write(struct file *file, const char __user *buffer,
        if (!access_ok(VERIFY_READ, buffer, count))
                return -EFAULT;
 
-       if ((midihdr = (struct midi_hdr *) kmalloc(sizeof(struct midi_hdr), GFP_KERNEL)) == NULL)
+       if ((midihdr = kmalloc(sizeof(struct midi_hdr), GFP_KERNEL)) == NULL)
                return -EINVAL;
 
        midihdr->bufferlength = count;
@@ -490,7 +490,7 @@ int emu10k1_seq_midi_open(int dev, int mode,
                        
        DPF(2, "emu10k1_seq_midi_open()\n");
        
-       if ((midi_dev = (struct emu10k1_mididevice *) kmalloc(sizeof(*midi_dev), GFP_KERNEL)) == NULL)
+       if ((midi_dev = kmalloc(sizeof(*midi_dev), GFP_KERNEL)) == NULL)
                return -EINVAL;
 
        midi_dev->card = card;
@@ -540,7 +540,7 @@ int emu10k1_seq_midi_out(int dev, unsigned char midi_byte)
 
        card = midi_devs[dev]->devc;
 
-       if ((midihdr = (struct midi_hdr *) kmalloc(sizeof(struct midi_hdr), GFP_KERNEL)) == NULL)
+       if ((midihdr = kmalloc(sizeof(struct midi_hdr), GFP_KERNEL)) == NULL)
                return -EINVAL;
 
        midihdr->bufferlength = 1;
index cbcaaa34189abc9bbf66119e2b524681948445c1..6419796c2ed7b665e442547dfea1447e6f7590a4 100644 (file)
@@ -194,7 +194,7 @@ static int emu10k1_private_mixer(struct emu10k1_card *card, unsigned int cmd, un
 
        case SOUND_MIXER_PRIVATE3:
 
-               ctl = (struct mixer_private_ioctl *) kmalloc(sizeof(struct mixer_private_ioctl), GFP_KERNEL);
+               ctl = kmalloc(sizeof(struct mixer_private_ioctl), GFP_KERNEL);
                if (ctl == NULL)
                        return -ENOMEM;
 
index 784bdd707055ede1e4ae3cdf176fd3ba262e26d1..d18286ccc14d244ee18d55b9ac9d04c48b0c2c50 100644 (file)
@@ -1435,7 +1435,7 @@ static int hal2_init_card(struct hal2_card **phal2, struct hpc3_regs *hpc3)
        int ret = 0;
        struct hal2_card *hal2;
 
-       hal2 = (struct hal2_card *) kmalloc(sizeof(struct hal2_card), GFP_KERNEL);
+       hal2 = kmalloc(sizeof(struct hal2_card), GFP_KERNEL);
        if (!hal2)
                return -ENOMEM;
        memset(hal2, 0, sizeof(struct hal2_card));
index e96220541971498a0c25c31f98ebb36cc11d6f6f..2796c0ef985fc5c08d62af8c33b92da2c83e1240 100644 (file)
@@ -1023,7 +1023,7 @@ int attach_mpu401(struct address_info *hw_config, struct module *owner)
                                devc->capabilities |= MPU_CAP_INTLG;    /* Supports intelligent mode */
 
 
-       mpu401_synth_operations[m] = (struct synth_operations *)kmalloc(sizeof(struct synth_operations), GFP_KERNEL);
+       mpu401_synth_operations[m] = kmalloc(sizeof(struct synth_operations), GFP_KERNEL);
 
        if (mpu401_synth_operations[m] == NULL)
        {
index 4799bc77f987223308da7adc3aa22bae581122b7..2e8cfa5481f28c4e1e7d7f2d40b5326538bd02d7 100644 (file)
@@ -166,7 +166,7 @@ int opl3_detect(int ioaddr, int *osp)
                return 0;
        }
 
-       devc = (struct opl_devinfo *)kmalloc(sizeof(*devc), GFP_KERNEL);
+       devc = kmalloc(sizeof(*devc), GFP_KERNEL);
 
        if (devc == NULL)
        {
index 440537c72604f467bdf359414d216fc5c8662546..07cbacf63824602d3a2763984efc3368c5c0f4ad 100644 (file)
@@ -625,7 +625,7 @@ int sb_dsp_detect(struct address_info *hw_config, int pci, int pciio, struct sb_
         */
 
 
-       detected_devc = (sb_devc *)kmalloc(sizeof(sb_devc), GFP_KERNEL);
+       detected_devc = kmalloc(sizeof(sb_devc), GFP_KERNEL);
        if (detected_devc == NULL)
        {
                printk(KERN_ERR "sb: Can't allocate memory for device information\n");
index 2e3bc045cabaf67d35a0d00d981dbba1e3df5866..8b796704e1120a15caaed0c96edffa67a34e8006 100644 (file)
@@ -173,7 +173,7 @@ void sb_dsp_midi_init(sb_devc * devc, struct module *owner)
                return;
        }
        std_midi_synth.midi_dev = devc->my_mididev = dev;
-       midi_devs[dev] = (struct midi_operations *)kmalloc(sizeof(struct midi_operations), GFP_KERNEL);
+       midi_devs[dev] = kmalloc(sizeof(struct midi_operations), GFP_KERNEL);
        if (midi_devs[dev] == NULL)
        {
                printk(KERN_WARNING "Sound Blaster:  failed to allocate MIDI memory.\n");
@@ -189,7 +189,7 @@ void sb_dsp_midi_init(sb_devc * devc, struct module *owner)
        midi_devs[dev]->devc = devc;
 
 
-       midi_devs[dev]->converter = (struct synth_operations *)kmalloc(sizeof(struct synth_operations), GFP_KERNEL);
+       midi_devs[dev]->converter = kmalloc(sizeof(struct synth_operations), GFP_KERNEL);
        if (midi_devs[dev]->converter == NULL)
        {
                  printk(KERN_WARNING "Sound Blaster:  failed to allocate MIDI memory.\n");
index 238e2cf44b082bb1b702a3065baed77172d0c1b0..fad1a4f25ad6db0402de24f24f0c21e1be301c54 100644 (file)
@@ -734,7 +734,7 @@ int sb_mixer_init(sb_devc * devc, struct module *owner)
        if (m == -1)
                return 0;
 
-       mixer_devs[m] = (struct mixer_operations *)kmalloc(sizeof(struct mixer_operations), GFP_KERNEL);
+       mixer_devs[m] = kmalloc(sizeof(struct mixer_operations), GFP_KERNEL);
        if (mixer_devs[m] == NULL)
        {
                printk(KERN_ERR "sb_mixer: Can't allocate memory\n");
index d952b2264da1da46fc0cb70e4e7228b0cf0f4817..103940fd5b4f46e9e2ae7c8435acf64938679faa 100644 (file)
@@ -183,7 +183,7 @@ static void __init attach_v_midi (struct address_info *hw_config)
                return;
        }
        
-       m=(struct vmidi_memory *)kmalloc(sizeof(struct vmidi_memory), GFP_KERNEL);
+       m = kmalloc(sizeof(struct vmidi_memory), GFP_KERNEL);
        if (m == NULL)
        {
                printk(KERN_WARNING "Loopback MIDI: Failed to allocate memory\n");
index c5bf363d32c2fb055e9639a2040e4501fb989fd7..26a7c6af95bcc5c18992cbe2a2ebea1763f741c7 100644 (file)
@@ -1267,7 +1267,7 @@ static int __init waveartist_init(wavnc_info *devc)
        conf_printf2(dev_name, devc->hw.io_base, devc->hw.irq,
                     devc->hw.dma, devc->hw.dma2);
 
-       portc = (wavnc_port_info *)kmalloc(sizeof(wavnc_port_info), GFP_KERNEL);
+       portc = kmalloc(sizeof(wavnc_port_info), GFP_KERNEL);
        if (portc == NULL)
                goto nomem;