Commit 170c0d74 authored by Mark Brown's avatar Mark Brown

Merge series "ASoC: soc-topology: cleanup cppcheck warning" from Kuninori...

Merge series "ASoC: soc-topology: cleanup cppcheck warning" from Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>:

Hi Mark

Now I'm posting audio-graph-card2 patch-set, but it seems it needs longer
discussion. Thus I want to post more easy patch first, and reduce my
local patches.

These are cppcheck warning cleanup patches for soc-topology.

Kuninori Morimoto (5):
  ASoC: soc-topology: cleanup cppcheck warning at soc_tplg_process_headers()
  ASoC: soc-topology: cleanup cppcheck warning at soc_tplg_dai_elems_load()
  ASoC: soc-topology: cleanup cppcheck warning at soc_tplg_dapm_widget_elems_load()
  ASoC: soc-topology: cleanup cppcheck warning at soc_tplg_kcontrol_elems_load()
  ASoC: soc-topology: cleanup cppcheck warning at snd_soc_find_dai_link()

 sound/soc/soc-topology.c | 23 +++++++++++------------
 1 file changed, 11 insertions(+), 12 deletions(-)

--
2.25.1
parents 6dfeb702 b81e8efa
...@@ -1035,7 +1035,6 @@ static int soc_tplg_denum_create(struct soc_tplg *tplg, unsigned int count, ...@@ -1035,7 +1035,6 @@ static int soc_tplg_denum_create(struct soc_tplg *tplg, unsigned int count,
static int soc_tplg_kcontrol_elems_load(struct soc_tplg *tplg, static int soc_tplg_kcontrol_elems_load(struct soc_tplg *tplg,
struct snd_soc_tplg_hdr *hdr) struct snd_soc_tplg_hdr *hdr)
{ {
struct snd_soc_tplg_ctl_hdr *control_hdr;
int ret; int ret;
int i; int i;
...@@ -1043,8 +1042,7 @@ static int soc_tplg_kcontrol_elems_load(struct soc_tplg *tplg, ...@@ -1043,8 +1042,7 @@ static int soc_tplg_kcontrol_elems_load(struct soc_tplg *tplg,
soc_tplg_get_offset(tplg)); soc_tplg_get_offset(tplg));
for (i = 0; i < le32_to_cpu(hdr->count); i++) { for (i = 0; i < le32_to_cpu(hdr->count); i++) {
struct snd_soc_tplg_ctl_hdr *control_hdr = (struct snd_soc_tplg_ctl_hdr *)tplg->pos;
control_hdr = (struct snd_soc_tplg_ctl_hdr *)tplg->pos;
if (le32_to_cpu(control_hdr->size) != sizeof(*control_hdr)) { if (le32_to_cpu(control_hdr->size) != sizeof(*control_hdr)) {
dev_err(tplg->dev, "ASoC: invalid control size\n"); dev_err(tplg->dev, "ASoC: invalid control size\n");
...@@ -1583,15 +1581,16 @@ static int soc_tplg_dapm_widget_create(struct soc_tplg *tplg, ...@@ -1583,15 +1581,16 @@ static int soc_tplg_dapm_widget_create(struct soc_tplg *tplg,
static int soc_tplg_dapm_widget_elems_load(struct soc_tplg *tplg, static int soc_tplg_dapm_widget_elems_load(struct soc_tplg *tplg,
struct snd_soc_tplg_hdr *hdr) struct snd_soc_tplg_hdr *hdr)
{ {
struct snd_soc_tplg_dapm_widget *widget; int count, i;
int ret, count, i;
count = le32_to_cpu(hdr->count); count = le32_to_cpu(hdr->count);
dev_dbg(tplg->dev, "ASoC: adding %d DAPM widgets\n", count); dev_dbg(tplg->dev, "ASoC: adding %d DAPM widgets\n", count);
for (i = 0; i < count; i++) { for (i = 0; i < count; i++) {
widget = (struct snd_soc_tplg_dapm_widget *) tplg->pos; struct snd_soc_tplg_dapm_widget *widget = (struct snd_soc_tplg_dapm_widget *) tplg->pos;
int ret;
if (le32_to_cpu(widget->size) != sizeof(*widget)) { if (le32_to_cpu(widget->size) != sizeof(*widget)) {
dev_err(tplg->dev, "ASoC: invalid widget size\n"); dev_err(tplg->dev, "ASoC: invalid widget size\n");
return -EINVAL; return -EINVAL;
...@@ -2125,10 +2124,9 @@ static struct snd_soc_dai_link *snd_soc_find_dai_link(struct snd_soc_card *card, ...@@ -2125,10 +2124,9 @@ static struct snd_soc_dai_link *snd_soc_find_dai_link(struct snd_soc_card *card,
const char *stream_name) const char *stream_name)
{ {
struct snd_soc_pcm_runtime *rtd; struct snd_soc_pcm_runtime *rtd;
struct snd_soc_dai_link *link;
for_each_card_rtds(card, rtd) { for_each_card_rtds(card, rtd) {
link = rtd->dai_link; struct snd_soc_dai_link *link = rtd->dai_link;
if (link->id != id) if (link->id != id)
continue; continue;
...@@ -2346,15 +2344,16 @@ static int soc_tplg_dai_config(struct soc_tplg *tplg, ...@@ -2346,15 +2344,16 @@ static int soc_tplg_dai_config(struct soc_tplg *tplg,
static int soc_tplg_dai_elems_load(struct soc_tplg *tplg, static int soc_tplg_dai_elems_load(struct soc_tplg *tplg,
struct snd_soc_tplg_hdr *hdr) struct snd_soc_tplg_hdr *hdr)
{ {
struct snd_soc_tplg_dai *dai;
int count; int count;
int i, ret; int i;
count = le32_to_cpu(hdr->count); count = le32_to_cpu(hdr->count);
/* config the existing BE DAIs */ /* config the existing BE DAIs */
for (i = 0; i < count; i++) { for (i = 0; i < count; i++) {
dai = (struct snd_soc_tplg_dai *)tplg->pos; struct snd_soc_tplg_dai *dai = (struct snd_soc_tplg_dai *)tplg->pos;
int ret;
if (le32_to_cpu(dai->size) != sizeof(*dai)) { if (le32_to_cpu(dai->size) != sizeof(*dai)) {
dev_err(tplg->dev, "ASoC: invalid physical DAI size\n"); dev_err(tplg->dev, "ASoC: invalid physical DAI size\n");
return -EINVAL; return -EINVAL;
...@@ -2572,13 +2571,13 @@ static int soc_tplg_load_header(struct soc_tplg *tplg, ...@@ -2572,13 +2571,13 @@ static int soc_tplg_load_header(struct soc_tplg *tplg,
/* process the topology file headers */ /* process the topology file headers */
static int soc_tplg_process_headers(struct soc_tplg *tplg) static int soc_tplg_process_headers(struct soc_tplg *tplg)
{ {
struct snd_soc_tplg_hdr *hdr;
int ret; int ret;
tplg->pass = SOC_TPLG_PASS_START; tplg->pass = SOC_TPLG_PASS_START;
/* process the header types from start to end */ /* process the header types from start to end */
while (tplg->pass <= SOC_TPLG_PASS_END) { while (tplg->pass <= SOC_TPLG_PASS_END) {
struct snd_soc_tplg_hdr *hdr;
tplg->hdr_pos = tplg->fw->data; tplg->hdr_pos = tplg->fw->data;
hdr = (struct snd_soc_tplg_hdr *)tplg->hdr_pos; hdr = (struct snd_soc_tplg_hdr *)tplg->hdr_pos;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment