mbox series

[v2,0/5] ASoC: codecs: lpass-rx-macro: Few code cleanups

Message ID 20240628-b4-qcom-audio-lpass-codec-cleanups-v2-0-e9741143e485@linaro.org
Headers show
Series ASoC: codecs: lpass-rx-macro: Few code cleanups | expand

Message

Krzysztof Kozlowski June 28, 2024, 10:10 a.m. UTC
Hi,

Changes in v2:
- Use cleanup.h instead of devm(), therefore not adding Dmitry's review.
- New patch #5.
- Link to v1: https://lore.kernel.org/r/20240627-b4-qcom-audio-lpass-codec-cleanups-v1-0-ede31891d238@linaro.org

Improve a bit the Qualcomm LPASS RX macro driver and align similar parts
of code with LPASS WSA macro driver for consistency.

No external dependencies.

Best regards,
Krzysztof

---
Krzysztof Kozlowski (5):
      ASoC: codecs: lpass-rx-macro: Simplify with cleanup.h
      ASoC: codecs: lpass-rx-macro: Keep static regmap_config as const
      ASoC: dapm: Use unsigned for number of widgets in snd_soc_dapm_new_controls()
      ASoC: codecs: lpass-rx-macro: Use unsigned for number of widgets
      ASoC: codecs: lpass-wsa-macro: Simplify with cleanup.h

 include/sound/soc-dapm.h           |  2 +-
 sound/soc/codecs/lpass-rx-macro.c  | 31 +++++++++++++++++++------------
 sound/soc/codecs/lpass-wsa-macro.c | 22 ++++++++++------------
 sound/soc/soc-dapm.c               |  2 +-
 4 files changed, 31 insertions(+), 26 deletions(-)
---
base-commit: feca1ff0cd5ab7bc3990ec5a387d81d4dff88068
change-id: 20240627-b4-qcom-audio-lpass-codec-cleanups-27175f1d069f

Best regards,

Comments

Krzysztof Kozlowski July 1, 2024, 6:29 a.m. UTC | #1
On 28/06/2024 12:10, Krzysztof Kozlowski wrote:
> Allocate the default register values array with scoped/cleanup.h to
> reduce number of error paths and make code a bit simpler.
> 
> Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
> 
> ---
> 
> Not adding Dmitry's Rb tag, because of major change devm->cleanup.h.
> ---
>  sound/soc/codecs/lpass-rx-macro.c | 11 +++++------
>  1 file changed, 5 insertions(+), 6 deletions(-)
> 
> diff --git a/sound/soc/codecs/lpass-rx-macro.c b/sound/soc/codecs/lpass-rx-macro.c
> index d47c49c90de3..4cf030760d74 100644
> --- a/sound/soc/codecs/lpass-rx-macro.c
> +++ b/sound/soc/codecs/lpass-rx-macro.c
> @@ -1,6 +1,7 @@
>  // SPDX-License-Identifier: GPL-2.0-only
>  // Copyright (c) 2018-2020, The Linux Foundation. All rights reserved.
>  
> +#include <linux/cleanup.h>
>  #include <linux/module.h>
>  #include <linux/init.h>
>  #include <linux/io.h>
> @@ -3764,7 +3765,6 @@ static const struct snd_soc_component_driver rx_macro_component_drv = {
>  
>  static int rx_macro_probe(struct platform_device *pdev)
>  {
> -	struct reg_default *reg_defaults;
>  	struct device *dev = &pdev->dev;
>  	kernel_ulong_t flags;
>  	struct rx_macro *rx;
> @@ -3809,6 +3809,8 @@ static int rx_macro_probe(struct platform_device *pdev)
>  		goto err;

I got now LKP report about build warning on clang (which I did not build
with).

note: jump bypasses initialization of variable with __attribute__((cleanup))

This needs new version.

Best regards,
Krzysztof