sound: Remove unnecessary casts of private_data

Signed-off-by: Joe Perches <joe@perches.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
This commit is contained in:
Joe Perches 2010-09-04 18:52:54 -07:00 committed by Takashi Iwai
parent 831853c87f
commit 9fe856e47e
14 changed files with 41 additions and 42 deletions

View File

@ -77,7 +77,7 @@ static int snd_mixer_oss_release(struct inode *inode, struct file *file)
struct snd_mixer_oss_file *fmixer; struct snd_mixer_oss_file *fmixer;
if (file->private_data) { if (file->private_data) {
fmixer = (struct snd_mixer_oss_file *) file->private_data; fmixer = file->private_data;
module_put(fmixer->card->module); module_put(fmixer->card->module);
snd_card_file_remove(fmixer->card, file); snd_card_file_remove(fmixer->card, file);
kfree(fmixer); kfree(fmixer);
@ -368,7 +368,7 @@ static int snd_mixer_oss_ioctl1(struct snd_mixer_oss_file *fmixer, unsigned int
static long snd_mixer_oss_ioctl(struct file *file, unsigned int cmd, unsigned long arg) static long snd_mixer_oss_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
{ {
return snd_mixer_oss_ioctl1((struct snd_mixer_oss_file *) file->private_data, cmd, arg); return snd_mixer_oss_ioctl1(file->private_data, cmd, arg);
} }
int snd_mixer_oss_ioctl_card(struct snd_card *card, unsigned int cmd, unsigned long arg) int snd_mixer_oss_ioctl_card(struct snd_card *card, unsigned int cmd, unsigned long arg)
@ -582,7 +582,7 @@ static int snd_mixer_oss_get_volume1(struct snd_mixer_oss_file *fmixer,
struct snd_mixer_oss_slot *pslot, struct snd_mixer_oss_slot *pslot,
int *left, int *right) int *left, int *right)
{ {
struct slot *slot = (struct slot *)pslot->private_data; struct slot *slot = pslot->private_data;
*left = *right = 100; *left = *right = 100;
if (slot->present & SNDRV_MIXER_OSS_PRESENT_PVOLUME) { if (slot->present & SNDRV_MIXER_OSS_PRESENT_PVOLUME) {
@ -691,7 +691,7 @@ static int snd_mixer_oss_put_volume1(struct snd_mixer_oss_file *fmixer,
struct snd_mixer_oss_slot *pslot, struct snd_mixer_oss_slot *pslot,
int left, int right) int left, int right)
{ {
struct slot *slot = (struct slot *)pslot->private_data; struct slot *slot = pslot->private_data;
if (slot->present & SNDRV_MIXER_OSS_PRESENT_PVOLUME) { if (slot->present & SNDRV_MIXER_OSS_PRESENT_PVOLUME) {
snd_mixer_oss_put_volume1_vol(fmixer, pslot, slot->numid[SNDRV_MIXER_OSS_ITEM_PVOLUME], left, right); snd_mixer_oss_put_volume1_vol(fmixer, pslot, slot->numid[SNDRV_MIXER_OSS_ITEM_PVOLUME], left, right);
@ -740,7 +740,7 @@ static int snd_mixer_oss_get_recsrc1_sw(struct snd_mixer_oss_file *fmixer,
struct snd_mixer_oss_slot *pslot, struct snd_mixer_oss_slot *pslot,
int *active) int *active)
{ {
struct slot *slot = (struct slot *)pslot->private_data; struct slot *slot = pslot->private_data;
int left, right; int left, right;
left = right = 1; left = right = 1;
@ -753,7 +753,7 @@ static int snd_mixer_oss_get_recsrc1_route(struct snd_mixer_oss_file *fmixer,
struct snd_mixer_oss_slot *pslot, struct snd_mixer_oss_slot *pslot,
int *active) int *active)
{ {
struct slot *slot = (struct slot *)pslot->private_data; struct slot *slot = pslot->private_data;
int left, right; int left, right;
left = right = 1; left = right = 1;
@ -766,7 +766,7 @@ static int snd_mixer_oss_put_recsrc1_sw(struct snd_mixer_oss_file *fmixer,
struct snd_mixer_oss_slot *pslot, struct snd_mixer_oss_slot *pslot,
int active) int active)
{ {
struct slot *slot = (struct slot *)pslot->private_data; struct slot *slot = pslot->private_data;
snd_mixer_oss_put_volume1_sw(fmixer, pslot, slot->numid[SNDRV_MIXER_OSS_ITEM_CSWITCH], active, active, 0); snd_mixer_oss_put_volume1_sw(fmixer, pslot, slot->numid[SNDRV_MIXER_OSS_ITEM_CSWITCH], active, active, 0);
return 0; return 0;
@ -776,7 +776,7 @@ static int snd_mixer_oss_put_recsrc1_route(struct snd_mixer_oss_file *fmixer,
struct snd_mixer_oss_slot *pslot, struct snd_mixer_oss_slot *pslot,
int active) int active)
{ {
struct slot *slot = (struct slot *)pslot->private_data; struct slot *slot = pslot->private_data;
snd_mixer_oss_put_volume1_sw(fmixer, pslot, slot->numid[SNDRV_MIXER_OSS_ITEM_CROUTE], active, active, 1); snd_mixer_oss_put_volume1_sw(fmixer, pslot, slot->numid[SNDRV_MIXER_OSS_ITEM_CROUTE], active, active, 1);
return 0; return 0;
@ -813,7 +813,7 @@ static int snd_mixer_oss_get_recsrc2(struct snd_mixer_oss_file *fmixer, unsigned
if (!(mixer->mask_recsrc & (1 << idx))) if (!(mixer->mask_recsrc & (1 << idx)))
continue; continue;
pslot = &mixer->slots[idx]; pslot = &mixer->slots[idx];
slot = (struct slot *)pslot->private_data; slot = pslot->private_data;
if (slot->signature != SNDRV_MIXER_OSS_SIGNATURE) if (slot->signature != SNDRV_MIXER_OSS_SIGNATURE)
continue; continue;
if (!(slot->present & SNDRV_MIXER_OSS_PRESENT_CAPTURE)) if (!(slot->present & SNDRV_MIXER_OSS_PRESENT_CAPTURE))
@ -861,7 +861,7 @@ static int snd_mixer_oss_put_recsrc2(struct snd_mixer_oss_file *fmixer, unsigned
if (!(mixer->mask_recsrc & (1 << idx))) if (!(mixer->mask_recsrc & (1 << idx)))
continue; continue;
pslot = &mixer->slots[idx]; pslot = &mixer->slots[idx];
slot = (struct slot *)pslot->private_data; slot = pslot->private_data;
if (slot->signature != SNDRV_MIXER_OSS_SIGNATURE) if (slot->signature != SNDRV_MIXER_OSS_SIGNATURE)
continue; continue;
if (!(slot->present & SNDRV_MIXER_OSS_PRESENT_CAPTURE)) if (!(slot->present & SNDRV_MIXER_OSS_PRESENT_CAPTURE))
@ -925,7 +925,7 @@ static int snd_mixer_oss_build_test(struct snd_mixer_oss *mixer, struct slot *sl
static void snd_mixer_oss_slot_free(struct snd_mixer_oss_slot *chn) static void snd_mixer_oss_slot_free(struct snd_mixer_oss_slot *chn)
{ {
struct slot *p = (struct slot *)chn->private_data; struct slot *p = chn->private_data;
if (p) { if (p) {
if (p->allocated && p->assigned) { if (p->allocated && p->assigned) {
kfree(p->assigned->name); kfree(p->assigned->name);

View File

@ -364,8 +364,7 @@ static void snd_pcm_stream_proc_info_read(struct snd_info_entry *entry,
static void snd_pcm_substream_proc_info_read(struct snd_info_entry *entry, static void snd_pcm_substream_proc_info_read(struct snd_info_entry *entry,
struct snd_info_buffer *buffer) struct snd_info_buffer *buffer)
{ {
snd_pcm_proc_info_read((struct snd_pcm_substream *)entry->private_data, snd_pcm_proc_info_read(entry->private_data, buffer);
buffer);
} }
static void snd_pcm_substream_proc_hw_params_read(struct snd_info_entry *entry, static void snd_pcm_substream_proc_hw_params_read(struct snd_info_entry *entry,

View File

@ -94,7 +94,7 @@ static int __devinit snd_virmidi_probe(struct platform_device *devptr)
sizeof(struct snd_card_virmidi), &card); sizeof(struct snd_card_virmidi), &card);
if (err < 0) if (err < 0)
return err; return err;
vmidi = (struct snd_card_virmidi *)card->private_data; vmidi = card->private_data;
vmidi->card = card; vmidi->card = card;
if (midi_devs[dev] > MAX_MIDI_DEVICES) { if (midi_devs[dev] > MAX_MIDI_DEVICES) {

View File

@ -878,7 +878,7 @@ static int build_deemphasis(struct snd_akm4xxx *ak, int num_emphs)
static void proc_regs_read(struct snd_info_entry *entry, static void proc_regs_read(struct snd_info_entry *entry,
struct snd_info_buffer *buffer) struct snd_info_buffer *buffer)
{ {
struct snd_akm4xxx *ak = (struct snd_akm4xxx *)entry->private_data; struct snd_akm4xxx *ak = entry->private_data;
int reg, val, chip; int reg, val, chip;
for (chip = 0; chip < ak->num_chips; chip++) { for (chip = 0; chip < ak->num_chips; chip++) {
for (reg = 0; reg < ak->total_regs; reg++) { for (reg = 0; reg < ak->total_regs; reg++) {

View File

@ -162,7 +162,7 @@ static int __devinit snd_card_ad1816a_probe(int dev, struct pnp_card_link *pcard
sizeof(struct snd_card_ad1816a), &card); sizeof(struct snd_card_ad1816a), &card);
if (error < 0) if (error < 0)
return error; return error;
acard = (struct snd_card_ad1816a *)card->private_data; acard = card->private_data;
if ((error = snd_card_ad1816a_pnp(dev, acard, pcard, pid))) { if ((error = snd_card_ad1816a_pnp(dev, acard, pcard, pid))) {
snd_card_free(card); snd_card_free(card);

View File

@ -188,7 +188,7 @@ static int __devinit snd_card_azt2320_probe(int dev,
sizeof(struct snd_card_azt2320), &card); sizeof(struct snd_card_azt2320), &card);
if (error < 0) if (error < 0)
return error; return error;
acard = (struct snd_card_azt2320 *)card->private_data; acard = card->private_data;
if ((error = snd_card_azt2320_pnp(dev, acard, pcard, pid))) { if ((error = snd_card_azt2320_pnp(dev, acard, pcard, pid))) {
snd_card_free(card); snd_card_free(card);

View File

@ -191,7 +191,7 @@ static int __devinit snd_gusmax_mixer(struct snd_wss *chip)
static void snd_gusmax_free(struct snd_card *card) static void snd_gusmax_free(struct snd_card *card)
{ {
struct snd_gusmax *maxcard = (struct snd_gusmax *)card->private_data; struct snd_gusmax *maxcard = card->private_data;
if (maxcard == NULL) if (maxcard == NULL)
return; return;
@ -219,7 +219,7 @@ static int __devinit snd_gusmax_probe(struct device *pdev, unsigned int dev)
if (err < 0) if (err < 0)
return err; return err;
card->private_free = snd_gusmax_free; card->private_free = snd_gusmax_free;
maxcard = (struct snd_gusmax *)card->private_data; maxcard = card->private_data;
maxcard->card = card; maxcard->card = card;
maxcard->irq = -1; maxcard->irq = -1;

View File

@ -72,7 +72,7 @@ static irqreturn_t snd_sb8_interrupt(int irq, void *dev_id)
static void snd_sb8_free(struct snd_card *card) static void snd_sb8_free(struct snd_card *card)
{ {
struct snd_sb8 *acard = (struct snd_sb8 *)card->private_data; struct snd_sb8 *acard = card->private_data;
if (acard == NULL) if (acard == NULL)
return; return;

View File

@ -171,7 +171,7 @@ au1550_delay(int msec)
static u16 static u16
rdcodec(struct ac97_codec *codec, u8 addr) rdcodec(struct ac97_codec *codec, u8 addr)
{ {
struct au1550_state *s = (struct au1550_state *)codec->private_data; struct au1550_state *s = codec->private_data;
unsigned long flags; unsigned long flags;
u32 cmd, val; u32 cmd, val;
u16 data; u16 data;
@ -239,7 +239,7 @@ rdcodec(struct ac97_codec *codec, u8 addr)
static void static void
wrcodec(struct ac97_codec *codec, u8 addr, u16 data) wrcodec(struct ac97_codec *codec, u8 addr, u16 data)
{ {
struct au1550_state *s = (struct au1550_state *)codec->private_data; struct au1550_state *s = codec->private_data;
unsigned long flags; unsigned long flags;
u32 cmd, val; u32 cmd, val;
int i; int i;
@ -820,7 +820,7 @@ mixdev_ioctl(struct ac97_codec *codec, unsigned int cmd,
static long static long
au1550_ioctl_mixdev(struct file *file, unsigned int cmd, unsigned long arg) au1550_ioctl_mixdev(struct file *file, unsigned int cmd, unsigned long arg)
{ {
struct au1550_state *s = (struct au1550_state *)file->private_data; struct au1550_state *s = file->private_data;
struct ac97_codec *codec = s->codec; struct ac97_codec *codec = s->codec;
int ret; int ret;
@ -1031,7 +1031,7 @@ copy_dmabuf_user(struct dmabuf *db, char* userbuf, int count, int to_user)
static ssize_t static ssize_t
au1550_read(struct file *file, char *buffer, size_t count, loff_t *ppos) au1550_read(struct file *file, char *buffer, size_t count, loff_t *ppos)
{ {
struct au1550_state *s = (struct au1550_state *)file->private_data; struct au1550_state *s = file->private_data;
struct dmabuf *db = &s->dma_adc; struct dmabuf *db = &s->dma_adc;
DECLARE_WAITQUEUE(wait, current); DECLARE_WAITQUEUE(wait, current);
ssize_t ret; ssize_t ret;
@ -1111,7 +1111,7 @@ au1550_read(struct file *file, char *buffer, size_t count, loff_t *ppos)
static ssize_t static ssize_t
au1550_write(struct file *file, const char *buffer, size_t count, loff_t * ppos) au1550_write(struct file *file, const char *buffer, size_t count, loff_t * ppos)
{ {
struct au1550_state *s = (struct au1550_state *)file->private_data; struct au1550_state *s = file->private_data;
struct dmabuf *db = &s->dma_dac; struct dmabuf *db = &s->dma_dac;
DECLARE_WAITQUEUE(wait, current); DECLARE_WAITQUEUE(wait, current);
ssize_t ret = 0; ssize_t ret = 0;
@ -1211,7 +1211,7 @@ au1550_write(struct file *file, const char *buffer, size_t count, loff_t * ppos)
static unsigned int static unsigned int
au1550_poll(struct file *file, struct poll_table_struct *wait) au1550_poll(struct file *file, struct poll_table_struct *wait)
{ {
struct au1550_state *s = (struct au1550_state *)file->private_data; struct au1550_state *s = file->private_data;
unsigned long flags; unsigned long flags;
unsigned int mask = 0; unsigned int mask = 0;
@ -1250,7 +1250,7 @@ au1550_poll(struct file *file, struct poll_table_struct *wait)
static int static int
au1550_mmap(struct file *file, struct vm_area_struct *vma) au1550_mmap(struct file *file, struct vm_area_struct *vma)
{ {
struct au1550_state *s = (struct au1550_state *)file->private_data; struct au1550_state *s = file->private_data;
struct dmabuf *db; struct dmabuf *db;
unsigned long size; unsigned long size;
int ret = 0; int ret = 0;
@ -1342,7 +1342,7 @@ dma_count_done(struct dmabuf *db)
static int static int
au1550_ioctl(struct file *file, unsigned int cmd, unsigned long arg) au1550_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
{ {
struct au1550_state *s = (struct au1550_state *)file->private_data; struct au1550_state *s = file->private_data;
unsigned long flags; unsigned long flags;
audio_buf_info abinfo; audio_buf_info abinfo;
count_info cinfo; count_info cinfo;
@ -1868,7 +1868,7 @@ au1550_open(struct inode *inode, struct file *file)
static int static int
au1550_release(struct inode *inode, struct file *file) au1550_release(struct inode *inode, struct file *file)
{ {
struct au1550_state *s = (struct au1550_state *)file->private_data; struct au1550_state *s = file->private_data;
lock_kernel(); lock_kernel();

View File

@ -321,7 +321,7 @@ static struct snd_rawmidi_ops snd_emu10k1_midi_input =
static void snd_emu10k1_midi_free(struct snd_rawmidi *rmidi) static void snd_emu10k1_midi_free(struct snd_rawmidi *rmidi)
{ {
struct snd_emu10k1_midi *midi = (struct snd_emu10k1_midi *)rmidi->private_data; struct snd_emu10k1_midi *midi = rmidi->private_data;
midi->interrupt = NULL; midi->interrupt = NULL;
midi->rmidi = NULL; midi->rmidi = NULL;
} }

View File

@ -638,7 +638,7 @@ static struct snd_kcontrol_new pontis_controls[] __devinitdata = {
*/ */
static void wm_proc_regs_write(struct snd_info_entry *entry, struct snd_info_buffer *buffer) static void wm_proc_regs_write(struct snd_info_entry *entry, struct snd_info_buffer *buffer)
{ {
struct snd_ice1712 *ice = (struct snd_ice1712 *)entry->private_data; struct snd_ice1712 *ice = entry->private_data;
char line[64]; char line[64];
unsigned int reg, val; unsigned int reg, val;
mutex_lock(&ice->gpio_mutex); mutex_lock(&ice->gpio_mutex);
@ -653,7 +653,7 @@ static void wm_proc_regs_write(struct snd_info_entry *entry, struct snd_info_buf
static void wm_proc_regs_read(struct snd_info_entry *entry, struct snd_info_buffer *buffer) static void wm_proc_regs_read(struct snd_info_entry *entry, struct snd_info_buffer *buffer)
{ {
struct snd_ice1712 *ice = (struct snd_ice1712 *)entry->private_data; struct snd_ice1712 *ice = entry->private_data;
int reg, val; int reg, val;
mutex_lock(&ice->gpio_mutex); mutex_lock(&ice->gpio_mutex);
@ -676,7 +676,7 @@ static void wm_proc_init(struct snd_ice1712 *ice)
static void cs_proc_regs_read(struct snd_info_entry *entry, struct snd_info_buffer *buffer) static void cs_proc_regs_read(struct snd_info_entry *entry, struct snd_info_buffer *buffer)
{ {
struct snd_ice1712 *ice = (struct snd_ice1712 *)entry->private_data; struct snd_ice1712 *ice = entry->private_data;
int reg, val; int reg, val;
mutex_lock(&ice->gpio_mutex); mutex_lock(&ice->gpio_mutex);

View File

@ -654,7 +654,7 @@ static int prodigy192_ak4114_init(struct snd_ice1712 *ice)
static void stac9460_proc_regs_read(struct snd_info_entry *entry, static void stac9460_proc_regs_read(struct snd_info_entry *entry,
struct snd_info_buffer *buffer) struct snd_info_buffer *buffer)
{ {
struct snd_ice1712 *ice = (struct snd_ice1712 *)entry->private_data; struct snd_ice1712 *ice = entry->private_data;
int reg, val; int reg, val;
/* registers 0x0 - 0x14 */ /* registers 0x0 - 0x14 */
for (reg = 0; reg <= 0x15; reg++) { for (reg = 0; reg <= 0x15; reg++) {

View File

@ -1527,14 +1527,14 @@ snd_rme96_free(void *private_data)
static void static void
snd_rme96_free_spdif_pcm(struct snd_pcm *pcm) snd_rme96_free_spdif_pcm(struct snd_pcm *pcm)
{ {
struct rme96 *rme96 = (struct rme96 *) pcm->private_data; struct rme96 *rme96 = pcm->private_data;
rme96->spdif_pcm = NULL; rme96->spdif_pcm = NULL;
} }
static void static void
snd_rme96_free_adat_pcm(struct snd_pcm *pcm) snd_rme96_free_adat_pcm(struct snd_pcm *pcm)
{ {
struct rme96 *rme96 = (struct rme96 *) pcm->private_data; struct rme96 *rme96 = pcm->private_data;
rme96->adat_pcm = NULL; rme96->adat_pcm = NULL;
} }
@ -1661,7 +1661,7 @@ static void
snd_rme96_proc_read(struct snd_info_entry *entry, struct snd_info_buffer *buffer) snd_rme96_proc_read(struct snd_info_entry *entry, struct snd_info_buffer *buffer)
{ {
int n; int n;
struct rme96 *rme96 = (struct rme96 *)entry->private_data; struct rme96 *rme96 = entry->private_data;
rme96->rcreg = readl(rme96->iobase + RME96_IO_CONTROL_REGISTER); rme96->rcreg = readl(rme96->iobase + RME96_IO_CONTROL_REGISTER);
@ -2348,7 +2348,7 @@ snd_rme96_probe(struct pci_dev *pci,
if (err < 0) if (err < 0)
return err; return err;
card->private_free = snd_rme96_card_free; card->private_free = snd_rme96_card_free;
rme96 = (struct rme96 *)card->private_data; rme96 = card->private_data;
rme96->card = card; rme96->card = card;
rme96->pci = pci; rme96->pci = pci;
snd_card_set_dev(card, &pci->dev); snd_card_set_dev(card, &pci->dev);

View File

@ -3284,7 +3284,7 @@ static int snd_hdsp_create_controls(struct snd_card *card, struct hdsp *hdsp)
static void static void
snd_hdsp_proc_read(struct snd_info_entry *entry, struct snd_info_buffer *buffer) snd_hdsp_proc_read(struct snd_info_entry *entry, struct snd_info_buffer *buffer)
{ {
struct hdsp *hdsp = (struct hdsp *) entry->private_data; struct hdsp *hdsp = entry->private_data;
unsigned int status; unsigned int status;
unsigned int status2; unsigned int status2;
char *pref_sync_ref; char *pref_sync_ref;
@ -4566,7 +4566,7 @@ static int hdsp_get_peak(struct hdsp *hdsp, struct hdsp_peak_rms __user *peak_rm
static int snd_hdsp_hwdep_ioctl(struct snd_hwdep *hw, struct file *file, unsigned int cmd, unsigned long arg) static int snd_hdsp_hwdep_ioctl(struct snd_hwdep *hw, struct file *file, unsigned int cmd, unsigned long arg)
{ {
struct hdsp *hdsp = (struct hdsp *)hw->private_data; struct hdsp *hdsp = hw->private_data;
void __user *argp = (void __user *)arg; void __user *argp = (void __user *)arg;
int err; int err;
@ -5155,7 +5155,7 @@ static int snd_hdsp_free(struct hdsp *hdsp)
static void snd_hdsp_card_free(struct snd_card *card) static void snd_hdsp_card_free(struct snd_card *card)
{ {
struct hdsp *hdsp = (struct hdsp *) card->private_data; struct hdsp *hdsp = card->private_data;
if (hdsp) if (hdsp)
snd_hdsp_free(hdsp); snd_hdsp_free(hdsp);
@ -5181,7 +5181,7 @@ static int __devinit snd_hdsp_probe(struct pci_dev *pci,
if (err < 0) if (err < 0)
return err; return err;
hdsp = (struct hdsp *) card->private_data; hdsp = card->private_data;
card->private_free = snd_hdsp_card_free; card->private_free = snd_hdsp_card_free;
hdsp->dev = dev; hdsp->dev = dev;
hdsp->pci = pci; hdsp->pci = pci;