From: Andre Przywara <andre.przywara@arm.com>
To: Corentin Labbe <clabbe.montjoie@gmail.com>,
maxime.ripard@free-electrons.com, Chen-Yu Tsai <wens@csie.org>,
arnd@arndb.de
Cc: Herbert Xu <herbert@gondor.apana.org.au>,
"David S . Miller" <davem@davemloft.net>,
linux-sunxi@googlegroups.com,
linux-arm-kernel@lists.infradead.org,
linux-kernel@vger.kernel.org
Subject: [PATCH 1/2] crypto: sunxi-ss-cipher: promote variables to match types in min3() calls
Date: Thu, 7 Jan 2016 15:58:17 +0000 [thread overview]
Message-ID: <1452182298-4653-2-git-send-email-andre.przywara@arm.com> (raw)
In-Reply-To: <1452182298-4653-1-git-send-email-andre.przywara@arm.com>
The min3() macro expects all arguments to be of the same type (or
size at least).
Change the type of some local variables in sun4i-ss-cipher.c to
size_t to match the type used in some generic structures we
compare against.
That shouldn't change anything for 32-bit (as size_t is unsigned int
there anyway), but allows compilation for 64-bit architectures.
Signed-off-by: Andre Przywara <andre.przywara@arm.com>
---
drivers/crypto/sunxi-ss/sun4i-ss-cipher.c | 20 ++++++++++----------
1 file changed, 10 insertions(+), 10 deletions(-)
diff --git a/drivers/crypto/sunxi-ss/sun4i-ss-cipher.c b/drivers/crypto/sunxi-ss/sun4i-ss-cipher.c
index a19ee12..707f30f 100644
--- a/drivers/crypto/sunxi-ss/sun4i-ss-cipher.c
+++ b/drivers/crypto/sunxi-ss/sun4i-ss-cipher.c
@@ -25,13 +25,13 @@ static int sun4i_ss_opti_poll(struct ablkcipher_request *areq)
struct sun4i_cipher_req_ctx *ctx = ablkcipher_request_ctx(areq);
u32 mode = ctx->mode;
/* when activating SS, the default FIFO space is SS_RX_DEFAULT(32) */
- u32 rx_cnt = SS_RX_DEFAULT;
- u32 tx_cnt = 0;
+ size_t rx_cnt = SS_RX_DEFAULT;
+ size_t tx_cnt = 0;
u32 spaces;
u32 v;
int i, err = 0;
- unsigned int ileft = areq->nbytes;
- unsigned int oleft = areq->nbytes;
+ size_t ileft = areq->nbytes;
+ size_t oleft = areq->nbytes;
unsigned int todo;
struct sg_mapping_iter mi, mo;
unsigned int oi, oo; /* offset for in and out */
@@ -134,13 +134,13 @@ static int sun4i_ss_cipher_poll(struct ablkcipher_request *areq)
struct sun4i_cipher_req_ctx *ctx = ablkcipher_request_ctx(areq);
u32 mode = ctx->mode;
/* when activating SS, the default FIFO space is SS_RX_DEFAULT(32) */
- u32 rx_cnt = SS_RX_DEFAULT;
- u32 tx_cnt = 0;
+ size_t rx_cnt = SS_RX_DEFAULT;
+ size_t tx_cnt = 0;
u32 v;
u32 spaces;
int i, err = 0;
- unsigned int ileft = areq->nbytes;
- unsigned int oleft = areq->nbytes;
+ size_t ileft = areq->nbytes;
+ size_t oleft = areq->nbytes;
unsigned int todo;
struct sg_mapping_iter mi, mo;
unsigned int oi, oo; /* offset for in and out */
@@ -148,7 +148,7 @@ static int sun4i_ss_cipher_poll(struct ablkcipher_request *areq)
char bufo[4 * SS_TX_MAX]; /* buffer for linearize SG dst */
unsigned int ob = 0; /* offset in buf */
unsigned int obo = 0; /* offset in bufo*/
- unsigned int obl = 0; /* length of data in bufo */
+ size_t obl = 0; /* length of data in bufo */
if (areq->nbytes == 0)
return 0;
@@ -251,7 +251,7 @@ static int sun4i_ss_cipher_poll(struct ablkcipher_request *areq)
spaces = readl(ss->base + SS_FCSR);
rx_cnt = SS_RXFIFO_SPACES(spaces);
tx_cnt = SS_TXFIFO_SPACES(spaces);
- dev_dbg(ss->dev, "%x %u/%u %u/%u cnt=%u %u/%u %u/%u cnt=%u %u %u\n",
+ dev_dbg(ss->dev, "%x %u/%zu %zu/%u cnt=%zu %u/%zu %zu/%u cnt=%zu %u %u\n",
mode,
oi, mi.length, ileft, areq->nbytes, rx_cnt,
oo, mo.length, oleft, areq->nbytes, tx_cnt,
--
2.6.4
next prev parent reply other threads:[~2016-01-07 15:58 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-01-07 15:58 [PATCH 0/2] crypto: sunxi-ss: fix 64-bit compilation Andre Przywara
2016-01-07 15:58 ` Andre Przywara [this message]
2016-01-07 15:58 ` [PATCH 2/2] crypto: sunxi-ss-hash: promote variables to match types in min3() calls Andre Przywara
2016-01-08 9:59 ` [PATCH 0/2] crypto: sunxi-ss: fix 64-bit compilation Herbert Xu
2016-01-08 11:15 ` Andre Przywara
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=1452182298-4653-2-git-send-email-andre.przywara@arm.com \
--to=andre.przywara@arm.com \
--cc=arnd@arndb.de \
--cc=clabbe.montjoie@gmail.com \
--cc=davem@davemloft.net \
--cc=herbert@gondor.apana.org.au \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-sunxi@googlegroups.com \
--cc=maxime.ripard@free-electrons.com \
--cc=wens@csie.org \
/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®