All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 00/10] ASoC: qcom: remove cppcheck warnings
@ 2021-02-18 22:29 Pierre-Louis Bossart
  2021-02-18 22:29 ` [PATCH 01/10] ASoC: qcom: lpass-hdmi: remove useless return Pierre-Louis Bossart
                   ` (11 more replies)
  0 siblings, 12 replies; 13+ messages in thread
From: Pierre-Louis Bossart @ 2021-02-18 22:29 UTC (permalink / raw)
  To: alsa-devel
  Cc: tiwai, vkoul, broonie, srinivas.kandagatla, Pierre-Louis Bossart

Second batch of cleanups for Qualcomm SOCs and codecs. The only
functional change is the addition of a missing error check in the last
patch.

Pierre-Louis Bossart (10):
  ASoC: qcom: lpass-hdmi: remove useless return
  ASoC: qcom: lpass-platform: remove useless assignment
  ASoC: qcom: q6dsp-dai: clarify expression
  ASoC: qcom: q6afe: remove useless assignments
  ASoC: qcom: q6afe: align function prototype
  ASoC: qcom: q6asm: align function prototypes
  ASoC: wcd-clsh-v2: align function prototypes
  ASoC: wcd9335: clarify return value
  ASoC: wcd934x: remove useless return
  ASoC: lpass-wsa-macro: add missing test

 sound/soc/codecs/lpass-wsa-macro.c | 2 ++
 sound/soc/codecs/wcd-clsh-v2.h     | 6 +++---
 sound/soc/codecs/wcd9335.c         | 2 +-
 sound/soc/codecs/wcd934x.c         | 2 --
 sound/soc/qcom/lpass-hdmi.c        | 4 ----
 sound/soc/qcom/lpass-platform.c    | 2 +-
 sound/soc/qcom/qdsp6/q6afe-dai.c   | 2 +-
 sound/soc/qcom/qdsp6/q6afe.c       | 5 ++---
 sound/soc/qcom/qdsp6/q6afe.h       | 2 +-
 sound/soc/qcom/qdsp6/q6asm.h       | 6 +++---
 10 files changed, 14 insertions(+), 19 deletions(-)

-- 
2.25.1


^ permalink raw reply	[flat|nested] 13+ messages in thread

* [PATCH 01/10] ASoC: qcom: lpass-hdmi: remove useless return
  2021-02-18 22:29 [PATCH 00/10] ASoC: qcom: remove cppcheck warnings Pierre-Louis Bossart
@ 2021-02-18 22:29 ` Pierre-Louis Bossart
  2021-02-18 22:29 ` [PATCH 02/10] ASoC: qcom: lpass-platform: remove useless assignment Pierre-Louis Bossart
                   ` (10 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: Pierre-Louis Bossart @ 2021-02-18 22:29 UTC (permalink / raw)
  To: alsa-devel
  Cc: tiwai, vkoul, broonie, srinivas.kandagatla, Pierre-Louis Bossart

cppcheck warning:

sound/soc/qcom/lpass-hdmi.c:189:9: warning: Identical condition and
return expression 'ret', return value is always 0
[identicalConditionAfterEarlyExit]
 return ret;
        ^
sound/soc/qcom/lpass-hdmi.c:186:6: note: If condition 'ret' is true,
the function will return/exit
 if (ret)
     ^
sound/soc/qcom/lpass-hdmi.c:189:9: note: Returning identical
expression 'ret'
 return ret;
        ^
sound/soc/qcom/lpass-hdmi.c:206:9: warning: Identical condition and
return expression 'ret', return value is always 0
[identicalConditionAfterEarlyExit]
 return ret;
        ^
sound/soc/qcom/lpass-hdmi.c:203:6: note: If condition 'ret' is true,
the function will return/exit
 if (ret)
     ^
sound/soc/qcom/lpass-hdmi.c:206:9: note: Returning identical
expression 'ret'
 return ret;
        ^

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
---
 sound/soc/qcom/lpass-hdmi.c | 4 ----
 1 file changed, 4 deletions(-)

diff --git a/sound/soc/qcom/lpass-hdmi.c b/sound/soc/qcom/lpass-hdmi.c
index abfb8737a89f..24b1a7523adb 100644
--- a/sound/soc/qcom/lpass-hdmi.c
+++ b/sound/soc/qcom/lpass-hdmi.c
@@ -183,8 +183,6 @@ static int lpass_hdmi_daiops_hw_params(struct snd_pcm_substream *substream,
 		return ret;
 
 	ret = regmap_field_write(sstream_ctl->dp_staffing_en, LPASS_SSTREAM_DEFAULT_ENABLE);
-	if (ret)
-		return ret;
 
 	return ret;
 }
@@ -200,8 +198,6 @@ static int lpass_hdmi_daiops_prepare(struct snd_pcm_substream *substream,
 		return ret;
 
 	ret = regmap_field_write(drvdata->meta_ctl->mute, LPASS_MUTE_DISABLE);
-	if (ret)
-		return ret;
 
 	return ret;
 }
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 13+ messages in thread

* [PATCH 02/10] ASoC: qcom: lpass-platform: remove useless assignment
  2021-02-18 22:29 [PATCH 00/10] ASoC: qcom: remove cppcheck warnings Pierre-Louis Bossart
  2021-02-18 22:29 ` [PATCH 01/10] ASoC: qcom: lpass-hdmi: remove useless return Pierre-Louis Bossart
@ 2021-02-18 22:29 ` Pierre-Louis Bossart
  2021-02-18 22:29 ` [PATCH 03/10] ASoC: qcom: q6dsp-dai: clarify expression Pierre-Louis Bossart
                   ` (9 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: Pierre-Louis Bossart @ 2021-02-18 22:29 UTC (permalink / raw)
  To: alsa-devel
  Cc: tiwai, vkoul, broonie, srinivas.kandagatla, Pierre-Louis Bossart

cppcheck warning:

sound/soc/qcom/lpass-platform.c:791:10: style: Variable 'ret' is
assigned a value that is never used. [unreadVariable]
 int ret = -EINVAL;
         ^

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
---
 sound/soc/qcom/lpass-platform.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/sound/soc/qcom/lpass-platform.c b/sound/soc/qcom/lpass-platform.c
index 0074b7f2dbc1..0df9481ea4c6 100644
--- a/sound/soc/qcom/lpass-platform.c
+++ b/sound/soc/qcom/lpass-platform.c
@@ -788,7 +788,7 @@ static int lpass_platform_pcm_new(struct snd_soc_component *component,
 {
 	struct snd_pcm *pcm = soc_runtime->pcm;
 	struct snd_pcm_substream *psubstream, *csubstream;
-	int ret = -EINVAL;
+	int ret;
 	size_t size = lpass_platform_pcm_hardware.buffer_bytes_max;
 
 	psubstream = pcm->streams[SNDRV_PCM_STREAM_PLAYBACK].substream;
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 13+ messages in thread

* [PATCH 03/10] ASoC: qcom: q6dsp-dai: clarify expression
  2021-02-18 22:29 [PATCH 00/10] ASoC: qcom: remove cppcheck warnings Pierre-Louis Bossart
  2021-02-18 22:29 ` [PATCH 01/10] ASoC: qcom: lpass-hdmi: remove useless return Pierre-Louis Bossart
  2021-02-18 22:29 ` [PATCH 02/10] ASoC: qcom: lpass-platform: remove useless assignment Pierre-Louis Bossart
@ 2021-02-18 22:29 ` Pierre-Louis Bossart
  2021-02-18 22:29 ` [PATCH 04/10] ASoC: qcom: q6afe: remove useless assignments Pierre-Louis Bossart
                   ` (8 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: Pierre-Louis Bossart @ 2021-02-18 22:29 UTC (permalink / raw)
  To: alsa-devel
  Cc: tiwai, vkoul, broonie, srinivas.kandagatla, Pierre-Louis Bossart

cppcheck warning:

sound/soc/qcom/qdsp6/q6afe-dai.c:264:35: style: Clarify calculation
precedence for '&' and '?'. [clarifyCalculation]
  tdm->slot_mask = (dai->id & 0x1 ? tx_mask : rx_mask) & cap_mask;
                                  ^

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
---
 sound/soc/qcom/qdsp6/q6afe-dai.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/sound/soc/qcom/qdsp6/q6afe-dai.c b/sound/soc/qcom/qdsp6/q6afe-dai.c
index 4e1f101281e7..3b52abec6a93 100644
--- a/sound/soc/qcom/qdsp6/q6afe-dai.c
+++ b/sound/soc/qcom/qdsp6/q6afe-dai.c
@@ -261,7 +261,7 @@ static int q6tdm_set_tdm_slot(struct snd_soc_dai *dai,
 		tdm->nslots_per_frame = slots;
 		tdm->slot_width = slot_width;
 		/* TDM RX dais ids are even and tx are odd */
-		tdm->slot_mask = (dai->id & 0x1 ? tx_mask : rx_mask) & cap_mask;
+		tdm->slot_mask = ((dai->id & 0x1) ? tx_mask : rx_mask) & cap_mask;
 		break;
 	default:
 		dev_err(dai->dev, "%s: invalid dai id 0x%x\n",
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 13+ messages in thread

* [PATCH 04/10] ASoC: qcom: q6afe: remove useless assignments
  2021-02-18 22:29 [PATCH 00/10] ASoC: qcom: remove cppcheck warnings Pierre-Louis Bossart
                   ` (2 preceding siblings ...)
  2021-02-18 22:29 ` [PATCH 03/10] ASoC: qcom: q6dsp-dai: clarify expression Pierre-Louis Bossart
@ 2021-02-18 22:29 ` Pierre-Louis Bossart
  2021-02-18 22:29 ` [PATCH 05/10] ASoC: qcom: q6afe: align function prototype Pierre-Louis Bossart
                   ` (7 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: Pierre-Louis Bossart @ 2021-02-18 22:29 UTC (permalink / raw)
  To: alsa-devel
  Cc: tiwai, vkoul, broonie, srinivas.kandagatla, Pierre-Louis Bossart

cppcheck warnings:

sound/soc/qcom/qdsp6/q6afe.c:848:25: note: Assignment 'p=NULL',
assigned value is 0
 struct q6afe_port *p = NULL;
                        ^
sound/soc/qcom/qdsp6/q6afe.c:854:7: note: Null pointer dereference
  if (p->token == token) {
      ^
sound/soc/qcom/qdsp6/q6afe.c:939:8: style: Redundant initialization
for 'wait'. The initialized value is overwritten before it is
read. [redundantInitialization]
  wait = &port->wait;
       ^
sound/soc/qcom/qdsp6/q6afe.c:933:26: note: wait is initialized
 wait_queue_head_t *wait = &port->wait;
                         ^
sound/soc/qcom/qdsp6/q6afe.c:939:8: note: wait is overwritten
  wait = &port->wait;
       ^
sound/soc/qcom/qdsp6/q6afe.c:1191:10: style: Redundant initialization
for 'port_id'. The initialized value is overwritten before it is
read. [redundantInitialization]
 port_id = port->id;
         ^
sound/soc/qcom/qdsp6/q6afe.c:1186:14: note: port_id is initialized
 int port_id = port->id;
             ^
sound/soc/qcom/qdsp6/q6afe.c:1191:10: note: port_id is overwritten
 port_id = port->id;
         ^

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
---
 sound/soc/qcom/qdsp6/q6afe.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/sound/soc/qcom/qdsp6/q6afe.c b/sound/soc/qcom/qdsp6/q6afe.c
index daa58b5f941e..60061d654946 100644
--- a/sound/soc/qcom/qdsp6/q6afe.c
+++ b/sound/soc/qcom/qdsp6/q6afe.c
@@ -845,7 +845,7 @@ static void q6afe_port_free(struct kref *ref)
 
 static struct q6afe_port *q6afe_find_port(struct q6afe *afe, int token)
 {
-	struct q6afe_port *p = NULL;
+	struct q6afe_port *p;
 	struct q6afe_port *ret = NULL;
 	unsigned long flags;
 
@@ -930,7 +930,7 @@ EXPORT_SYMBOL_GPL(q6afe_get_port_id);
 static int afe_apr_send_pkt(struct q6afe *afe, struct apr_pkt *pkt,
 			    struct q6afe_port *port, uint32_t rsp_opcode)
 {
-	wait_queue_head_t *wait = &port->wait;
+	wait_queue_head_t *wait;
 	struct aprv2_ibasic_rsp_result_t *result;
 	int ret;
 
@@ -1188,7 +1188,6 @@ int q6afe_port_stop(struct q6afe_port *port)
 	int index, pkt_size;
 	void *p;
 
-	port_id = port->id;
 	index = port->token;
 	if (index < 0 || index >= AFE_PORT_MAX) {
 		dev_err(afe->dev, "AFE port index[%d] invalid!\n", index);
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 13+ messages in thread

* [PATCH 05/10] ASoC: qcom: q6afe: align function prototype
  2021-02-18 22:29 [PATCH 00/10] ASoC: qcom: remove cppcheck warnings Pierre-Louis Bossart
                   ` (3 preceding siblings ...)
  2021-02-18 22:29 ` [PATCH 04/10] ASoC: qcom: q6afe: remove useless assignments Pierre-Louis Bossart
@ 2021-02-18 22:29 ` Pierre-Louis Bossart
  2021-02-18 22:29 ` [PATCH 06/10] ASoC: qcom: q6asm: align function prototypes Pierre-Louis Bossart
                   ` (6 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: Pierre-Louis Bossart @ 2021-02-18 22:29 UTC (permalink / raw)
  To: alsa-devel
  Cc: tiwai, vkoul, broonie, srinivas.kandagatla, Pierre-Louis Bossart

cppcheck warning:

sound/soc/qcom/qdsp6/q6afe.c:1101:63: style:inconclusive: Function
'q6afe_set_lpass_clock' argument 3 names different: declaration
'clk_src' definition 'attri'. [funcArgNamesDifferent]
int q6afe_set_lpass_clock(struct device *dev, int clk_id, int attri,
                                                              ^
sound/soc/qcom/qdsp6/q6afe.h:236:63: note: Function
'q6afe_set_lpass_clock' argument 3 names different: declaration
'clk_src' definition 'attri'.
int q6afe_set_lpass_clock(struct device *dev, int clk_id, int clk_src,
                                                              ^
sound/soc/qcom/qdsp6/q6afe.c:1101:63: note: Function
'q6afe_set_lpass_clock' argument 3 names different: declaration
'clk_src' definition 'attri'.
int q6afe_set_lpass_clock(struct device *dev, int clk_id, int attri,
                                                              ^

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
---
 sound/soc/qcom/qdsp6/q6afe.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/sound/soc/qcom/qdsp6/q6afe.h b/sound/soc/qcom/qdsp6/q6afe.h
index 22e10269aa10..41133f8797c9 100644
--- a/sound/soc/qcom/qdsp6/q6afe.h
+++ b/sound/soc/qcom/qdsp6/q6afe.h
@@ -233,7 +233,7 @@ void q6afe_cdc_dma_port_prepare(struct q6afe_port *port,
 int q6afe_port_set_sysclk(struct q6afe_port *port, int clk_id,
 			  int clk_src, int clk_root,
 			  unsigned int freq, int dir);
-int q6afe_set_lpass_clock(struct device *dev, int clk_id, int clk_src,
+int q6afe_set_lpass_clock(struct device *dev, int clk_id, int attri,
 			  int clk_root, unsigned int freq);
 int q6afe_vote_lpass_core_hw(struct device *dev, uint32_t hw_block_id,
 			     char *client_name, uint32_t *client_handle);
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 13+ messages in thread

* [PATCH 06/10] ASoC: qcom: q6asm: align function prototypes
  2021-02-18 22:29 [PATCH 00/10] ASoC: qcom: remove cppcheck warnings Pierre-Louis Bossart
                   ` (4 preceding siblings ...)
  2021-02-18 22:29 ` [PATCH 05/10] ASoC: qcom: q6afe: align function prototype Pierre-Louis Bossart
@ 2021-02-18 22:29 ` Pierre-Louis Bossart
  2021-02-18 22:29 ` [PATCH 07/10] ASoC: wcd-clsh-v2: " Pierre-Louis Bossart
                   ` (5 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: Pierre-Louis Bossart @ 2021-02-18 22:29 UTC (permalink / raw)
  To: alsa-devel
  Cc: tiwai, vkoul, broonie, srinivas.kandagatla, Pierre-Louis Bossart

cppcheck warnings:

sound/soc/qcom/qdsp6/q6asm.c:502:16: style:inconclusive: Function
'q6asm_map_memory_regions' argument 4 names different: declaration
'bufsz' definition 'period_sz'. [funcArgNamesDifferent]
        size_t period_sz, unsigned int periods)
               ^
sound/soc/qcom/qdsp6/q6asm.h:150:16: note: Function
'q6asm_map_memory_regions' argument 4 names different: declaration
'bufsz' definition 'period_sz'.
        size_t bufsz, unsigned int bufcnt);
               ^
sound/soc/qcom/qdsp6/q6asm.c:502:16: note: Function
'q6asm_map_memory_regions' argument 4 names different: declaration
'bufsz' definition 'period_sz'.
        size_t period_sz, unsigned int periods)
               ^
sound/soc/qcom/qdsp6/q6asm.c:502:40: style:inconclusive: Function
'q6asm_map_memory_regions' argument 5 names different: declaration
'bufcnt' definition 'periods'. [funcArgNamesDifferent]
        size_t period_sz, unsigned int periods)
                                       ^
sound/soc/qcom/qdsp6/q6asm.h:150:36: note: Function
'q6asm_map_memory_regions' argument 5 names different: declaration
'bufcnt' definition 'periods'.
        size_t bufsz, unsigned int bufcnt);
                                   ^
sound/soc/qcom/qdsp6/q6asm.c:502:40: note: Function
'q6asm_map_memory_regions' argument 5 names different: declaration
'bufcnt' definition 'periods'.
        size_t period_sz, unsigned int periods)
                                       ^
sound/soc/qcom/qdsp6/q6asm.c:823:47: style:inconclusive: Function
'q6asm_get_session_id' argument 1 names different: declaration 'ac'
definition 'c'. [funcArgNamesDifferent]
int q6asm_get_session_id(struct audio_client *c)
                                              ^
sound/soc/qcom/qdsp6/q6asm.h:146:47: note: Function
'q6asm_get_session_id' argument 1 names different: declaration 'ac'
definition 'c'.
int q6asm_get_session_id(struct audio_client *ac);
                                              ^
sound/soc/qcom/qdsp6/q6asm.c:823:47: note: Function
'q6asm_get_session_id' argument 1 names different: declaration 'ac'
definition 'c'.
int q6asm_get_session_id(struct audio_client *c)
                                              ^
sound/soc/qcom/qdsp6/q6asm.c:1573:52: style:inconclusive: Function
'q6asm_write_async' argument 6 names different: declaration 'flags'
definition 'wflags'. [funcArgNamesDifferent]
        uint32_t msw_ts, uint32_t lsw_ts, uint32_t wflags)
                                                   ^
sound/soc/qcom/qdsp6/q6asm.h:100:52: note: Function
'q6asm_write_async' argument 6 names different: declaration 'flags'
definition 'wflags'.
        uint32_t msw_ts, uint32_t lsw_ts, uint32_t flags);
                                                   ^
sound/soc/qcom/qdsp6/q6asm.c:1573:52: note: Function
'q6asm_write_async' argument 6 names different: declaration 'flags'
definition 'wflags'.
        uint32_t msw_ts, uint32_t lsw_ts, uint32_t wflags)
                                                   ^

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
---
 sound/soc/qcom/qdsp6/q6asm.h | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/sound/soc/qcom/qdsp6/q6asm.h b/sound/soc/qcom/qdsp6/q6asm.h
index 82e584aa534f..394604c34943 100644
--- a/sound/soc/qcom/qdsp6/q6asm.h
+++ b/sound/soc/qcom/qdsp6/q6asm.h
@@ -97,7 +97,7 @@ struct audio_client *q6asm_audio_client_alloc(struct device *dev,
 					      int session_id, int perf_mode);
 void q6asm_audio_client_free(struct audio_client *ac);
 int q6asm_write_async(struct audio_client *ac, uint32_t stream_id, uint32_t len,
-		      uint32_t msw_ts, uint32_t lsw_ts, uint32_t flags);
+		      uint32_t msw_ts, uint32_t lsw_ts, uint32_t wflags);
 int q6asm_open_write(struct audio_client *ac, uint32_t stream_id,
 		     uint32_t format, u32 codec_profile,
 		     uint16_t bits_per_sample, bool is_gapless);
@@ -143,10 +143,10 @@ int q6asm_stream_remove_trailing_silence(struct audio_client *ac,
 					 uint32_t trailing_samples);
 int q6asm_cmd(struct audio_client *ac, uint32_t stream_id,  int cmd);
 int q6asm_cmd_nowait(struct audio_client *ac, uint32_t stream_id,  int cmd);
-int q6asm_get_session_id(struct audio_client *ac);
+int q6asm_get_session_id(struct audio_client *c);
 int q6asm_map_memory_regions(unsigned int dir,
 			     struct audio_client *ac,
 			     phys_addr_t phys,
-			     size_t bufsz, unsigned int bufcnt);
+			     size_t period_sz, unsigned int periods);
 int q6asm_unmap_memory_regions(unsigned int dir, struct audio_client *ac);
 #endif /* __Q6_ASM_H__ */
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 13+ messages in thread

* [PATCH 07/10] ASoC: wcd-clsh-v2: align function prototypes
  2021-02-18 22:29 [PATCH 00/10] ASoC: qcom: remove cppcheck warnings Pierre-Louis Bossart
                   ` (5 preceding siblings ...)
  2021-02-18 22:29 ` [PATCH 06/10] ASoC: qcom: q6asm: align function prototypes Pierre-Louis Bossart
@ 2021-02-18 22:29 ` Pierre-Louis Bossart
  2021-02-18 22:29 ` [PATCH 08/10] ASoC: wcd9335: clarify return value Pierre-Louis Bossart
                   ` (4 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: Pierre-Louis Bossart @ 2021-02-18 22:29 UTC (permalink / raw)
  To: alsa-devel
  Cc: tiwai, vkoul, broonie, srinivas.kandagatla, Pierre-Louis Bossart

cppcheck warnings:

sound/soc/codecs/wcd-clsh-v2.c:523:28: style:inconclusive: Function
'wcd_clsh_ctrl_set_state' argument 2 names different: declaration
'event' definition 'clsh_event'. [funcArgNamesDifferent]
       enum wcd_clsh_event clsh_event,
                           ^
sound/soc/codecs/wcd-clsh-v2.h:45:28: note: Function
'wcd_clsh_ctrl_set_state' argument 2 names different: declaration
'event' definition 'clsh_event'.
       enum wcd_clsh_event event,
                           ^
sound/soc/codecs/wcd-clsh-v2.c:523:28: note: Function
'wcd_clsh_ctrl_set_state' argument 2 names different: declaration
'event' definition 'clsh_event'.
       enum wcd_clsh_event clsh_event,
                           ^
sound/soc/codecs/wcd-clsh-v2.c:524:12: style:inconclusive: Function
'wcd_clsh_ctrl_set_state' argument 3 names different: declaration
'state' definition 'nstate'. [funcArgNamesDifferent]
       int nstate,
           ^
sound/soc/codecs/wcd-clsh-v2.h:46:12: note: Function
'wcd_clsh_ctrl_set_state' argument 3 names different: declaration
'state' definition 'nstate'.
       int state,
           ^
sound/soc/codecs/wcd-clsh-v2.c:524:12: note: Function
'wcd_clsh_ctrl_set_state' argument 3 names different: declaration
'state' definition 'nstate'.
       int nstate,
           ^
sound/soc/codecs/wcd-clsh-v2.c:557:69: style:inconclusive: Function
'wcd_clsh_ctrl_alloc' argument 1 names different: declaration
'component' definition 'comp'. [funcArgNamesDifferent]
struct wcd_clsh_ctrl *wcd_clsh_ctrl_alloc(struct snd_soc_component *comp,
                                                                    ^
sound/soc/codecs/wcd-clsh-v2.h:40:31: note: Function
'wcd_clsh_ctrl_alloc' argument 1 names different: declaration
'component' definition 'comp'.
    struct snd_soc_component *component,
                              ^
sound/soc/codecs/wcd-clsh-v2.c:557:69: note: Function
'wcd_clsh_ctrl_alloc' argument 1 names different: declaration
'component' definition 'comp'.
struct wcd_clsh_ctrl *wcd_clsh_ctrl_alloc(struct snd_soc_component *comp,
                                                                    ^

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
---
 sound/soc/codecs/wcd-clsh-v2.h | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/sound/soc/codecs/wcd-clsh-v2.h b/sound/soc/codecs/wcd-clsh-v2.h
index a902f9893467..a6d0f2d0e9e3 100644
--- a/sound/soc/codecs/wcd-clsh-v2.h
+++ b/sound/soc/codecs/wcd-clsh-v2.h
@@ -37,13 +37,13 @@ enum wcd_clsh_mode {
 struct wcd_clsh_ctrl;
 
 extern struct wcd_clsh_ctrl *wcd_clsh_ctrl_alloc(
-				struct snd_soc_component *component,
+				struct snd_soc_component *comp,
 				int version);
 extern void wcd_clsh_ctrl_free(struct wcd_clsh_ctrl *ctrl);
 extern int wcd_clsh_ctrl_get_state(struct wcd_clsh_ctrl *ctrl);
 extern int wcd_clsh_ctrl_set_state(struct wcd_clsh_ctrl *ctrl,
-				   enum wcd_clsh_event event,
-				   int state,
+				   enum wcd_clsh_event clsh_event,
+				   int nstate,
 				   enum wcd_clsh_mode mode);
 
 #endif /* _WCD_CLSH_V2_H_ */
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 13+ messages in thread

* [PATCH 08/10] ASoC: wcd9335: clarify return value
  2021-02-18 22:29 [PATCH 00/10] ASoC: qcom: remove cppcheck warnings Pierre-Louis Bossart
                   ` (6 preceding siblings ...)
  2021-02-18 22:29 ` [PATCH 07/10] ASoC: wcd-clsh-v2: " Pierre-Louis Bossart
@ 2021-02-18 22:29 ` Pierre-Louis Bossart
  2021-02-18 22:29 ` [PATCH 09/10] ASoC: wcd934x: remove useless return Pierre-Louis Bossart
                   ` (3 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: Pierre-Louis Bossart @ 2021-02-18 22:29 UTC (permalink / raw)
  To: alsa-devel
  Cc: tiwai, vkoul, broonie, srinivas.kandagatla, Pierre-Louis Bossart

cppcheck warning:

sound/soc/codecs/wcd9335.c:5216:9: warning: Identical condition and
return expression 'ret', return value is always 0
[identicalConditionAfterEarlyExit]
 return ret;
        ^
sound/soc/codecs/wcd9335.c:5211:6: note: If condition 'ret' is true,
the function will return/exit
 if (ret)
     ^
sound/soc/codecs/wcd9335.c:5216:9: note: Returning identical
expression 'ret'
 return ret;
        ^

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
---
 sound/soc/codecs/wcd9335.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/sound/soc/codecs/wcd9335.c b/sound/soc/codecs/wcd9335.c
index 9ddfed797b7e..adb325fac930 100644
--- a/sound/soc/codecs/wcd9335.c
+++ b/sound/soc/codecs/wcd9335.c
@@ -5213,7 +5213,7 @@ static int wcd9335_slim_status(struct slim_device *sdev,
 
 	wcd9335_probe(wcd);
 
-	return ret;
+	return 0;
 }
 
 static const struct slim_device_id wcd9335_slim_id[] = {
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 13+ messages in thread

* [PATCH 09/10] ASoC: wcd934x: remove useless return
  2021-02-18 22:29 [PATCH 00/10] ASoC: qcom: remove cppcheck warnings Pierre-Louis Bossart
                   ` (7 preceding siblings ...)
  2021-02-18 22:29 ` [PATCH 08/10] ASoC: wcd9335: clarify return value Pierre-Louis Bossart
@ 2021-02-18 22:29 ` Pierre-Louis Bossart
  2021-02-18 22:29 ` [PATCH 10/10] ASoC: lpass-wsa-macro: add missing test Pierre-Louis Bossart
                   ` (2 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: Pierre-Louis Bossart @ 2021-02-18 22:29 UTC (permalink / raw)
  To: alsa-devel
  Cc: tiwai, vkoul, broonie, srinivas.kandagatla, Pierre-Louis Bossart

cppcheck warning:

sound/soc/codecs/wcd934x.c:1571:9: warning: Identical condition and
return expression 'ret', return value is always 0
[identicalConditionAfterEarlyExit]
 return ret;
        ^
sound/soc/codecs/wcd934x.c:1568:6: note: If condition 'ret' is true,
the function will return/exit
 if (ret)
     ^
sound/soc/codecs/wcd934x.c:1571:9: note: Returning identical
expression 'ret'
 return ret;
        ^

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
---
 sound/soc/codecs/wcd934x.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/sound/soc/codecs/wcd934x.c b/sound/soc/codecs/wcd934x.c
index 40f682f5dab8..d461a3747b4d 100644
--- a/sound/soc/codecs/wcd934x.c
+++ b/sound/soc/codecs/wcd934x.c
@@ -1565,8 +1565,6 @@ static int wcd934x_set_interpolator_rate(struct snd_soc_dai *dai,
 		return ret;
 	ret = wcd934x_set_mix_interpolator_rate(dai, (u8)rate_val,
 						sample_rate);
-	if (ret)
-		return ret;
 
 	return ret;
 }
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 13+ messages in thread

* [PATCH 10/10] ASoC: lpass-wsa-macro: add missing test
  2021-02-18 22:29 [PATCH 00/10] ASoC: qcom: remove cppcheck warnings Pierre-Louis Bossart
                   ` (8 preceding siblings ...)
  2021-02-18 22:29 ` [PATCH 09/10] ASoC: wcd934x: remove useless return Pierre-Louis Bossart
@ 2021-02-18 22:29 ` Pierre-Louis Bossart
  2021-02-19 10:32 ` [PATCH 00/10] ASoC: qcom: remove cppcheck warnings Srinivas Kandagatla
  2021-03-01 23:34 ` Mark Brown
  11 siblings, 0 replies; 13+ messages in thread
From: Pierre-Louis Bossart @ 2021-02-18 22:29 UTC (permalink / raw)
  To: alsa-devel
  Cc: tiwai, vkoul, broonie, srinivas.kandagatla, Pierre-Louis Bossart

cppcheck warning:

sound/soc/codecs/lpass-wsa-macro.c:958:6: style: Variable 'ret' is
reassigned a value before the old one has been
used. [redundantAssignment]
 ret = wsa_macro_set_prim_interpolator_rate(dai, (u8) rate_val, sample_rate);
     ^
sound/soc/codecs/lpass-wsa-macro.c:946:6: note: ret is assigned
 ret = wsa_macro_set_mix_interpolator_rate(dai, (u8) rate_val, sample_rate);
     ^
sound/soc/codecs/lpass-wsa-macro.c:958:6: note: ret is overwritten
 ret = wsa_macro_set_prim_interpolator_rate(dai, (u8) rate_val, sample_rate);
     ^

set_mix_interpolator_rate can return -EINVAL, add a test and bail on error.

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
---
 sound/soc/codecs/lpass-wsa-macro.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/sound/soc/codecs/lpass-wsa-macro.c b/sound/soc/codecs/lpass-wsa-macro.c
index 5ebcd935ba89..0be5d25e2a29 100644
--- a/sound/soc/codecs/lpass-wsa-macro.c
+++ b/sound/soc/codecs/lpass-wsa-macro.c
@@ -944,6 +944,8 @@ static int wsa_macro_set_interpolator_rate(struct snd_soc_dai *dai,
 		goto prim_rate;
 
 	ret = wsa_macro_set_mix_interpolator_rate(dai, (u8) rate_val, sample_rate);
+	if (ret < 0)
+		return ret;
 prim_rate:
 	/* set primary path sample rate */
 	for (i = 0; i < ARRAY_SIZE(int_prim_sample_rate_val); i++) {
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 13+ messages in thread

* Re: [PATCH 00/10] ASoC: qcom: remove cppcheck warnings
  2021-02-18 22:29 [PATCH 00/10] ASoC: qcom: remove cppcheck warnings Pierre-Louis Bossart
                   ` (9 preceding siblings ...)
  2021-02-18 22:29 ` [PATCH 10/10] ASoC: lpass-wsa-macro: add missing test Pierre-Louis Bossart
@ 2021-02-19 10:32 ` Srinivas Kandagatla
  2021-03-01 23:34 ` Mark Brown
  11 siblings, 0 replies; 13+ messages in thread
From: Srinivas Kandagatla @ 2021-02-19 10:32 UTC (permalink / raw)
  To: Pierre-Louis Bossart, alsa-devel; +Cc: tiwai, vkoul, broonie

Thanks Pierre for taking time to fix these warning!

On 18/02/2021 22:29, Pierre-Louis Bossart wrote:
> Second batch of cleanups for Qualcomm SOCs and codecs. The only
> functional change is the addition of a missing error check in the last
> patch.
> 
> Pierre-Louis Bossart (10):
>    ASoC: qcom: lpass-hdmi: remove useless return
>    ASoC: qcom: lpass-platform: remove useless assignment
>    ASoC: qcom: q6dsp-dai: clarify expression
>    ASoC: qcom: q6afe: remove useless assignments
>    ASoC: qcom: q6afe: align function prototype
>    ASoC: qcom: q6asm: align function prototypes
>    ASoC: wcd-clsh-v2: align function prototypes
>    ASoC: wcd9335: clarify return value
>    ASoC: wcd934x: remove useless return
>    ASoC: lpass-wsa-macro: add missing test
> 
>   sound/soc/codecs/lpass-wsa-macro.c | 2 ++
>   sound/soc/codecs/wcd-clsh-v2.h     | 6 +++---
>   sound/soc/codecs/wcd9335.c         | 2 +-
>   sound/soc/codecs/wcd934x.c         | 2 --
>   sound/soc/qcom/lpass-hdmi.c        | 4 ----
>   sound/soc/qcom/lpass-platform.c    | 2 +-
>   sound/soc/qcom/qdsp6/q6afe-dai.c   | 2 +-
>   sound/soc/qcom/qdsp6/q6afe.c       | 5 ++---
>   sound/soc/qcom/qdsp6/q6afe.h       | 2 +-
>   sound/soc/qcom/qdsp6/q6asm.h       | 6 +++---
>   10 files changed, 14 insertions(+), 19 deletions(-)
> 

All for these changes LGTM,

Reviewed-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>


--srini


^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [PATCH 00/10] ASoC: qcom: remove cppcheck warnings
  2021-02-18 22:29 [PATCH 00/10] ASoC: qcom: remove cppcheck warnings Pierre-Louis Bossart
                   ` (10 preceding siblings ...)
  2021-02-19 10:32 ` [PATCH 00/10] ASoC: qcom: remove cppcheck warnings Srinivas Kandagatla
@ 2021-03-01 23:34 ` Mark Brown
  11 siblings, 0 replies; 13+ messages in thread
From: Mark Brown @ 2021-03-01 23:34 UTC (permalink / raw)
  To: Pierre-Louis Bossart, alsa-devel; +Cc: tiwai, vkoul, srinivas.kandagatla

On Thu, 18 Feb 2021 16:29:06 -0600, Pierre-Louis Bossart wrote:
> Second batch of cleanups for Qualcomm SOCs and codecs. The only
> functional change is the addition of a missing error check in the last
> patch.
> 
> Pierre-Louis Bossart (10):
>   ASoC: qcom: lpass-hdmi: remove useless return
>   ASoC: qcom: lpass-platform: remove useless assignment
>   ASoC: qcom: q6dsp-dai: clarify expression
>   ASoC: qcom: q6afe: remove useless assignments
>   ASoC: qcom: q6afe: align function prototype
>   ASoC: qcom: q6asm: align function prototypes
>   ASoC: wcd-clsh-v2: align function prototypes
>   ASoC: wcd9335: clarify return value
>   ASoC: wcd934x: remove useless return
>   ASoC: lpass-wsa-macro: add missing test
> 
> [...]

Applied to

   https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git for-next

Thanks!

[01/10] ASoC: qcom: lpass-hdmi: remove useless return
        commit: 0bf10fbda55679a3fef86f5fae47105b2d61fecc
[02/10] ASoC: qcom: lpass-platform: remove useless assignment
        commit: 25ab7dcdb77e4ecfa1a9e1c7939318b2b90a90f3
[03/10] ASoC: qcom: q6dsp-dai: clarify expression
        commit: fd565b469d21ab1008f5f4fb5ca5cf9eaff83cc1
[04/10] ASoC: qcom: q6afe: remove useless assignments
        commit: 924d4aad24337def5b18cd3225eec7e27dcf0f74
[05/10] ASoC: qcom: q6afe: align function prototype
        commit: 7ca70ca9914c23e1f8a9ae68c96f1fc812cc8575
[06/10] ASoC: qcom: q6asm: align function prototypes
        commit: 63a372715a3c2c13720774698a08d85de5f40934
[07/10] ASoC: wcd-clsh-v2: align function prototypes
        commit: 297ef0a73103c59c107f8b7c013b17d27ea2f772
[08/10] ASoC: wcd9335: clarify return value
        commit: 71ea36550bda7359ab055a4572a5f3ae04369b07
[09/10] ASoC: wcd934x: remove useless return
        commit: 5c3252b3f71184f96cf1bcad3a78aa074d6d7db8
[10/10] ASoC: lpass-wsa-macro: add missing test
        commit: 0076777b8753e3969516dbd514a2c5ffb3ceba3a

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

^ permalink raw reply	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2021-03-01 23:44 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-02-18 22:29 [PATCH 00/10] ASoC: qcom: remove cppcheck warnings Pierre-Louis Bossart
2021-02-18 22:29 ` [PATCH 01/10] ASoC: qcom: lpass-hdmi: remove useless return Pierre-Louis Bossart
2021-02-18 22:29 ` [PATCH 02/10] ASoC: qcom: lpass-platform: remove useless assignment Pierre-Louis Bossart
2021-02-18 22:29 ` [PATCH 03/10] ASoC: qcom: q6dsp-dai: clarify expression Pierre-Louis Bossart
2021-02-18 22:29 ` [PATCH 04/10] ASoC: qcom: q6afe: remove useless assignments Pierre-Louis Bossart
2021-02-18 22:29 ` [PATCH 05/10] ASoC: qcom: q6afe: align function prototype Pierre-Louis Bossart
2021-02-18 22:29 ` [PATCH 06/10] ASoC: qcom: q6asm: align function prototypes Pierre-Louis Bossart
2021-02-18 22:29 ` [PATCH 07/10] ASoC: wcd-clsh-v2: " Pierre-Louis Bossart
2021-02-18 22:29 ` [PATCH 08/10] ASoC: wcd9335: clarify return value Pierre-Louis Bossart
2021-02-18 22:29 ` [PATCH 09/10] ASoC: wcd934x: remove useless return Pierre-Louis Bossart
2021-02-18 22:29 ` [PATCH 10/10] ASoC: lpass-wsa-macro: add missing test Pierre-Louis Bossart
2021-02-19 10:32 ` [PATCH 00/10] ASoC: qcom: remove cppcheck warnings Srinivas Kandagatla
2021-03-01 23:34 ` Mark Brown

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.