[PATCH 0/5] ASoC: codecs: minor cppcheck cleanups
Small number of cleanups that were either missed in previous versions or detected by new cppcheck version.
Pierre-Louis Bossart (5): ASoC: hdmi-codec: remove unused definitions ASoC: wcd-mbhc-v2: remove always-true condition ASoC: wcd9335: remove always-true condition ASoC: fsl: fsl-utils: remove useless assignment ASoC: ti: omap-mcbsp: remove useless assignment
sound/soc/codecs/hdmi-codec.c | 4 ---- sound/soc/codecs/wcd-mbhc-v2.c | 2 +- sound/soc/codecs/wcd9335.c | 4 +--- sound/soc/fsl/fsl_utils.c | 2 +- sound/soc/ti/omap-mcbsp.c | 2 +- 5 files changed, 4 insertions(+), 10 deletions(-)
cppcheck warning:
sound/soc/codecs/hdmi-codec.c:24:16: style: struct member 'hdmi_codec_channel_ma`p_table::map' is never used. [unusedStructMember] unsigned char map; /* ALSA API channel map position */ ^
Signed-off-by: Pierre-Louis Bossart pierre-louis.bossart@linux.intel.com Reviewed-by: Bard Liao yung-chuan.liao@linux.intel.com Reviewed-by: Kai Vehmanen kai.vehmanen@linux.intel.com Reviewed-by: Chao Song chao.song@intel.com --- sound/soc/codecs/hdmi-codec.c | 4 ---- 1 file changed, 4 deletions(-)
diff --git a/sound/soc/codecs/hdmi-codec.c b/sound/soc/codecs/hdmi-codec.c index 5679102de91f8..863e679d2ac11 100644 --- a/sound/soc/codecs/hdmi-codec.c +++ b/sound/soc/codecs/hdmi-codec.c @@ -20,10 +20,6 @@
#define HDMI_CODEC_CHMAP_IDX_UNKNOWN -1
-struct hdmi_codec_channel_map_table { - unsigned char map; /* ALSA API channel map position */ -}; - /* * CEA speaker placement for HDMI 1.4: *
cppcheck warning:
sound/soc/codecs/wcd-mbhc-v2.c:1192:26: style: Condition 'cross_conn<0' is always true [knownConditionTrueFalse] } else if (cross_conn < 0) /* Error */ ^ sound/soc/codecs/wcd-mbhc-v2.c:1188:15: note: Assuming that condition '!cross_conn' is not redundant } else if (!cross_conn) { /* no cross connection */ ^ sound/soc/codecs/wcd-mbhc-v2.c:1192:26: note: Condition 'cross_conn<0' is always true } else if (cross_conn < 0) /* Error */ ^ Signed-off-by: Pierre-Louis Bossart pierre-louis.bossart@linux.intel.com Reviewed-by: Bard Liao yung-chuan.liao@linux.intel.com Reviewed-by: Kai Vehmanen kai.vehmanen@linux.intel.com Reviewed-by: Chao Song chao.song@intel.com --- sound/soc/codecs/wcd-mbhc-v2.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/sound/soc/codecs/wcd-mbhc-v2.c b/sound/soc/codecs/wcd-mbhc-v2.c index 98baef594bf31..b16a18dbfe7af 100644 --- a/sound/soc/codecs/wcd-mbhc-v2.c +++ b/sound/soc/codecs/wcd-mbhc-v2.c @@ -1189,7 +1189,7 @@ static void wcd_correct_swch_plug(struct work_struct *work) pt_gnd_mic_swap_cnt = 0; plug_type = wcd_mbhc_get_plug_from_adc(mbhc, output_mv); continue; - } else if (cross_conn < 0) /* Error */ + } else /* Error if (cross_conn < 0) */ continue;
if (pt_gnd_mic_swap_cnt == GND_MIC_SWAP_THRESHOLD) {
cppcheck warning:
sound/soc/codecs/wcd9335.c:1824:22: style: Condition 'tx_port==13' is always true [knownConditionTrueFalse] } else if (tx_port == 13) { ^ sound/soc/codecs/wcd9335.c:1802:16: note: Assuming that condition 'tx_port==12' is not redundant if ((tx_port == 12) || (tx_port >= 14)) { ^ sound/soc/codecs/wcd9335.c:1802:35: note: Assuming that condition 'tx_port>=14' is not redundant if ((tx_port == 12) || (tx_port >= 14)) { ^ sound/soc/codecs/wcd9335.c:1824:22: note: Condition 'tx_port==13' is always true } else if (tx_port == 13) { ^ sound/soc/codecs/wcd9335.c:1845:22: style: Condition 'tx_port==13' is always true [knownConditionTrueFalse] } else if (tx_port == 13) { ^ sound/soc/codecs/wcd9335.c:1802:16: note: Assuming that condition 'tx_port==12' is not redundant if ((tx_port == 12) || (tx_port >= 14)) { ^ sound/soc/codecs/wcd9335.c:1802:35: note: Assuming that condition 'tx_port>=14' is not redundant if ((tx_port == 12) || (tx_port >= 14)) { ^ sound/soc/codecs/wcd9335.c:1845:22: note: Condition 'tx_port==13' is always true } else if (tx_port == 13) { ^
Signed-off-by: Pierre-Louis Bossart pierre-louis.bossart@linux.intel.com Reviewed-by: Bard Liao yung-chuan.liao@linux.intel.com Reviewed-by: Kai Vehmanen kai.vehmanen@linux.intel.com Reviewed-by: Chao Song chao.song@intel.com --- sound/soc/codecs/wcd9335.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/sound/soc/codecs/wcd9335.c b/sound/soc/codecs/wcd9335.c index beeeb35e80321..5b4d3c5973532 100644 --- a/sound/soc/codecs/wcd9335.c +++ b/sound/soc/codecs/wcd9335.c @@ -1821,12 +1821,10 @@ static int wcd9335_set_decimator_rate(struct snd_soc_dai *dai, tx_port_reg = WCD9335_CDC_IF_ROUTER_TX_MUX_CFG3; shift = 0; shift_val = 0x0F; - } else if (tx_port == 13) { + } else /* (tx_port == 13) */ { tx_port_reg = WCD9335_CDC_IF_ROUTER_TX_MUX_CFG3; shift = 4; shift_val = 0x03; - } else { - return -EINVAL; }
tx_mux_sel = snd_soc_component_read(comp, tx_port_reg) &
cppcheck warning:
sound/soc/fsl/fsl_utils.c:127:10: style: Variable 'ret' is assigned a value that is never used. [unreadVariable] int ret = 0; ^
Signed-off-by: Pierre-Louis Bossart pierre-louis.bossart@linux.intel.com Reviewed-by: Bard Liao yung-chuan.liao@linux.intel.com Reviewed-by: Kai Vehmanen kai.vehmanen@linux.intel.com Reviewed-by: Chao Song chao.song@intel.com --- sound/soc/fsl/fsl_utils.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/sound/soc/fsl/fsl_utils.c b/sound/soc/fsl/fsl_utils.c index d0fc430f7033d..a5ab27c2f711c 100644 --- a/sound/soc/fsl/fsl_utils.c +++ b/sound/soc/fsl/fsl_utils.c @@ -124,7 +124,7 @@ void fsl_asoc_reparent_pll_clocks(struct device *dev, struct clk *clk, { struct clk *p, *pll = NULL, *npll = NULL; bool reparent = false; - int ret = 0; + int ret;
if (!clk || !pll8k_clk || !pll11k_clk) return;
On Tue, Aug 23, 2022 at 2:43 AM Pierre-Louis Bossart < pierre-louis.bossart@linux.intel.com> wrote:
cppcheck warning:
sound/soc/fsl/fsl_utils.c:127:10: style: Variable 'ret' is assigned a value that is never used. [unreadVariable] int ret = 0; ^
Signed-off-by: Pierre-Louis Bossart pierre-louis.bossart@linux.intel.com Reviewed-by: Bard Liao yung-chuan.liao@linux.intel.com Reviewed-by: Kai Vehmanen kai.vehmanen@linux.intel.com Reviewed-by: Chao Song chao.song@intel.com
Acked-by: Shengjiu Wang shengjiu.wang@gmail.com
Best regards Wang Shengjiu
sound/soc/fsl/fsl_utils.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/sound/soc/fsl/fsl_utils.c b/sound/soc/fsl/fsl_utils.c index d0fc430f7033d..a5ab27c2f711c 100644 --- a/sound/soc/fsl/fsl_utils.c +++ b/sound/soc/fsl/fsl_utils.c @@ -124,7 +124,7 @@ void fsl_asoc_reparent_pll_clocks(struct device *dev, struct clk *clk, { struct clk *p, *pll = NULL, *npll = NULL; bool reparent = false;
int ret = 0;
int ret; if (!clk || !pll8k_clk || !pll11k_clk) return;
-- 2.34.1
sound/soc/ti/omap-mcbsp.c:617:10: style: Variable 'ret' is assigned a value that is never used. [unreadVariable] int ret = 0; ^
Signed-off-by: Pierre-Louis Bossart pierre-louis.bossart@linux.intel.com Reviewed-by: Bard Liao yung-chuan.liao@linux.intel.com Reviewed-by: Kai Vehmanen kai.vehmanen@linux.intel.com Reviewed-by: Chao Song chao.song@intel.com --- sound/soc/ti/omap-mcbsp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/sound/soc/ti/omap-mcbsp.c b/sound/soc/ti/omap-mcbsp.c index 0b377bb7737fd..7c539a41a6a34 100644 --- a/sound/soc/ti/omap-mcbsp.c +++ b/sound/soc/ti/omap-mcbsp.c @@ -614,7 +614,7 @@ static int omap_mcbsp_init(struct platform_device *pdev) { struct omap_mcbsp *mcbsp = platform_get_drvdata(pdev); struct resource *res; - int ret = 0; + int ret;
spin_lock_init(&mcbsp->lock); mcbsp->free = true;
On Mon, 22 Aug 2022 20:42:34 +0200, Pierre-Louis Bossart wrote:
Small number of cleanups that were either missed in previous versions or detected by new cppcheck version.
Pierre-Louis Bossart (5): ASoC: hdmi-codec: remove unused definitions ASoC: wcd-mbhc-v2: remove always-true condition ASoC: wcd9335: remove always-true condition ASoC: fsl: fsl-utils: remove useless assignment ASoC: ti: omap-mcbsp: remove useless assignment
[...]
Applied to
https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git for-next
Thanks!
[1/5] ASoC: hdmi-codec: remove unused definitions commit: c90d6054ff9d75bc185c48b798b745aa2c05236c [2/5] ASoC: wcd-mbhc-v2: remove always-true condition commit: 43265ceeb0b9cb1f8f5fb182adaa6c2ed4941478 [3/5] ASoC: wcd9335: remove always-true condition commit: c9a9b4dbc18f4dc609d47b9ac19545b31fb21e3f [4/5] ASoC: fsl: fsl-utils: remove useless assignment commit: 3653a6a2a7c146f04940d572d2728c939b50cba1 [5/5] ASoC: ti: omap-mcbsp: remove useless assignment commit: 7a0431bbda8ae24de56ea1dadcf1a2e56f939707
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
participants (3)
-
Mark Brown
-
Pierre-Louis Bossart
-
Shengjiu Wang