diff mbox

[1/2] crypto: sahara: fix 64-bit dma_addr_t compilation

Message ID 1707164.bU6CqSGiie@wuerfel (mailing list archive)
State Accepted
Delegated to: Herbert Xu
Headers show

Commit Message

Arnd Bergmann Dec. 8, 2015, 3:23 p.m. UTC
The sahara hardware uses DMA descriptors with 32-bit addresses, but
dma_addr_t is variable size depending on whether we want to support
any devices that use 64-bit DMA addresses in hardware.
This means that the definition of the DMA descriptor structure is wrong,
and we helpfully get a compiler warning about them too:

drivers/crypto/sahara.c:423:372: warning: format '%x' expects argument of type 'unsigned int', but argument 4 has type 'dma_addr_t {aka long long unsigned int}' [-Wformat=]

This changes the definition of the sahara_hw_desc and sahara_hw_link
structures to only contain fixed-length members, which is required
to make the driver work on ARM LPAE mode, and avoids most of the
gcc warnings we get.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
 drivers/crypto/sahara.c | 18 +++++++++---------
 1 file changed, 9 insertions(+), 9 deletions(-)

Comments

Herbert Xu Dec. 11, 2015, 3 a.m. UTC | #1
On Tue, Dec 08, 2015 at 04:23:51PM +0100, Arnd Bergmann wrote:
> The sahara hardware uses DMA descriptors with 32-bit addresses, but
> dma_addr_t is variable size depending on whether we want to support
> any devices that use 64-bit DMA addresses in hardware.
> This means that the definition of the DMA descriptor structure is wrong,
> and we helpfully get a compiler warning about them too:
> 
> drivers/crypto/sahara.c:423:372: warning: format '%x' expects argument of type 'unsigned int', but argument 4 has type 'dma_addr_t {aka long long unsigned int}' [-Wformat=]
> 
> This changes the definition of the sahara_hw_desc and sahara_hw_link
> structures to only contain fixed-length members, which is required
> to make the driver work on ARM LPAE mode, and avoids most of the
> gcc warnings we get.
> 
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>

Both patches applied.  Thanks.
diff mbox

Patch

diff --git a/drivers/crypto/sahara.c b/drivers/crypto/sahara.c
index cc738f3592a3..38bf12ae5589 100644
--- a/drivers/crypto/sahara.c
+++ b/drivers/crypto/sahara.c
@@ -130,18 +130,18 @@ 
 #define SAHARA_REG_IDAR		0x20
 
 struct sahara_hw_desc {
-	u32		hdr;
-	u32		len1;
-	dma_addr_t	p1;
-	u32		len2;
-	dma_addr_t	p2;
-	dma_addr_t	next;
+	u32	hdr;
+	u32	len1;
+	u32	p1;
+	u32	len2;
+	u32	p2;
+	u32	next;
 };
 
 struct sahara_hw_link {
-	u32		len;
-	dma_addr_t	p;
-	dma_addr_t	next;
+	u32	len;
+	u32	p;
+	u32	next;
 };
 
 struct sahara_ctx {