From: Mark Brown <broonie@kernel.org> To: Xie Yisheng <xieyisheng1@huawei.com> Cc: Liam Girdwood <lgirdwood@gmail.com>, Mark Brown <broonie@kernel.org>, Jaroslav Kysela <perex@perex.cz>, Takashi Iwai <tiwai@suse.com>, alsa-devel@alsa-project.org, Yisheng Xie <xieyisheng1@huawei.com>, Mark Brown <broonie@kernel.org>, linux-kernel@vger.kernel.org, Yisheng Xie <xieyisheng1@huawei.com>, alsa-devel@alsa-project.org, Takashi Iwai <tiwai@suse.com>, Liam Girdwood <lgirdwood@gmail.com>, andy.shevchenko@gmail.com, Mark Brown <broonie@kernel.org>, alsa-devel@alsa-project.org Subject: Applied "ASoC: max98088: use match_string() helper" to the asoc tree Date: Thu, 31 May 2018 17:09:45 +0100 [thread overview] Message-ID: <E1fOQ93-0003CU-AS@debutante> (raw) In-Reply-To: <1527765086-19873-17-git-send-email-xieyisheng1@huawei.com> The patch ASoC: max98088: use match_string() helper has been applied to the asoc tree at https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git All being well this means that it will be integrated into the linux-next tree (usually sometime in the next 24 hours) and sent to Linus during the next merge window (or sooner if it is a bug fix), however if problems are discovered then the patch may be dropped or reverted. You may get further e-mails resulting from automated or manual testing and review of the tree, please engage with people reporting problems and send followup patches addressing any issues that are reported if needed. If any updates are required or you are submitting further changes they should be sent as incremental updates against current git, existing patches will not be replaced. Please add any relevant lists and maintainers to the CCs when replying to this mail. Thanks, Mark >From 3470631510fa383feac5969b436499ca9bad03b8 Mon Sep 17 00:00:00 2001 From: Xie Yisheng <xieyisheng1@huawei.com> Date: Thu, 31 May 2018 19:11:21 +0800 Subject: [PATCH] ASoC: max98088: use match_string() helper match_string() returns the index of an array for a matching string, which can be used instead of open coded variant. Cc: Liam Girdwood <lgirdwood@gmail.com> Cc: Mark Brown <broonie@kernel.org> Cc: Jaroslav Kysela <perex@perex.cz> Cc: Takashi Iwai <tiwai@suse.com> Cc: alsa-devel@alsa-project.org Signed-off-by: Yisheng Xie <xieyisheng1@huawei.com> Signed-off-by: Mark Brown <broonie@kernel.org> --- sound/soc/codecs/max98088.c | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/sound/soc/codecs/max98088.c b/sound/soc/codecs/max98088.c index 865f64c40b79..fb515aaa54fc 100644 --- a/sound/soc/codecs/max98088.c +++ b/sound/soc/codecs/max98088.c @@ -1382,15 +1382,12 @@ static const char *eq_mode_name[] = {"EQ1 Mode", "EQ2 Mode"}; static int max98088_get_channel(struct snd_soc_component *component, const char *name) { - int i; + int ret; - for (i = 0; i < ARRAY_SIZE(eq_mode_name); i++) - if (strcmp(name, eq_mode_name[i]) == 0) - return i; - - /* Shouldn't happen */ - dev_err(component->dev, "Bad EQ channel name '%s'\n", name); - return -EINVAL; + ret = match_string(eq_mode_name, ARRAY_SIZE(eq_mode_name), name); + if (ret < 0) + dev_err(component->dev, "Bad EQ channel name '%s'\n", name); + return ret; } static void max98088_setup_eq1(struct snd_soc_component *component) -- 2.17.0
WARNING: multiple messages have this Message-ID (diff)
From: Mark Brown <broonie@kernel.org> Cc: Liam Girdwood <lgirdwood@gmail.com>, Mark Brown <broonie@kernel.org>, Jaroslav Kysela <perex@perex.cz>, Takashi Iwai <tiwai@suse.com>, alsa-devel@alsa-project.org, Yisheng Xie <xieyisheng1@huawei.com>Mark Brown <broonie@kernel.org>, linux-kernel@vger.kernel.orgYisheng Xie <xieyisheng1@huawei.com>alsa-devel@alsa-project.orgTakashi Iwai <tiwai@suse.com>Liam Girdwood <lgirdwood@gmail.com>, andy.shevchenko@gmail.comMark Brown <broonie@kernel.org>alsa-devel@alsa-project.org Subject: Applied "ASoC: max98088: use match_string() helper" to the asoc tree Date: Thu, 31 May 2018 17:09:45 +0100 [thread overview] Message-ID: <E1fOQ93-0003CU-AS@debutante> (raw) In-Reply-To: <1527765086-19873-17-git-send-email-xieyisheng1@huawei.com> The patch ASoC: max98088: use match_string() helper has been applied to the asoc tree at https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git All being well this means that it will be integrated into the linux-next tree (usually sometime in the next 24 hours) and sent to Linus during the next merge window (or sooner if it is a bug fix), however if problems are discovered then the patch may be dropped or reverted. You may get further e-mails resulting from automated or manual testing and review of the tree, please engage with people reporting problems and send followup patches addressing any issues that are reported if needed. If any updates are required or you are submitting further changes they should be sent as incremental updates against current git, existing patches will not be replaced. Please add any relevant lists and maintainers to the CCs when replying to this mail. Thanks, Mark >From 3470631510fa383feac5969b436499ca9bad03b8 Mon Sep 17 00:00:00 2001 From: Xie Yisheng <xieyisheng1@huawei.com> Date: Thu, 31 May 2018 19:11:21 +0800 Subject: [PATCH] ASoC: max98088: use match_string() helper match_string() returns the index of an array for a matching string, which can be used instead of open coded variant. Cc: Liam Girdwood <lgirdwood@gmail.com> Cc: Mark Brown <broonie@kernel.org> Cc: Jaroslav Kysela <perex@perex.cz> Cc: Takashi Iwai <tiwai@suse.com> Cc: alsa-devel@alsa-project.org Signed-off-by: Yisheng Xie <xieyisheng1@huawei.com> Signed-off-by: Mark Brown <broonie@kernel.org> --- sound/soc/codecs/max98088.c | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/sound/soc/codecs/max98088.c b/sound/soc/codecs/max98088.c index 865f64c40b79..fb515aaa54fc 100644 --- a/sound/soc/codecs/max98088.c +++ b/sound/soc/codecs/max98088.c @@ -1382,15 +1382,12 @@ static const char *eq_mode_name[] = {"EQ1 Mode", "EQ2 Mode"}; static int max98088_get_channel(struct snd_soc_component *component, const char *name) { - int i; + int ret; - for (i = 0; i < ARRAY_SIZE(eq_mode_name); i++) - if (strcmp(name, eq_mode_name[i]) == 0) - return i; - - /* Shouldn't happen */ - dev_err(component->dev, "Bad EQ channel name '%s'\n", name); - return -EINVAL; + ret = match_string(eq_mode_name, ARRAY_SIZE(eq_mode_name), name); + if (ret < 0) + dev_err(component->dev, "Bad EQ channel name '%s'\n", name); + return ret; } static void max98088_setup_eq1(struct snd_soc_component *component) -- 2.17.0
next prev parent reply other threads:[~2018-05-31 16:09 UTC|newest] Thread overview: 113+ messages / expand[flat|nested] mbox.gz Atom feed top 2018-05-31 11:11 [PATCH v2 00/21] use match_string() helper Yisheng Xie 2018-05-31 11:11 ` [PATCH v2 01/21] usb: phy: " Yisheng Xie 2018-05-31 11:11 ` [v2,01/21] " Xie Yisheng 2018-05-31 16:55 ` [PATCH v2 01/21] " Sergei Shtylyov 2018-05-31 16:55 ` [v2,01/21] " Sergei Shtylyov 2018-05-31 18:47 ` [PATCH v2 01/21] " Andy Shevchenko 2018-05-31 18:47 ` [v2,01/21] " Andy Shevchenko 2018-05-31 18:56 ` [PATCH v2 01/21] " Sergei Shtylyov 2018-05-31 18:56 ` [v2,01/21] " Sergei Shtylyov 2018-05-31 18:59 ` [PATCH v2 01/21] " Andy Shevchenko 2018-05-31 18:59 ` [v2,01/21] " Andy Shevchenko 2018-06-05 9:28 ` [PATCH v2 01/21] " Yisheng Xie 2018-06-05 9:28 ` [v2,01/21] " Xie Yisheng 2018-05-31 11:11 ` [PATCH v2 02/21] mfd: omap-usb-host: " Yisheng Xie 2018-05-31 11:11 ` Yisheng Xie 2018-06-04 7:44 ` Lee Jones 2018-06-04 8:13 ` Yisheng Xie 2018-06-04 8:13 ` Yisheng Xie 2018-05-31 11:11 ` [PATCH v2 03/21] Staging: gdm724x: " Yisheng Xie 2018-05-31 11:44 ` Greg Kroah-Hartman 2018-05-31 12:12 ` Yisheng Xie 2018-06-06 2:21 ` [PATCH v3 " Yisheng Xie 2018-05-31 11:11 ` [PATCH v2 04/21] cxgb4: " Yisheng Xie 2018-06-05 13:19 ` Andy Shevchenko 2018-05-31 11:11 ` [PATCH v2 05/21] hp100: " Yisheng Xie 2018-05-31 11:11 ` [PATCH v2 06/21] iwlwifi: mvm: " Yisheng Xie 2018-06-05 13:19 ` Andy Shevchenko 2018-05-31 11:11 ` [PATCH v2 07/21] bus: fsl-mc: " Yisheng Xie 2018-05-31 11:11 ` [PATCH v2 08/21] clk: bcm2835: " Yisheng Xie 2018-05-31 11:11 ` Yisheng Xie 2018-06-02 6:17 ` Stephen Boyd 2018-06-02 6:17 ` Stephen Boyd 2018-06-02 6:17 ` Stephen Boyd 2018-05-31 11:11 ` [PATCH v2 09/21] clk: " Yisheng Xie 2018-06-02 6:17 ` Stephen Boyd 2018-06-02 6:17 ` Stephen Boyd 2018-05-31 11:11 ` [PATCH v2 10/21] cpufreq: intel_pstate: " Yisheng Xie 2018-05-31 11:11 ` Yisheng Xie 2018-06-26 15:23 ` Rafael J. Wysocki 2018-06-26 23:56 ` Srinivas Pandruvada 2018-07-04 10:52 ` Rafael J. Wysocki 2018-05-31 11:11 ` [PATCH v2 11/21] drm/nouveau: " Yisheng Xie 2018-05-31 11:11 ` Yisheng Xie 2018-06-05 13:20 ` Andy Shevchenko 2018-06-05 13:20 ` Andy Shevchenko 2018-05-31 11:11 ` [PATCH v2 12/21] drm: i2c: ch7006: " Yisheng Xie 2018-05-31 11:11 ` Yisheng Xie 2018-06-05 13:21 ` Andy Shevchenko 2018-05-31 11:11 ` [PATCH v2 13/21] ima: " Yisheng Xie 2018-05-31 11:11 ` Yisheng Xie 2018-05-31 15:02 ` Mimi Zohar 2018-05-31 15:02 ` Mimi Zohar 2018-06-01 10:55 ` Andy Shevchenko 2018-06-01 10:55 ` Andy Shevchenko 2018-05-31 11:11 ` [PATCH v2 14/21] sched/debug: " Yisheng Xie 2018-06-05 13:21 ` Andy Shevchenko 2018-05-31 11:11 ` [PATCH v2 15/21] ALSA: oxygen: " Yisheng Xie 2018-05-31 11:11 ` Yisheng Xie 2018-05-31 18:39 ` Takashi Iwai 2018-05-31 18:39 ` Takashi Iwai 2018-05-31 18:40 ` Andy Shevchenko 2018-05-31 18:43 ` Takashi Iwai 2018-05-31 18:43 ` Takashi Iwai 2018-05-31 18:44 ` Andy Shevchenko 2018-05-31 18:41 ` Andy Shevchenko 2018-05-31 18:59 ` Takashi Iwai 2018-05-31 19:02 ` Andy Shevchenko 2018-05-31 20:30 ` Takashi Iwai 2018-05-31 11:11 ` [PATCH v2 16/21] ASoC: max98088: " Yisheng Xie 2018-05-31 11:11 ` Yisheng Xie 2018-05-31 11:49 ` Mark Brown 2018-05-31 12:25 ` Yisheng Xie 2018-05-31 12:25 ` Yisheng Xie 2018-05-31 16:02 ` Mark Brown 2018-06-01 0:38 ` Yisheng Xie 2018-06-01 0:38 ` Yisheng Xie 2018-05-31 16:09 ` Mark Brown [this message] 2018-05-31 16:09 ` Applied "ASoC: max98088: use match_string() helper" to the asoc tree Mark Brown 2018-05-31 11:11 ` [PATCH v2 17/21] ASoC: max98095: use match_string() helper Yisheng Xie 2018-05-31 11:11 ` Yisheng Xie 2018-05-31 16:09 ` Applied "ASoC: max98095: use match_string() helper" to the asoc tree Mark Brown 2018-05-31 16:09 ` Mark Brown 2018-05-31 11:11 ` [PATCH v2 18/21] ASoC: dapm: use match_string() helper Yisheng Xie 2018-05-31 11:11 ` Yisheng Xie 2018-05-31 11:11 ` [PATCH v2 19/21] bcache: " Yisheng Xie 2018-05-31 11:11 ` Yisheng Xie 2018-06-01 3:45 ` Coly Li 2018-06-01 4:32 ` Yisheng Xie 2018-06-01 4:32 ` Yisheng Xie 2018-06-01 5:04 ` Coly Li 2018-05-31 11:11 ` [PATCH v2 20/21] powerpc/xmon: " Yisheng Xie 2018-06-04 14:11 ` [v2,20/21] " Michael Ellerman 2018-05-31 11:11 ` [PATCH v2 21/21] sparc64: " Yisheng Xie 2018-05-31 11:11 ` Yisheng Xie 2018-06-01 11:34 ` Andy Shevchenko 2018-06-01 11:34 ` Andy Shevchenko 2018-06-04 1:06 ` Yisheng Xie 2018-06-04 1:06 ` Yisheng Xie 2018-06-04 10:06 ` Andy Shevchenko 2018-06-04 10:06 ` Andy Shevchenko 2018-06-05 9:05 ` Yisheng Xie 2018-06-05 9:05 ` Yisheng Xie 2018-06-06 2:19 ` [PATCH v3 " Yisheng Xie 2018-06-06 2:19 ` Yisheng Xie 2018-06-06 5:01 ` Andy Shevchenko 2018-06-06 5:01 ` Andy Shevchenko 2018-06-21 1:13 ` Yisheng Xie 2018-06-21 1:13 ` Yisheng Xie 2018-06-21 1:39 ` [PATCH v4 " Yisheng Xie 2018-06-21 1:39 ` Yisheng Xie 2018-06-21 2:24 ` Andy Shevchenko 2018-06-21 2:24 ` Andy Shevchenko 2018-05-31 12:23 ` [PATCH v2 00/21] " Yisheng Xie
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=E1fOQ93-0003CU-AS@debutante \ --to=broonie@kernel.org \ --cc=alsa-devel@alsa-project.org \ --cc=andy.shevchenko@gmail.com \ --cc=lgirdwood@gmail.com \ --cc=linux-kernel@vger.kernel.org \ --cc=perex@perex.cz \ --cc=tiwai@suse.com \ --cc=xieyisheng1@huawei.com \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes, see mirroring instructions on how to clone and mirror all data and code used by this external index.