Skip to content

Commit

Permalink
sound: Remove unnecessary casts of private_data
Browse files Browse the repository at this point in the history
Signed-off-by: Joe Perches <[email protected]>
Signed-off-by: Takashi Iwai <[email protected]>
  • Loading branch information
JoePerches authored and tiwai committed Sep 7, 2010
1 parent 831853c commit 9fe856e
Show file tree
Hide file tree
Showing 14 changed files with 41 additions and 42 deletions.
22 changes: 11 additions & 11 deletions sound/core/oss/mixer_oss.c
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ static int snd_mixer_oss_release(struct inode *inode, struct file *file)
struct snd_mixer_oss_file *fmixer;

if (file->private_data) {
fmixer = (struct snd_mixer_oss_file *) file->private_data;
fmixer = file->private_data;
module_put(fmixer->card->module);
snd_card_file_remove(fmixer->card, file);
kfree(fmixer);
Expand Down Expand Up @@ -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)
{
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)
Expand Down Expand Up @@ -582,7 +582,7 @@ static int snd_mixer_oss_get_volume1(struct snd_mixer_oss_file *fmixer,
struct snd_mixer_oss_slot *pslot,
int *left, int *right)
{
struct slot *slot = (struct slot *)pslot->private_data;
struct slot *slot = pslot->private_data;

*left = *right = 100;
if (slot->present & SNDRV_MIXER_OSS_PRESENT_PVOLUME) {
Expand Down Expand Up @@ -691,7 +691,7 @@ static int snd_mixer_oss_put_volume1(struct snd_mixer_oss_file *fmixer,
struct snd_mixer_oss_slot *pslot,
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) {
snd_mixer_oss_put_volume1_vol(fmixer, pslot, slot->numid[SNDRV_MIXER_OSS_ITEM_PVOLUME], left, right);
Expand Down Expand Up @@ -740,7 +740,7 @@ static int snd_mixer_oss_get_recsrc1_sw(struct snd_mixer_oss_file *fmixer,
struct snd_mixer_oss_slot *pslot,
int *active)
{
struct slot *slot = (struct slot *)pslot->private_data;
struct slot *slot = pslot->private_data;
int left, right;

left = right = 1;
Expand All @@ -753,7 +753,7 @@ static int snd_mixer_oss_get_recsrc1_route(struct snd_mixer_oss_file *fmixer,
struct snd_mixer_oss_slot *pslot,
int *active)
{
struct slot *slot = (struct slot *)pslot->private_data;
struct slot *slot = pslot->private_data;
int left, right;

left = right = 1;
Expand All @@ -766,7 +766,7 @@ static int snd_mixer_oss_put_recsrc1_sw(struct snd_mixer_oss_file *fmixer,
struct snd_mixer_oss_slot *pslot,
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);
return 0;
Expand All @@ -776,7 +776,7 @@ static int snd_mixer_oss_put_recsrc1_route(struct snd_mixer_oss_file *fmixer,
struct snd_mixer_oss_slot *pslot,
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);
return 0;
Expand Down Expand Up @@ -813,7 +813,7 @@ static int snd_mixer_oss_get_recsrc2(struct snd_mixer_oss_file *fmixer, unsigned
if (!(mixer->mask_recsrc & (1 << idx)))
continue;
pslot = &mixer->slots[idx];
slot = (struct slot *)pslot->private_data;
slot = pslot->private_data;
if (slot->signature != SNDRV_MIXER_OSS_SIGNATURE)
continue;
if (!(slot->present & SNDRV_MIXER_OSS_PRESENT_CAPTURE))
Expand Down Expand Up @@ -861,7 +861,7 @@ static int snd_mixer_oss_put_recsrc2(struct snd_mixer_oss_file *fmixer, unsigned
if (!(mixer->mask_recsrc & (1 << idx)))
continue;
pslot = &mixer->slots[idx];
slot = (struct slot *)pslot->private_data;
slot = pslot->private_data;
if (slot->signature != SNDRV_MIXER_OSS_SIGNATURE)
continue;
if (!(slot->present & SNDRV_MIXER_OSS_PRESENT_CAPTURE))
Expand Down Expand Up @@ -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)
{
struct slot *p = (struct slot *)chn->private_data;
struct slot *p = chn->private_data;
if (p) {
if (p->allocated && p->assigned) {
kfree(p->assigned->name);
Expand Down
3 changes: 1 addition & 2 deletions sound/core/pcm.c
Original file line number Diff line number Diff line change
Expand Up @@ -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,
struct snd_info_buffer *buffer)
{
snd_pcm_proc_info_read((struct snd_pcm_substream *)entry->private_data,
buffer);
snd_pcm_proc_info_read(entry->private_data, buffer);
}

static void snd_pcm_substream_proc_hw_params_read(struct snd_info_entry *entry,
Expand Down
2 changes: 1 addition & 1 deletion sound/drivers/virmidi.c
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ static int __devinit snd_virmidi_probe(struct platform_device *devptr)
sizeof(struct snd_card_virmidi), &card);
if (err < 0)
return err;
vmidi = (struct snd_card_virmidi *)card->private_data;
vmidi = card->private_data;
vmidi->card = card;

if (midi_devs[dev] > MAX_MIDI_DEVICES) {
Expand Down
2 changes: 1 addition & 1 deletion sound/i2c/other/ak4xxx-adda.c
Original file line number Diff line number Diff line change
Expand Up @@ -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,
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;
for (chip = 0; chip < ak->num_chips; chip++) {
for (reg = 0; reg < ak->total_regs; reg++) {
Expand Down
2 changes: 1 addition & 1 deletion sound/isa/ad1816a/ad1816a.c
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ static int __devinit snd_card_ad1816a_probe(int dev, struct pnp_card_link *pcard
sizeof(struct snd_card_ad1816a), &card);
if (error < 0)
return error;
acard = (struct snd_card_ad1816a *)card->private_data;
acard = card->private_data;

if ((error = snd_card_ad1816a_pnp(dev, acard, pcard, pid))) {
snd_card_free(card);
Expand Down
2 changes: 1 addition & 1 deletion sound/isa/azt2320.c
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ static int __devinit snd_card_azt2320_probe(int dev,
sizeof(struct snd_card_azt2320), &card);
if (error < 0)
return error;
acard = (struct snd_card_azt2320 *)card->private_data;
acard = card->private_data;

if ((error = snd_card_azt2320_pnp(dev, acard, pcard, pid))) {
snd_card_free(card);
Expand Down
4 changes: 2 additions & 2 deletions sound/isa/gus/gusmax.c
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ static int __devinit snd_gusmax_mixer(struct snd_wss *chip)

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)
return;
Expand Down Expand Up @@ -219,7 +219,7 @@ static int __devinit snd_gusmax_probe(struct device *pdev, unsigned int dev)
if (err < 0)
return err;
card->private_free = snd_gusmax_free;
maxcard = (struct snd_gusmax *)card->private_data;
maxcard = card->private_data;
maxcard->card = card;
maxcard->irq = -1;

Expand Down
2 changes: 1 addition & 1 deletion sound/isa/sb/sb8.c
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ static irqreturn_t snd_sb8_interrupt(int irq, void *dev_id)

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)
return;
Expand Down
18 changes: 9 additions & 9 deletions sound/oss/au1550_ac97.c
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ au1550_delay(int msec)
static u16
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;
u32 cmd, val;
u16 data;
Expand Down Expand Up @@ -239,7 +239,7 @@ rdcodec(struct ac97_codec *codec, u8 addr)
static void
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;
u32 cmd, val;
int i;
Expand Down Expand Up @@ -820,7 +820,7 @@ mixdev_ioctl(struct ac97_codec *codec, unsigned int cmd,
static long
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;
int ret;

Expand Down Expand Up @@ -1031,7 +1031,7 @@ copy_dmabuf_user(struct dmabuf *db, char* userbuf, int count, int to_user)
static ssize_t
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;
DECLARE_WAITQUEUE(wait, current);
ssize_t ret;
Expand Down Expand Up @@ -1111,7 +1111,7 @@ au1550_read(struct file *file, char *buffer, size_t count, loff_t *ppos)
static ssize_t
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;
DECLARE_WAITQUEUE(wait, current);
ssize_t ret = 0;
Expand Down Expand Up @@ -1211,7 +1211,7 @@ au1550_write(struct file *file, const char *buffer, size_t count, loff_t * ppos)
static unsigned int
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 int mask = 0;

Expand Down Expand Up @@ -1250,7 +1250,7 @@ au1550_poll(struct file *file, struct poll_table_struct *wait)
static int
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;
unsigned long size;
int ret = 0;
Expand Down Expand Up @@ -1342,7 +1342,7 @@ dma_count_done(struct dmabuf *db)
static int
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;
audio_buf_info abinfo;
count_info cinfo;
Expand Down Expand Up @@ -1868,7 +1868,7 @@ au1550_open(struct inode *inode, struct file *file)
static int
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();

Expand Down
2 changes: 1 addition & 1 deletion sound/pci/emu10k1/emumpu401.c
Original file line number Diff line number Diff line change
Expand Up @@ -321,7 +321,7 @@ static struct snd_rawmidi_ops snd_emu10k1_midi_input =

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->rmidi = NULL;
}
Expand Down
6 changes: 3 additions & 3 deletions sound/pci/ice1712/pontis.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
struct snd_ice1712 *ice = (struct snd_ice1712 *)entry->private_data;
struct snd_ice1712 *ice = entry->private_data;
char line[64];
unsigned int reg, val;
mutex_lock(&ice->gpio_mutex);
Expand All @@ -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)
{
struct snd_ice1712 *ice = (struct snd_ice1712 *)entry->private_data;
struct snd_ice1712 *ice = entry->private_data;
int reg, val;

mutex_lock(&ice->gpio_mutex);
Expand All @@ -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)
{
struct snd_ice1712 *ice = (struct snd_ice1712 *)entry->private_data;
struct snd_ice1712 *ice = entry->private_data;
int reg, val;

mutex_lock(&ice->gpio_mutex);
Expand Down
2 changes: 1 addition & 1 deletion sound/pci/ice1712/prodigy192.c
Original file line number Diff line number Diff line change
Expand Up @@ -654,7 +654,7 @@ static int prodigy192_ak4114_init(struct snd_ice1712 *ice)
static void stac9460_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;
/* registers 0x0 - 0x14 */
for (reg = 0; reg <= 0x15; reg++) {
Expand Down
8 changes: 4 additions & 4 deletions sound/pci/rme96.c
Original file line number Diff line number Diff line change
Expand Up @@ -1527,14 +1527,14 @@ snd_rme96_free(void *private_data)
static void
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;
}

static void
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;
}

Expand Down Expand Up @@ -1661,7 +1661,7 @@ static void
snd_rme96_proc_read(struct snd_info_entry *entry, struct snd_info_buffer *buffer)
{
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);

Expand Down Expand Up @@ -2348,7 +2348,7 @@ snd_rme96_probe(struct pci_dev *pci,
if (err < 0)
return err;
card->private_free = snd_rme96_card_free;
rme96 = (struct rme96 *)card->private_data;
rme96 = card->private_data;
rme96->card = card;
rme96->pci = pci;
snd_card_set_dev(card, &pci->dev);
Expand Down
8 changes: 4 additions & 4 deletions sound/pci/rme9652/hdsp.c
Original file line number Diff line number Diff line change
Expand Up @@ -3284,7 +3284,7 @@ static int snd_hdsp_create_controls(struct snd_card *card, struct hdsp *hdsp)
static void
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 status2;
char *pref_sync_ref;
Expand Down Expand Up @@ -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)
{
struct hdsp *hdsp = (struct hdsp *)hw->private_data;
struct hdsp *hdsp = hw->private_data;
void __user *argp = (void __user *)arg;
int err;

Expand Down Expand Up @@ -5155,7 +5155,7 @@ static int snd_hdsp_free(struct hdsp *hdsp)

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)
snd_hdsp_free(hdsp);
Expand All @@ -5181,7 +5181,7 @@ static int __devinit snd_hdsp_probe(struct pci_dev *pci,
if (err < 0)
return err;

hdsp = (struct hdsp *) card->private_data;
hdsp = card->private_data;
card->private_free = snd_hdsp_card_free;
hdsp->dev = dev;
hdsp->pci = pci;
Expand Down

0 comments on commit 9fe856e

Please sign in to comment.