public inbox for linux-mtd@lists.infradead.org
 help / color / mirror / Atom feed
From: Markus Elfring <Markus.Elfring@web.de>
To: Christophe Jaillet <christophe.jaillet@wanadoo.fr>,
	linux-mtd@lists.infradead.org
Cc: Vignesh Raghavendra <vigneshr@ti.com>,
	Martin Blumenstingl <martin.blumenstingl@googlemail.com>,
	Richard Weinberger <richard@nod.at>,
	kernel-janitors@vger.kernel.org, linux-kernel@vger.kernel.org,
	Ramuthevar Vadivel Murugan
	<vadivel.muruganx.ramuthevar@linux.intel.com>,
	Miquel Raynal <miquel.raynal@bootlin.com>
Subject: Re: [PATCH] mtd: rawnand: Fix an error handling path in 'ebu_dma_start()'
Date: Sun, 24 Jan 2021 21:05:05 +0100	[thread overview]
Message-ID: <fe72d1d2-8222-5cda-74ff-9327725f196a@web.de> (raw)
In-Reply-To: <20210124073955.728797-1-christophe.jaillet@wanadoo.fr>

> 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?

Regards,
Markus

______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/

  reply	other threads:[~2021-01-24 20:07 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-01-24  7:39 [PATCH] mtd: rawnand: Fix an error handling path in 'ebu_dma_start()' Christophe JAILLET
2021-01-24 20:05 ` Markus Elfring [this message]
2021-01-24 20:14   ` Richard Weinberger
2021-01-27 12:48 ` Miquel Raynal

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=fe72d1d2-8222-5cda-74ff-9327725f196a@web.de \
    --to=markus.elfring@web.de \
    --cc=christophe.jaillet@wanadoo.fr \
    --cc=kernel-janitors@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mtd@lists.infradead.org \
    --cc=martin.blumenstingl@googlemail.com \
    --cc=miquel.raynal@bootlin.com \
    --cc=richard@nod.at \
    --cc=vadivel.muruganx.ramuthevar@linux.intel.com \
    --cc=vigneshr@ti.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox