Skip to contentSkip to conversation

crypto: caam - writel() arguments are swapped

PATCH In review Dan Carpenter 3 participants 3 messages Feb 21, 2014 – Feb 25, 2014

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 crypto: caam - writel() arguments are swapped

My guess is that this little endian configuration is never found in real life, but if it were then the writel() arguments are in the wrong order so the driver would crash immediately.

---
I can't compile this code.

drivers/crypto/caam/regs.h +2 -2
index d50174f45b21..cbde8b95a6f8 100644
@@ -74,10 +74,10 @@
 #endif
 #else
 #ifdef __LITTLE_ENDIAN
-#define wr_reg32(reg, data) __raw_writel(reg, data)
+#define wr_reg32(reg, data) __raw_writel(data, reg)
 #define rd_reg32(reg) __raw_readl(reg)
 #ifdef CONFIG_64BIT
-#define wr_reg64(reg, data) __raw_writeq(reg, data)
+#define wr_reg64(reg, data) __raw_writeq(data, reg)
 #define rd_reg64(reg) __raw_readq(reg)
 #endif
 #endif
Acked-by on v1 1/1
#1 lore raw
Quoted 2 lines · On Fri, 21 Feb 2014 11:51:31 +0300 Dan Carpenter <[email protected]>…

My guess is that this little endian configuration is never found in real life,

it is, but the code has not been upstreamed. Steve?

Quoted 5 lines

but if it were then the writel() arguments are in the wrong order so the driver would crash immediately.

---

Meanwhile:

Kim

maintainer
#2 lore raw
Quoted 11 lines · Kim Phillips
Quoted 2 lines · On Fri, 21 Feb 2014 11:51:31 +0300 Dan Carpenter <[email protected]>…

My guess is that this little endian configuration is never found in real life,

it is, but the code has not been upstreamed. Steve?

Quoted 3 lines

but if it were then the writel() arguments are in the wrong order so the driver would crash immediately.

Quoted 6 lines
Quoted 2 lines

---

Meanwhile:

Patch applied.

Signature · 3 lines
Email: Herbert Xu <[email protected]>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt