All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/3] ASoC: codecs: cppcheck warnings
@ 2021-08-04 19:24 Pierre-Louis Bossart
  2021-08-04 19:24 ` [PATCH 1/3] ASoC: max98090: remove duplicate status reads and useless assignmment Pierre-Louis Bossart
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: Pierre-Louis Bossart @ 2021-08-04 19:24 UTC (permalink / raw)
  To: alsa-devel; +Cc: tiwai, broonie, Pierre-Louis Bossart

Two minor corrections for return values, and one more important one
for max98090 where duplicate reads don't seem necessary.

Pierre-Louis Bossart (3):
  ASoC: max98090: remove duplicate status reads and useless assignmment
  ASoC: mt6359-accdet.c: remove useless assignments
  ASoC: wcd938x: simplify return value

 sound/soc/codecs/max98090.c      | 4 +---
 sound/soc/codecs/mt6359-accdet.c | 8 ++++----
 sound/soc/codecs/wcd938x.c       | 2 +-
 3 files changed, 6 insertions(+), 8 deletions(-)

-- 
2.25.1


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

* [PATCH 1/3] ASoC: max98090: remove duplicate status reads and useless assignmment
  2021-08-04 19:24 [PATCH 0/3] ASoC: codecs: cppcheck warnings Pierre-Louis Bossart
@ 2021-08-04 19:24 ` Pierre-Louis Bossart
  2021-08-04 19:24 ` [PATCH 2/3] ASoC: mt6359-accdet.c: remove useless assignments Pierre-Louis Bossart
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: Pierre-Louis Bossart @ 2021-08-04 19:24 UTC (permalink / raw)
  To: alsa-devel; +Cc: tiwai, broonie, Pierre-Louis Bossart

The logic for the jack detection has not changed since the first
commit for this driver. Remove a duplicate read and remove useless
assignment

sound/soc/codecs/max98090.c:2170:6: style: Variable 'reg' is
reassigned a value before the old one has been
used. [redundantAssignment]
 reg = snd_soc_component_read(component, M98090_REG_JACK_STATUS);
     ^

sound/soc/codecs/max98090.c:2161:7: note: reg is assigned
  reg = snd_soc_component_read(component, M98090_REG_JACK_STATUS);
      ^

sound/soc/codecs/max98090.c:2170:6: note: reg is overwritten
 reg = snd_soc_component_read(component, M98090_REG_JACK_STATUS);
     ^

sound/soc/codecs/max98090.c:2170:6: style: Variable 'reg' is
reassigned a value before the old one has been
used. [redundantAssignment]
 reg = snd_soc_component_read(component, M98090_REG_JACK_STATUS);
     ^

sound/soc/codecs/max98090.c:2167:7: note: reg is assigned
  reg = snd_soc_component_read(component, M98090_REG_JACK_STATUS);
      ^

sound/soc/codecs/max98090.c:2170:6: note: reg is overwritten
 reg = snd_soc_component_read(component, M98090_REG_JACK_STATUS);
     ^

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

diff --git a/sound/soc/codecs/max98090.c b/sound/soc/codecs/max98090.c
index bc30a1dc7530..b45ec35cd63c 100644
--- a/sound/soc/codecs/max98090.c
+++ b/sound/soc/codecs/max98090.c
@@ -2158,13 +2158,11 @@ static void max98090_jack_work(struct work_struct *work)
 
 		msleep(50);
 
-		reg = snd_soc_component_read(component, M98090_REG_JACK_STATUS);
+		snd_soc_component_read(component, M98090_REG_JACK_STATUS);
 
 		/* Weak pull up allows only insertion detection */
 		snd_soc_component_update_bits(component, M98090_REG_JACK_DETECT,
 			M98090_JDWK_MASK, M98090_JDWK_MASK);
-	} else {
-		reg = snd_soc_component_read(component, M98090_REG_JACK_STATUS);
 	}
 
 	reg = snd_soc_component_read(component, M98090_REG_JACK_STATUS);
-- 
2.25.1


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

* [PATCH 2/3] ASoC: mt6359-accdet.c: remove useless assignments
  2021-08-04 19:24 [PATCH 0/3] ASoC: codecs: cppcheck warnings Pierre-Louis Bossart
  2021-08-04 19:24 ` [PATCH 1/3] ASoC: max98090: remove duplicate status reads and useless assignmment Pierre-Louis Bossart
@ 2021-08-04 19:24 ` Pierre-Louis Bossart
  2021-08-04 19:24 ` [PATCH 3/3] ASoC: wcd938x: simplify return value Pierre-Louis Bossart
  2021-08-06  0:47 ` [PATCH 0/3] ASoC: codecs: cppcheck warnings Mark Brown
  3 siblings, 0 replies; 5+ messages in thread
From: Pierre-Louis Bossart @ 2021-08-04 19:24 UTC (permalink / raw)
  To: alsa-devel; +Cc: tiwai, broonie, Pierre-Louis Bossart

cppcheck warnings (and additional issue found by code inspection)

sound/soc/codecs/mt6359-accdet.c:464: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>
---
 sound/soc/codecs/mt6359-accdet.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/sound/soc/codecs/mt6359-accdet.c b/sound/soc/codecs/mt6359-accdet.c
index aec77f0ac3bb..6d3d170144a0 100644
--- a/sound/soc/codecs/mt6359-accdet.c
+++ b/sound/soc/codecs/mt6359-accdet.c
@@ -234,7 +234,7 @@ static void recover_eint_setting(struct mt6359_accdet *priv)
 
 static void mt6359_accdet_recover_jd_setting(struct mt6359_accdet *priv)
 {
-	int ret = 0;
+	int ret;
 	unsigned int value = 0;
 
 	regmap_update_bits(priv->regmap, ACCDET_IRQ_ADDR,
@@ -461,7 +461,7 @@ static irqreturn_t mt6359_accdet_irq(int irq, void *data)
 {
 	struct mt6359_accdet *priv = data;
 	unsigned int irq_val = 0, val = 0, value = 0;
-	int ret = 0;
+	int ret;
 
 	mutex_lock(&priv->res_lock);
 	regmap_read(priv->regmap, ACCDET_IRQ_ADDR, &irq_val);
@@ -551,7 +551,7 @@ static irqreturn_t mt6359_accdet_irq(int irq, void *data)
 
 static int mt6359_accdet_parse_dt(struct mt6359_accdet *priv)
 {
-	int ret = 0;
+	int ret;
 	struct device *dev = priv->dev;
 	struct device_node *node = NULL;
 	int pwm_deb[15] = {0};
@@ -926,7 +926,7 @@ static int mt6359_accdet_probe(struct platform_device *pdev)
 {
 	struct mt6359_accdet *priv;
 	struct mt6397_chip *mt6397 = dev_get_drvdata(pdev->dev.parent);
-	int ret = 0;
+	int ret;
 
 	dev_dbg(&pdev->dev, "%s(), dev name %s\n",
 		__func__, dev_name(&pdev->dev));
-- 
2.25.1


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

* [PATCH 3/3] ASoC: wcd938x: simplify return value
  2021-08-04 19:24 [PATCH 0/3] ASoC: codecs: cppcheck warnings Pierre-Louis Bossart
  2021-08-04 19:24 ` [PATCH 1/3] ASoC: max98090: remove duplicate status reads and useless assignmment Pierre-Louis Bossart
  2021-08-04 19:24 ` [PATCH 2/3] ASoC: mt6359-accdet.c: remove useless assignments Pierre-Louis Bossart
@ 2021-08-04 19:24 ` Pierre-Louis Bossart
  2021-08-06  0:47 ` [PATCH 0/3] ASoC: codecs: cppcheck warnings Mark Brown
  3 siblings, 0 replies; 5+ messages in thread
From: Pierre-Louis Bossart @ 2021-08-04 19:24 UTC (permalink / raw)
  To: alsa-devel; +Cc: tiwai, broonie, Pierre-Louis Bossart

cppcheck warning:

sound/soc/codecs/wcd938x.c:3701:9: warning: Identical condition and
return expression 'ret', return value is always 0
[identicalConditionAfterEarlyExit]

 return ret;
        ^
sound/soc/codecs/wcd938x.c:3691:6: note: If condition 'ret' is true,
        the function will return/exit
 if (ret)
     ^
sound/soc/codecs/wcd938x.c:3701:9: note: Returning identical expression 'ret'
 return ret;
        ^

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

diff --git a/sound/soc/codecs/wcd938x.c b/sound/soc/codecs/wcd938x.c
index dd69653ceec0..a1d03cfcf92d 100644
--- a/sound/soc/codecs/wcd938x.c
+++ b/sound/soc/codecs/wcd938x.c
@@ -3698,7 +3698,7 @@ static int wcd938x_probe(struct platform_device *pdev)
 	pm_runtime_enable(dev);
 	pm_runtime_idle(dev);
 
-	return ret;
+	return 0;
 }
 
 static int wcd938x_remove(struct platform_device *pdev)
-- 
2.25.1


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

* Re: [PATCH 0/3] ASoC: codecs: cppcheck warnings
  2021-08-04 19:24 [PATCH 0/3] ASoC: codecs: cppcheck warnings Pierre-Louis Bossart
                   ` (2 preceding siblings ...)
  2021-08-04 19:24 ` [PATCH 3/3] ASoC: wcd938x: simplify return value Pierre-Louis Bossart
@ 2021-08-06  0:47 ` Mark Brown
  3 siblings, 0 replies; 5+ messages in thread
From: Mark Brown @ 2021-08-06  0:47 UTC (permalink / raw)
  To: Pierre-Louis Bossart, alsa-devel; +Cc: tiwai, Mark Brown

On Wed, 4 Aug 2021 14:24:53 -0500, Pierre-Louis Bossart wrote:
> Two minor corrections for return values, and one more important one
> for max98090 where duplicate reads don't seem necessary.
> 
> Pierre-Louis Bossart (3):
>   ASoC: max98090: remove duplicate status reads and useless assignmment
>   ASoC: mt6359-accdet.c: remove useless assignments
>   ASoC: wcd938x: simplify return value
> 
> [...]

Applied to

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

Thanks!

[1/3] ASoC: max98090: remove duplicate status reads and useless assignmment
      commit: 221034aca4fdcf8a6552267d2d3aa6825fae29b1
[2/3] ASoC: mt6359-accdet.c: remove useless assignments
      commit: c18abd00333b8b4c6432f4a6789aa02e3b18fdc8
[3/3] ASoC: wcd938x: simplify return value
      commit: 8c62dbcb489aa038fcb9c73faa5c6b56f1f54902

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] 5+ messages in thread

end of thread, other threads:[~2021-08-06  0:50 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-08-04 19:24 [PATCH 0/3] ASoC: codecs: cppcheck warnings Pierre-Louis Bossart
2021-08-04 19:24 ` [PATCH 1/3] ASoC: max98090: remove duplicate status reads and useless assignmment Pierre-Louis Bossart
2021-08-04 19:24 ` [PATCH 2/3] ASoC: mt6359-accdet.c: remove useless assignments Pierre-Louis Bossart
2021-08-04 19:24 ` [PATCH 3/3] ASoC: wcd938x: simplify return value Pierre-Louis Bossart
2021-08-06  0:47 ` [PATCH 0/3] ASoC: codecs: cppcheck warnings 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.