Skip to content

Commit

Permalink
ALSA: opl4: use list_move_tail instead of list_del/list_add_tail
Browse files Browse the repository at this point in the history
Using list_move_tail() instead of list_del() + list_add_tail().

Signed-off-by: Wei Yongjun <[email protected]>
Acked-by: Clemens Ladisch <[email protected]>
Signed-off-by: Takashi Iwai <[email protected]>
  • Loading branch information
Wei Yongjun authored and tiwai committed Sep 5, 2012
1 parent 2b58fd5 commit 3a4a7ef
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions sound/drivers/opl4/opl4_synth.c
Original file line number Diff line number Diff line change
Expand Up @@ -504,8 +504,7 @@ void snd_opl4_note_on(void *private_data, int note, int vel, struct snd_midi_cha
spin_lock_irqsave(&opl4->reg_lock, flags);
for (i = 0; i < voices; i++) {
voice[i] = snd_opl4_get_voice(opl4);
list_del(&voice[i]->list);
list_add_tail(&voice[i]->list, &opl4->on_voices);
list_move_tail(&voice[i]->list, &opl4->on_voices);
voice[i]->chan = chan;
voice[i]->note = note;
voice[i]->velocity = vel & 0x7f;
Expand Down Expand Up @@ -555,8 +554,7 @@ void snd_opl4_note_on(void *private_data, int note, int vel, struct snd_midi_cha

static void snd_opl4_voice_off(struct snd_opl4 *opl4, struct opl4_voice *voice)
{
list_del(&voice->list);
list_add_tail(&voice->list, &opl4->off_voices);
list_move_tail(&voice->list, &opl4->off_voices);

voice->reg_misc &= ~OPL4_KEY_ON_BIT;
snd_opl4_write(opl4, OPL4_REG_MISC + voice->number, voice->reg_misc);
Expand All @@ -571,8 +569,7 @@ void snd_opl4_note_off(void *private_data, int note, int vel, struct snd_midi_ch

static void snd_opl4_terminate_voice(struct snd_opl4 *opl4, struct opl4_voice *voice)
{
list_del(&voice->list);
list_add_tail(&voice->list, &opl4->off_voices);
list_move_tail(&voice->list, &opl4->off_voices);

voice->reg_misc = (voice->reg_misc & ~OPL4_KEY_ON_BIT) | OPL4_DAMP_BIT;
snd_opl4_write(opl4, OPL4_REG_MISC + voice->number, voice->reg_misc);
Expand Down

0 comments on commit 3a4a7ef

Please sign in to comment.