From patchwork Tue Jan 26 13:44:50 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 101090 Delivered-To: patch@linaro.org Received: by 10.112.130.2 with SMTP id oa2csp1965963lbb; Tue, 26 Jan 2016 05:46:02 -0800 (PST) X-Received: by 10.98.75.143 with SMTP id d15mr34044264pfj.96.1453815961552; Tue, 26 Jan 2016 05:46:01 -0800 (PST) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id wk6si2161755pac.91.2016.01.26.05.46.01 for ; Tue, 26 Jan 2016 05:46:01 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-crypto-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-crypto-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S965169AbcAZNqA (ORCPT ); Tue, 26 Jan 2016 08:46:00 -0500 Received: from mout.kundenserver.de ([212.227.126.134]:53296 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S965130AbcAZNp7 (ORCPT ); Tue, 26 Jan 2016 08:45:59 -0500 Received: from wuerfel.lan. ([78.42.132.4]) by mrelayeu.kundenserver.de (mreue001) with ESMTPA (Nemesis) id 0LvcM8-1a3B1f3zbg-017YLp; Tue, 26 Jan 2016 14:45:12 +0100 From: Arnd Bergmann To: Herbert Xu Cc: linux-arm-kernel@lists.infradead.org, Arnd Bergmann , Corentin Labbe , "David S. Miller" , Maxime Ripard , Chen-Yu Tsai , linux-crypto@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v2 1/2] crypto: sunxi - don't print confusing data Date: Tue, 26 Jan 2016 14:44:50 +0100 Message-Id: <1453815902-3070323-1-git-send-email-arnd@arndb.de> X-Mailer: git-send-email 2.7.0 X-Provags-ID: V03:K0:l+xcr5w1lDWsIcKTLUFGrgEhxwth2zmIRRf6kE9FNI0JfcLe1B8 yFDc9+lOTdA53yvbBNTrSBCP4b+Nqom3KjX3c5w6pWYbUsfjTCBX7j4cmvMOmthZg9eua7N uX+ptJFvz9tPXd5z2lvNb5orfV8uf9znwx+yFlMqaKJogA498GvBEhcfDaeY24n9lRkvMfC x9d4CpjCIGiagB4QXP56Q== X-UI-Out-Filterresults: notjunk:1; V01:K0:rGaxsTCM4cI=:rZEYZiCx8ka8GeiV1qxzZG VSFkG7dUnn04VNZ1kyQBDza0qESQzQ0NTGgdlooYiSDxk383pKmMQglz2cf8+cM5fFWSfTIiJ 2zYhKGd5z3CbHxCEcDruEzjgr81k3SEe1NN+WtuIWtu2re2qID3GJmHM505TTh9u58cp0j8kF ApT7DKpOt9taI9TDiIMw1G0OgTOKf1Sslf+Sy5IhMMMI0zya3NnbXO96tqct/9buCUoKJX1wG zgXqbvV9zfbPViRLmZsc5kZ/ABKpSw5t+BkTflilrSGhnVzJOsgeZiu36Lr3YjQyT+rlAG5x7 wDfJdCuAAKACEx6p1959OzAk/Z9WZ0tw3Zw5EJagqdOlnotqBjwsUDj3DeaNPVgcfc5tN6avI WVnHOViH3Lwlh/REc2LRwJY+TsYQ55TzGAwzIFYki/hcXMSIDH7XMd+jSOtWXVyYpNDcJEzSl 1RoRHtYmYTrHjg637O34Uy38J7Y+YTEzAbxizz26M9YC/d+EpUsZh8Tn7Jlx+SwDMsUCxj3Kz 8mfVE7vNfQs6HspjuBg60of67H8j7Kwx0vydcO0Srawawudw9eCPAI9T2L984+SYEZlJc0AWx wK3vZu0icQKMTzVdjNRvnlg7iOmsCA8Om2rxySS6MkUwPQ7UWGdGQ8UbXlMIJ0MQDsUWXBB24 qV9bM4YnJUnOwxk206wixdBGKKA8KtxMr2+kN75tbqed24NIXIysNyS0qEvhKX/iSh3g= Sender: linux-crypto-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org 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 --- drivers/crypto/sunxi-ss/sun4i-ss-cipher.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) -- 2.7.0 -- To unsubscribe from this list: send the line "unsubscribe linux-crypto" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/drivers/crypto/sunxi-ss/sun4i-ss-cipher.c b/drivers/crypto/sunxi-ss/sun4i-ss-cipher.c index a19ee127edca..7be3fbcd8d78 100644 --- a/drivers/crypto/sunxi-ss/sun4i-ss-cipher.c +++ b/drivers/crypto/sunxi-ss/sun4i-ss-cipher.c @@ -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; From patchwork Tue Jan 26 13:47:10 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 101089 Delivered-To: patch@linaro.org Received: by 10.112.130.2 with SMTP id oa2csp1966906lbb; Tue, 26 Jan 2016 05:48:00 -0800 (PST) X-Received: by 10.98.16.65 with SMTP id y62mr34133748pfi.138.1453816080015; Tue, 26 Jan 2016 05:48:00 -0800 (PST) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id yu1si2216561pac.9.2016.01.26.05.47.59 for ; Tue, 26 Jan 2016 05:47:59 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-crypto-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-crypto-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S965533AbcAZNr6 (ORCPT ); Tue, 26 Jan 2016 08:47:58 -0500 Received: from mout.kundenserver.de ([217.72.192.73]:58791 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S965470AbcAZNr5 (ORCPT ); Tue, 26 Jan 2016 08:47:57 -0500 Received: from wuerfel.lan. ([78.42.132.4]) by mrelayeu.kundenserver.de (mreue103) with ESMTPA (Nemesis) id 0MDmuc-1aK9wa2bmQ-00H72c; Tue, 26 Jan 2016 14:47:22 +0100 From: Arnd Bergmann To: Herbert Xu Cc: linux-arm-kernel@lists.infradead.org, Arnd Bergmann , "David S. Miller" , linux-crypto@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v2 2/2] crypto: jitterentropy - always select CRYPTO_RNG Date: Tue, 26 Jan 2016 14:47:10 +0100 Message-Id: <1453816035-3070440-1-git-send-email-arnd@arndb.de> X-Mailer: git-send-email 2.7.0 In-Reply-To: <1453815902-3070323-1-git-send-email-arnd@arndb.de> References: <1453815902-3070323-1-git-send-email-arnd@arndb.de> X-Provags-ID: V03:K0:6WgmVxTbuxCFpWTkEs+8tadA2JPwL5DEus5NNEQkCjIMEWoaWWZ Stfl8jjO0FLbR9B9WWNCY0EwnMjDb92YE2m6XYF90S0sJqs5v7pF6Q0BA6B1CJLVa4KHo18 WdmyPOHdmB96OaQqSWS+tgr42DQ2Mciv7aTditkavHgS7uQ0toIysiczPSVunQRRLIwrHEN SfDecDq1Y9y1l7QiXYfsA== X-UI-Out-Filterresults: notjunk:1; V01:K0:ZekAv7P/Aic=:6v3FkqZG9oHIQagsVH70YT vUC7M/Vf8Djd2D5Utow0MnVWkRVkyhxiULqmDjk6NQsGIaJfHDc8EvBbqc7JMXuJOJkrF6IrB ruzDGy7TEdmTCnWwZARi/kiZ4D8i6IMqyIEjlgL0u8m2bAEs21cxMdavKYvZizfGwywG4iqcd TsHbWjpE2k877VfJp3RXmHGuvmDqVOotbD+oJwa+Iqfa+S0pw6KhVAlAlRbA576E6sw4ohjOT D63ZmKLOTKVZR8y1YlHD15W45G3WJp3sJEJn08dM8a0iEpLpCr7SEg6Z0+6ScO70dGcl/gFVN 9/RWZY2MJFCBxAVRls7oPBTsTa/m9zmrIaoWx/yrfh9VuD3ACmRTaU5uHhagj8ocdJwkKQHQX P9SjD3koEwW2b4SmV88fy6pJIQxMsTA4GPKw3QSYQVnTqHFaQqCi0n6OI9q0uCS1wPumH/hv5 9buMIBZL7kSV3ouEAwgac2gyqqR1h8J0EzstuI0hxVEeOjNkrlSHTZF/cULWTW8wNAUOBC7SY QbNS/+4trODE+SS8Fvzx69VbZOaa5+iYGa8WoDcTD91HZvowWahCUgD+GFtXR0VP8fi+wmNzD VPqEBBSpheInhVKxjC567OFYmEPU1MJzdOgJVfU0NpWBDNLu4Ddbb1gg9SIGpLiGh9LyZuUFl YwbrxuxksGDz5lwtDp4cdVYG2QHxSG+NynAz6tVbkOASu6vBA8AS/jOvH45D5oZdUkMw= Sender: linux-crypto-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org When building the jitterentropy driver by itself, we get a link error when CRYPTO_RNG is not enabled as well: crypto/built-in.o: In function `jent_mod_init': jitterentropy-kcapi.c:(.init.text+0x98): undefined reference to `crypto_register_rng' crypto/built-in.o: In function `jent_mod_exit': jitterentropy-kcapi.c:(.exit.text+0x60): undefined reference to `crypto_unregister_rng' This adds a 'select CRYPTO_RNG' to CRYPTO_JITTERENTROPY to ensure the API is always there when it's used, not just when DRBG is also enabled. CRYPTO_DRBG would set it implicitly through CRYPTO_JITTERENTROPY now, but this leaves it in place to make it explicit what the driver does. Signed-off-by: Arnd Bergmann --- crypto/Kconfig | 1 + 1 file changed, 1 insertion(+) -- 2.7.0 -- To unsubscribe from this list: send the line "unsubscribe linux-crypto" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/crypto/Kconfig b/crypto/Kconfig index 3be07ad1d80d..88248821af82 100644 --- a/crypto/Kconfig +++ b/crypto/Kconfig @@ -1595,6 +1595,7 @@ endif # if CRYPTO_DRBG_MENU config CRYPTO_JITTERENTROPY tristate "Jitterentropy Non-Deterministic Random Number Generator" + select CRYPTO_RNG help The Jitterentropy RNG is a noise that is intended to provide seed to another RNG. The RNG does not