2014-02-21 08:51:31

by Dan Carpenter

[permalink] [raw]
Subject: [patch] 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.

Signed-off-by: Dan Carpenter <[email protected]>
---
I can't compile this code.

diff --git a/drivers/crypto/caam/regs.h b/drivers/crypto/caam/regs.h
index d50174f45b21..cbde8b95a6f8 100644
--- a/drivers/crypto/caam/regs.h
+++ b/drivers/crypto/caam/regs.h
@@ -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


2014-02-25 00:46:59

by Kim Phillips

[permalink] [raw]
Subject: Re: [patch] crypto: caam - writel() arguments are swapped

On Fri, 21 Feb 2014 11:51:31 +0300
Dan Carpenter <[email protected]> wrote:

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

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

> but if it were then the writel() arguments are in the wrong order
> so the driver would crash immediately.
>
> Signed-off-by: Dan Carpenter <[email protected]>
> ---

Meanwhile:

Acked-by: Kim Phillips <[email protected]>

Kim

2014-02-25 12:19:16

by Herbert Xu

[permalink] [raw]
Subject: Re: [patch] crypto: caam - writel() arguments are swapped

On Mon, Feb 24, 2014 at 06:41:42PM -0600, Kim Phillips wrote:
> On Fri, 21 Feb 2014 11:51:31 +0300
> Dan Carpenter <[email protected]> wrote:
>
> > My guess is that this little endian configuration is never found in real
> > life,
>
> it is, but the code has not been upstreamed. Steve?
>
> > but if it were then the writel() arguments are in the wrong order
> > so the driver would crash immediately.
> >
> > Signed-off-by: Dan Carpenter <[email protected]>
> > ---
>
> Meanwhile:
>
> Acked-by: Kim Phillips <[email protected]>

Patch applied.
--
Email: Herbert Xu <[email protected]>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt