From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752889Ab2IEHkj (ORCPT ); Wed, 5 Sep 2012 03:40:39 -0400 Received: from cantor2.suse.de ([195.135.220.15]:46649 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750991Ab2IEHkh (ORCPT ); Wed, 5 Sep 2012 03:40:37 -0400 Date: Wed, 05 Sep 2012 09:40:29 +0200 Message-ID: From: Takashi Iwai To: Wei Yongjun Cc: clemens@ladisch.de, perex@perex.cz, yongjun_wei@trendmicro.com.cn, alsa-devel@alsa-project.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] ALSA: use list_move_tail instead of list_del/list_add_tail In-Reply-To: References: User-Agent: Wanderlust/2.15.9 (Almost Unreal) SEMI/1.14.6 (Maruoka) FLIM/1.14.9 (=?UTF-8?B?R29qxY0=?=) APEL/10.8 Emacs/24.1 (x86_64-suse-linux-gnu) MULE/6.0 (HANACHIRUSATO) MIME-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Content-Type: text/plain; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org At Wed, 5 Sep 2012 14:33:21 +0800, Wei Yongjun wrote: > > From: Wei Yongjun > > Using list_move_tail() instead of list_del() + list_add_tail(). > > Signed-off-by: Wei Yongjun Thanks, applied. Takashi > --- > sound/drivers/opl4/opl4_synth.c | 9 +++------ > 1 file changed, 3 insertions(+), 6 deletions(-) > > diff --git a/sound/drivers/opl4/opl4_synth.c b/sound/drivers/opl4/opl4_synth.c > index 49b9e24..4b91adc 100644 > --- a/sound/drivers/opl4/opl4_synth.c > +++ b/sound/drivers/opl4/opl4_synth.c > @@ -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; > @@ -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); > @@ -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); >