2021-03-26 22:01:23

by Pierre-Louis Bossart

[permalink] [raw]
Subject: [PATCH 00/17] ASoC: remove cppcheck warnings for multiple SOCs

Trivial cleanups to make cppcheck less verbose.

There should be no functionality change, except for the 'sti_uniperif'
patch where an error check was added.

Pierre-Louis Bossart (17):
ASoC: amd: renoir: acp3x-pdm-dma: remove unnecessary assignments
ASoC: atmel: fix shadowed variable
ASoC: atmel: atmel-i2s: remove useless initialization
ASoC: bcm: cygnus_ssp: remove useless initialization
ASoC: meson: axg-tdmin: remove useless assignment
ASoC: meson: axg-tdmout: remove useless assignment
ASoC: pxa: remove useless assignment
ASoC: sti: sti_uniperif: add missing error check
ASoC: sti: uniperif: align function prototypes
ASoC: stm: stm32_adfsdm: fix snprintf format string
ASoC: sunxi: sun8i-codec: clarify expression
ASoC: tegra: tegra20_das: clarify expression
ASoC: tegra: tegra20_das: align function prototypes
ASoC: ti: omap-abe-twl6040: remove useless assignment
ASoC: ti: omap-mcsp: remove duplicate test
ASoC: ux500: mop500: rename shadowing variable
ASoC: ux500: mop500: align function prototype

sound/soc/amd/renoir/acp3x-pdm-dma.c | 2 --
sound/soc/atmel/atmel-classd.c | 6 +++---
sound/soc/atmel/atmel-i2s.c | 2 +-
sound/soc/bcm/cygnus-ssp.c | 2 +-
sound/soc/meson/axg-tdmin.c | 2 +-
sound/soc/meson/axg-tdmout.c | 2 +-
sound/soc/pxa/mmp-pcm.c | 2 +-
sound/soc/sti/sti_uniperif.c | 2 ++
sound/soc/sti/uniperif.h | 4 ++--
sound/soc/stm/stm32_adfsdm.c | 2 +-
sound/soc/sunxi/sun8i-codec.c | 2 +-
sound/soc/tegra/tegra20_das.c | 8 ++++----
sound/soc/tegra/tegra20_das.h | 6 +++---
sound/soc/ti/omap-abe-twl6040.c | 2 +-
sound/soc/ti/omap-mcbsp.c | 3 +--
sound/soc/ux500/mop500.c | 6 +++---
sound/soc/ux500/mop500_ab8500.h | 2 +-
17 files changed, 27 insertions(+), 28 deletions(-)

--
2.25.1


2021-03-26 22:01:23

by Pierre-Louis Bossart

[permalink] [raw]
Subject: [PATCH 01/17] ASoC: amd: renoir: acp3x-pdm-dma: remove unnecessary assignments

cppcheck warning:

sound/soc/amd/renoir/acp3x-pdm-dma.c:132:17: style: Variable
'pdm_dma_enable' is assigned a value that is never
used. [unreadVariable]
pdm_dma_enable = 0x00;
^
sound/soc/amd/renoir/acp3x-pdm-dma.c:156:18: style: Variable
'pdm_dma_enable' is assigned a value that is never
used. [unreadVariable]
pdm_dma_enable = 0x00;
^

indeed those values are never used because the timeout is reset.

Signed-off-by: Pierre-Louis Bossart <[email protected]>
---
sound/soc/amd/renoir/acp3x-pdm-dma.c | 2 --
1 file changed, 2 deletions(-)

diff --git a/sound/soc/amd/renoir/acp3x-pdm-dma.c b/sound/soc/amd/renoir/acp3x-pdm-dma.c
index 7b14d9a81b97..1acd20439399 100644
--- a/sound/soc/amd/renoir/acp3x-pdm-dma.c
+++ b/sound/soc/amd/renoir/acp3x-pdm-dma.c
@@ -129,7 +129,6 @@ static int start_pdm_dma(void __iomem *acp_base)
enable_pdm_clock(acp_base);
rn_writel(pdm_enable, acp_base + ACP_WOV_PDM_ENABLE);
rn_writel(pdm_dma_enable, acp_base + ACP_WOV_PDM_DMA_ENABLE);
- pdm_dma_enable = 0x00;
timeout = 0;
while (++timeout < ACP_COUNTER) {
pdm_dma_enable = rn_readl(acp_base + ACP_WOV_PDM_DMA_ENABLE);
@@ -153,7 +152,6 @@ static int stop_pdm_dma(void __iomem *acp_base)
if (pdm_dma_enable & 0x01) {
pdm_dma_enable = 0x02;
rn_writel(pdm_dma_enable, acp_base + ACP_WOV_PDM_DMA_ENABLE);
- pdm_dma_enable = 0x00;
timeout = 0;
while (++timeout < ACP_COUNTER) {
pdm_dma_enable = rn_readl(acp_base +
--
2.25.1

2021-03-26 22:01:23

by Pierre-Louis Bossart

[permalink] [raw]
Subject: [PATCH 02/17] ASoC: atmel: fix shadowed variable

Fix cppcheck warning:

sound/soc/atmel/atmel-classd.c:51:14: style: Local variable 'pwm_type'
shadows outer variable [shadowVariable]
const char *pwm_type;
^
sound/soc/atmel/atmel-classd.c:226:27: note: Shadowed declaration
static const char * const pwm_type[] = {
^
sound/soc/atmel/atmel-classd.c:51:14: note: Shadow variable
const char *pwm_type;
^

Signed-off-by: Pierre-Louis Bossart <[email protected]>
---
sound/soc/atmel/atmel-classd.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/sound/soc/atmel/atmel-classd.c b/sound/soc/atmel/atmel-classd.c
index b1a28a9382fb..6023369e0f1a 100644
--- a/sound/soc/atmel/atmel-classd.c
+++ b/sound/soc/atmel/atmel-classd.c
@@ -48,7 +48,7 @@ static struct atmel_classd_pdata *atmel_classd_dt_init(struct device *dev)
{
struct device_node *np = dev->of_node;
struct atmel_classd_pdata *pdata;
- const char *pwm_type;
+ const char *pwm_type_s;
int ret;

if (!np) {
@@ -60,8 +60,8 @@ static struct atmel_classd_pdata *atmel_classd_dt_init(struct device *dev)
if (!pdata)
return ERR_PTR(-ENOMEM);

- ret = of_property_read_string(np, "atmel,pwm-type", &pwm_type);
- if ((ret == 0) && (strcmp(pwm_type, "diff") == 0))
+ ret = of_property_read_string(np, "atmel,pwm-type", &pwm_type_s);
+ if ((ret == 0) && (strcmp(pwm_type_s, "diff") == 0))
pdata->pwm_type = CLASSD_MR_PWMTYP_DIFF;
else
pdata->pwm_type = CLASSD_MR_PWMTYP_SINGLE;
--
2.25.1

2021-03-26 22:01:25

by Pierre-Louis Bossart

[permalink] [raw]
Subject: [PATCH 03/17] ASoC: atmel: atmel-i2s: remove useless initialization

Cppcheck complains:

sound/soc/atmel/atmel-i2s.c:628:6: style: Redundant initialization for 'err'. The initialized value is overwritten before it is read. [redundantInitialization]
err = devm_request_irq(&pdev->dev, irq, atmel_i2s_interrupt, 0,
^
sound/soc/atmel/atmel-i2s.c:598:10: note: err is initialized
int err = -ENXIO;
^
sound/soc/atmel/atmel-i2s.c:628:6: note: err is overwritten
err = devm_request_irq(&pdev->dev, irq, atmel_i2s_interrupt, 0,
^

Signed-off-by: Pierre-Louis Bossart <[email protected]>
---
sound/soc/atmel/atmel-i2s.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/sound/soc/atmel/atmel-i2s.c b/sound/soc/atmel/atmel-i2s.c
index 7c6187e41f2b..584656cc7d3c 100644
--- a/sound/soc/atmel/atmel-i2s.c
+++ b/sound/soc/atmel/atmel-i2s.c
@@ -595,7 +595,7 @@ static int atmel_i2s_probe(struct platform_device *pdev)
struct regmap *regmap;
void __iomem *base;
int irq;
- int err = -ENXIO;
+ int err;
unsigned int pcm_flags = 0;
unsigned int version;

--
2.25.1

2021-03-26 22:01:34

by Pierre-Louis Bossart

[permalink] [raw]
Subject: [PATCH 05/17] ASoC: meson: axg-tdmin: remove useless assignment

cppcheck complains about potential null pointer dereference but it's
rather an unnecessary assignment to NULL before walking through a
list.

Signed-off-by: Pierre-Louis Bossart <[email protected]>
---
sound/soc/meson/axg-tdmin.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/sound/soc/meson/axg-tdmin.c b/sound/soc/meson/axg-tdmin.c
index b4faf9d5c1aa..49b613a1faf2 100644
--- a/sound/soc/meson/axg-tdmin.c
+++ b/sound/soc/meson/axg-tdmin.c
@@ -57,7 +57,7 @@ static const struct snd_kcontrol_new axg_tdmin_in_mux =
static struct snd_soc_dai *
axg_tdmin_get_be(struct snd_soc_dapm_widget *w)
{
- struct snd_soc_dapm_path *p = NULL;
+ struct snd_soc_dapm_path *p;
struct snd_soc_dai *be;

snd_soc_dapm_widget_for_each_source_path(w, p) {
--
2.25.1

2021-03-26 22:01:55

by Pierre-Louis Bossart

[permalink] [raw]
Subject: [PATCH 08/17] ASoC: sti: sti_uniperif: add missing error check

cppcheck warning:

sound/soc/sti/sti_uniperif.c:490:6: style: Variable 'ret' is
reassigned a value before the old one has been
used. [redundantAssignment]
ret = devm_snd_soc_register_component(&pdev->dev,
^
sound/soc/sti/sti_uniperif.c:486:6: note: ret is assigned
ret = sti_uniperiph_cpu_dai_of(node, priv);
^
sound/soc/sti/sti_uniperif.c:490:6: note: ret is overwritten
ret = devm_snd_soc_register_component(&pdev->dev,
^

sti_uniperiph_cpu_dai_of() can return -EINVAL which seems like a
good-enough reason to bail.

Signed-off-by: Pierre-Louis Bossart <[email protected]>
---
sound/soc/sti/sti_uniperif.c | 2 ++
1 file changed, 2 insertions(+)

diff --git a/sound/soc/sti/sti_uniperif.c b/sound/soc/sti/sti_uniperif.c
index 7b9169f04d6e..67315d9b352d 100644
--- a/sound/soc/sti/sti_uniperif.c
+++ b/sound/soc/sti/sti_uniperif.c
@@ -484,6 +484,8 @@ static int sti_uniperiph_probe(struct platform_device *pdev)
priv->pdev = pdev;

ret = sti_uniperiph_cpu_dai_of(node, priv);
+ if (ret < 0)
+ return ret;

dev_set_drvdata(&pdev->dev, priv);

--
2.25.1

2021-03-26 22:01:55

by Pierre-Louis Bossart

[permalink] [raw]
Subject: [PATCH 06/17] ASoC: meson: axg-tdmout: remove useless assignment

cppcheck complains about potential null pointer dereference but it's
rather an unnecessary assignment to NULL before walking through a
list.

Signed-off-by: Pierre-Louis Bossart <[email protected]>
---
sound/soc/meson/axg-tdmout.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/sound/soc/meson/axg-tdmout.c b/sound/soc/meson/axg-tdmout.c
index 3ceabddae629..22d519fc07b2 100644
--- a/sound/soc/meson/axg-tdmout.c
+++ b/sound/soc/meson/axg-tdmout.c
@@ -55,7 +55,7 @@ static const struct regmap_config axg_tdmout_regmap_cfg = {
static struct snd_soc_dai *
axg_tdmout_get_be(struct snd_soc_dapm_widget *w)
{
- struct snd_soc_dapm_path *p = NULL;
+ struct snd_soc_dapm_path *p;
struct snd_soc_dai *be;

snd_soc_dapm_widget_for_each_sink_path(w, p) {
--
2.25.1

2021-03-26 22:01:55

by Pierre-Louis Bossart

[permalink] [raw]
Subject: [PATCH 09/17] ASoC: sti: uniperif: align function prototypes

cppcheck warning:

sound/soc/sti/uniperif_player.c:1049:24: style:inconclusive: Function
'uni_player_init' argument 2 names different: declaration 'uni_player'
definition 'player'. [funcArgNamesDifferent]
struct uniperif *player)
^
sound/soc/sti/uniperif.h:1375:24: note: Function 'uni_player_init'
argument 2 names different: declaration 'uni_player' definition
'player'.
struct uniperif *uni_player);
^
sound/soc/sti/uniperif_player.c:1049:24: note: Function
'uni_player_init' argument 2 names different: declaration 'uni_player'
definition 'player'.
struct uniperif *player)
^
sound/soc/sti/uniperif_reader.c:411:24: style:inconclusive: Function
'uni_reader_init' argument 2 names different: declaration 'uni_reader'
definition 'reader'. [funcArgNamesDifferent]
struct uniperif *reader)
^
sound/soc/sti/uniperif.h:1380:24: note: Function 'uni_reader_init'
argument 2 names different: declaration 'uni_reader' definition
'reader'.
struct uniperif *uni_reader);
^
sound/soc/sti/uniperif_reader.c:411:24: note: Function
'uni_reader_init' argument 2 names different: declaration 'uni_reader'
definition 'reader'.
struct uniperif *reader)
^

Signed-off-by: Pierre-Louis Bossart <[email protected]>
---
sound/soc/sti/uniperif.h | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/sound/soc/sti/uniperif.h b/sound/soc/sti/uniperif.h
index a16adeb7c1e9..2a5de328501c 100644
--- a/sound/soc/sti/uniperif.h
+++ b/sound/soc/sti/uniperif.h
@@ -1372,12 +1372,12 @@ static __maybe_unused const struct snd_pcm_hardware uni_tdm_hw = {

/* uniperiph player*/
int uni_player_init(struct platform_device *pdev,
- struct uniperif *uni_player);
+ struct uniperif *player);
int uni_player_resume(struct uniperif *player);

/* uniperiph reader */
int uni_reader_init(struct platform_device *pdev,
- struct uniperif *uni_reader);
+ struct uniperif *reader);

/* common */
int sti_uniperiph_dai_set_fmt(struct snd_soc_dai *dai,
--
2.25.1

2021-03-26 22:01:55

by Pierre-Louis Bossart

[permalink] [raw]
Subject: [PATCH 07/17] ASoC: pxa: remove useless assignment

cppcheck warning:

sound/soc/pxa/mmp-pcm.c:207:10: style: Variable 'ret' is assigned a
value that is never used. [unreadVariable]
int ret = 0, stream;
^

Signed-off-by: Pierre-Louis Bossart <[email protected]>
---
sound/soc/pxa/mmp-pcm.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/sound/soc/pxa/mmp-pcm.c b/sound/soc/pxa/mmp-pcm.c
index 53fc49e32fbc..5d520e18e512 100644
--- a/sound/soc/pxa/mmp-pcm.c
+++ b/sound/soc/pxa/mmp-pcm.c
@@ -204,7 +204,7 @@ static int mmp_pcm_new(struct snd_soc_component *component,
{
struct snd_pcm_substream *substream;
struct snd_pcm *pcm = rtd->pcm;
- int ret = 0, stream;
+ int ret, stream;

for (stream = 0; stream < 2; stream++) {
substream = pcm->streams[stream].substream;
--
2.25.1

2021-03-26 22:01:55

by Pierre-Louis Bossart

[permalink] [raw]
Subject: [PATCH 10/17] ASoC: stm: stm32_adfsdm: fix snprintf format string

cppcheck warning:

sound/soc/stm/stm32_adfsdm.c:120:2: warning: %d in format
string (no. 1) requires 'int' but the argument type is 'unsigned
int'. [invalidPrintfArgType_sint]
snprintf(str_freq, sizeof(str_freq), "%d\n", freq);
^

Signed-off-by: Pierre-Louis Bossart <[email protected]>
---
sound/soc/stm/stm32_adfsdm.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/sound/soc/stm/stm32_adfsdm.c b/sound/soc/stm/stm32_adfsdm.c
index 47fae8dd20b4..e6078f50e508 100644
--- a/sound/soc/stm/stm32_adfsdm.c
+++ b/sound/soc/stm/stm32_adfsdm.c
@@ -117,7 +117,7 @@ static int stm32_adfsdm_set_sysclk(struct snd_soc_dai *dai, int clk_id,

/* Set IIO frequency if CODEC is master as clock comes from SPI_IN */

- snprintf(str_freq, sizeof(str_freq), "%d\n", freq);
+ snprintf(str_freq, sizeof(str_freq), "%u\n", freq);
size = iio_write_channel_ext_info(priv->iio_ch, "spi_clk_freq",
str_freq, sizeof(str_freq));
if (size != sizeof(str_freq)) {
--
2.25.1

2021-03-26 22:01:58

by Pierre-Louis Bossart

[permalink] [raw]
Subject: [PATCH 12/17] ASoC: tegra: tegra20_das: clarify expression

cppcheck warning:

sound/soc/tegra/tegra20_das.c:64:60: style: Boolean result is used in
bitwise operation. Clarify expression with
parentheses. [clarifyCondition]
reg = otherdap << TEGRA20_DAS_DAP_CTRL_SEL_DAP_CTRL_SEL_P |
^
sound/soc/tegra/tegra20_das.c:65:61: style: Boolean result is used in
bitwise operation. Clarify expression with
parentheses. [clarifyCondition]

!!sdata2rx << TEGRA20_DAS_DAP_CTRL_SEL_DAP_SDATA2_TX_RX_P |
^
sound/soc/tegra/tegra20_das.c:66:61: style: Boolean result is used in
bitwise operation. Clarify expression with
parentheses. [clarifyCondition]
!!sdata1rx << TEGRA20_DAS_DAP_CTRL_SEL_DAP_SDATA1_TX_RX_P |
^

Signed-off-by: Pierre-Louis Bossart <[email protected]>
---
sound/soc/tegra/tegra20_das.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/sound/soc/tegra/tegra20_das.c b/sound/soc/tegra/tegra20_das.c
index 79dba878d854..69c651274c12 100644
--- a/sound/soc/tegra/tegra20_das.c
+++ b/sound/soc/tegra/tegra20_das.c
@@ -61,10 +61,10 @@ int tegra20_das_connect_dap_to_dap(int dap, int otherdap, int master,

addr = TEGRA20_DAS_DAP_CTRL_SEL +
(dap * TEGRA20_DAS_DAP_CTRL_SEL_STRIDE);
- reg = otherdap << TEGRA20_DAS_DAP_CTRL_SEL_DAP_CTRL_SEL_P |
- !!sdata2rx << TEGRA20_DAS_DAP_CTRL_SEL_DAP_SDATA2_TX_RX_P |
- !!sdata1rx << TEGRA20_DAS_DAP_CTRL_SEL_DAP_SDATA1_TX_RX_P |
- !!master << TEGRA20_DAS_DAP_CTRL_SEL_DAP_MS_SEL_P;
+ reg = (otherdap << TEGRA20_DAS_DAP_CTRL_SEL_DAP_CTRL_SEL_P) |
+ (!!sdata2rx << TEGRA20_DAS_DAP_CTRL_SEL_DAP_SDATA2_TX_RX_P) |
+ (!!sdata1rx << TEGRA20_DAS_DAP_CTRL_SEL_DAP_SDATA1_TX_RX_P) |
+ (!!master << TEGRA20_DAS_DAP_CTRL_SEL_DAP_MS_SEL_P);

tegra20_das_write(addr, reg);

--
2.25.1

2021-03-26 22:02:06

by Pierre-Louis Bossart

[permalink] [raw]
Subject: [PATCH 11/17] ASoC: sunxi: sun8i-codec: clarify expression

cppcheck warning:

sound/soc/sunxi/sun8i-codec.c:488:28: style: Clarify calculation
precedence for '%' and '?'. [clarifyCalculation]
return sample_rate % 4000 ? 22579200 : 24576000;
^

Signed-off-by: Pierre-Louis Bossart <[email protected]>
---
sound/soc/sunxi/sun8i-codec.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/sound/soc/sunxi/sun8i-codec.c b/sound/soc/sunxi/sun8i-codec.c
index 460924fc173f..518bfb724a5b 100644
--- a/sound/soc/sunxi/sun8i-codec.c
+++ b/sound/soc/sunxi/sun8i-codec.c
@@ -485,7 +485,7 @@ static int sun8i_codec_get_lrck_div_order(unsigned int slots,

static unsigned int sun8i_codec_get_sysclk_rate(unsigned int sample_rate)
{
- return sample_rate % 4000 ? 22579200 : 24576000;
+ return (sample_rate % 4000) ? 22579200 : 24576000;
}

static int sun8i_codec_hw_params(struct snd_pcm_substream *substream,
--
2.25.1

2021-03-26 22:02:32

by Pierre-Louis Bossart

[permalink] [raw]
Subject: [PATCH 16/17] ASoC: ux500: mop500: rename shadowing variable

cppcheck warning:

sound/soc/ux500/mop500.c:143:23: style: Local variable 'mop500_card'
shadows outer variable [shadowVariable]

struct snd_soc_card *mop500_card = platform_get_drvdata(pdev);
^
sound/soc/ux500/mop500.c:54:28: note: Shadowed declaration
static struct snd_soc_card mop500_card = {
^
sound/soc/ux500/mop500.c:143:23: note: Shadow variable
struct snd_soc_card *mop500_card = platform_get_drvdata(pdev);
^

Signed-off-by: Pierre-Louis Bossart <[email protected]>
---
sound/soc/ux500/mop500.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/sound/soc/ux500/mop500.c b/sound/soc/ux500/mop500.c
index cdae1190b930..4f41bb0ab2b0 100644
--- a/sound/soc/ux500/mop500.c
+++ b/sound/soc/ux500/mop500.c
@@ -140,12 +140,12 @@ static int mop500_probe(struct platform_device *pdev)

static int mop500_remove(struct platform_device *pdev)
{
- struct snd_soc_card *mop500_card = platform_get_drvdata(pdev);
+ struct snd_soc_card *card = platform_get_drvdata(pdev);

pr_debug("%s: Enter.\n", __func__);

- snd_soc_unregister_card(mop500_card);
- mop500_ab8500_remove(mop500_card);
+ snd_soc_unregister_card(card);
+ mop500_ab8500_remove(card);
mop500_of_node_put();

return 0;
--
2.25.1

2021-03-26 22:02:32

by Pierre-Louis Bossart

[permalink] [raw]
Subject: [PATCH 15/17] ASoC: ti: omap-mcsp: remove duplicate test

cppcheck warning:

sound/soc/ti/omap-mcbsp.c:379:11: style: The if condition is the same
as the previous if condition [duplicateCondition]

if (mcbsp->irq) {
^
sound/soc/ti/omap-mcbsp.c:376:11: note: First condition
if (mcbsp->irq)
^
sound/soc/ti/omap-mcbsp.c:379:11: note: Second condition
if (mcbsp->irq) {
^

Keeping two separate tests was probably intentional for clarity, but
since this generates warnings we might as well make cppcheck happy so
that we have fewer warnings.

Signed-off-by: Pierre-Louis Bossart <[email protected]>
---
sound/soc/ti/omap-mcbsp.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/sound/soc/ti/omap-mcbsp.c b/sound/soc/ti/omap-mcbsp.c
index 6025b30bbe77..db47981768c5 100644
--- a/sound/soc/ti/omap-mcbsp.c
+++ b/sound/soc/ti/omap-mcbsp.c
@@ -373,10 +373,9 @@ static void omap_mcbsp_free(struct omap_mcbsp *mcbsp)
MCBSP_WRITE(mcbsp, WAKEUPEN, 0);

/* Disable interrupt requests */
- if (mcbsp->irq)
+ if (mcbsp->irq) {
MCBSP_WRITE(mcbsp, IRQEN, 0);

- if (mcbsp->irq) {
free_irq(mcbsp->irq, (void *)mcbsp);
} else {
free_irq(mcbsp->rx_irq, (void *)mcbsp);
--
2.25.1

2021-03-26 22:03:27

by Pierre-Louis Bossart

[permalink] [raw]
Subject: [PATCH 04/17] ASoC: bcm: cygnus_ssp: remove useless initialization

Cppcheck warning:

sound/soc/bcm/cygnus-ssp.c:1364:6: style: Redundant initialization for
'err'. The initialized value is overwritten before it is
read. [redundantInitialization]
err = devm_snd_soc_register_component(dev, &cygnus_ssp_component,
^
sound/soc/bcm/cygnus-ssp.c:1313:10: note: err is initialized
int err = -EINVAL;
^
sound/soc/bcm/cygnus-ssp.c:1364:6: note: err is overwritten
err = devm_snd_soc_register_component(dev, &cygnus_ssp_component,
^

Signed-off-by: Pierre-Louis Bossart <[email protected]>
---
sound/soc/bcm/cygnus-ssp.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/sound/soc/bcm/cygnus-ssp.c b/sound/soc/bcm/cygnus-ssp.c
index 6e634b448293..fea296b41a43 100644
--- a/sound/soc/bcm/cygnus-ssp.c
+++ b/sound/soc/bcm/cygnus-ssp.c
@@ -1310,7 +1310,7 @@ static int cygnus_ssp_probe(struct platform_device *pdev)
struct device_node *child_node;
struct resource *res;
struct cygnus_audio *cygaud;
- int err = -EINVAL;
+ int err;
int node_count;
int active_port_count;

--
2.25.1

2021-03-26 22:04:00

by Pierre-Louis Bossart

[permalink] [raw]
Subject: [PATCH 13/17] ASoC: tegra: tegra20_das: align function prototypes

cppcheck warnings:

sound/soc/tegra/tegra20_das.c:35:40: style:inconclusive: Function
'tegra20_das_connect_dap_to_dac' argument 1 names different:
declaration 'dap_id' definition 'dap'. [funcArgNamesDifferent]

int tegra20_das_connect_dap_to_dac(int dap, int dac)
^
sound/soc/tegra/tegra20_das.h:98:47: note: Function
'tegra20_das_connect_dap_to_dac' argument 1 names different:
declaration 'dap_id' definition 'dap'.
extern int tegra20_das_connect_dap_to_dac(int dap_id, int dac_sel);
^
sound/soc/tegra/tegra20_das.c:35:40: note: Function
'tegra20_das_connect_dap_to_dac' argument 1 names different:
declaration 'dap_id' definition 'dap'.
int tegra20_das_connect_dap_to_dac(int dap, int dac)
^
sound/soc/tegra/tegra20_das.c:35:49: style:inconclusive: Function
'tegra20_das_connect_dap_to_dac' argument 2 names different:
declaration 'dac_sel' definition 'dac'. [funcArgNamesDifferent]
int tegra20_das_connect_dap_to_dac(int dap, int dac)
^
sound/soc/tegra/tegra20_das.h:98:59: note: Function
'tegra20_das_connect_dap_to_dac' argument 2 names different:
declaration 'dac_sel' definition 'dac'.
extern int tegra20_das_connect_dap_to_dac(int dap_id, int dac_sel);
^
sound/soc/tegra/tegra20_das.c:35:49: note: Function 'tegra20_das_connect_dap_to_dac' argument 2 names different: declaration 'dac_sel' definition 'dac'.
int tegra20_das_connect_dap_to_dac(int dap, int dac)
^
sound/soc/tegra/tegra20_das.c:53:40: style:inconclusive: Function
'tegra20_das_connect_dap_to_dap' argument 1 names different:
declaration 'dap_id' definition 'dap'. [funcArgNamesDifferent]
int tegra20_das_connect_dap_to_dap(int dap, int otherdap, int master,
^
sound/soc/tegra/tegra20_das.h:108:47: note: Function
'tegra20_das_connect_dap_to_dap' argument 1 names different:
declaration 'dap_id' definition 'dap'.
extern int tegra20_das_connect_dap_to_dap(int dap_id, int other_dap_sel,
^
sound/soc/tegra/tegra20_das.c:53:40: note: Function
'tegra20_das_connect_dap_to_dap' argument 1 names different:
declaration 'dap_id' definition 'dap'.
int tegra20_das_connect_dap_to_dap(int dap, int otherdap, int master,
^
sound/soc/tegra/tegra20_das.c:53:49: style:inconclusive: Function
'tegra20_das_connect_dap_to_dap' argument 2 names different:
declaration 'other_dap_sel' definition
'otherdap'. [funcArgNamesDifferent]
int tegra20_das_connect_dap_to_dap(int dap, int otherdap, int master,
^
sound/soc/tegra/tegra20_das.h:108:59: note: Function
'tegra20_das_connect_dap_to_dap' argument 2 names different:
declaration 'other_dap_sel' definition 'otherdap'.
extern int tegra20_das_connect_dap_to_dap(int dap_id, int other_dap_sel,
^
sound/soc/tegra/tegra20_das.c:53:49: note: Function
'tegra20_das_connect_dap_to_dap' argument 2 names different:
declaration 'other_dap_sel' definition 'otherdap'.
int tegra20_das_connect_dap_to_dap(int dap, int otherdap, int master,
^
sound/soc/tegra/tegra20_das.c:75:40: style:inconclusive: Function
'tegra20_das_connect_dac_to_dap' argument 1 names different:
declaration 'dac_id' definition 'dac'. [funcArgNamesDifferent]
int tegra20_das_connect_dac_to_dap(int dac, int dap)
^
sound/soc/tegra/tegra20_das.h:118:47: note: Function
'tegra20_das_connect_dac_to_dap' argument 1 names different:
declaration 'dac_id' definition 'dac'.
extern int tegra20_das_connect_dac_to_dap(int dac_id, int dap_sel);
^
sound/soc/tegra/tegra20_das.c:75:40: note: Function
'tegra20_das_connect_dac_to_dap' argument 1 names different:
declaration 'dac_id' definition 'dac'.
int tegra20_das_connect_dac_to_dap(int dac, int dap)
^
sound/soc/tegra/tegra20_das.c:75:49: style:inconclusive: Function
'tegra20_das_connect_dac_to_dap' argument 2 names different:
declaration 'dap_sel' definition 'dap'. [funcArgNamesDifferent]
int tegra20_das_connect_dac_to_dap(int dac, int dap)
^
sound/soc/tegra/tegra20_das.h:118:59: note: Function
'tegra20_das_connect_dac_to_dap' argument 2 names different:
declaration 'dap_sel' definition 'dap'.
extern int tegra20_das_connect_dac_to_dap(int dac_id, int dap_sel);
^
sound/soc/tegra/tegra20_das.c:75:49: note: Function
'tegra20_das_connect_dac_to_dap' argument 2 names different:
declaration 'dap_sel' definition 'dap'.
int tegra20_das_connect_dac_to_dap(int dac, int dap)
^

Signed-off-by: Pierre-Louis Bossart <[email protected]>
---
sound/soc/tegra/tegra20_das.h | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/sound/soc/tegra/tegra20_das.h b/sound/soc/tegra/tegra20_das.h
index d22abc4d08e6..18e832ded73a 100644
--- a/sound/soc/tegra/tegra20_das.h
+++ b/sound/soc/tegra/tegra20_das.h
@@ -95,7 +95,7 @@ struct tegra20_das {
* dap_id: DAP to connect: TEGRA20_DAS_DAP_ID_*
* dac_sel: DAC to connect to: TEGRA20_DAS_DAP_SEL_DAC*
*/
-extern int tegra20_das_connect_dap_to_dac(int dap_id, int dac_sel);
+extern int tegra20_das_connect_dap_to_dac(int dap, int dac);

/*
* Connect a DAP to another DAP
@@ -105,7 +105,7 @@ extern int tegra20_das_connect_dap_to_dac(int dap_id, int dac_sel);
* sdata1rx: Is this DAP's SDATA1 pin RX (1) or TX (0)
* sdata2rx: Is this DAP's SDATA2 pin RX (1) or TX (0)
*/
-extern int tegra20_das_connect_dap_to_dap(int dap_id, int other_dap_sel,
+extern int tegra20_das_connect_dap_to_dap(int dap, int otherdap,
int master, int sdata1rx,
int sdata2rx);

@@ -115,6 +115,6 @@ extern int tegra20_das_connect_dap_to_dap(int dap_id, int other_dap_sel,
* dac_id: DAC ID to connect: TEGRA20_DAS_DAC_ID_*
* dap_sel: DAP to receive input from: TEGRA20_DAS_DAC_SEL_DAP*
*/
-extern int tegra20_das_connect_dac_to_dap(int dac_id, int dap_sel);
+extern int tegra20_das_connect_dac_to_dap(int dac, int dap);

#endif
--
2.25.1

2021-03-26 22:04:05

by Pierre-Louis Bossart

[permalink] [raw]
Subject: [PATCH 14/17] ASoC: ti: omap-abe-twl6040: remove useless assignment

cppcheck warning:

sound/soc/ti/omap-abe-twl6040.c:173:10: style: Variable 'ret' is
assigned a value that is never used. [unreadVariable]
int ret = 0;
^

Signed-off-by: Pierre-Louis Bossart <[email protected]>
---
sound/soc/ti/omap-abe-twl6040.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/sound/soc/ti/omap-abe-twl6040.c b/sound/soc/ti/omap-abe-twl6040.c
index 16ea039ff865..91cc9a4f44d7 100644
--- a/sound/soc/ti/omap-abe-twl6040.c
+++ b/sound/soc/ti/omap-abe-twl6040.c
@@ -170,7 +170,7 @@ static int omap_abe_twl6040_init(struct snd_soc_pcm_runtime *rtd)
struct snd_soc_card *card = rtd->card;
struct abe_twl6040 *priv = snd_soc_card_get_drvdata(card);
int hs_trim;
- int ret = 0;
+ int ret;

/*
* Configure McPDM offset cancellation based on the HSOTRIM value from
--
2.25.1

2021-03-26 22:04:59

by Pierre-Louis Bossart

[permalink] [raw]
Subject: [PATCH 17/17] ASoC: ux500: mop500: align function prototype

cppcheck warning:

sound/soc/ux500/mop500_ab8500.c:360:60: style:inconclusive: Function
'mop500_ab8500_machine_init' argument 1 names different: declaration
'runtime' definition 'rtd'. [funcArgNamesDifferent]

int mop500_ab8500_machine_init(struct snd_soc_pcm_runtime *rtd)
^
sound/soc/ux500/mop500_ab8500.h:16:60: note: Function
'mop500_ab8500_machine_init' argument 1 names different: declaration
'runtime' definition 'rtd'.
int mop500_ab8500_machine_init(struct snd_soc_pcm_runtime *runtime);
^
sound/soc/ux500/mop500_ab8500.c:360:60: note: Function
'mop500_ab8500_machine_init' argument 1 names different: declaration
'runtime' definition 'rtd'.
int mop500_ab8500_machine_init(struct snd_soc_pcm_runtime *rtd)
^

Signed-off-by: Pierre-Louis Bossart <[email protected]>
---
sound/soc/ux500/mop500_ab8500.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/sound/soc/ux500/mop500_ab8500.h b/sound/soc/ux500/mop500_ab8500.h
index 99cfd972ea7a..8138a4e9aaf5 100644
--- a/sound/soc/ux500/mop500_ab8500.h
+++ b/sound/soc/ux500/mop500_ab8500.h
@@ -13,7 +13,7 @@

extern struct snd_soc_ops mop500_ab8500_ops[];

-int mop500_ab8500_machine_init(struct snd_soc_pcm_runtime *runtime);
+int mop500_ab8500_machine_init(struct snd_soc_pcm_runtime *rtd);
void mop500_ab8500_remove(struct snd_soc_card *card);

#endif
--
2.25.1

2021-03-29 05:54:07

by Péter Ujfalusi

[permalink] [raw]
Subject: Re: [PATCH 14/17] ASoC: ti: omap-abe-twl6040: remove useless assignment



On 3/26/21 11:59 PM, Pierre-Louis Bossart wrote:
> cppcheck warning:
>
> sound/soc/ti/omap-abe-twl6040.c:173:10: style: Variable 'ret' is
> assigned a value that is never used. [unreadVariable]
> int ret = 0;
> ^

Thanks,
Acked-by: Peter Ujfalusi <[email protected]>

>
> Signed-off-by: Pierre-Louis Bossart <[email protected]>
> ---
> sound/soc/ti/omap-abe-twl6040.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/sound/soc/ti/omap-abe-twl6040.c b/sound/soc/ti/omap-abe-twl6040.c
> index 16ea039ff865..91cc9a4f44d7 100644
> --- a/sound/soc/ti/omap-abe-twl6040.c
> +++ b/sound/soc/ti/omap-abe-twl6040.c
> @@ -170,7 +170,7 @@ static int omap_abe_twl6040_init(struct snd_soc_pcm_runtime *rtd)
> struct snd_soc_card *card = rtd->card;
> struct abe_twl6040 *priv = snd_soc_card_get_drvdata(card);
> int hs_trim;
> - int ret = 0;
> + int ret;
>
> /*
> * Configure McPDM offset cancellation based on the HSOTRIM value from
>

--
Péter

2021-03-29 05:56:53

by Péter Ujfalusi

[permalink] [raw]
Subject: Re: [PATCH 15/17] ASoC: ti: omap-mcsp: remove duplicate test

Hi Pierre,

On 3/26/21 11:59 PM, Pierre-Louis Bossart wrote:
> cppcheck warning:
>
> sound/soc/ti/omap-mcbsp.c:379:11: style: The if condition is the same
> as the previous if condition [duplicateCondition]
>
> if (mcbsp->irq) {
> ^
> sound/soc/ti/omap-mcbsp.c:376:11: note: First condition
> if (mcbsp->irq)
> ^
> sound/soc/ti/omap-mcbsp.c:379:11: note: Second condition
> if (mcbsp->irq) {
> ^
>
> Keeping two separate tests was probably intentional for clarity, but
> since this generates warnings we might as well make cppcheck happy so
> that we have fewer warnings.

There might be other historical reasons why it ended up like this but
merging them does not make it less cleaner.

Acked-by: Peter Ujfalusi <[email protected]>

> Signed-off-by: Pierre-Louis Bossart <[email protected]>
> ---
> sound/soc/ti/omap-mcbsp.c | 3 +--
> 1 file changed, 1 insertion(+), 2 deletions(-)
>
> diff --git a/sound/soc/ti/omap-mcbsp.c b/sound/soc/ti/omap-mcbsp.c
> index 6025b30bbe77..db47981768c5 100644
> --- a/sound/soc/ti/omap-mcbsp.c
> +++ b/sound/soc/ti/omap-mcbsp.c
> @@ -373,10 +373,9 @@ static void omap_mcbsp_free(struct omap_mcbsp *mcbsp)
> MCBSP_WRITE(mcbsp, WAKEUPEN, 0);
>
> /* Disable interrupt requests */
> - if (mcbsp->irq)
> + if (mcbsp->irq) {
> MCBSP_WRITE(mcbsp, IRQEN, 0);
>
> - if (mcbsp->irq) {
> free_irq(mcbsp->irq, (void *)mcbsp);
> } else {
> free_irq(mcbsp->rx_irq, (void *)mcbsp);
>

--
Péter

2021-03-29 07:16:10

by Thierry Reding

[permalink] [raw]
Subject: Re: [PATCH 13/17] ASoC: tegra: tegra20_das: align function prototypes

On Fri, Mar 26, 2021 at 04:59:23PM -0500, Pierre-Louis Bossart wrote:
> cppcheck warnings:
>
> sound/soc/tegra/tegra20_das.c:35:40: style:inconclusive: Function
> 'tegra20_das_connect_dap_to_dac' argument 1 names different:
> declaration 'dap_id' definition 'dap'. [funcArgNamesDifferent]
>
> int tegra20_das_connect_dap_to_dac(int dap, int dac)
> ^
> sound/soc/tegra/tegra20_das.h:98:47: note: Function
> 'tegra20_das_connect_dap_to_dac' argument 1 names different:
> declaration 'dap_id' definition 'dap'.
> extern int tegra20_das_connect_dap_to_dac(int dap_id, int dac_sel);
> ^
> sound/soc/tegra/tegra20_das.c:35:40: note: Function
> 'tegra20_das_connect_dap_to_dac' argument 1 names different:
> declaration 'dap_id' definition 'dap'.
> int tegra20_das_connect_dap_to_dac(int dap, int dac)
> ^
> sound/soc/tegra/tegra20_das.c:35:49: style:inconclusive: Function
> 'tegra20_das_connect_dap_to_dac' argument 2 names different:
> declaration 'dac_sel' definition 'dac'. [funcArgNamesDifferent]
> int tegra20_das_connect_dap_to_dac(int dap, int dac)
> ^
> sound/soc/tegra/tegra20_das.h:98:59: note: Function
> 'tegra20_das_connect_dap_to_dac' argument 2 names different:
> declaration 'dac_sel' definition 'dac'.
> extern int tegra20_das_connect_dap_to_dac(int dap_id, int dac_sel);
> ^
> sound/soc/tegra/tegra20_das.c:35:49: note: Function 'tegra20_das_connect_dap_to_dac' argument 2 names different: declaration 'dac_sel' definition 'dac'.
> int tegra20_das_connect_dap_to_dac(int dap, int dac)
> ^
> sound/soc/tegra/tegra20_das.c:53:40: style:inconclusive: Function
> 'tegra20_das_connect_dap_to_dap' argument 1 names different:
> declaration 'dap_id' definition 'dap'. [funcArgNamesDifferent]
> int tegra20_das_connect_dap_to_dap(int dap, int otherdap, int master,
> ^
> sound/soc/tegra/tegra20_das.h:108:47: note: Function
> 'tegra20_das_connect_dap_to_dap' argument 1 names different:
> declaration 'dap_id' definition 'dap'.
> extern int tegra20_das_connect_dap_to_dap(int dap_id, int other_dap_sel,
> ^
> sound/soc/tegra/tegra20_das.c:53:40: note: Function
> 'tegra20_das_connect_dap_to_dap' argument 1 names different:
> declaration 'dap_id' definition 'dap'.
> int tegra20_das_connect_dap_to_dap(int dap, int otherdap, int master,
> ^
> sound/soc/tegra/tegra20_das.c:53:49: style:inconclusive: Function
> 'tegra20_das_connect_dap_to_dap' argument 2 names different:
> declaration 'other_dap_sel' definition
> 'otherdap'. [funcArgNamesDifferent]
> int tegra20_das_connect_dap_to_dap(int dap, int otherdap, int master,
> ^
> sound/soc/tegra/tegra20_das.h:108:59: note: Function
> 'tegra20_das_connect_dap_to_dap' argument 2 names different:
> declaration 'other_dap_sel' definition 'otherdap'.
> extern int tegra20_das_connect_dap_to_dap(int dap_id, int other_dap_sel,
> ^
> sound/soc/tegra/tegra20_das.c:53:49: note: Function
> 'tegra20_das_connect_dap_to_dap' argument 2 names different:
> declaration 'other_dap_sel' definition 'otherdap'.
> int tegra20_das_connect_dap_to_dap(int dap, int otherdap, int master,
> ^
> sound/soc/tegra/tegra20_das.c:75:40: style:inconclusive: Function
> 'tegra20_das_connect_dac_to_dap' argument 1 names different:
> declaration 'dac_id' definition 'dac'. [funcArgNamesDifferent]
> int tegra20_das_connect_dac_to_dap(int dac, int dap)
> ^
> sound/soc/tegra/tegra20_das.h:118:47: note: Function
> 'tegra20_das_connect_dac_to_dap' argument 1 names different:
> declaration 'dac_id' definition 'dac'.
> extern int tegra20_das_connect_dac_to_dap(int dac_id, int dap_sel);
> ^
> sound/soc/tegra/tegra20_das.c:75:40: note: Function
> 'tegra20_das_connect_dac_to_dap' argument 1 names different:
> declaration 'dac_id' definition 'dac'.
> int tegra20_das_connect_dac_to_dap(int dac, int dap)
> ^
> sound/soc/tegra/tegra20_das.c:75:49: style:inconclusive: Function
> 'tegra20_das_connect_dac_to_dap' argument 2 names different:
> declaration 'dap_sel' definition 'dap'. [funcArgNamesDifferent]
> int tegra20_das_connect_dac_to_dap(int dac, int dap)
> ^
> sound/soc/tegra/tegra20_das.h:118:59: note: Function
> 'tegra20_das_connect_dac_to_dap' argument 2 names different:
> declaration 'dap_sel' definition 'dap'.
> extern int tegra20_das_connect_dac_to_dap(int dac_id, int dap_sel);
> ^
> sound/soc/tegra/tegra20_das.c:75:49: note: Function
> 'tegra20_das_connect_dac_to_dap' argument 2 names different:
> declaration 'dap_sel' definition 'dap'.
> int tegra20_das_connect_dac_to_dap(int dac, int dap)
> ^
>
> Signed-off-by: Pierre-Louis Bossart <[email protected]>
> ---
> sound/soc/tegra/tegra20_das.h | 6 +++---
> 1 file changed, 3 insertions(+), 3 deletions(-)

Acked-by: Thierry Reding <[email protected]>


Attachments:
(No filename) (5.47 kB)
signature.asc (849.00 B)
Download all attachments

2021-03-29 07:17:58

by Thierry Reding

[permalink] [raw]
Subject: Re: [PATCH 12/17] ASoC: tegra: tegra20_das: clarify expression

On Fri, Mar 26, 2021 at 04:59:22PM -0500, Pierre-Louis Bossart wrote:
> cppcheck warning:
>
> sound/soc/tegra/tegra20_das.c:64:60: style: Boolean result is used in
> bitwise operation. Clarify expression with
> parentheses. [clarifyCondition]
> reg = otherdap << TEGRA20_DAS_DAP_CTRL_SEL_DAP_CTRL_SEL_P |
> ^
> sound/soc/tegra/tegra20_das.c:65:61: style: Boolean result is used in
> bitwise operation. Clarify expression with
> parentheses. [clarifyCondition]
>
> !!sdata2rx << TEGRA20_DAS_DAP_CTRL_SEL_DAP_SDATA2_TX_RX_P |
> ^
> sound/soc/tegra/tegra20_das.c:66:61: style: Boolean result is used in
> bitwise operation. Clarify expression with
> parentheses. [clarifyCondition]
> !!sdata1rx << TEGRA20_DAS_DAP_CTRL_SEL_DAP_SDATA1_TX_RX_P |
> ^
>
> Signed-off-by: Pierre-Louis Bossart <[email protected]>
> ---
> sound/soc/tegra/tegra20_das.c | 8 ++++----
> 1 file changed, 4 insertions(+), 4 deletions(-)

Acked-by: Thierry Reding <[email protected]>


Attachments:
(No filename) (1.16 kB)
signature.asc (849.00 B)
Download all attachments

2021-03-29 08:03:50

by Arnaud POULIQUEN

[permalink] [raw]
Subject: RE: [PATCH 09/17] ASoC: sti: uniperif: align function prototypes

Hi,

> -----Original Message-----
> From: Pierre-Louis Bossart <[email protected]>
> Sent: vendredi 26 mars 2021 22:59
> To: [email protected]
> Cc: [email protected]; [email protected]; [email protected]; Pierre-
> Louis Bossart <[email protected]>; Arnaud POULIQUEN
> <[email protected]>; Liam Girdwood <[email protected]>;
> Jaroslav Kysela <[email protected]>; Takashi Iwai <[email protected]>
> Subject: [PATCH 09/17] ASoC: sti: uniperif: align function prototypes
>
> cppcheck warning:
>
> sound/soc/sti/uniperif_player.c:1049:24: style:inconclusive: Function
> 'uni_player_init' argument 2 names different: declaration 'uni_player'
> definition 'player'. [funcArgNamesDifferent]
> struct uniperif *player)
> ^
> sound/soc/sti/uniperif.h:1375:24: note: Function 'uni_player_init'
> argument 2 names different: declaration 'uni_player' definition 'player'.
> struct uniperif *uni_player);
> ^
> sound/soc/sti/uniperif_player.c:1049:24: note: Function 'uni_player_init'
> argument 2 names different: declaration 'uni_player'
> definition 'player'.
> struct uniperif *player)
> ^
> sound/soc/sti/uniperif_reader.c:411:24: style:inconclusive: Function
> 'uni_reader_init' argument 2 names different: declaration 'uni_reader'
> definition 'reader'. [funcArgNamesDifferent]
> struct uniperif *reader)
> ^
> sound/soc/sti/uniperif.h:1380:24: note: Function 'uni_reader_init'
> argument 2 names different: declaration 'uni_reader' definition 'reader'.
> struct uniperif *uni_reader);
> ^
> sound/soc/sti/uniperif_reader.c:411:24: note: Function 'uni_reader_init'
> argument 2 names different: declaration 'uni_reader'
> definition 'reader'.
> struct uniperif *reader)
> ^
>
> Signed-off-by: Pierre-Louis Bossart <[email protected]>

Reviewed-by: Arnaud Pouliquen <[email protected]>

Thanks
Arnaud

> ---
> sound/soc/sti/uniperif.h | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/sound/soc/sti/uniperif.h b/sound/soc/sti/uniperif.h index
> a16adeb7c1e9..2a5de328501c 100644
> --- a/sound/soc/sti/uniperif.h
> +++ b/sound/soc/sti/uniperif.h
> @@ -1372,12 +1372,12 @@ static __maybe_unused const struct
> snd_pcm_hardware uni_tdm_hw = {
>
> /* uniperiph player*/
> int uni_player_init(struct platform_device *pdev,
> - struct uniperif *uni_player);
> + struct uniperif *player);
> int uni_player_resume(struct uniperif *player);
>
> /* uniperiph reader */
> int uni_reader_init(struct platform_device *pdev,
> - struct uniperif *uni_reader);
> + struct uniperif *reader);
>
> /* common */
> int sti_uniperiph_dai_set_fmt(struct snd_soc_dai *dai,
> --
> 2.25.1

2021-03-29 08:05:32

by Arnaud POULIQUEN

[permalink] [raw]
Subject: RE: [PATCH 08/17] ASoC: sti: sti_uniperif: add missing error check



> -----Original Message-----
> From: Pierre-Louis Bossart <[email protected]>
> Sent: vendredi 26 mars 2021 22:59
> To: [email protected]
> Cc: [email protected]; [email protected]; [email protected]; Pierre-
> Louis Bossart <[email protected]>; Arnaud POULIQUEN
> <[email protected]>; Liam Girdwood <[email protected]>;
> Jaroslav Kysela <[email protected]>; Takashi Iwai <[email protected]>
> Subject: [PATCH 08/17] ASoC: sti: sti_uniperif: add missing error check
>
> cppcheck warning:
>
> sound/soc/sti/sti_uniperif.c:490:6: style: Variable 'ret' is reassigned a value
> before the old one has been used. [redundantAssignment] ret =
> devm_snd_soc_register_component(&pdev->dev,
> ^
> sound/soc/sti/sti_uniperif.c:486:6: note: ret is assigned ret =
> sti_uniperiph_cpu_dai_of(node, priv);
> ^
> sound/soc/sti/sti_uniperif.c:490:6: note: ret is overwritten ret =
> devm_snd_soc_register_component(&pdev->dev,
> ^
>
> sti_uniperiph_cpu_dai_of() can return -EINVAL which seems like a good-enough
> reason to bail.
>
> Signed-off-by: Pierre-Louis Bossart <[email protected]>

Reviewed-by: Arnaud Pouliquen <[email protected]>

Thanks
Arnaud

> ---
> sound/soc/sti/sti_uniperif.c | 2 ++
> 1 file changed, 2 insertions(+)
>
> diff --git a/sound/soc/sti/sti_uniperif.c b/sound/soc/sti/sti_uniperif.c index
> 7b9169f04d6e..67315d9b352d 100644
> --- a/sound/soc/sti/sti_uniperif.c
> +++ b/sound/soc/sti/sti_uniperif.c
> @@ -484,6 +484,8 @@ static int sti_uniperiph_probe(struct platform_device
> *pdev)
> priv->pdev = pdev;
>
> ret = sti_uniperiph_cpu_dai_of(node, priv);
> + if (ret < 0)
> + return ret;
>
> dev_set_drvdata(&pdev->dev, priv);
>
> --
> 2.25.1

2021-03-29 08:21:34

by Maxime Ripard

[permalink] [raw]
Subject: Re: [PATCH 11/17] ASoC: sunxi: sun8i-codec: clarify expression

On Fri, Mar 26, 2021 at 04:59:21PM -0500, Pierre-Louis Bossart wrote:
> cppcheck warning:
>
> sound/soc/sunxi/sun8i-codec.c:488:28: style: Clarify calculation
> precedence for '%' and '?'. [clarifyCalculation]
> return sample_rate % 4000 ? 22579200 : 24576000;
> ^
>
> Signed-off-by: Pierre-Louis Bossart <[email protected]>

Acked-by: Maxime Ripard <[email protected]>

Thanks!
Maxime


Attachments:
(No filename) (449.00 B)
signature.asc (235.00 B)
Download all attachments

2021-04-01 10:30:59

by Mark Brown

[permalink] [raw]
Subject: Re: [PATCH 00/17] ASoC: remove cppcheck warnings for multiple SOCs

On Fri, 26 Mar 2021 16:59:10 -0500, Pierre-Louis Bossart wrote:
> Trivial cleanups to make cppcheck less verbose.
>
> There should be no functionality change, except for the 'sti_uniperif'
> patch where an error check was added.
>
> Pierre-Louis Bossart (17):
> ASoC: amd: renoir: acp3x-pdm-dma: remove unnecessary assignments
> ASoC: atmel: fix shadowed variable
> ASoC: atmel: atmel-i2s: remove useless initialization
> ASoC: bcm: cygnus_ssp: remove useless initialization
> ASoC: meson: axg-tdmin: remove useless assignment
> ASoC: meson: axg-tdmout: remove useless assignment
> ASoC: pxa: remove useless assignment
> ASoC: sti: sti_uniperif: add missing error check
> ASoC: sti: uniperif: align function prototypes
> ASoC: stm: stm32_adfsdm: fix snprintf format string
> ASoC: sunxi: sun8i-codec: clarify expression
> ASoC: tegra: tegra20_das: clarify expression
> ASoC: tegra: tegra20_das: align function prototypes
> ASoC: ti: omap-abe-twl6040: remove useless assignment
> ASoC: ti: omap-mcsp: remove duplicate test
> ASoC: ux500: mop500: rename shadowing variable
> ASoC: ux500: mop500: align function prototype
>
> [...]

Applied to

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

Thanks!

[01/17] ASoC: amd: renoir: acp3x-pdm-dma: remove unnecessary assignments
commit: 2711a2d993036f26837e459ffb7b0d45c36b92a2
[02/17] ASoC: atmel: fix shadowed variable
commit: 86f3c05534bed54342ef6912b9da1d75f6b8d902
[03/17] ASoC: atmel: atmel-i2s: remove useless initialization
commit: 6692dc07fa113939fc2c15d58dc3b27e28fc767c
[04/17] ASoC: bcm: cygnus_ssp: remove useless initialization
commit: ce36242046f272c7656f7b4c91ff7b4387f514b0
[05/17] ASoC: meson: axg-tdmin: remove useless assignment
commit: 84d0493f67b856e5909c18e15b7ce78391565057
[06/17] ASoC: meson: axg-tdmout: remove useless assignment
commit: 18efddee4f0a8820a4ba0215655bbafd479025bf
[07/17] ASoC: pxa: remove useless assignment
commit: 00a25480cca4a094765084964c753c8f28e0f6fd
[08/17] ASoC: sti: sti_uniperif: add missing error check
commit: bf2a6b44d5e56a12dde6438a2d092475e54d1923
[09/17] ASoC: sti: uniperif: align function prototypes
commit: 00a820086ddd8c6f3eeeca3a034d234cebf084ba
[10/17] ASoC: stm: stm32_adfsdm: fix snprintf format string
commit: 11033e51b31696fd7949f1abb558cba171ecf0f5
[11/17] ASoC: sunxi: sun8i-codec: clarify expression
commit: 54f78aebe803b12e06d49988be88d87823ca16ab
[12/17] ASoC: tegra: tegra20_das: clarify expression
commit: 1bc6d7a90b01e30123578761f5e70548ad894445
[13/17] ASoC: tegra: tegra20_das: align function prototypes
commit: 53567ebce407639e3657b5c232bd60970a66f82c
[14/17] ASoC: ti: omap-abe-twl6040: remove useless assignment
commit: 248d4dc9c3b8ced2cb274581d1c306e7ec617aec
[15/17] ASoC: ti: omap-mcsp: remove duplicate test
commit: 3d37b27fffb311c521d61144e57ea4d40e31ab9b
[16/17] ASoC: ux500: mop500: rename shadowing variable
commit: 5b920abeea03302e561b036181a6a5be4e53a584
[17/17] ASoC: ux500: mop500: align function prototype
commit: b4d09a01666fdcab8866f44b72f79e106f14a48d

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