All of lore.kernel.org
 help / color / mirror / Atom feed
From: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
To: Mark Brown <broonie@kernel.org>
Cc: Linux-ALSA <alsa-devel@alsa-project.org>
Subject: [PATCH 1/7] ASoC: soc-core: cleanup cppcheck warning at snd_soc_set_dmi_name()
Date: 29 Jul 2021 10:15:33 +0900	[thread overview]
Message-ID: <87wnp9yl6y.wl-kuninori.morimoto.gx@renesas.com> (raw)
In-Reply-To: <87y29pyl7i.wl-kuninori.morimoto.gx@renesas.com>

From: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>

This patch cleanups below cppcheck warning.

sound/soc/soc-core.c:1721:33: style: The scope of the variable 'product_version' can be reduced. [variableScope]
 const char *vendor, *product, *product_version, *board;
                                ^
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
---
 sound/soc/soc-core.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/sound/soc/soc-core.c b/sound/soc/soc-core.c
index 583f2381cfc8..305b444c507a 100644
--- a/sound/soc/soc-core.c
+++ b/sound/soc/soc-core.c
@@ -1718,7 +1718,7 @@ static void append_dmi_string(struct snd_soc_card *card, const char *str)
  */
 int snd_soc_set_dmi_name(struct snd_soc_card *card, const char *flavour)
 {
-	const char *vendor, *product, *product_version, *board;
+	const char *vendor, *product, *board;
 
 	if (card->long_name)
 		return 0; /* long name already set by driver or from DMI */
@@ -1738,13 +1738,14 @@ int snd_soc_set_dmi_name(struct snd_soc_card *card, const char *flavour)
 
 	product = dmi_get_system_info(DMI_PRODUCT_NAME);
 	if (product && is_dmi_valid(product)) {
+		const char *product_version = dmi_get_system_info(DMI_PRODUCT_VERSION);
+
 		append_dmi_string(card, product);
 
 		/*
 		 * some vendors like Lenovo may only put a self-explanatory
 		 * name in the product version field
 		 */
-		product_version = dmi_get_system_info(DMI_PRODUCT_VERSION);
 		if (product_version && is_dmi_valid(product_version))
 			append_dmi_string(card, product_version);
 	}
-- 
2.25.1


  reply	other threads:[~2021-07-29  1:17 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-07-29  1:15 [PATCH 0/7] ASoC: soc-core: cleanup cppcheck warning Kuninori Morimoto
2021-07-29  1:15 ` Kuninori Morimoto [this message]
2021-07-29  1:15 ` [PATCH 2/7] ASoC: soc-core: cleanup cppcheck warning at snd_soc_get_dai_name() Kuninori Morimoto
2021-07-29  1:15 ` [PATCH 3/7] ASoC: soc-core: cleanup cppcheck warning at snd_soc_daifmt_parse_format() Kuninori Morimoto
2021-07-29  1:15 ` [PATCH 4/7] ASoC: soc-core: cleanup cppcheck warning at snd_soc_unregister_component() Kuninori Morimoto
2021-07-29  1:15 ` [PATCH 5/7] ASoC: soc-core: cleanup cppcheck warning at snd_soc_add_controls() Kuninori Morimoto
2021-07-29  1:15 ` [PATCH 6/7] ASoC: soc-core: cleanup cppcheck warning at snd_soc_of_parse_audio_simple_widgets() Kuninori Morimoto
2021-07-29  1:16 ` [PATCH 7/7] ASoC: soc-core: cleanup cppcheck warning at snd_soc_of_parse_audio_routing() Kuninori Morimoto
2021-07-29 16:39 ` [PATCH 0/7] ASoC: soc-core: cleanup cppcheck warning Mark Brown

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=87wnp9yl6y.wl-kuninori.morimoto.gx@renesas.com \
    --to=kuninori.morimoto.gx@renesas.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=broonie@kernel.org \
    /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: link
Be 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.