login
Login
/
Register
Search
Search this site:
Forums
News
Blogs
Features
Site
Home
»
Mailing list archives
»
linux-kernel
»
2007
»
August
»
24
Re: [PATCH 09/30] mtd: Don't cast kmalloc() return value in drivers/mtd/maps/pmcmsp-flash.c
view
thread
Previous message: [
thread
] [
date
] [
author
]
Next message: [
thread
] [
date
] [
author
]
[view in full thread]
From: Denys Vlasenko
Subject:
Re: [PATCH 09/30] mtd: Don't cast kmalloc() return value in drivers/mtd/maps/pmcmsp-flash.c
Date: Friday, August 24, 2007 - 3:41 am
On Friday 24 August 2007 00:52, Jesper Juhl wrote:
quoted text
> kmalloc() returns a void pointer. > No need to cast it.
quoted text
> - msp_flash = (struct mtd_info **)kmalloc( > - fcnt * sizeof(struct map_info *), GFP_KERNEL); > - msp_parts = (struct mtd_partition **)kmalloc( > - fcnt * sizeof(struct mtd_partition *), GFP_KERNEL); > - msp_maps = (struct map_info *)kmalloc( > - fcnt * sizeof(struct mtd_info), GFP_KERNEL); > + msp_flash = kmalloc(fcnt * sizeof(struct map_info *), GFP_KERNEL); > + msp_parts = kmalloc(fcnt * sizeof(struct mtd_partition *), GFP_KERNEL); > + msp_maps = kmalloc(fcnt * sizeof(struct mtd_info), GFP_KERNEL); > memset(msp_maps, 0, fcnt * sizeof(struct mtd_info));
This one wants kzalloc.
quoted text
> - msp_parts[i] = (struct mtd_partition *)kmalloc( > - pcnt * sizeof(struct mtd_partition), GFP_KERNEL); > + msp_parts[i] = kmalloc(pcnt * sizeof(struct mtd_partition), > + GFP_KERNEL); > memset(msp_parts[i], 0, pcnt * sizeof(struct mtd_partition)); > > /* now initialize the devices proper */
Same -- vda -
unsubscribe notice
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to
majordomo@vger.kernel.org
More majordomo info at
http://vger.kernel.org/majordomo-info.html
Please read the FAQ at
http://www.tux.org/lkml/
Previous message: [
thread
] [
date
] [
author
]
Next message: [
thread
] [
date
] [
author
]
Messages in current thread:
[PATCH 0/30] Remove unneeded casts of [kv][mzc]alloc() ret ...
, Jesper Juhl
, (Thu Aug 23, 4:35 pm)
[PATCH 01/30] ia64: Remove unnecessary cast of allocation ...
, Jesper Juhl
, (Thu Aug 23, 4:40 pm)
[PATCH 02/30] cris: Remove unnecessary cast of allocation ...
, Jesper Juhl
, (Thu Aug 23, 4:42 pm)
[PATCH 03/30] um: Don't unnecessarily cast allocation retu ...
, Jesper Juhl
, (Thu Aug 23, 4:43 pm)
[PATCH 04/30] powerpc: Don't cast kmalloc return value in ...
, Jesper Juhl
, (Thu Aug 23, 4:45 pm)
[PATCH 05/30] atm: No need to cast vmalloc() return value
, Jesper Juhl
, (Thu Aug 23, 4:46 pm)
[PATCH 06/30] i2o: No need to cast kmalloc() return value ...
, Jesper Juhl
, (Thu Aug 23, 4:48 pm)
[PATCH 07/30] mtd: Get rid of pointless cast of kzalloc() ...
, Jesper Juhl
, (Thu Aug 23, 4:50 pm)
[PATCH 08/30] mtd: Avoid a pointless kmalloc() return valu ...
, Jesper Juhl
, (Thu Aug 23, 4:51 pm)
[PATCH 09/30] mtd: Don't cast kmalloc() return value in dr ...
, Jesper Juhl
, (Thu Aug 23, 4:52 pm)
[PATCH 10/30] irda: Do not do pointless kmalloc return val ...
, Jesper Juhl
, (Thu Aug 23, 4:54 pm)
[PATCH 14/30] net: Kill some unneeded allocation return va ...
, Jesper Juhl
, (Thu Aug 23, 5:03 pm)
[PATCH 16/30] net: Avoid pointless allocation casts in BSD ...
, Jesper Juhl
, (Thu Aug 23, 5:06 pm)
[PATCH 17/30] isdn: Get rid of some pointless allocation c ...
, Jesper Juhl
, (Thu Aug 23, 5:09 pm)
[PATCH 18/30] isdn: eicon - get rid of a pointless vmalloc ...
, Jesper Juhl
, (Thu Aug 23, 5:11 pm)
[PATCH 19/30] scsi: Remove explicit casts of [kv]alloc ret ...
, Jesper Juhl
, (Thu Aug 23, 5:12 pm)
[PATCH 20/30] scsi: In the Advansys driver, do not cast al ...
, Jesper Juhl
, (Thu Aug 23, 5:16 pm)
[PATCH 21/30] oss: Remove unneeded vmalloc() return value ...
, Jesper Juhl
, (Thu Aug 23, 5:18 pm)
[PATCH 22/30] ivtv: kzalloc() returns void pointer, no nee ...
, Jesper Juhl
, (Thu Aug 23, 5:20 pm)
[PATCH 23/30] video: Remove pointless kmalloc() return val ...
, Jesper Juhl
, (Thu Aug 23, 5:22 pm)
Re: [PATCH 03/30] um: Don't unnecessarily cast allocation ...
, Jeff Dike
, (Thu Aug 23, 5:22 pm)
[PATCH 24/30] dvb: remove some unneeded vmalloc() return v ...
, Jesper Juhl
, (Thu Aug 23, 5:25 pm)
[PATCH 25/30] tty: dont needlessly cast kmalloc() return value
, Jesper Juhl
, (Thu Aug 23, 5:28 pm)
[PATCH 26/30] md: vmalloc() returns void pointer so we don ...
, Jesper Juhl
, (Thu Aug 23, 5:30 pm)
[PATCH 27/30] usb: avoid redundant cast of kmalloc() retur ...
, Jesper Juhl
, (Thu Aug 23, 5:35 pm)
[PATCH 28/30] jfs: avoid pointless casts of kmalloc() retu ...
, Jesper Juhl
, (Thu Aug 23, 5:36 pm)
Re: [PATCH 04/30] powerpc: Don't cast kmalloc return value ...
, Joachim Fenkes
, (Thu Aug 23, 5:37 pm)
[PATCH 29/30] mm: No need to cast vmalloc() return value i ...
, Jesper Juhl
, (Thu Aug 23, 5:39 pm)
[PATCH 30/30] emu10k1: There's no need to cast vmalloc() r ...
, Jesper Juhl
, (Thu Aug 23, 5:41 pm)
Re: [PATCH 0/30] Remove unneeded casts of [kv][mzc]alloc() ...
, Jesper Juhl
, (Thu Aug 23, 5:53 pm)
Re: [PATCH 20/30] scsi: In the Advansys driver, do not cas ...
, Matthew Wilcox
, (Thu Aug 23, 7:03 pm)
Re: [PATCH 28/30] jfs: avoid pointless casts of kmalloc() ...
, Dave Kleikamp
, (Thu Aug 23, 9:19 pm)
Re: [PATCH 18/30] isdn: eicon - get rid of a pointless vma ...
, Armin Schindler
, (Thu Aug 23, 11:47 pm)
Re: [PATCH 19/30] scsi: Remove explicit casts of [kv]alloc ...
, Rolf Eike Beer
, (Fri Aug 24, 12:04 am)
Re: [PATCH 22/30] ivtv: kzalloc() returns void pointer, no ...
, Hans Verkuil
, (Fri Aug 24, 1:32 am)
Re: [PATCH 22/30] ivtv: kzalloc() returns void pointer, no ...
, Jesper Juhl
, (Fri Aug 24, 1:44 am)
Re: [PATCH 19/30] scsi: Remove explicit casts of [kv]alloc ...
, Jesper Juhl
, (Fri Aug 24, 1:46 am)
Re: [PATCH 28/30] jfs: avoid pointless casts of kmalloc() ...
, Jesper Juhl
, (Fri Aug 24, 1:48 am)
Re: [PATCH 20/30] scsi: In the Advansys driver, do not cas ...
, Jesper Juhl
, (Fri Aug 24, 2:00 am)
Re: [PATCH 17/30] isdn: Get rid of some pointless allocati ...
, Karsten Keil
, (Fri Aug 24, 2:23 am)
Re: [PATCH 09/30] mtd: Don't cast kmalloc() return value i ...
, Denys Vlasenko
, (Fri Aug 24, 3:41 am)
Re: [PATCH 09/30] mtd: Don't cast kmalloc() return value i ...
, Robert P. J. Day
, (Fri Aug 24, 3:43 am)
Re: [PATCH 09/30] mtd: Don't cast kmalloc() return value i ...
, Jesper Juhl
, (Fri Aug 24, 3:48 am)
Re: [PATCH 14/30] net: Kill some unneeded allocation retur ...
, Dan Williams
, (Fri Aug 24, 8:50 am)
patch usb-avoid-redundant-cast-of-kmalloc-return-value-in- ...
, gregkh
, (Fri Aug 24, 9:43 pm)
Re: [PATCH 10/30] irda: Do not do pointless kmalloc return ...
, David Miller
, (Fri Aug 24, 11:23 pm)
Re: [PATCH 16/30] net: Avoid pointless allocation casts in ...
, David Miller
, (Fri Aug 24, 11:25 pm)
Re: [PATCH 17/30] isdn: Get rid of some pointless allocati ...
, David Miller
, (Fri Aug 24, 11:25 pm)
Re: [PATCH 09/30] mtd: Don't cast kmalloc() return value i ...
, Jesper Juhl
, (Sat Aug 25, 3:27 pm)
Re: [PATCH 09/30] mtd: Don't cast kmalloc() return value i ...
, Robert P. J. Day
, (Sat Aug 25, 4:59 pm)
Re: [PATCH 09/30] mtd: Don't cast kmalloc() return value i ...
, Robert P. J. Day
, (Sat Aug 25, 5:23 pm)
Re: [PATCH 09/30] mtd: Don't cast kmalloc() return value i ...
, Jesper Juhl
, (Sat Aug 25, 5:28 pm)
Re: [PATCH 09/30] mtd: Don't cast kmalloc() return value i ...
, Jesper Juhl
, (Sat Aug 25, 5:36 pm)
Re: [PATCH 09/30] mtd: Don't cast kmalloc() return value i ...
, Kyle Moffett
, (Sat Aug 25, 6:52 pm)
Re: [PATCH 09/30] mtd: Don't cast kmalloc() return value i ...
, Denys Vlasenko
, (Sun Aug 26, 7:28 am)
Re: [PATCH 09/30] mtd: Don't cast kmalloc() return value i ...
, Jan Engelhardt
, (Sun Aug 26, 7:37 am)
Re: [PATCH 09/30] mtd: Don't cast kmalloc() return value i ...
, Jesper Juhl
, (Sun Aug 26, 3:10 pm)
Re: [PATCH 30/30] emu10k1: There's no need to cast vmalloc ...
, Takashi Iwai
, (Tue Aug 28, 6:22 am)
Navigation
Mailing list archives
Recent posts
Popular discussions
linux-kernel
:
Rusty Russell
Re: 2.6.22-rc3-mm1
Gautham R Shenoy
[PATCH 1/8] Enhance process freezer interface for usage beyond software suspend
Jeffrey V. Merkey
Re: Versioning file system
James Bottomley
Re: [PATCH -mm 1/2] scsi: remove dma_is_consistent usage in 53c700
David Miller
Re: NO_HZ: timer interrupt stuck
git-commits-head
:
Linux Kernel Mailing List
V4L/DVB: tm6000: add special usb request to quit i2c tuner transfer
Linux Kernel Mailing List
OMAP: DSS2: SDI driver
Linux Kernel Mailing List
PCI: introduce pci_pcie_cap()
Linux Kernel Mailing List
ipc/sem.c: move wake_up_process out of the spinlock section
Linux Kernel Mailing List
netfilter: nf_conntrack_sip: add T.38 FAX support
git
:
Oliver Kullmann
Re: how to move with history?
Junio C Hamano
Re: [PATCH 2/3] git-add--interactive: remove hunk coalescing
Shawn O. Pearce
Re: Bugs in Gitosis
Miles Bader
Re: way to automatically add untracked files?
Harvey Harrison
Re: [SoC RFC] libsvn-fs-git: A git backend for the subversion filesystem
linux-netdev
:
Timo Teräs
ip xfrm policy semantics
David Miller
Re: [2.6.30-rc3] powerpc: compilation error of mace module
Patrick McHardy
Re: [rfc 02/13] [RFC 02/13] netfilter: nf_conntrack_sip: Add callid parser
webmaster Maintenance
联系系统管理员
Krzysztof Oledzki
Re: Error: an inet prefix is expected rather than "0/0".
openbsd-misc
:
Ted Bullock
Re: Proliant DL380 G3 cannot get on network
Úlfar M. E. Johnson
installing openbsd in xen
Eric Furman
Re: Defending OpenBSD Performance
Damien Miller
Re: Patching a SSH 'Weakness'
FRLinux
Re: ucom(4)
Colocation donated by:
Syndicate