[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20191016114945.30451-1-ben.dooks@codethink.co.uk>
Date: Wed, 16 Oct 2019 12:49:45 +0100
From: "Ben Dooks (Codethink)" <ben.dooks@...ethink.co.uk>
To: linux-kernel@...ts.codethink.co.uk
Cc: "Ben Dooks (Codethink)" <ben.dooks@...ethink.co.uk>,
Antoine Tenart <antoine.tenart@...tlin.com>,
Herbert Xu <herbert@...dor.apana.org.au>,
"David S. Miller" <davem@...emloft.net>,
linux-crypto@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: [PATCH] crypto: inside-secure - fix type of buffer in eip197_write_firmware
In eip197_write_firmware() the firmware buffer is sent using
writel(be32_to_cpu(),,,) this produces a number of warnings.
Note, should this really be cpu_to_be32() ?
drivers/crypto/inside-secure/safexcel.c:306:17: warning: cast to restricted __be32
drivers/crypto/inside-secure/safexcel.c:306:17: warning: cast to restricted __be32
drivers/crypto/inside-secure/safexcel.c:306:17: warning: cast to restricted __be32
drivers/crypto/inside-secure/safexcel.c:306:17: warning: cast to restricted __be32
drivers/crypto/inside-secure/safexcel.c:306:17: warning: cast to restricted __be32
drivers/crypto/inside-secure/safexcel.c:306:17: warning: cast to restricted __be32
Signed-off-by: Ben Dooks <ben.dooks@...ethink.co.uk>
---
Cc: Antoine Tenart <antoine.tenart@...tlin.com>
Cc: Herbert Xu <herbert@...dor.apana.org.au>
Cc: "David S. Miller" <davem@...emloft.net>
Cc: linux-crypto@...r.kernel.org
Cc: linux-kernel@...r.kernel.org
---
drivers/crypto/inside-secure/safexcel.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/drivers/crypto/inside-secure/safexcel.c b/drivers/crypto/inside-secure/safexcel.c
index 223d1bfdc7e6..dd33f6dda295 100644
--- a/drivers/crypto/inside-secure/safexcel.c
+++ b/drivers/crypto/inside-secure/safexcel.c
@@ -298,13 +298,13 @@ static void eip197_init_firmware(struct safexcel_crypto_priv *priv)
static int eip197_write_firmware(struct safexcel_crypto_priv *priv,
const struct firmware *fw)
{
- const u32 *data = (const u32 *)fw->data;
+ const __be32 *data = (const __be32 *)fw->data;
int i;
/* Write the firmware */
- for (i = 0; i < fw->size / sizeof(u32); i++)
+ for (i = 0; i < fw->size / sizeof(__be32); i++)
writel(be32_to_cpu(data[i]),
- priv->base + EIP197_CLASSIFICATION_RAMS + i * sizeof(u32));
+ priv->base + EIP197_CLASSIFICATION_RAMS + i * sizeof(__be32));
/* Exclude final 2 NOPs from size */
return i - EIP197_FW_TERMINAL_NOPS;
--
2.23.0
Powered by blists - more mailing lists