[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <edf69d41-1997-47fb-998d-014af3074713@foss.st.com>
Date: Tue, 18 Nov 2025 09:14:38 +0100
From: Amelie Delaunay <amelie.delaunay@...s.st.com>
To: Johan Hovold <johan@...nel.org>, Vinod Koul <vkoul@...nel.org>
CC: Ludovic Desroches <ludovic.desroches@...rochip.com>,
Viresh Kumar
<vireshk@...nel.org>,
Andy Shevchenko <andriy.shevchenko@...ux.intel.com>,
Vinicius Costa Gomes <vinicius.gomes@...el.com>,
Dave Jiang
<dave.jiang@...el.com>, Vladimir Zapolskiy <vz@...ia.com>,
Piotr Wojtaszczyk
<piotr.wojtaszczyk@...esys.com>,
Maxime Coquelin <mcoquelin.stm32@...il.com>,
Alexandre Torgue <alexandre.torgue@...s.st.com>,
Peter Ujfalusi
<peter.ujfalusi@...il.com>,
<dmaengine@...r.kernel.org>, <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH 11/15] dmaengine: stm32: dmamux: clean up route allocation
error labels
On 11/17/25 17:12, Johan Hovold wrote:
> Error labels should be named after what they do (and not after wherefrom
> they are jumped to).
>
> Signed-off-by: Johan Hovold <johan@...nel.org>
Reviewed-by: Amelie Delaunay <amelie.delaunay@...s.st.com>
> ---
> drivers/dma/stm32/stm32-dmamux.c | 9 ++++-----
> 1 file changed, 4 insertions(+), 5 deletions(-)
>
> diff --git a/drivers/dma/stm32/stm32-dmamux.c b/drivers/dma/stm32/stm32-dmamux.c
> index 2bd218dbabbb..db13498b9c9f 100644
> --- a/drivers/dma/stm32/stm32-dmamux.c
> +++ b/drivers/dma/stm32/stm32-dmamux.c
> @@ -118,7 +118,7 @@ static void *stm32_dmamux_route_allocate(struct of_phandle_args *dma_spec,
> spin_unlock_irqrestore(&dmamux->lock, flags);
> dev_err(&pdev->dev, "Run out of free DMA requests\n");
> ret = -ENOMEM;
> - goto error_chan_id;
> + goto err_free_mux;
> }
> set_bit(mux->chan_id, dmamux->dma_inuse);
> spin_unlock_irqrestore(&dmamux->lock, flags);
> @@ -135,7 +135,7 @@ static void *stm32_dmamux_route_allocate(struct of_phandle_args *dma_spec,
> dma_spec->np = of_parse_phandle(ofdma->of_node, "dma-masters", i - 1);
> if (!dma_spec->np) {
> dev_err(&pdev->dev, "can't get dma master\n");
> - goto error;
> + goto err_clear_inuse;
> }
>
> /* Set dma request */
> @@ -167,10 +167,9 @@ static void *stm32_dmamux_route_allocate(struct of_phandle_args *dma_spec,
>
> err_put_dma_spec_np:
> of_node_put(dma_spec->np);
> -error:
> +err_clear_inuse:
> clear_bit(mux->chan_id, dmamux->dma_inuse);
> -
> -error_chan_id:
> +err_free_mux:
> kfree(mux);
> err_put_pdev:
> put_device(&pdev->dev);
Powered by blists - more mailing lists