Skip to content

Remove unneeded casts of [kv][mzc]alloc() return values

Jesper Juhl lkml 1 version Applied

Status from this message: Applied to libertas-2.6 'for-linville' branch, thanks.

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest26 of 30 patches 37 repliesApplied

26 of 30 patches are in this archive. The cover letter announces 30.

Patches in v1 Applied

#Subject and filesSizeRepliesApplied
1/30ia64: Remove unnecessary cast of allocation return value in sn_hwperf_enum_objects()arch/ia64/sn/kernel/sn2/sn_hwperf.c+2 -19 replies
2/30cris: Remove unnecessary cast of allocation return value in intmem.carch/cris/arch-v32/mm/intmem.c+4 -60 replies
3/30um: Don't unnecessarily cast allocation return value in ubd_kern.carch/um/drivers/ubd_kern.c+1 -11 reply
4/30powerpc: Don't cast kmalloc return value in ibmebus.carch/powerpc/kernel/ibmebus.c+2 -11 reply
5/30atm: No need to cast vmalloc() return valuedrivers/atm/lanai.c+1 -10 replies
6/30i2o: No need to cast kmalloc() return value in cfg_open()drivers/message/i2o/i2o_config.c+2 -30 replies
7/30mtd: Get rid of pointless cast of kzalloc() return value in AT26xxx driverdrivers/mtd/devices/at91_dataflash26.c+1 -20 replies
8/30mtd: Avoid a pointless kmalloc() return value cast in TQM8xxL mapping handling codedrivers/mtd/maps/tqm8xxl.c+1 -20 replies
9/30mtd: Don't cast kmalloc() return value in drivers/mtd/maps/pmcmsp-flash.cdrivers/mtd/maps/pmcmsp-flash.c+5 -812 replies
10/30irda: Do not do pointless kmalloc return value cast in KingSun driverdrivers/net/irda/kingsun-sir.c+2 -21 reply
14/30net: Kill some unneeded allocation return value casts in libertasdrivers/net/wireless/libertas/debugfs.c drivers/net/wireless/libertas/ethtool.c+2 -31 reply
16/30net: Avoid pointless allocation casts in BSD compression moduledrivers/net/bsd_comp.c+2 -41 reply
17/30isdn: Get rid of some pointless allocation casts in common and bsd comp.drivers/isdn/i4l/isdn_bsdcomp.c drivers/isdn/i4l/isdn_common.c+3 -42 replies
18/30isdn: eicon - get rid of a pointless vmalloc() return value castdrivers/isdn/hardware/eicon/platform.h+1 -11 reply
19/30scsi: Remove explicit casts of [kv]alloc return values in osst driverdrivers/scsi/osst.c+4 -42 replies
20/30scsi: In the Advansys driver, do not cast allocation function return valuesdrivers/scsi/advansys.c+3 -62 replies
21/30oss: Remove unneeded vmalloc() return value casts in OSSsound/oss/midibuf.c sound/oss/pss.c sound/oss/sequencer.c +1 more+8 -80 replies
22/30ivtv: kzalloc() returns void pointer, no need to castdrivers/media/video/ivtv/ivtv-queue.c+2 -22 replies
23/30video: Remove pointless kmalloc() return value cast in Zoran PCI controller driverdrivers/media/video/zoran_driver.c+1 -40 replies
24/30dvb: remove some unneeded vmalloc() return value casts from av7110drivers/media/dvb/ttpci/av7110.c drivers/media/dvb/ttpci/av7110_ir.c+2 -20 replies
25/30tty: dont needlessly cast kmalloc() return valuedrivers/char/tty_io.c+2 -40 replies
26/30md: vmalloc() returns void pointer so we don't need to cast it in dm-ioctldrivers/md/dm-ioctl.c+1 -10 replies
27/30usb: avoid redundant cast of kmalloc() return value in OTi-6858 driverdrivers/usb/serial/oti6858.c+1 -11 reply
28/30jfs: avoid pointless casts of kmalloc() return valfs/jfs/jfs_dtree.c+2 -62 replies
29/30mm: No need to cast vmalloc() return value in zone_wait_table_init()mm/page_alloc.c+1 -10 replies
30/30emu10k1: There's no need to cast vmalloc() return value in snd_emu10k1_create()sound/pci/emu10k1/emu10k1_main.c+2 -21 reply

Reviews trailers per patch

4 of 26 patches have a Reviewed-by or Acked-by.

PatchJoachim FenkesArmin SchindlerKumar GalaKarsten Keil
1/30A-b
2/30
3/30
4/30A-b
5/30
6/30
7/30
8/30
9/30
10/30
14/30
16/30
17/30A-b
18/30A-b
19/30
20/30
21/30
22/30
23/30
24/30
25/30
26/30
27/30
28/30
29/30
30/30

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes. Scroll the table sideways for all 4 reviewers.

Read the v1 thread

Cover letter [PATCH 0/30] Remove unneeded casts of [kv][mzc]alloc() return values

Hi,

The [kv][mzc]alloc() functions return a void pointer, so when assigning to a pointer type variable there is no need to cast the return value.

This is something that is already commonly being cleaned up when people change nearby code and it's also something people are usually asked not to do when submitting new code.

I took a look at how many such casts are currently left and didn't find that many, so I cleaned them up.
I've probably missed some, but this patch series should clean up the majority of the remaining ones at least.

The patches in this series are

[PATCH 1/30] ia64: Remove unnecessary cast of allocation return value in sn_hwperf_enum_objects() [PATCH 1/30] cris: Remove unnecessary cast of allocation return value in intmem.c [PATCH 1/30] um: Don't unnecessarily cast allocation return value in ubd_kern.c [PATCH 1/30] powerpc: Don't cast kmalloc return value in ibmebus.c
[PATCH 1/30] atm: No need to cast vmalloc() return value
[PATCH 1/30] i2o: No need to cast kmalloc() return value in cfg_open()
[PATCH 1/30] mtd: Get rid of pointless cast of kzalloc() return value in AT26xxx driver [PATCH 1/30] mtd: Avoid a pointless kmalloc() return value cast in TQM8xxL mapping handling code [PATCH 1/30] mtd: Don't cast kmalloc() return value in drivers/mtd/maps/pmcmsp-flash.c [PATCH 1/30] irda: Do not do pointless kmalloc return value cast in KingSun driver [PATCH 1/30] net: No need to cast vmalloc() return values in NetXen NIC driver [PATCH 1/30] net: No point in casting kmalloc return values in Gianfar Ethernet Driver [PATCH 1/30] net: Don't do pointless kmalloc return value casts in zd1211 driver [PATCH 1/30] net: Kill some unneeded allocation return value casts in libertas [PATCH 1/30] net: No need to cast kmalloc() return value in ipw2100 driver
[PATCH 1/30] net: Avoid pointless allocation casts in BSD compression module [PATCH 1/30] isdn: Get rid of some pointless allocation casts in common and bsd comp. [PATCH 1/30] isdn: eicon - get rid of a pointless vmalloc() return value cast [PATCH 1/30] scsi: Remove explicit casts of [kv]alloc return values in osst driver [PATCH 1/30] scsi: In the Advansys driver, do not cast allocation function return values [PATCH 1/30] oss: Remove unneeded vmalloc() return value casts in OSS
[PATCH 1/30] ivtv: kzalloc() returns void pointer, no need to cast
[PATCH 1/30] video: Remove pointless kmalloc() return value cast in Zoran PCI controller driver [PATCH 1/30] dvb: remove some unneeded vmalloc() return value casts from av7110 [PATCH 1/30] tty: dont needlessly cast kmalloc() return value
[PATCH 1/30] md: vmalloc() returns void pointer so we don't need to cast it in dm-ioctl [PATCH 1/30] usb: avoid redundant cast of kmalloc() return value in OTi-6858 driver [PATCH 1/30] jfs: avoid pointless casts of kmalloc() return val
[PATCH 1/30] mm: No need to cast vmalloc() return value in zone_wait_table_init() [PATCH 1/30] emu10k1: There's no need to cast vmalloc() return value in snd_emu10k1_create()

I'll send them all as replies to this email, to LKML and maintainers.

Kind regards,
Jesper