From: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
To: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>,
Mark Brown <broonie@kernel.org>
Cc: Linux-ALSA <alsa-devel@alsa-project.org>
Subject: Re: [PATCH 09/28] ASoC: soc-core: don't check routes for snd_soc_dapm_add_routes()
Date: Mon, 05 Aug 2019 21:41:04 -0700 [thread overview]
Message-ID: <3849f0d37debfab976f0c5be6d9afe77965a43e0.camel@linux.intel.com> (raw)
In-Reply-To: <87o9132ih0.wl-kuninori.morimoto.gx@renesas.com>
On Tue, 2019-08-06 at 10:28 +0900, Kuninori Morimoto wrote:
> From: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
>
> snd_soc_dapm_add_routes() registers routes by using
> for(... i < num; ...). If routes was NULL, num should be zero.
> Thus, we don't need to check about route pointer.
>
> Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
> ---
> sound/soc/soc-core.c | 17 +++++++----------
> 1 file changed, 7 insertions(+), 10 deletions(-)
>
> diff --git a/sound/soc/soc-core.c b/sound/soc/soc-core.c
> index 7be8385..5b26a59 100644
> --- a/sound/soc/soc-core.c
> +++ b/sound/soc/soc-core.c
> @@ -1307,10 +1307,9 @@ static int soc_probe_component(struct
> snd_soc_card *card,
> snd_soc_add_component_controls(component,
> component->driver->controls,
> component->driver-
> >num_controls);
> - if (component->driver->dapm_routes)
> - snd_soc_dapm_add_routes(dapm,
> - component->driver->dapm_routes,
> - component->driver-
> >num_dapm_routes);
> + snd_soc_dapm_add_routes(dapm,
> + component->driver->dapm_routes,
> + component->driver->num_dapm_routes);
return value needs to be checked for all the snd_soc_dapm_add_routes()
calls?
Thanks,
Ranjani
>
> list_add(&dapm->list, &card->dapm_list);
> /* see for_each_card_components */
> @@ -2053,13 +2052,11 @@ static int snd_soc_instantiate_card(struct
> snd_soc_card *card)
> snd_soc_add_card_controls(card, card->controls,
> card->num_controls);
>
> - if (card->dapm_routes)
> - snd_soc_dapm_add_routes(&card->dapm, card->dapm_routes,
> - card->num_dapm_routes);
> + snd_soc_dapm_add_routes(&card->dapm, card->dapm_routes,
> + card->num_dapm_routes);
>
> - if (card->of_dapm_routes)
> - snd_soc_dapm_add_routes(&card->dapm, card-
> >of_dapm_routes,
> - card->num_of_dapm_routes);
> + snd_soc_dapm_add_routes(&card->dapm, card->of_dapm_routes,
> + card->num_of_dapm_routes);
>
> /* try to set some sane longname if DMI is available */
> snd_soc_set_dmi_name(card, NULL);
next prev parent reply other threads:[~2019-08-06 4:41 UTC|newest]
Thread overview: 46+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-08-06 1:25 [PATCH 00/28] ASoC: cleanup patches for soc-core Kuninori Morimoto
2019-08-06 1:27 ` [PATCH 01/28] ASoC: soc-core: use device_register() Kuninori Morimoto
2019-08-06 1:28 ` [PATCH 02/28] ASoC: soc-core: set component->debugfs_root NULL Kuninori Morimoto
2019-08-06 14:49 ` Pierre-Louis Bossart
2019-08-06 16:22 ` Mark Brown
2019-08-06 16:46 ` Pierre-Louis Bossart
2019-08-06 16:54 ` Mark Brown
2019-08-06 1:28 ` [PATCH 03/28] ASoC: soc-core: add comment for for_each_xxx Kuninori Morimoto
2019-08-06 1:28 ` [PATCH 04/28] ASoC: soc-core: check return value of snd_soc_add_dai_link() Kuninori Morimoto
2019-08-06 1:28 ` [PATCH 05/28] ASoC: soc-core: don't use for_each_card_links_safe() at snd_soc_find_dai_link() Kuninori Morimoto
2019-08-06 1:28 ` [PATCH 06/28] ASoC: soc-core: reuse rtdcom at snd_soc_rtdcom_add() Kuninori Morimoto
2019-08-06 1:28 ` [PATCH 07/28] ASoC: soc-core: don't check widget for snd_soc_dapm_new_controls() Kuninori Morimoto
2019-08-06 4:35 ` Ranjani Sridharan
2019-08-06 18:07 ` Mark Brown
2019-08-06 1:28 ` [PATCH 08/28] ASoC: soc-core: don't check controls for snd_soc_add_component_controls() Kuninori Morimoto
2019-08-06 4:38 ` Ranjani Sridharan
2019-08-06 1:28 ` [PATCH 09/28] ASoC: soc-core: don't check routes for snd_soc_dapm_add_routes() Kuninori Morimoto
2019-08-06 4:41 ` Ranjani Sridharan [this message]
2019-08-06 1:29 ` [PATCH 10/28] ASoC: soc-core: don't check controls for snd_soc_add_card_controls() Kuninori Morimoto
2019-08-06 1:29 ` [PATCH 11/28] ASoC: soc-core: call snd_soc_dapm_debugfs_init() at soc_init_card_debugfs() Kuninori Morimoto
2019-08-06 1:29 ` [PATCH 12/28] ASoC: soc-core: remove unneeded list_empty() check for snd_soc_try_rebind_card() Kuninori Morimoto
2019-08-06 1:29 ` [PATCH 13/28] ASoC: soc-core: remove verbose debug message from soc_bind_dai_link() Kuninori Morimoto
2019-08-06 14:54 ` Pierre-Louis Bossart
2019-08-07 0:13 ` Kuninori Morimoto
2019-08-06 1:29 ` [PATCH 14/28] ASoC: soc-core: remove duplicated soc_is_dai_link_bound() Kuninori Morimoto
2019-08-06 4:49 ` Ranjani Sridharan
2019-08-06 1:29 ` [PATCH 15/28] ASoC: soc-core: tidyup for card->deferred_resume_work Kuninori Morimoto
2019-08-06 14:55 ` Pierre-Louis Bossart
2019-08-06 1:29 ` [PATCH 16/28] ASoC: soc-core: initialize rtd->list Kuninori Morimoto
2019-08-06 5:00 ` Ranjani Sridharan
2019-08-06 6:29 ` Kuninori Morimoto
2019-08-06 1:30 ` [PATCH 17/28] ASoC: soc-core: define soc_dpcm_debugfs_add() for non CONFIG_DEBUG_FS Kuninori Morimoto
2019-08-06 1:30 ` [PATCH 18/28] ASoC: soc-core: dai_link check under soc_dpcm_debugfs_add() Kuninori Morimoto
2019-08-06 1:30 ` [PATCH 19/28] ASoC: soc-core: merge snd_soc_initialize_card_lists() Kuninori Morimoto
2019-08-06 1:30 ` [PATCH 20/28] ASoC: soc-core: remove unneeded dai_link check from snd_soc_remove_dai_link() Kuninori Morimoto
2019-08-06 1:30 ` [PATCH 21/28] ASoC: soc-core: add NOTE to snd_soc_rtdcom_lookup() Kuninori Morimoto
2019-08-06 1:30 ` [PATCH 22/28] ASoC: soc-core: don't call snd_soc_component_set_jack() Kuninori Morimoto
2019-08-06 1:30 ` [PATCH 23/28] ASoC: soc-core: don't alloc memory carelessly when creating debugfs Kuninori Morimoto
2019-08-06 15:05 ` Pierre-Louis Bossart
2019-08-06 1:30 ` [PATCH 24/28] ASoC: soc-core: soc_cleanup_card_resources() become void Kuninori Morimoto
2019-08-06 1:30 ` [PATCH 25/28] ASoC: soc-core: initialize component list Kuninori Morimoto
2019-08-06 15:07 ` Pierre-Louis Bossart
2019-08-07 0:18 ` Kuninori Morimoto
2019-08-06 1:30 ` [PATCH 26/28] ASoC: soc-core: initialize list at one place Kuninori Morimoto
2019-08-06 1:30 ` [PATCH 27/28] ASoC: soc-dai: use bit field for bus_control Kuninori Morimoto
2019-08-06 1:31 ` [PATCH 28/28] ASoC: soc-topology: use for_each_component_dais() at remove_dai() Kuninori Morimoto
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=3849f0d37debfab976f0c5be6d9afe77965a43e0.camel@linux.intel.com \
--to=ranjani.sridharan@linux.intel.com \
--cc=alsa-devel@alsa-project.org \
--cc=broonie@kernel.org \
--cc=kuninori.morimoto.gx@renesas.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: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).