aboutsummaryrefslogtreecommitdiffstats
path: root/sound/synth/emux
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--sound/synth/emux/emux.c12
-rw-r--r--sound/synth/emux/emux_effect.c13
-rw-r--r--sound/synth/emux/emux_hwdep.c6
-rw-r--r--sound/synth/emux/emux_nrpn.c2
-rw-r--r--sound/synth/emux/soundfont.c46
5 files changed, 48 insertions, 31 deletions
diff --git a/sound/synth/emux/emux.c b/sound/synth/emux/emux.c
index f65e6c7b139f..a870759d179e 100644
--- a/sound/synth/emux/emux.c
+++ b/sound/synth/emux/emux.c
@@ -88,7 +88,7 @@ int snd_emux_register(struct snd_emux *emu, struct snd_card *card, int index, ch
emu->name = kstrdup(name, GFP_KERNEL);
emu->voices = kcalloc(emu->max_voices, sizeof(struct snd_emux_voice),
GFP_KERNEL);
- if (emu->voices == NULL)
+ if (emu->name == NULL || emu->voices == NULL)
return -ENOMEM;
/* create soundfont list */
@@ -104,7 +104,8 @@ int snd_emux_register(struct snd_emux *emu, struct snd_card *card, int index, ch
if (emu->sflist == NULL)
return -ENOMEM;
- if ((err = snd_emux_init_hwdep(emu)) < 0)
+ err = snd_emux_init_hwdep(emu);
+ if (err < 0)
return err;
snd_emux_init_voices(emu);
@@ -125,15 +126,10 @@ EXPORT_SYMBOL(snd_emux_register);
*/
int snd_emux_free(struct snd_emux *emu)
{
- unsigned long flags;
-
if (! emu)
return -EINVAL;
- spin_lock_irqsave(&emu->voice_lock, flags);
- if (emu->timer_active)
- del_timer(&emu->tlist);
- spin_unlock_irqrestore(&emu->voice_lock, flags);
+ del_timer_sync(&emu->tlist);
snd_emux_proc_free(emu);
snd_emux_delete_virmidi(emu);
diff --git a/sound/synth/emux/emux_effect.c b/sound/synth/emux/emux_effect.c
index afd119b11f39..3c7314f5fb19 100644
--- a/sound/synth/emux/emux_effect.c
+++ b/sound/synth/emux/emux_effect.c
@@ -181,7 +181,10 @@ snd_emux_send_effect(struct snd_emux_port *port, struct snd_midi_channel *chan,
fx->flag[type] = mode;
/* do we need to modify the register in realtime ? */
- if (! parm_defs[type].update || (offset = parm_defs[type].offset) < 0)
+ if (!parm_defs[type].update)
+ return;
+ offset = parm_defs[type].offset;
+ if (offset < 0)
return;
#ifdef SNDRV_LITTLE_ENDIAN
@@ -223,13 +226,17 @@ snd_emux_setup_effect(struct snd_emux_voice *vp)
unsigned char *srcp;
int i;
- if (! (fx = chan->private))
+ fx = chan->private;
+ if (!fx)
return;
/* modify the register values via effect table */
for (i = 0; i < EMUX_FX_END; i++) {
int offset;
- if (! fx->flag[i] || (offset = parm_defs[i].offset) < 0)
+ if (!fx->flag[i])
+ continue;
+ offset = parm_defs[i].offset;
+ if (offset < 0)
continue;
#ifdef SNDRV_LITTLE_ENDIAN
if (parm_defs[i].type & PARM_IS_ALIGN_HI)
diff --git a/sound/synth/emux/emux_hwdep.c b/sound/synth/emux/emux_hwdep.c
index 8a965e2f160a..81719bfb8ed7 100644
--- a/sound/synth/emux/emux_hwdep.c
+++ b/sound/synth/emux/emux_hwdep.c
@@ -116,7 +116,8 @@ snd_emux_init_hwdep(struct snd_emux *emu)
struct snd_hwdep *hw;
int err;
- if ((err = snd_hwdep_new(emu->card, SNDRV_EMUX_HWDEP_NAME, emu->hwdep_idx, &hw)) < 0)
+ err = snd_hwdep_new(emu->card, SNDRV_EMUX_HWDEP_NAME, emu->hwdep_idx, &hw);
+ if (err < 0)
return err;
emu->hwdep = hw;
strcpy(hw->name, SNDRV_EMUX_HWDEP_NAME);
@@ -127,7 +128,8 @@ snd_emux_init_hwdep(struct snd_emux *emu)
hw->ops.ioctl_compat = snd_emux_hwdep_ioctl;
hw->exclusive = 1;
hw->private_data = emu;
- if ((err = snd_card_register(emu->card)) < 0)
+ err = snd_card_register(emu->card);
+ if (err < 0)
return err;
return 0;
diff --git a/sound/synth/emux/emux_nrpn.c b/sound/synth/emux/emux_nrpn.c
index 7eed5791972c..8056422ed7c5 100644
--- a/sound/synth/emux/emux_nrpn.c
+++ b/sound/synth/emux/emux_nrpn.c
@@ -69,7 +69,7 @@ static const int gs_sense[] =
DEF_FX_VIBRATE, DEF_FX_VIBDEPTH, DEF_FX_VIBDELAY
};
-/* effect sensitivies for XG controls:
+/* effect sensitivities for XG controls:
* adjusted for chaos 8MB soundfonts
*/
static const int xg_sense[] =
diff --git a/sound/synth/emux/soundfont.c b/sound/synth/emux/soundfont.c
index 9ebc711afa6b..16f00097cb95 100644
--- a/sound/synth/emux/soundfont.c
+++ b/sound/synth/emux/soundfont.c
@@ -108,7 +108,7 @@ snd_soundfont_close_check(struct snd_sf_list *sflist, int client)
* Deal with a soundfont patch. Any driver could use these routines
* although it was designed for the AWE64.
*
- * The sample_write and callargs pararameters allow a callback into
+ * The sample_write and callargs parameters allow a callback into
* the actual driver to write sample data to the board or whatever
* it wants to do with it.
*/
@@ -349,7 +349,8 @@ sf_zone_new(struct snd_sf_list *sflist, struct snd_soundfont *sf)
{
struct snd_sf_zone *zp;
- if ((zp = kzalloc(sizeof(*zp), GFP_KERNEL)) == NULL)
+ zp = kzalloc(sizeof(*zp), GFP_KERNEL);
+ if (!zp)
return NULL;
zp->next = sf->zones;
sf->zones = zp;
@@ -381,7 +382,8 @@ sf_sample_new(struct snd_sf_list *sflist, struct snd_soundfont *sf)
{
struct snd_sf_sample *sp;
- if ((sp = kzalloc(sizeof(*sp), GFP_KERNEL)) == NULL)
+ sp = kzalloc(sizeof(*sp), GFP_KERNEL);
+ if (!sp)
return NULL;
sp->next = sf->samples;
@@ -451,7 +453,8 @@ load_map(struct snd_sf_list *sflist, const void __user *data, int count)
}
/* create a new zone */
- if ((zp = sf_zone_new(sflist, sf)) == NULL)
+ zp = sf_zone_new(sflist, sf);
+ if (!zp)
return -ENOMEM;
zp->bank = map.map_bank;
@@ -514,7 +517,8 @@ load_info(struct snd_sf_list *sflist, const void __user *data, long count)
int i;
/* patch must be opened */
- if ((sf = sflist->currsf) == NULL)
+ sf = sflist->currsf;
+ if (!sf)
return -EINVAL;
if (is_special_type(sf->type))
@@ -579,9 +583,9 @@ load_info(struct snd_sf_list *sflist, const void __user *data, long count)
init_voice_parm(&tmpzone.v.parm);
/* create a new zone */
- if ((zone = sf_zone_new(sflist, sf)) == NULL) {
+ zone = sf_zone_new(sflist, sf);
+ if (!zone)
return -ENOMEM;
- }
/* copy the temporary data */
zone->bank = tmpzone.bank;
@@ -700,7 +704,8 @@ load_data(struct snd_sf_list *sflist, const void __user *data, long count)
long off;
/* patch must be opened */
- if ((sf = sflist->currsf) == NULL)
+ sf = sflist->currsf;
+ if (!sf)
return -EINVAL;
if (is_special_type(sf->type))
@@ -723,7 +728,8 @@ load_data(struct snd_sf_list *sflist, const void __user *data, long count)
}
/* Allocate a new sample structure */
- if ((sp = sf_sample_new(sflist, sf)) == NULL)
+ sp = sf_sample_new(sflist, sf);
+ if (!sp)
return -ENOMEM;
sp->v = sample_info;
@@ -793,7 +799,7 @@ snd_sf_linear_to_log(unsigned int amount, int offset, int ratio)
amount <<= 1;
s = (amount >> 24) & 0x7f;
low = (amount >> 16) & 0xff;
- /* linear approxmimation by lower 8 bit */
+ /* linear approximation by lower 8 bit */
v = (log_tbl[s + 1] * low + log_tbl[s] * (0x100 - low)) >> 8;
v -= offset;
v = (v * ratio) >> 16;
@@ -958,7 +964,8 @@ load_guspatch(struct snd_sf_list *sflist, const char __user *data,
sf = newsf(sflist, SNDRV_SFNT_PAT_TYPE_GUS|SNDRV_SFNT_PAT_SHARED, NULL);
if (sf == NULL)
return -ENOMEM;
- if ((smp = sf_sample_new(sflist, sf)) == NULL)
+ smp = sf_sample_new(sflist, sf);
+ if (!smp)
return -ENOMEM;
sample_id = sflist->sample_counter;
smp->v.sample = sample_id;
@@ -996,7 +1003,8 @@ load_guspatch(struct snd_sf_list *sflist, const char __user *data,
smp->v.sf_id = sf->id;
/* set up voice info */
- if ((zone = sf_zone_new(sflist, sf)) == NULL) {
+ zone = sf_zone_new(sflist, sf);
+ if (!zone) {
sf_sample_delete(sflist, sf, smp);
return -ENOMEM;
}
@@ -1181,7 +1189,8 @@ add_preset(struct snd_sf_list *sflist, struct snd_sf_zone *cur)
}
/* prepend this zone */
- if ((index = get_index(cur->bank, cur->instr, cur->v.low)) < 0)
+ index = get_index(cur->bank, cur->instr, cur->v.low);
+ if (index < 0)
return;
cur->next_zone = zone; /* zone link */
cur->next_instr = sflist->presets[index]; /* preset table link */
@@ -1197,7 +1206,8 @@ delete_preset(struct snd_sf_list *sflist, struct snd_sf_zone *zp)
int index;
struct snd_sf_zone *p;
- if ((index = get_index(zp->bank, zp->instr, zp->v.low)) < 0)
+ index = get_index(zp->bank, zp->instr, zp->v.low);
+ if (index < 0)
return;
for (p = sflist->presets[index]; p; p = p->next_instr) {
while (p->next_instr == zp) {
@@ -1257,7 +1267,8 @@ search_first_zone(struct snd_sf_list *sflist, int bank, int preset, int key)
int index;
struct snd_sf_zone *zp;
- if ((index = get_index(bank, preset, key)) < 0)
+ index = get_index(bank, preset, key);
+ if (index < 0)
return NULL;
for (zp = sflist->presets[index]; zp; zp = zp->next_instr) {
if (zp->instr == preset && zp->bank == bank)
@@ -1386,7 +1397,8 @@ snd_sf_new(struct snd_sf_callback *callback, struct snd_util_memhdr *hdr)
{
struct snd_sf_list *sflist;
- if ((sflist = kzalloc(sizeof(*sflist), GFP_KERNEL)) == NULL)
+ sflist = kzalloc(sizeof(*sflist), GFP_KERNEL);
+ if (!sflist)
return NULL;
mutex_init(&sflist->presets_mutex);
@@ -1421,7 +1433,7 @@ snd_sf_free(struct snd_sf_list *sflist)
/*
* Remove all samples
- * The soundcard should be silet before calling this function.
+ * The soundcard should be silent before calling this function.
*/
int
snd_soundfont_remove_samples(struct snd_sf_list *sflist)