login
Login
/
Register
Search
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
!MAILaRCHIVE_VOTE_RePLACE
Previous message: [
thread
] [
date
] [
author
]
Next message: [
thread
] [
date
] [
author
]
[view in full thread]
From:
Denys Vlasenko <vda.linux@...>
To: Jesper Juhl <jesper.juhl@...>
Cc: Linux Kernel Mailing List <linux-kernel@...>, David Woodhouse <dwmw2@...>, <linux-mtd@...>
Subject:
Re: [PATCH 09/30] mtd: Don't cast kmalloc() return value in drivers/mtd/maps/pmcmsp-flash.c
Date: Friday, August 24, 2007 - 6: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() retur...
, Jesper Juhl
, (Thu Aug 23, 7:35 pm)
Re: [PATCH 0/30] Remove unneeded casts of [kv][mzc]alloc() r...
, Jesper Juhl
, (Thu Aug 23, 8:53 pm)
[PATCH 01/30] ia64: Remove unnecessary cast of allocation re...
, Jesper Juhl
, (Thu Aug 23, 7:40 pm)
[PATCH 16/30] net: Avoid pointless allocation casts in BSD c...
, Jesper Juhl
, (Thu Aug 23, 8:06 pm)
Re: [PATCH 16/30] net: Avoid pointless allocation casts in B...
, David Miller
, (Sat Aug 25, 2:25 am)
[PATCH 18/30] isdn: eicon - get rid of a pointless vmalloc()...
, Jesper Juhl
, (Thu Aug 23, 8:11 pm)
Re: [PATCH 18/30] isdn: eicon - get rid of a pointless vmall...
, Armin Schindler
, (Fri Aug 24, 2:47 am)
[PATCH 27/30] usb: avoid redundant cast of kmalloc() return ...
, Jesper Juhl
, (Thu Aug 23, 8:35 pm)
patch usb-avoid-redundant-cast-of-kmalloc-return-value-in-ot...
,
, (Sat Aug 25, 12:43 am)
[PATCH 26/30] md: vmalloc() returns void pointer so we don't...
, Jesper Juhl
, (Thu Aug 23, 8:30 pm)
[PATCH 19/30] scsi: Remove explicit casts of [kv]alloc retur...
, Jesper Juhl
, (Thu Aug 23, 8:12 pm)
Re: [PATCH 19/30] scsi: Remove explicit casts of [kv]alloc r...
, Rolf Eike Beer
, (Fri Aug 24, 3:04 am)
Re: [PATCH 19/30] scsi: Remove explicit casts of [kv]alloc r...
, Jesper Juhl
, (Fri Aug 24, 4:46 am)
[PATCH 03/30] um: Don't unnecessarily cast allocation return...
, Jesper Juhl
, (Thu Aug 23, 7:43 pm)
Re: [PATCH 03/30] um: Don't unnecessarily cast allocation re...
, Jeff Dike
, (Thu Aug 23, 8:22 pm)
[PATCH 04/30] powerpc: Don't cast kmalloc return value in ib...
, Jesper Juhl
, (Thu Aug 23, 7:45 pm)
Re: [PATCH 04/30] powerpc: Don't cast kmalloc return value i...
, Joachim Fenkes
, (Thu Aug 23, 8:37 pm)
[PATCH 17/30] isdn: Get rid of some pointless allocation cas...
, Jesper Juhl
, (Thu Aug 23, 8:09 pm)
Re: [PATCH 17/30] isdn: Get rid of some pointless allocation...
, Karsten Keil
, (Fri Aug 24, 5:23 am)
Re: [PATCH 17/30] isdn: Get rid of some pointless allocation...
, David Miller
, (Sat Aug 25, 2:25 am)
[PATCH 20/30] scsi: In the Advansys driver, do not cast allo...
, Jesper Juhl
, (Thu Aug 23, 8:16 pm)
Re: [PATCH 20/30] scsi: In the Advansys driver, do not cast ...
, Matthew Wilcox
, (Thu Aug 23, 10:03 pm)
Re: [PATCH 20/30] scsi: In the Advansys driver, do not cast ...
, Jesper Juhl
, (Fri Aug 24, 5:00 am)
[PATCH 23/30] video: Remove pointless kmalloc() return value...
, Jesper Juhl
, (Thu Aug 23, 8:22 pm)
[PATCH 07/30] mtd: Get rid of pointless cast of kzalloc() re...
, Jesper Juhl
, (Thu Aug 23, 7:50 pm)
[PATCH 05/30] atm: No need to cast vmalloc() return value
, Jesper Juhl
, (Thu Aug 23, 7:46 pm)
[PATCH 29/30] mm: No need to cast vmalloc() return value in ...
, Jesper Juhl
, (Thu Aug 23, 8:39 pm)
[PATCH 30/30] emu10k1: There's no need to cast vmalloc() ret...
, Jesper Juhl
, (Thu Aug 23, 8:41 pm)
Re: [PATCH 30/30] emu10k1: There's no need to cast vmalloc()...
, Takashi Iwai
, (Tue Aug 28, 9:22 am)
[PATCH 24/30] dvb: remove some unneeded vmalloc() return val...
, Jesper Juhl
, (Thu Aug 23, 8:25 pm)
[PATCH 06/30] i2o: No need to cast kmalloc() return value in...
, Jesper Juhl
, (Thu Aug 23, 7:48 pm)
[PATCH 22/30] ivtv: kzalloc() returns void pointer, no need ...
, Jesper Juhl
, (Thu Aug 23, 8:20 pm)
Re: [PATCH 22/30] ivtv: kzalloc() returns void pointer, no n...
, Hans Verkuil
, (Fri Aug 24, 4:32 am)
Re: [PATCH 22/30] ivtv: kzalloc() returns void pointer, no n...
, Jesper Juhl
, (Fri Aug 24, 4:44 am)
[PATCH 10/30] irda: Do not do pointless kmalloc return value...
, Jesper Juhl
, (Thu Aug 23, 7:54 pm)
Re: [PATCH 10/30] irda: Do not do pointless kmalloc return v...
, David Miller
, (Sat Aug 25, 2:23 am)
[PATCH 09/30] mtd: Don't cast kmalloc() return value in driv...
, Jesper Juhl
, (Thu Aug 23, 7:52 pm)
Re: [PATCH 09/30] mtd: Don't cast kmalloc() return value in ...
, Denys Vlasenko
, (Fri Aug 24, 6:41 am)
Re: [PATCH 09/30] mtd: Don't cast kmalloc() return value in ...
, Robert P. J. Day
, (Fri Aug 24, 6:43 am)
Re: [PATCH 09/30] mtd: Don't cast kmalloc() return value in ...
, Jesper Juhl
, (Sat Aug 25, 6:27 pm)
Re: [PATCH 09/30] mtd: Don't cast kmalloc() return value in ...
, Robert P. J. Day
, (Sat Aug 25, 7:59 pm)
Re: [PATCH 09/30] mtd: Don't cast kmalloc() return value in ...
, Jesper Juhl
, (Sat Aug 25, 8:28 pm)
Re: [PATCH 09/30] mtd: Don't cast kmalloc() return value in ...
, Robert P. J. Day
, (Sat Aug 25, 8:23 pm)
Re: [PATCH 09/30] mtd: Don't cast kmalloc() return value in ...
, Denys Vlasenko
, (Sun Aug 26, 10:28 am)
Re: [PATCH 09/30] mtd: Don't cast kmalloc() return value in ...
, Jan Engelhardt
, (Sun Aug 26, 10:37 am)
Re: [PATCH 09/30] mtd: Don't cast kmalloc() return value in ...
, Jesper Juhl
, (Sun Aug 26, 6:10 pm)
Re: [PATCH 09/30] mtd: Don't cast kmalloc() return value in ...
, Jesper Juhl
, (Sat Aug 25, 8:36 pm)
Re: [PATCH 09/30] mtd: Don't cast kmalloc() return value in ...
, Kyle Moffett
, (Sat Aug 25, 9:52 pm)
Re: [PATCH 09/30] mtd: Don't cast kmalloc() return value in ...
, Jesper Juhl
, (Fri Aug 24, 6:48 am)
[PATCH 25/30] tty: dont needlessly cast kmalloc() return value
, Jesper Juhl
, (Thu Aug 23, 8:28 pm)
[PATCH 21/30] oss: Remove unneeded vmalloc() return value ca...
, Jesper Juhl
, (Thu Aug 23, 8:18 pm)
[PATCH 14/30] net: Kill some unneeded allocation return valu...
, Jesper Juhl
, (Thu Aug 23, 8:03 pm)
Re: [PATCH 14/30] net: Kill some unneeded allocation return ...
, Dan Williams
, (Fri Aug 24, 11:50 am)
[PATCH 08/30] mtd: Avoid a pointless kmalloc() return value ...
, Jesper Juhl
, (Thu Aug 23, 7:51 pm)
[PATCH 02/30] cris: Remove unnecessary cast of allocation re...
, Jesper Juhl
, (Thu Aug 23, 7:42 pm)
[PATCH 28/30] jfs: avoid pointless casts of kmalloc() return...
, Jesper Juhl
, (Thu Aug 23, 8:36 pm)
Re: [PATCH 28/30] jfs: avoid pointless casts of kmalloc() re...
, Dave Kleikamp
, (Fri Aug 24, 12:19 am)
Re: [PATCH 28/30] jfs: avoid pointless casts of kmalloc() re...
, Jesper Juhl
, (Fri Aug 24, 4:48 am)
Navigation
Create content
Mailing list archives
Recent posts
Popular discussions
linux-kernel
:
James Bottomley
Re: Integration of SCST in the mainstream Linux kernel
Greg Kroah-Hartman
[PATCH 007/196] Chinese: add translation of stable_kernel_rules.txt
david
Re: Dual-Licensing Linux Kernel with GPL V2 and GPL V3
Jan Engelhardt
intel iommu (Re: -mm merge plans for 2.6.23)
git
:
openbsd-misc
:
linux-netdev
:
Alexey Dobriyan
Re: [GIT]: Networking
Jarek Poplawski
[PATCH] pkt_sched: Destroy gen estimators under rtnl_lock().
Gerrit Renker
[PATCH 27/37] dccp: Integration of dynamic feature activation - part 2 (server side)
David Miller
Re: [BUG] New Kernel Bugs
Colocation donated by:
Who's online
There are currently
10 users
and
877 guests
online.
Online users
colongems5
hdtelevisioneq
williamboydtyrk
bmxracingqruhu
aquariumtanksx
zamuwws
davidward561
benefitsofcoll
dalesnail
twilightdolls61
Syndicate