[<prev] [next>] [day] [month] [year] [list]
Message-ID: <CAFLxGvzFDPBGY1uoB7vqJreOSfs9N2PGMDTbQ24PYBWBRVR4oQ@mail.gmail.com>
Date: Sun, 24 Jan 2021 21:14:32 +0100
From: Richard Weinberger <richard.weinberger@...il.com>
To: Christophe Jaillet <christophe.jaillet@...adoo.fr>
Cc: linux-mtd@...ts.infradead.org,
Vignesh Raghavendra <vigneshr@...com>,
Martin Blumenstingl <martin.blumenstingl@...glemail.com>,
Richard Weinberger <richard@....at>,
kernel-janitors@...r.kernel.org,
LKML <linux-kernel@...r.kernel.org>,
Ramuthevar Vadivel Murugan
<vadivel.muruganx.ramuthevar@...ux.intel.com>,
Miquel Raynal <miquel.raynal@...tlin.com>
Subject: Re: [PATCH] mtd: rawnand: Fix an error handling path in 'ebu_dma_start()'
On Sun, Jan 24, 2021 at 9:13 PM Markus Elfring <Markus.Elfring@....de> wrote:
>
> > If 'dmaengine_prep_slave_single()' fails, we must undo a previous
> > 'dma_map_single()' call, as already done in all the other error handling
> > paths of this function.
>
> Would you ever like to use an imperative wording for the change description?
> https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/Documentation/process/submitting-patches.rst?id=fdbc80bdc4365078a0f7d65631171cb80e3ffd6e#n89
>
>
> …
> > +++ b/drivers/mtd/nand/raw/intel-nand-controller.c
> > @@ -318,8 +318,10 @@ static int ebu_dma_start(struct ebu_nand_controller *ebu_host, u32 dir,
> > }
> >
> > tx = dmaengine_prep_slave_single(chan, buf_dma, len, dir, flags);
> > - if (!tx)
> > - return -ENXIO;
> > + if (!tx) {
> > + ret = -ENXIO;
> > + goto err_unmap;
> > + }
> >
> > tx->callback = callback;
> …
>
> By the way:
> Can it be nicer to achieve the statement “ret = -EIO;” by a jump for
> a target like “e_io” so that less exception handling code would be duplicated
> for this function implementation?
Please feel free to ignore Markus.
https://lore.kernel.org/lkml/X+x3pIanr18Ep4ga@kroah.com/
--
Thanks,
//richard
Powered by blists - more mailing lists