mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Ahmad Fatoum <a.fatoum@pengutronix.de>
To: barebox@lists.infradead.org
Cc: Ahmad Fatoum <a.fatoum@pengutronix.de>,
	ukl@pengutronix.de, sha@pengutronix.de
Subject: [PATCH master] mtd: nand-imx: fix passing pointer of wrong type on NAND_CMD_READOOB
Date: Fri, 13 Nov 2020 01:04:17 +0100	[thread overview]
Message-ID: <20201113000417.25478-1-a.fatoum@pengutronix.de> (raw)

copy_spare used to take a mtd_info, but since 5f605dc6168c ("mtd: nand:
Pass struct nand_chip around") it now takes a nand_chip.
3588d40c5385 ("mtd: nand-imx: repair reading the oob area") was drafted
in parallel and still passes a mtd_info. Their merge did not adjust
this, triggering a compiler warning and undefined behavior. Fix this.

Fixes: 7b1d8b4b3561 ("Merge branch 'for-next/mtd-nand'")
Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
---
 drivers/mtd/nand/nand_imx.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/mtd/nand/nand_imx.c b/drivers/mtd/nand/nand_imx.c
index 3d4082fe1851..0f20e9d394a0 100644
--- a/drivers/mtd/nand/nand_imx.c
+++ b/drivers/mtd/nand/nand_imx.c
@@ -1022,7 +1022,7 @@ static void imx_nand_command(struct nand_chip *chip, unsigned command,
 		 */
 		if (command == NAND_CMD_READOOB) {
 			host->send_page(host, NFC_OUTPUT);
-			copy_spare(mtd, 1, host->data_buf + mtd->writesize);
+			copy_spare(chip, 1, host->data_buf + mtd->writesize);
 		}
 
 		break;
-- 
2.28.0


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

             reply	other threads:[~2020-11-13  0:04 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-11-13  0:04 Ahmad Fatoum [this message]
2020-11-13  7:38 ` Sascha Hauer

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=20201113000417.25478-1-a.fatoum@pengutronix.de \
    --to=a.fatoum@pengutronix.de \
    --cc=barebox@lists.infradead.org \
    --cc=sha@pengutronix.de \
    --cc=ukl@pengutronix.de \
    /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