All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Uwe Kleine-König" <u.kleine-koenig@pengutronix.de>
To: linux-mtd@lists.infradead.org
Cc: devicetree-discuss@lists.ozlabs.org,
	linux-arm-kernel@lists.infradead.org, kernel@pengutronix.de
Subject: [PATCH] mtd: mxc_nand: fix several sparse warnings about incorrect address space
Date: Tue, 24 Apr 2012 10:12:17 +0200	[thread overview]
Message-ID: <1335255137-13714-1-git-send-email-u.kleine-koenig@pengutronix.de> (raw)
In-Reply-To: <20120424081052.GG20039@pengutronix.de>

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
---
 drivers/mtd/nand/mxc_nand.c |   22 +++++++++++-----------
 1 file changed, 11 insertions(+), 11 deletions(-)

diff --git a/drivers/mtd/nand/mxc_nand.c b/drivers/mtd/nand/mxc_nand.c
index 1041bb1..ec5ba8b 100644
--- a/drivers/mtd/nand/mxc_nand.c
+++ b/drivers/mtd/nand/mxc_nand.c
@@ -181,8 +181,8 @@ struct mxc_nand_host {
 	struct nand_chip	nand;
 	struct device		*dev;
 
-	void			*spare0;
-	void			*main_area0;
+	void __iomem		*spare0;
+	void __iomem		*main_area0;
 
 	void __iomem		*base;
 	void __iomem		*regs;
@@ -519,7 +519,7 @@ static void send_read_id_v3(struct mxc_nand_host *host)
 
 	wait_op_done(host, true);
 
-	memcpy(host->data_buf, host->main_area0, 16);
+	memcpy_fromio(host->data_buf, host->main_area0, 16);
 }
 
 /* Request the NANDFC to perform a read of the NAND device ID. */
@@ -535,7 +535,7 @@ static void send_read_id_v1_v2(struct mxc_nand_host *host)
 	/* Wait for operation to complete */
 	wait_op_done(host, true);
 
-	memcpy(host->data_buf, host->main_area0, 16);
+	memcpy_fromio(host->data_buf, host->main_area0, 16);
 
 	if (this->options & NAND_BUSWIDTH_16) {
 		/* compress the ID info */
@@ -790,23 +790,23 @@ static void copy_spare(struct mtd_info *mtd, bool bfrom)
 	u16 i, j;
 	u16 n = mtd->writesize >> 9;
 	u8 *d = host->data_buf + mtd->writesize;
-	u8 *s = host->spare0;
+	u8 __iomem *s = host->spare0;
 	u16 t = host->devtype_data->spare_len;
 
 	j = (mtd->oobsize / n >> 1) << 1;
 
 	if (bfrom) {
 		for (i = 0; i < n - 1; i++)
-			memcpy(d + i * j, s + i * t, j);
+			memcpy_fromio(d + i * j, s + i * t, j);
 
 		/* the last section */
-		memcpy(d + i * j, s + i * t, mtd->oobsize - i * j);
+		memcpy_fromio(d + i * j, s + i * t, mtd->oobsize - i * j);
 	} else {
 		for (i = 0; i < n - 1; i++)
-			memcpy(&s[i * t], &d[i * j], j);
+			memcpy_toio(&s[i * t], &d[i * j], j);
 
 		/* the last section */
-		memcpy(&s[i * t], &d[i * j], mtd->oobsize - i * j);
+		memcpy_toio(&s[i * t], &d[i * j], mtd->oobsize - i * j);
 	}
 }
 
@@ -1070,7 +1070,7 @@ static void mxc_nand_command(struct mtd_info *mtd, unsigned command,
 
 		host->devtype_data->send_page(mtd, NFC_OUTPUT);
 
-		memcpy(host->data_buf, host->main_area0, mtd->writesize);
+		memcpy_fromio(host->data_buf, host->main_area0, mtd->writesize);
 		copy_spare(mtd, true);
 		break;
 
@@ -1086,7 +1086,7 @@ static void mxc_nand_command(struct mtd_info *mtd, unsigned command,
 		break;
 
 	case NAND_CMD_PAGEPROG:
-		memcpy(host->main_area0, host->data_buf, mtd->writesize);
+		memcpy_toio(host->main_area0, host->data_buf, mtd->writesize);
 		copy_spare(mtd, false);
 		host->devtype_data->send_page(mtd, NFC_INPUT);
 		host->devtype_data->send_cmd(host, command, true);
-- 
1.7.10


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

WARNING: multiple messages have this Message-ID (diff)
From: "Uwe Kleine-König" <u.kleine-koenig@pengutronix.de>
To: linux-mtd@lists.infradead.org
Cc: devicetree-discuss@lists.ozlabs.org,
	linux-arm-kernel@lists.infradead.org, kernel@pengutronix.de
Subject: [PATCH] mtd: mxc_nand: fix several sparse warnings about incorrect address space
Date: Tue, 24 Apr 2012 10:12:17 +0200	[thread overview]
Message-ID: <1335255137-13714-1-git-send-email-u.kleine-koenig@pengutronix.de> (raw)
In-Reply-To: <20120424081052.GG20039@pengutronix.de>

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
---
 drivers/mtd/nand/mxc_nand.c |   22 +++++++++++-----------
 1 file changed, 11 insertions(+), 11 deletions(-)

diff --git a/drivers/mtd/nand/mxc_nand.c b/drivers/mtd/nand/mxc_nand.c
index 1041bb1..ec5ba8b 100644
--- a/drivers/mtd/nand/mxc_nand.c
+++ b/drivers/mtd/nand/mxc_nand.c
@@ -181,8 +181,8 @@ struct mxc_nand_host {
 	struct nand_chip	nand;
 	struct device		*dev;
 
-	void			*spare0;
-	void			*main_area0;
+	void __iomem		*spare0;
+	void __iomem		*main_area0;
 
 	void __iomem		*base;
 	void __iomem		*regs;
@@ -519,7 +519,7 @@ static void send_read_id_v3(struct mxc_nand_host *host)
 
 	wait_op_done(host, true);
 
-	memcpy(host->data_buf, host->main_area0, 16);
+	memcpy_fromio(host->data_buf, host->main_area0, 16);
 }
 
 /* Request the NANDFC to perform a read of the NAND device ID. */
@@ -535,7 +535,7 @@ static void send_read_id_v1_v2(struct mxc_nand_host *host)
 	/* Wait for operation to complete */
 	wait_op_done(host, true);
 
-	memcpy(host->data_buf, host->main_area0, 16);
+	memcpy_fromio(host->data_buf, host->main_area0, 16);
 
 	if (this->options & NAND_BUSWIDTH_16) {
 		/* compress the ID info */
@@ -790,23 +790,23 @@ static void copy_spare(struct mtd_info *mtd, bool bfrom)
 	u16 i, j;
 	u16 n = mtd->writesize >> 9;
 	u8 *d = host->data_buf + mtd->writesize;
-	u8 *s = host->spare0;
+	u8 __iomem *s = host->spare0;
 	u16 t = host->devtype_data->spare_len;
 
 	j = (mtd->oobsize / n >> 1) << 1;
 
 	if (bfrom) {
 		for (i = 0; i < n - 1; i++)
-			memcpy(d + i * j, s + i * t, j);
+			memcpy_fromio(d + i * j, s + i * t, j);
 
 		/* the last section */
-		memcpy(d + i * j, s + i * t, mtd->oobsize - i * j);
+		memcpy_fromio(d + i * j, s + i * t, mtd->oobsize - i * j);
 	} else {
 		for (i = 0; i < n - 1; i++)
-			memcpy(&s[i * t], &d[i * j], j);
+			memcpy_toio(&s[i * t], &d[i * j], j);
 
 		/* the last section */
-		memcpy(&s[i * t], &d[i * j], mtd->oobsize - i * j);
+		memcpy_toio(&s[i * t], &d[i * j], mtd->oobsize - i * j);
 	}
 }
 
@@ -1070,7 +1070,7 @@ static void mxc_nand_command(struct mtd_info *mtd, unsigned command,
 
 		host->devtype_data->send_page(mtd, NFC_OUTPUT);
 
-		memcpy(host->data_buf, host->main_area0, mtd->writesize);
+		memcpy_fromio(host->data_buf, host->main_area0, mtd->writesize);
 		copy_spare(mtd, true);
 		break;
 
@@ -1086,7 +1086,7 @@ static void mxc_nand_command(struct mtd_info *mtd, unsigned command,
 		break;
 
 	case NAND_CMD_PAGEPROG:
-		memcpy(host->main_area0, host->data_buf, mtd->writesize);
+		memcpy_toio(host->main_area0, host->data_buf, mtd->writesize);
 		copy_spare(mtd, false);
 		host->devtype_data->send_page(mtd, NFC_INPUT);
 		host->devtype_data->send_cmd(host, command, true);
-- 
1.7.10

WARNING: multiple messages have this Message-ID (diff)
From: u.kleine-koenig@pengutronix.de (Uwe Kleine-König)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH] mtd: mxc_nand: fix several sparse warnings about incorrect address space
Date: Tue, 24 Apr 2012 10:12:17 +0200	[thread overview]
Message-ID: <1335255137-13714-1-git-send-email-u.kleine-koenig@pengutronix.de> (raw)
In-Reply-To: <20120424081052.GG20039@pengutronix.de>

Signed-off-by: Uwe Kleine-K?nig <u.kleine-koenig@pengutronix.de>
---
 drivers/mtd/nand/mxc_nand.c |   22 +++++++++++-----------
 1 file changed, 11 insertions(+), 11 deletions(-)

diff --git a/drivers/mtd/nand/mxc_nand.c b/drivers/mtd/nand/mxc_nand.c
index 1041bb1..ec5ba8b 100644
--- a/drivers/mtd/nand/mxc_nand.c
+++ b/drivers/mtd/nand/mxc_nand.c
@@ -181,8 +181,8 @@ struct mxc_nand_host {
 	struct nand_chip	nand;
 	struct device		*dev;
 
-	void			*spare0;
-	void			*main_area0;
+	void __iomem		*spare0;
+	void __iomem		*main_area0;
 
 	void __iomem		*base;
 	void __iomem		*regs;
@@ -519,7 +519,7 @@ static void send_read_id_v3(struct mxc_nand_host *host)
 
 	wait_op_done(host, true);
 
-	memcpy(host->data_buf, host->main_area0, 16);
+	memcpy_fromio(host->data_buf, host->main_area0, 16);
 }
 
 /* Request the NANDFC to perform a read of the NAND device ID. */
@@ -535,7 +535,7 @@ static void send_read_id_v1_v2(struct mxc_nand_host *host)
 	/* Wait for operation to complete */
 	wait_op_done(host, true);
 
-	memcpy(host->data_buf, host->main_area0, 16);
+	memcpy_fromio(host->data_buf, host->main_area0, 16);
 
 	if (this->options & NAND_BUSWIDTH_16) {
 		/* compress the ID info */
@@ -790,23 +790,23 @@ static void copy_spare(struct mtd_info *mtd, bool bfrom)
 	u16 i, j;
 	u16 n = mtd->writesize >> 9;
 	u8 *d = host->data_buf + mtd->writesize;
-	u8 *s = host->spare0;
+	u8 __iomem *s = host->spare0;
 	u16 t = host->devtype_data->spare_len;
 
 	j = (mtd->oobsize / n >> 1) << 1;
 
 	if (bfrom) {
 		for (i = 0; i < n - 1; i++)
-			memcpy(d + i * j, s + i * t, j);
+			memcpy_fromio(d + i * j, s + i * t, j);
 
 		/* the last section */
-		memcpy(d + i * j, s + i * t, mtd->oobsize - i * j);
+		memcpy_fromio(d + i * j, s + i * t, mtd->oobsize - i * j);
 	} else {
 		for (i = 0; i < n - 1; i++)
-			memcpy(&s[i * t], &d[i * j], j);
+			memcpy_toio(&s[i * t], &d[i * j], j);
 
 		/* the last section */
-		memcpy(&s[i * t], &d[i * j], mtd->oobsize - i * j);
+		memcpy_toio(&s[i * t], &d[i * j], mtd->oobsize - i * j);
 	}
 }
 
@@ -1070,7 +1070,7 @@ static void mxc_nand_command(struct mtd_info *mtd, unsigned command,
 
 		host->devtype_data->send_page(mtd, NFC_OUTPUT);
 
-		memcpy(host->data_buf, host->main_area0, mtd->writesize);
+		memcpy_fromio(host->data_buf, host->main_area0, mtd->writesize);
 		copy_spare(mtd, true);
 		break;
 
@@ -1086,7 +1086,7 @@ static void mxc_nand_command(struct mtd_info *mtd, unsigned command,
 		break;
 
 	case NAND_CMD_PAGEPROG:
-		memcpy(host->main_area0, host->data_buf, mtd->writesize);
+		memcpy_toio(host->main_area0, host->data_buf, mtd->writesize);
 		copy_spare(mtd, false);
 		host->devtype_data->send_page(mtd, NFC_INPUT);
 		host->devtype_data->send_cmd(host, command, true);
-- 
1.7.10

  reply	other threads:[~2012-04-24  8:12 UTC|newest]

Thread overview: 51+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-04-23  9:22 [PATCH 00/10] allow mxc_nand to be probed via device tree Uwe Kleine-König
2012-04-23  9:22 ` Uwe Kleine-König
2012-04-23  9:22 ` Uwe Kleine-König
2012-04-23  9:23 ` [PATCH 04/10] mtd: mxc_nand: split some functions to get rid of more nfc_is_vX() Uwe Kleine-König
2012-04-23  9:23   ` Uwe Kleine-König
2012-04-23  9:23   ` Uwe Kleine-König
     [not found] ` <20120423092240.GA18013-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>
2012-04-23  9:23   ` [PATCH 01/10] mtd: mxc_nand: set owner field to prevent module unloading when in use Uwe Kleine-König
2012-04-23  9:23     ` Uwe Kleine-König
2012-04-23  9:23     ` Uwe Kleine-König
2012-04-23  9:23   ` [PATCH 02/10] mtd: mxc_nand: use a flag to detect if the mx21 quirk is necessary Uwe Kleine-König
2012-04-23  9:23     ` Uwe Kleine-König
2012-04-23  9:23     ` Uwe Kleine-König
2012-04-23  9:23   ` [PATCH 03/10] mtd: mxc_nand: move function pointers to a per-SOC struct Uwe Kleine-König
2012-04-23  9:23     ` Uwe Kleine-König
2012-04-23  9:23     ` Uwe Kleine-König
     [not found]     ` <1335173022-22371-3-git-send-email-u.kleine-koenig-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>
2012-04-24  7:24       ` Sascha Hauer
2012-04-24  7:24         ` Sascha Hauer
2012-04-24  7:24         ` Sascha Hauer
     [not found]         ` <20120424072457.GL3852-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>
2012-04-24  8:10           ` Uwe Kleine-König
2012-04-24  8:10             ` Uwe Kleine-König
2012-04-24  8:10             ` Uwe Kleine-König
2012-04-24  8:12             ` Uwe Kleine-König [this message]
2012-04-24  8:12               ` [PATCH] mtd: mxc_nand: fix several sparse warnings about incorrect address space Uwe Kleine-König
2012-04-24  8:12               ` Uwe Kleine-König
2012-04-23  9:23   ` [PATCH 05/10] mtd: mxc_nand: put ecc layout into devtype structs Uwe Kleine-König
2012-04-23  9:23     ` Uwe Kleine-König
2012-04-23  9:23     ` Uwe Kleine-König
2012-04-23  9:23   ` [PATCH 06/10] mtd: mxc_nand: split chip_select function and put it into devtype struct Uwe Kleine-König
2012-04-23  9:23     ` Uwe Kleine-König
2012-04-23  9:23     ` Uwe Kleine-König
2012-04-23  9:23   ` [PATCH 07/10] mtd: mxc_nand: put callback for data correction " Uwe Kleine-König
2012-04-23  9:23     ` Uwe Kleine-König
2012-04-23  9:23     ` Uwe Kleine-König
2012-04-23  9:23   ` [PATCH 08/10] mtd: mxc_nand: put several more fields into devtype_data Uwe Kleine-König
2012-04-23  9:23     ` Uwe Kleine-König
2012-04-23  9:23     ` Uwe Kleine-König
2012-04-23  9:23   ` [PATCH 09/10] mtd: mxc_nand: implement device tree probing Uwe Kleine-König
2012-04-23  9:23     ` Uwe Kleine-König
2012-04-23  9:23     ` Uwe Kleine-König
2012-04-23  9:23   ` [PATCH 10/10] ARM: imx: add mxc_nand to imx27 device tree Uwe Kleine-König
2012-04-23  9:23     ` Uwe Kleine-König
2012-04-23  9:23     ` Uwe Kleine-König
2012-04-28 12:20   ` [PATCH 00/10] allow mxc_nand to be probed via " Artem Bityutskiy
2012-04-28 12:20     ` Artem Bityutskiy
2012-04-28 12:20     ` Artem Bityutskiy
2012-04-29  9:27     ` Uwe Kleine-König
2012-04-29  9:27       ` Uwe Kleine-König
2012-04-29  9:27       ` Uwe Kleine-König
     [not found]       ` <20120429092701.GS20039-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>
2012-04-29 11:10         ` Artem Bityutskiy
2012-04-29 11:10           ` Artem Bityutskiy
2012-04-29 11:10           ` Artem Bityutskiy

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=1335255137-13714-1-git-send-email-u.kleine-koenig@pengutronix.de \
    --to=u.kleine-koenig@pengutronix.de \
    --cc=devicetree-discuss@lists.ozlabs.org \
    --cc=kernel@pengutronix.de \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-mtd@lists.infradead.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.