From: Guenter Roeck <linux@roeck-us.net>
To: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: linux-kernel@vger.kernel.org, Nilesh Javali <njavali@marvell.com>,
Christoph Hellwig <hch@lst.de>,
Guenter Roeck <linux@roeck-us.net>,
Chris Leech <cleech@redhat.com>
Subject: [PATCH 3/3] uio_pruss: Fix build failure on 32 bit builds with 64 bit physaddr
Date: Sat, 23 Mar 2024 07:42:28 -0700 [thread overview]
Message-ID: <20240323144228.3924542-3-linux@roeck-us.net> (raw)
In-Reply-To: <20240323144228.3924542-1-linux@roeck-us.net>
Builds on 32-bit systems with 64 bit physical address fail with
drivers/uio/uio_pruss.c: In function 'pruss_probe':
drivers/uio/uio_pruss.c:194:34: error:
cast from pointer to integer of different size
The conversion itself is safe since sizeof(phys_addr_t) it in general equal
to or larger than sizeof(void *). Solve the problem by double-casting the
conversion.
Fixes: 7722151e4651 ("uio_pruss: UIO_MEM_DMA_COHERENT conversion")
Cc: Chris Leech <cleech@redhat.com>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
---
drivers/uio/uio_pruss.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/uio/uio_pruss.c b/drivers/uio/uio_pruss.c
index 72b33f7d4c40..b8fedb6b4f29 100644
--- a/drivers/uio/uio_pruss.c
+++ b/drivers/uio/uio_pruss.c
@@ -191,7 +191,7 @@ static int pruss_probe(struct platform_device *pdev)
p->mem[1].size = sram_pool_sz;
p->mem[1].memtype = UIO_MEM_PHYS;
- p->mem[2].addr = (phys_addr_t) gdev->ddr_vaddr;
+ p->mem[2].addr = (phys_addr_t)(unsigned long)gdev->ddr_vaddr;
p->mem[2].dma_addr = gdev->ddr_paddr;
p->mem[2].size = extram_pool_sz;
p->mem[2].memtype = UIO_MEM_DMA_COHERENT;
--
2.39.2
next prev parent reply other threads:[~2024-03-23 14:42 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-03-23 14:42 [PATCH 1/3] uio_dmem_genirq: " Guenter Roeck
2024-03-23 14:42 ` [PATCH 2/3] uio: " Guenter Roeck
2024-03-23 14:42 ` Guenter Roeck [this message]
2024-03-23 15:36 ` [PATCH 1/3] uio_dmem_genirq: " Greg Kroah-Hartman
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=20240323144228.3924542-3-linux@roeck-us.net \
--to=linux@roeck-us.net \
--cc=cleech@redhat.com \
--cc=gregkh@linuxfoundation.org \
--cc=hch@lst.de \
--cc=linux-kernel@vger.kernel.org \
--cc=njavali@marvell.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
all inboxes | Powered by JetHome®