From: Jesper Juhl <jesper.juhl@gmail.com>
To: Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Cc: Takashi Iwai <tiwai@suse.de>,
Hannu Savolainen <hannu@opensound.com>,
Jesper Juhl <jesper.juhl@gmail.com>
Subject: [PATCH 21/30] oss: Remove unneeded vmalloc() return value casts in OSS
Date: Fri, 24 Aug 2007 02:18:26 +0200 [thread overview]
Message-ID: <40043332e9d997f833d65e8a230a6ed7dd9105fc.1187912217.git.jesper.juhl@gmail.com> (raw)
In-Reply-To: <1554af80879a7ef2f78a4d654f23c248203500d9.1187912217.git.jesper.juhl@gmail.com>
vmalloc() returns a void pointer that we don't need to cast.
This patch should clean this up in sound/oss/.
Signed-off-by: Jesper Juhl <jesper.juhl@gmail.com>
---
sound/oss/midibuf.c | 4 ++--
sound/oss/pss.c | 6 +++---
sound/oss/sequencer.c | 4 ++--
sound/oss/sscape.c | 2 +-
4 files changed, 8 insertions(+), 8 deletions(-)
diff --git a/sound/oss/midibuf.c b/sound/oss/midibuf.c
index a40be0c..66f8a7f 100644
--- a/sound/oss/midibuf.c
+++ b/sound/oss/midibuf.c
@@ -177,7 +177,7 @@ int MIDIbuf_open(int dev, struct file *file)
return err;
parms[dev].prech_timeout = MAX_SCHEDULE_TIMEOUT;
- midi_in_buf[dev] = (struct midi_buf *) vmalloc(sizeof(struct midi_buf));
+ midi_in_buf[dev] = vmalloc(sizeof(struct midi_buf));
if (midi_in_buf[dev] == NULL)
{
@@ -187,7 +187,7 @@ int MIDIbuf_open(int dev, struct file *file)
}
midi_in_buf[dev]->len = midi_in_buf[dev]->head = midi_in_buf[dev]->tail = 0;
- midi_out_buf[dev] = (struct midi_buf *) vmalloc(sizeof(struct midi_buf));
+ midi_out_buf[dev] = vmalloc(sizeof(struct midi_buf));
if (midi_out_buf[dev] == NULL)
{
diff --git a/sound/oss/pss.c b/sound/oss/pss.c
index ece428b..b140584 100644
--- a/sound/oss/pss.c
+++ b/sound/oss/pss.c
@@ -872,7 +872,7 @@ static int pss_coproc_ioctl(void *dev_info, unsigned int cmd, void __user *arg,
return 0;
case SNDCTL_COPR_LOAD:
- buf = (copr_buffer *) vmalloc(sizeof(copr_buffer));
+ buf = vmalloc(sizeof(copr_buffer));
if (buf == NULL)
return -ENOSPC;
if (copy_from_user(buf, arg, sizeof(copr_buffer))) {
@@ -884,7 +884,7 @@ static int pss_coproc_ioctl(void *dev_info, unsigned int cmd, void __user *arg,
return err;
case SNDCTL_COPR_SENDMSG:
- mbuf = (copr_msg *)vmalloc(sizeof(copr_msg));
+ mbuf = vmalloc(sizeof(copr_msg));
if (mbuf == NULL)
return -ENOSPC;
if (copy_from_user(mbuf, arg, sizeof(copr_msg))) {
@@ -908,7 +908,7 @@ static int pss_coproc_ioctl(void *dev_info, unsigned int cmd, void __user *arg,
case SNDCTL_COPR_RCVMSG:
err = 0;
- mbuf = (copr_msg *)vmalloc(sizeof(copr_msg));
+ mbuf = vmalloc(sizeof(copr_msg));
if (mbuf == NULL)
return -ENOSPC;
data = (unsigned short *)mbuf->data;
diff --git a/sound/oss/sequencer.c b/sound/oss/sequencer.c
index 5c215f7..cfe3dd0 100644
--- a/sound/oss/sequencer.c
+++ b/sound/oss/sequencer.c
@@ -1649,13 +1649,13 @@ void sequencer_init(void)
{
if (sequencer_ok)
return;
- queue = (unsigned char *)vmalloc(SEQ_MAX_QUEUE * EV_SZ);
+ queue = vmalloc(SEQ_MAX_QUEUE * EV_SZ);
if (queue == NULL)
{
printk(KERN_ERR "sequencer: Can't allocate memory for sequencer output queue\n");
return;
}
- iqueue = (unsigned char *)vmalloc(SEQ_MAX_QUEUE * IEV_SZ);
+ iqueue = vmalloc(SEQ_MAX_QUEUE * IEV_SZ);
if (iqueue == NULL)
{
printk(KERN_ERR "sequencer: Can't allocate memory for sequencer input queue\n");
diff --git a/sound/oss/sscape.c b/sound/oss/sscape.c
index 30c36d1..9d6b9b0 100644
--- a/sound/oss/sscape.c
+++ b/sound/oss/sscape.c
@@ -573,7 +573,7 @@ static int sscape_coproc_ioctl(void *dev_info, unsigned int cmd, void __user *ar
return 0;
case SNDCTL_COPR_LOAD:
- buf = (copr_buffer *) vmalloc(sizeof(copr_buffer));
+ buf = vmalloc(sizeof(copr_buffer));
if (buf == NULL)
return -ENOSPC;
if (copy_from_user(buf, arg, sizeof(copr_buffer)))
--
1.5.2.2
next prev parent reply other threads:[~2007-08-24 0:21 UTC|newest]
Thread overview: 65+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <Message-Id: <200708240135.56833.jesper.juhl@gmail.com>
2007-08-23 23:40 ` [PATCH 01/30] ia64: Remove unnecessary cast of allocation return value in sn_hwperf_enum_objects() Jesper Juhl
2007-08-23 23:42 ` [PATCH 02/30] cris: Remove unnecessary cast of allocation return value in intmem.c Jesper Juhl
2007-08-23 23:43 ` [PATCH 03/30] um: Don't unnecessarily cast allocation return value in ubd_kern.c Jesper Juhl
2007-08-24 0:22 ` Jeff Dike
2007-08-23 23:45 ` [PATCH 04/30] powerpc: Don't cast kmalloc return value in ibmebus.c Jesper Juhl
2007-08-24 0:37 ` Joachim Fenkes
2007-08-23 23:46 ` [PATCH 05/30] atm: No need to cast vmalloc() return value Jesper Juhl
2007-08-23 23:48 ` [PATCH 06/30] i2o: No need to cast kmalloc() return value in cfg_open() Jesper Juhl
2007-08-23 23:50 ` [PATCH 07/30] mtd: Get rid of pointless cast of kzalloc() return value in AT26xxx driver Jesper Juhl
2007-08-23 23:51 ` [PATCH 08/30] mtd: Avoid a pointless kmalloc() return value cast in TQM8xxL mapping handling code Jesper Juhl
2007-08-23 23:52 ` [PATCH 09/30] mtd: Don't cast kmalloc() return value in drivers/mtd/maps/pmcmsp-flash.c Jesper Juhl
2007-08-24 10:41 ` Denys Vlasenko
2007-08-24 10:43 ` Robert P. J. Day
2007-08-25 22:27 ` Jesper Juhl
2007-08-25 23:59 ` Robert P. J. Day
2007-08-26 0:28 ` Jesper Juhl
2007-08-26 0:23 ` Robert P. J. Day
2007-08-26 0:36 ` Jesper Juhl
2007-08-26 1:52 ` Kyle Moffett
2007-08-26 14:28 ` Denys Vlasenko
2007-08-26 14:37 ` Jan Engelhardt
2007-08-26 22:10 ` Jesper Juhl
2007-08-24 10:48 ` Jesper Juhl
2007-08-23 23:54 ` [PATCH 10/30] irda: Do not do pointless kmalloc return value cast in KingSun driver Jesper Juhl
2007-08-25 6:23 ` David Miller
2007-08-24 0:03 ` [PATCH 14/30] net: Kill some unneeded allocation return value casts in libertas Jesper Juhl
2007-08-24 15:50 ` Dan Williams
2007-08-24 0:06 ` [PATCH 16/30] net: Avoid pointless allocation casts in BSD compression module Jesper Juhl
2007-08-25 6:25 ` David Miller
2007-08-24 0:09 ` [PATCH 17/30] isdn: Get rid of some pointless allocation casts in common and bsd comp Jesper Juhl
2007-08-24 9:23 ` Karsten Keil
2007-08-25 6:25 ` David Miller
2007-08-24 0:11 ` [PATCH 18/30] isdn: eicon - get rid of a pointless vmalloc() return value cast Jesper Juhl
2007-08-24 6:47 ` Armin Schindler
2007-08-24 0:12 ` [PATCH 19/30] scsi: Remove explicit casts of [kv]alloc return values in osst driver Jesper Juhl
2007-08-24 7:04 ` Rolf Eike Beer
2007-08-24 8:46 ` Jesper Juhl
2007-08-24 0:16 ` [PATCH 20/30] scsi: In the Advansys driver, do not cast allocation function return values Jesper Juhl
2007-08-24 2:03 ` Matthew Wilcox
2007-08-24 9:00 ` Jesper Juhl
2007-08-24 0:18 ` Jesper Juhl [this message]
2007-08-24 0:20 ` [PATCH 22/30] ivtv: kzalloc() returns void pointer, no need to cast Jesper Juhl
2007-08-24 8:32 ` Hans Verkuil
2007-08-24 8:44 ` Jesper Juhl
2007-08-24 0:22 ` [PATCH 23/30] video: Remove pointless kmalloc() return value cast in Zoran PCI controller driver Jesper Juhl
2007-08-24 0:25 ` [PATCH 24/30] dvb: remove some unneeded vmalloc() return value casts from av7110 Jesper Juhl
2007-08-24 0:28 ` [PATCH 25/30] tty: dont needlessly cast kmalloc() return value Jesper Juhl
2007-08-24 0:30 ` [PATCH 26/30] md: vmalloc() returns void pointer so we don't need to cast it in dm-ioctl Jesper Juhl
2007-08-24 0:35 ` [PATCH 27/30] usb: avoid redundant cast of kmalloc() return value in OTi-6858 driver Jesper Juhl
2007-08-25 4:43 ` patch usb-avoid-redundant-cast-of-kmalloc-return-value-in-oti-6858-driver.patch added to gregkh-2.6 tree gregkh
2007-08-24 0:36 ` [PATCH 28/30] jfs: avoid pointless casts of kmalloc() return val Jesper Juhl
2007-08-24 4:19 ` Dave Kleikamp
2007-08-24 8:48 ` Jesper Juhl
2007-08-24 0:39 ` [PATCH 29/30] mm: No need to cast vmalloc() return value in zone_wait_table_init() Jesper Juhl
2007-08-24 0:41 ` [PATCH 30/30] emu10k1: There's no need to cast vmalloc() return value in snd_emu10k1_create() Jesper Juhl
2007-08-28 13:22 ` Takashi Iwai
[not found] ` <c4e095af9df5ab47e7d1c8e4f3d256d74576a0c9.1187912217.git.jesper.juhl@gmail.com>
2007-08-24 7:25 ` [PATCH 12/30] net: No point in casting kmalloc return values in Gianfar Ethernet Driver Kumar Gala
[not found] ` <d551047daed1cb4d9de1eff956268a468c9837f6.1187912217.git.jesper.juhl@gmail.com>
2007-08-30 17:54 ` [PATCH 13/30] net: Don't do pointless kmalloc return value casts in zd1211 driver Daniel Drake
2007-08-30 20:20 ` Jesper Juhl
2007-08-30 22:19 ` Joe Perches
2007-08-30 22:30 ` [PATCH] Don't needlessly initialize variable to NULL in zd_chip (was: Re: [PATCH 13/30] net: Don't do pointless kmalloc return value casts in zd1211 driver) Jesper Juhl
2007-08-30 22:42 ` Randy Dunlap
2007-08-30 23:04 ` Jesper Juhl
2007-08-30 23:47 ` [PATCH 13/30] net: Don't do pointless kmalloc return value casts in zd1211 driver Daniel Drake
2007-08-31 9:30 ` Herbert Xu
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=40043332e9d997f833d65e8a230a6ed7dd9105fc.1187912217.git.jesper.juhl@gmail.com \
--to=jesper.juhl@gmail.com \
--cc=hannu@opensound.com \
--cc=linux-kernel@vger.kernel.org \
--cc=tiwai@suse.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®