Re: [PATCH v3 14/25] ASoC: renesas: rz-ssi: Use goto label names that specify their actions

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Claudiu,

On Wed, Nov 13, 2024 at 2:36 PM Claudiu <claudiu.beznea@xxxxxxxxx> wrote:
> From: Claudiu Beznea <claudiu.beznea.uj@xxxxxxxxxxxxxx>
>
> Use goto label names that specify their action. In this way we can have
> a better understanding of what is the action associated with the label
> by just reading the label name.
>
> Signed-off-by: Claudiu Beznea <claudiu.beznea.uj@xxxxxxxxxxxxxx>

Thanks for your patch!

Reviewed-by: Geert Uytterhoeven <geert+renesas@xxxxxxxxx>

> --- a/sound/soc/renesas/rz-ssi.c
> +++ b/sound/soc/renesas/rz-ssi.c
> @@ -1084,15 +1084,15 @@ static int rz_ssi_probe(struct platform_device *pdev)
>         /* Error Interrupt */
>         ssi->irq_int = platform_get_irq_byname(pdev, "int_req");
>         if (ssi->irq_int < 0) {
> -               rz_ssi_release_dma_channels(ssi);
> -               return ssi->irq_int;
> +               ret = ssi->irq_int;
> +               goto err_release_dma_chs;
>         }
>
>         ret = devm_request_irq(dev, ssi->irq_int, &rz_ssi_interrupt,
>                                0, dev_name(dev), ssi);
>         if (ret < 0) {
> -               rz_ssi_release_dma_channels(ssi);
> -               return dev_err_probe(dev, ret, "irq request error (int_req)\n");
> +               dev_err_probe(dev, ret, "irq request error (int_req)\n");
> +               goto err_release_dma_chs;
>         }
>
>         if (!rz_ssi_is_dma_enabled(ssi)) {

Inside this block there are several return statements.
As we know DMA is not available when we get here, these do not
need to call rz_ssi_release_dma_channels() hence do not use
"goto err_release_dma_chs".
However, this may be missed when making future changes.
So perhaps it may be prudent to make this safer, by moving this inside
the failure branch of the rz_ssi_dma_request() check above?

Gr{oetje,eeting}s,

                        Geert

-- 
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@xxxxxxxxxxxxxx

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds





[Index of Archives]     [Linux SPI]     [Linux Kernel]     [Linux ARM (vger)]     [Linux ARM MSM]     [Linux Omap]     [Linux Arm]     [Linux Tegra]     [Fedora ARM]     [Linux for Samsung SOC]     [eCos]     [Linux Fastboot]     [Gcc Help]     [Git]     [DCCP]     [IETF Announce]     [Security]     [Linux MIPS]     [Yosemite Campsites]

  Powered by Linux