crypto: sunxi - don't print confusing data
authorArnd Bergmann <arnd@arndb.de>
Tue, 26 Jan 2016 13:44:50 +0000 (14:44 +0100)
committerHerbert Xu <herbert@gondor.apana.org.au>
Wed, 27 Jan 2016 12:36:26 +0000 (20:36 +0800)
gcc correctly warns that the printk output contains a variable that
it thinks is not initialized in some cases:

drivers/crypto/sunxi-ss/sun4i-ss-cipher.c: In function 'sun4i_ss_cipher_poll':
drivers/crypto/sunxi-ss/sun4i-ss-cipher.c:254:76: warning: 'todo' may be used uninitialized in this function [-Wmaybe-uninitialized]
drivers/crypto/sunxi-ss/sun4i-ss-cipher.c:144:15: note: 'todo' was declared here

A closer look at the function reveals that the variable is always
initialized at this point (ileft is guaranteed to be positive at the
start), but its contents are not well-defined:
Depending on some other variables, it might be either a count in
words or bytes, and it could refer to either input or output.

The easiest solution apparently is to remove the confusing output
and let the reader figure out the state from the other variables.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
drivers/crypto/sunxi-ss/sun4i-ss-cipher.c

index a19ee127edcafd3c70ad9e6ee8a86b1823f020f7..7be3fbcd8d78a6b5c0968a4b0846694313989d6b 100644 (file)
@@ -251,11 +251,10 @@ 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/%u %u/%u cnt=%u %u/%u %u/%u cnt=%u %u\n",
                        mode,
                        oi, mi.length, ileft, areq->nbytes, rx_cnt,
-                       oo, mo.length, oleft, areq->nbytes, tx_cnt,
-                       todo, ob);
+                       oo, mo.length, oleft, areq->nbytes, tx_cnt, ob);
 
                if (tx_cnt == 0)
                        continue;