mbox series

[0/6] ASoC: samsung: remove cppcheck warnings

Message ID 20210219230918.5058-1-pierre-louis.bossart@linux.intel.com
Headers show
Series ASoC: samsung: remove cppcheck warnings | expand

Message

Pierre-Louis Bossart Feb. 19, 2021, 11:09 p.m. UTC
No functional changes except for patch 2 and 3 where missing error
checks were added for consistency.

Pierre-Louis Bossart (6):
  ASoC: samsung: i2s: remove unassigned variable
  ASoC: samsung: s3c24xx_simtec: add missing error check
  ASoC: samsung: smdk_wm8994: add missing return
  ASoC: samsung: snow: remove useless test
  ASoC: samsung: tm2_wm5110: check of_parse return value
  ASoC: samsung: tm2_wm5510: remove shadowing variable

 sound/soc/samsung/i2s.c            | 3 +--
 sound/soc/samsung/s3c24xx_simtec.c | 5 +++++
 sound/soc/samsung/smdk_wm8994.c    | 1 +
 sound/soc/samsung/snow.c           | 5 +----
 sound/soc/samsung/tm2_wm5110.c     | 3 +--
 5 files changed, 9 insertions(+), 8 deletions(-)

Comments

Krzysztof Kozlowski Feb. 21, 2021, 10:53 a.m. UTC | #1
On Fri, Feb 19, 2021 at 05:09:13PM -0600, Pierre-Louis Bossart wrote:
> cppcheck warning:
> 
> sound/soc/samsung/i2s.c:1159:18: style: Variable 'dai' is not assigned
> a value. [unassignedVariable]
>  struct i2s_dai *dai;
>                  ^
> 
> This variable is only used for a sizeof(*dai).
> 
> Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
> ---
>  sound/soc/samsung/i2s.c | 3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)
> 

Reviewed-by: Krzysztof Kozlowski <krzk@kernel.org>

Best regards,
Krzysztof
Krzysztof Kozlowski Feb. 21, 2021, 10:59 a.m. UTC | #2
On Fri, Feb 19, 2021 at 05:09:15PM -0600, Pierre-Louis Bossart wrote:
> cppcheck warning:
> 
> sound/soc/samsung/smdk_wm8994.c:179:6: style: Variable 'ret' is
> reassigned a value before the old one has been
> used. [redundantAssignment]
>  ret = devm_snd_soc_register_card(&pdev->dev, card);
>      ^
> sound/soc/samsung/smdk_wm8994.c:166:8: note: ret is assigned
>    ret = -EINVAL;
>        ^
> sound/soc/samsung/smdk_wm8994.c:179:6: note: ret is overwritten
>  ret = devm_snd_soc_register_card(&pdev->dev, card);
>      ^
> 
> The initial authors bothered to set ret to -EINVAL and throw a
> dev_err() message, so it looks like there is a missing return to avoid
> continuing if the property is missing.

Good catch. It's a required property.

Reviewed-by: Krzysztof Kozlowski <krzk@kernel.org>

Best regards,
Krzysztof
Mark Brown Feb. 22, 2021, 4:07 p.m. UTC | #3
On Fri, 19 Feb 2021 17:09:12 -0600, Pierre-Louis Bossart wrote:
> No functional changes except for patch 2 and 3 where missing error
> checks were added for consistency.
> 
> Pierre-Louis Bossart (6):
>   ASoC: samsung: i2s: remove unassigned variable
>   ASoC: samsung: s3c24xx_simtec: add missing error check
>   ASoC: samsung: smdk_wm8994: add missing return
>   ASoC: samsung: snow: remove useless test
>   ASoC: samsung: tm2_wm5110: check of_parse return value
>   ASoC: samsung: tm2_wm5510: remove shadowing variable
> 
> [...]

Applied to

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

Thanks!

[5/6] ASoC: samsung: tm2_wm5110: check of_parse return value
      commit: 75fa6833aef349fce1b315eaa96c9611a227014b

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
Krzysztof Kozlowski Feb. 22, 2021, 5:31 p.m. UTC | #4
On Mon, 22 Feb 2021 at 17:08, Mark Brown <broonie@kernel.org> wrote:
>
> On Fri, 19 Feb 2021 17:09:12 -0600, Pierre-Louis Bossart wrote:
> > No functional changes except for patch 2 and 3 where missing error
> > checks were added for consistency.
> >
> > Pierre-Louis Bossart (6):
> >   ASoC: samsung: i2s: remove unassigned variable
> >   ASoC: samsung: s3c24xx_simtec: add missing error check
> >   ASoC: samsung: smdk_wm8994: add missing return
> >   ASoC: samsung: snow: remove useless test
> >   ASoC: samsung: tm2_wm5110: check of_parse return value
> >   ASoC: samsung: tm2_wm5510: remove shadowing variable
> >
> > [...]
>
> Applied to
>
>    https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git for-next
>
> Thanks!
>
> [5/6] ASoC: samsung: tm2_wm5110: check of_parse return value
>       commit: 75fa6833aef349fce1b315eaa96c9611a227014b

Hi Mark,

Hmmm, I had comments about this one so it should not have been
applied. The check if (ret || !args.np) is still not good (or
confusing) because args is an uninitialized stack value.

Best regards,
Krzysztof
Mark Brown Feb. 22, 2021, 8:19 p.m. UTC | #5
On Mon, Feb 22, 2021 at 06:31:15PM +0100, Krzysztof Kozlowski wrote:

> Hmmm, I had comments about this one so it should not have been
> applied. The check if (ret || !args.np) is still not good (or
> confusing) because args is an uninitialized stack value.

Ah, I saw the "this is actually a fix CC stable" bit, the bit saying
there were issues was hidden - it looked like you'd just not deleted
context.
On 20.02.2021 00:09, Pierre-Louis Bossart wrote:
> cppcheck warning:
> 
> sound/soc/samsung/tm2_wm5110.c:552:26: style: Local variable 'args'
> shadows outer variable [shadowVariable]
>   struct of_phandle_args args;

> it's not clear why there was a need for a local variable at a lower
> scope, remove it and share the same variable between scopes.

s/tm2_wm5510/tm2_wm5110

Reviewed-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Mark Brown March 1, 2021, 11:34 p.m. UTC | #7
On Fri, 19 Feb 2021 17:09:12 -0600, Pierre-Louis Bossart wrote:
> No functional changes except for patch 2 and 3 where missing error
> checks were added for consistency.
> 
> Pierre-Louis Bossart (6):
>   ASoC: samsung: i2s: remove unassigned variable
>   ASoC: samsung: s3c24xx_simtec: add missing error check
>   ASoC: samsung: smdk_wm8994: add missing return
>   ASoC: samsung: snow: remove useless test
>   ASoC: samsung: tm2_wm5110: check of_parse return value
>   ASoC: samsung: tm2_wm5510: remove shadowing variable
> 
> [...]

Applied to

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

Thanks!

[1/6] ASoC: samsung: i2s: remove unassigned variable
      commit: b832fa1ce0826a915a9e1fe533fc86a1cf5ae8cd
[2/6] ASoC: samsung: s3c24xx_simtec: add missing error check
      commit: feb45eb2ecafdfaca5b82f27997e717ae3c70323
[3/6] ASoC: samsung: smdk_wm8994: add missing return
      commit: 1e4a9fcffd56b73acf4e706465be2df261da83de
[4/6] ASoC: samsung: snow: remove useless test
      commit: 4ff97b8dc7e6a3c5caf733ebad4efaf018829142

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