[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <20220917123155.1899689-1-yangyingliang@huawei.com>
Date: Sat, 17 Sep 2022 20:31:54 +0800
From: Yang Yingliang <yangyingliang@...wei.com>
To: <alsa-devel@...a-project.org>, <linux-kernel@...r.kernel.org>
CC: <perex@...ex.cz>, <tiwai@...e.com>
Subject: [PATCH -next 1/2] ALSA: mts64: Switch to use list_for_each_entry() helper
Use list_for_each_entry() helper instead of list_for_each() and
list_entry() to simplify code a bit. No functional change.
Signed-off-by: Yang Yingliang <yangyingliang@...wei.com>
---
sound/drivers/mts64.c | 13 ++++++-------
1 file changed, 6 insertions(+), 7 deletions(-)
diff --git a/sound/drivers/mts64.c b/sound/drivers/mts64.c
index d3bc9e8c407d..746ac25a319e 100644
--- a/sound/drivers/mts64.c
+++ b/sound/drivers/mts64.c
@@ -752,7 +752,6 @@ static int snd_mts64_rawmidi_create(struct snd_card *card)
struct mts64 *mts = card->private_data;
struct snd_rawmidi *rmidi;
struct snd_rawmidi_substream *substream;
- struct list_head *list;
int err;
err = snd_rawmidi_new(card, CARD_NAME, 0,
@@ -778,16 +777,16 @@ static int snd_mts64_rawmidi_create(struct snd_card *card)
/* name substreams */
/* output */
- list_for_each(list,
- &rmidi->streams[SNDRV_RAWMIDI_STREAM_OUTPUT].substreams) {
- substream = list_entry(list, struct snd_rawmidi_substream, list);
+ list_for_each_entry(substream,
+ &rmidi->streams[SNDRV_RAWMIDI_STREAM_OUTPUT].substreams,
+ list) {
sprintf(substream->name,
"Miditerminal %d", substream->number+1);
}
/* input */
- list_for_each(list,
- &rmidi->streams[SNDRV_RAWMIDI_STREAM_INPUT].substreams) {
- substream = list_entry(list, struct snd_rawmidi_substream, list);
+ list_for_each_entry(substream,
+ &rmidi->streams[SNDRV_RAWMIDI_STREAM_INPUT].substreams,
+ list) {
mts->midi_input_substream[substream->number] = substream;
switch(substream->number) {
case MTS64_SMPTE_SUBSTREAM:
--
2.25.1
Powered by blists - more mailing lists