mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Sascha Hauer <s.hauer@pengutronix.de>
To: Barebox List <barebox@lists.infradead.org>
Subject: [PATCH 05/15] ARM: i.MX: xload-gpmi: Fix compiler warning
Date: Mon, 17 May 2021 20:54:14 +0200	[thread overview]
Message-ID: <20210517185424.32145-6-s.hauer@pengutronix.de> (raw)
In-Reply-To: <20210517185424.32145-1-s.hauer@pengutronix.de>

'pdesc' is a pointer casted to a 32bit value. This rightfully issues a
compiler warning when being compiled with a 64bit toolchain. This code
is compiled on 64bit systems, but the hardware won't be used there.
Just silence the warning by casting the pointer to unsigned long.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
---
 arch/arm/mach-imx/xload-gpmi-nand.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/arch/arm/mach-imx/xload-gpmi-nand.c b/arch/arm/mach-imx/xload-gpmi-nand.c
index b3fd479cb4..deb7f4806e 100644
--- a/arch/arm/mach-imx/xload-gpmi-nand.c
+++ b/arch/arm/mach-imx/xload-gpmi-nand.c
@@ -111,14 +111,15 @@ static int mxs_dma_enable(struct mxs_dma_chan *pchan,
 	struct apbh_dma *apbh = pchan->apbh;
 	int channel_bit;
 	int channel = pchan->channel;
+	unsigned long pdesc32 = (unsigned long)pdesc;
 
 	if (apbh_dma_is_imx23(apbh)) {
-		writel((uint32_t)pdesc,
+		writel(pdesc32,
 			apbh->regs + HW_APBHX_CHn_NXTCMDAR_MX23(channel));
 		writel(1, apbh->regs + HW_APBHX_CHn_SEMA_MX23(channel));
 		channel_bit = channel + BP_APBH_CTRL0_CLKGATE_CHANNEL;
 	} else {
-		writel((uint32_t)pdesc,
+		writel(pdesc32,
 			apbh->regs + HW_APBHX_CHn_NXTCMDAR_MX28(channel));
 		writel(1, apbh->regs + HW_APBHX_CHn_SEMA_MX28(channel));
 		channel_bit = channel;
@@ -174,7 +175,7 @@ static int mxs_dma_run(struct mxs_dma_chan *pchan, struct mxs_dma_cmd *pdesc,
 
 	/* chain descriptors */
 	for (i = 0; i < num - 1; i++) {
-		pdesc[i].next = (uint32_t)(&pdesc[i + 1]);
+		pdesc[i].next = (unsigned long)(&pdesc[i + 1]);
 		pdesc[i].data |= DMACMD_CHAIN;
 	}
 
-- 
2.29.2


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


  parent reply	other threads:[~2021-05-17 18:55 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-05-17 18:54 [PATCH 00/15] Compiler warning fixes Sascha Hauer
2021-05-17 18:54 ` [PATCH 01/15] arm: friendlyarm-tiny210: Remove dead code Sascha Hauer
2021-05-17 18:54 ` [PATCH 02/15] ARM: socfpga: Fix timeout tests Sascha Hauer
2021-05-17 18:54 ` [PATCH 03/15] i.MX FCB: Fix error checking Sascha Hauer
2021-05-17 18:54 ` [PATCH 04/15] clk: tegra: Fix -Wtype-limits compiler warning Sascha Hauer
2021-05-17 18:54 ` Sascha Hauer [this message]
2021-05-17 18:54 ` [PATCH 06/15] mtd: cfi-flash: Fix " Sascha Hauer
2021-05-17 18:54 ` [PATCH 07/15] pci: mvebu: Fix wrong error check Sascha Hauer
2021-05-17 18:54 ` [PATCH 08/15] ARM: i.MX bbu-external-nand: Do not modify image Sascha Hauer
2021-05-17 18:54 ` [PATCH 09/15] ARM: layerscape: Fix wrong error check Sascha Hauer
2021-05-17 18:54 ` [PATCH 10/15] ARM: phytec-phycard-omap3: Fix checking of unsigned variable being negative Sascha Hauer
2021-05-17 18:54 ` [PATCH 11/15] scripts: zynq_mkimage: Make locally used function static Sascha Hauer
2021-05-17 18:54 ` [PATCH 12/15] ARM: module: Remove always false check Sascha Hauer
2021-05-17 18:54 ` [PATCH 13/15] aiodev: lm75: Handle unknown lm75 types Sascha Hauer
2021-05-17 18:54 ` [PATCH 14/15] clk: zynqmp: Fix wrong error check Sascha Hauer
2021-05-17 18:54 ` [PATCH 15/15] powerpc: law: use signed type to allow error checking 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=20210517185424.32145-6-s.hauer@pengutronix.de \
    --to=s.hauer@pengutronix.de \
    --cc=barebox@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox