Skip to content

Commit

Permalink
sound/oss/pss: Remove typedefs pss_mixerdata and pss_confdata
Browse files Browse the repository at this point in the history
The Linux kernel coding style guidelines suggest not using typedefs
for structure types. This patch gets rid of the typedefs for pss_mixerdata
and pss_confdata.

The following Coccinelle semantic patch is used to make the change.

@tn@
identifier i;
type td;
@@

-typedef
 struct i { ... }
-td
 ;

@@
type tn.td;
identifier tn.i;
@@

-td
+ struct i

Signed-off-by: Himangi Saraogi <[email protected]>
Acked-by: Julia Lawall <[email protected]>
Signed-off-by: Takashi Iwai <[email protected]>
  • Loading branch information
himangi774 authored and tiwai committed Aug 5, 2014
1 parent 8b0276d commit 81cb6b6
Showing 1 changed file with 24 additions and 22 deletions.
46 changes: 24 additions & 22 deletions sound/oss/pss.c
Original file line number Diff line number Diff line change
Expand Up @@ -123,25 +123,25 @@ static bool pss_mixer;
#endif


typedef struct pss_mixerdata {
struct pss_mixerdata {
unsigned int volume_l;
unsigned int volume_r;
unsigned int bass;
unsigned int treble;
unsigned int synth;
} pss_mixerdata;
};

typedef struct pss_confdata {
struct pss_confdata {
int base;
int irq;
int dma;
int *osp;
pss_mixerdata mixer;
struct pss_mixerdata mixer;
int ad_mixer_dev;
} pss_confdata;
};

static pss_confdata pss_data;
static pss_confdata *devc = &pss_data;
static struct pss_confdata pss_data;
static struct pss_confdata *devc = &pss_data;
static DEFINE_SPINLOCK(lock);

static int pss_initialized;
Expand All @@ -150,7 +150,7 @@ static int pss_cdrom_port = -1; /* Parameter for the PSS cdrom port */
static bool pss_enable_joystick; /* Parameter for enabling the joystick */
static coproc_operations pss_coproc_operations;

static void pss_write(pss_confdata *devc, int data)
static void pss_write(struct pss_confdata *devc, int data)
{
unsigned long i, limit;

Expand Down Expand Up @@ -206,7 +206,7 @@ static int __init probe_pss(struct address_info *hw_config)
return 1;
}

static int set_irq(pss_confdata * devc, int dev, int irq)
static int set_irq(struct pss_confdata *devc, int dev, int irq)
{
static unsigned short irq_bits[16] =
{
Expand All @@ -232,15 +232,15 @@ static int set_irq(pss_confdata * devc, int dev, int irq)
return 1;
}

static void set_io_base(pss_confdata * devc, int dev, int base)
static void set_io_base(struct pss_confdata *devc, int dev, int base)
{
unsigned short tmp = inw(REG(dev)) & 0x003f;
unsigned short bits = (base & 0x0ffc) << 4;

outw(bits | tmp, REG(dev));
}

static int set_dma(pss_confdata * devc, int dev, int dma)
static int set_dma(struct pss_confdata *devc, int dev, int dma)
{
static unsigned short dma_bits[8] =
{
Expand All @@ -264,7 +264,7 @@ static int set_dma(pss_confdata * devc, int dev, int dma)
return 1;
}

static int pss_reset_dsp(pss_confdata * devc)
static int pss_reset_dsp(struct pss_confdata *devc)
{
unsigned long i, limit = jiffies + HZ/10;

Expand All @@ -275,7 +275,7 @@ static int pss_reset_dsp(pss_confdata * devc)
return 1;
}

static int pss_put_dspword(pss_confdata * devc, unsigned short word)
static int pss_put_dspword(struct pss_confdata *devc, unsigned short word)
{
int i, val;

Expand All @@ -291,7 +291,7 @@ static int pss_put_dspword(pss_confdata * devc, unsigned short word)
return 0;
}

static int pss_get_dspword(pss_confdata * devc, unsigned short *word)
static int pss_get_dspword(struct pss_confdata *devc, unsigned short *word)
{
int i, val;

Expand All @@ -307,7 +307,8 @@ static int pss_get_dspword(pss_confdata * devc, unsigned short *word)
return 0;
}

static int pss_download_boot(pss_confdata * devc, unsigned char *block, int size, int flags)
static int pss_download_boot(struct pss_confdata *devc, unsigned char *block,
int size, int flags)
{
int i, val, count;
unsigned long limit;
Expand Down Expand Up @@ -397,7 +398,7 @@ static int pss_download_boot(pss_confdata * devc, unsigned char *block, int size
}

/* Mixer */
static void set_master_volume(pss_confdata *devc, int left, int right)
static void set_master_volume(struct pss_confdata *devc, int left, int right)
{
static unsigned char log_scale[101] = {
0xdb, 0xe0, 0xe3, 0xe5, 0xe7, 0xe9, 0xea, 0xeb, 0xec, 0xed, 0xed, 0xee,
Expand All @@ -416,7 +417,7 @@ static void set_master_volume(pss_confdata *devc, int left, int right)
pss_write(devc, log_scale[right] | 0x0100);
}

static void set_synth_volume(pss_confdata *devc, int volume)
static void set_synth_volume(struct pss_confdata *devc, int volume)
{
int vol = ((0x8000*volume)/100L);
pss_write(devc, 0x0080);
Expand All @@ -425,21 +426,21 @@ static void set_synth_volume(pss_confdata *devc, int volume)
pss_write(devc, vol);
}

static void set_bass(pss_confdata *devc, int level)
static void set_bass(struct pss_confdata *devc, int level)
{
int vol = (int)(((0xfd - 0xf0) * level)/100L) + 0xf0;
pss_write(devc, 0x0010);
pss_write(devc, vol | 0x0200);
};

static void set_treble(pss_confdata *devc, int level)
static void set_treble(struct pss_confdata *devc, int level)
{
int vol = (((0xfd - 0xf0) * level)/100L) + 0xf0;
pss_write(devc, 0x0010);
pss_write(devc, vol | 0x0300);
};

static void pss_mixer_reset(pss_confdata *devc)
static void pss_mixer_reset(struct pss_confdata *devc)
{
set_master_volume(devc, 33, 33);
set_bass(devc, 50);
Expand Down Expand Up @@ -499,7 +500,8 @@ static int ret_vol_stereo(int left, int right)
return ((right << 8) | left);
}

static int call_ad_mixer(pss_confdata *devc,unsigned int cmd, void __user *arg)
static int call_ad_mixer(struct pss_confdata *devc, unsigned int cmd,
void __user *arg)
{
if (devc->ad_mixer_dev != NO_WSS_MIXER)
return mixer_devs[devc->ad_mixer_dev]->ioctl(devc->ad_mixer_dev, cmd, arg);
Expand All @@ -509,7 +511,7 @@ static int call_ad_mixer(pss_confdata *devc,unsigned int cmd, void __user *arg)

static int pss_mixer_ioctl (int dev, unsigned int cmd, void __user *arg)
{
pss_confdata *devc = mixer_devs[dev]->devc;
struct pss_confdata *devc = mixer_devs[dev]->devc;
int cmdf = cmd & 0xff;

if ((cmdf != SOUND_MIXER_VOLUME) && (cmdf != SOUND_MIXER_BASS) &&
Expand Down

0 comments on commit 81cb6b6

Please sign in to comment.