From patchwork Thu Nov 10 16:44:51 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 101534 Delivered-To: patch@linaro.org Received: by 10.140.97.165 with SMTP id m34csp824490qge; Thu, 10 Nov 2016 08:47:54 -0800 (PST) X-Received: by 10.98.200.8 with SMTP id z8mr11510003pff.176.1478796473976; Thu, 10 Nov 2016 08:47:53 -0800 (PST) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id u75si5835968pfa.86.2016.11.10.08.47.53; Thu, 10 Nov 2016 08:47:53 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-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-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S964856AbcKJQrd (ORCPT + 27 others); Thu, 10 Nov 2016 11:47:33 -0500 Received: from mout.kundenserver.de ([212.227.126.135]:50439 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S935138AbcKJQrZ (ORCPT ); Thu, 10 Nov 2016 11:47:25 -0500 Received: from wuerfel.lan ([78.43.20.153]) by mrelayeu.kundenserver.de (mreue002 [212.227.15.129]) with ESMTPA (Nemesis) id 0Ll5ba-1cdO1O0g3a-00b6Kv; Thu, 10 Nov 2016 17:45:44 +0100 From: Arnd Bergmann To: Linus Torvalds Cc: Andrew Morton , Arnd Bergmann , Anna Schumaker , "David S. Miller" , Herbert Xu , Ilya Dryomov , Javier Martinez Canillas , Jiri Kosina , Jonathan Cameron , Ley Foon Tan , "Luis R . Rodriguez" , Martin Schwidefsky , Mauro Carvalho Chehab , Michal Marek , Russell King , Sean Young , Sebastian Ott , Trond Myklebust , x86@kernel.org, linux-kbuild@vger.kernel.org, linux-kernel@vger.kernel.org, linux-snps-arc@lists.infradead.org, nios2-dev@lists.rocketboards.org, linux-s390@vger.kernel.org, linux-crypto@vger.kernel.org, linux-media@vger.kernel.org, linux-nfs@vger.kernel.org Subject: [PATCH v2 08/11] crypto: aesni: shut up -Wmaybe-uninitialized warning Date: Thu, 10 Nov 2016 17:44:51 +0100 Message-Id: <20161110164454.293477-9-arnd@arndb.de> X-Mailer: git-send-email 2.9.0 In-Reply-To: <20161110164454.293477-1-arnd@arndb.de> References: <20161110164454.293477-1-arnd@arndb.de> MIME-Version: 1.0 X-Provags-ID: V03:K0:pMptUU8f/fXpnZ1y/GKWImJVxyL8T6QqhZTLuSbNRSbnlgxC3EX 1X3mLU9PhMSHNeCk0T0XCzYM5fLNe/sz7lWwQpUsGlkPTQUzk9xT/fZR5/0+8AMTTFkT1Z3 JwAKAfRcTbwtOZe0nm5z7xJMvd7eDT3N7vE0i3pw/YoGsQUo0jVzDNe2DdLfc5K+R9VSflw GjBc0XYi6YktrO/ah7IyA== X-UI-Out-Filterresults: notjunk:1; V01:K0:dZWCbpHHfVQ=:Bi731d0PgQ6glBTDHVvpym lzgrKKfWaOoNQSyx+WLaHXfGww3HW6XMJ7uyIEEY+KErZbbrqgJTnugaY+I4oY2OU/Jp7pZuy c3Xo971tJhBb75to7uvYLKBZ8g0aFcVr4dpkNlvrjYO8np0BQDuYYe9ZG4jw8CurkbTWWHnJ/ +7/aZFL6gVR800qNNO9zHRjjR9q5mkCdI9IKqnKvhA7zXfbWt4YG//nmN6gsBZWvN//6p5QJh Xkqrmmh2DbB5qlq0+Bj+8BolXtgKcMklubcafz5+YgAiGjhOVSw2pr5dpPawaaLBRJXAFGUL8 5NEk8mCBvNpTyTeAvGznENCuYftZ78MdjpPLxf9ScxOPxBjogtNJy5ge59+Hi6LjLZ+VSH0F7 x80C8mZ2hHcu3Af/595pgg+xdRRHqnf65kmTZkqIVab3JZEcyEQU6xJfKcVdzMbkiwBYE0oyL 8vf4RTYrYXzd8VPbyedMWhkKb7+bKbrFgs3R0tYtDyvMDtlI2xRBAAw3oPZVNn5B35bMcwnID 2g9DjUD88yIZlDgqSeirTbsnrzphDKctLvhjncSQjIUf7LyEazSWK7E0iGWJyeR0adCbwuECh HJaW3mem9EF0CXhB0Vp9PlPybe6ShSBxYdqv0iVHI+VvlzWqK3MLZRcWHQewBgCeS70hE7Eqn 6+KLYiB1U3re/YdGHwsK9mBR2LnkSZagLQqUHEykVz0myEWVXiUNGNgqpomqXzVNtVZ9Qxq7r 473ButSojgHfXqkA Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The rfc4106 encrypy/decrypt helper functions cause an annoying false-positive warning in allmodconfig if we turn on -Wmaybe-uninitialized warnings again: arch/x86/crypto/aesni-intel_glue.c: In function ‘helper_rfc4106_decrypt’: include/linux/scatterlist.h:67:31: warning: ‘dst_sg_walk.sg’ may be used uninitialized in this function [-Wmaybe-uninitialized] The problem seems to be that the compiler doesn't track the state of the 'one_entry_in_sg' variable across the kernel_fpu_begin/kernel_fpu_end section. This takes the easy way out by adding a bogus initialization, which should be harmless enough to get the patch into v4.9 so we can turn on this warning again by default without producing useless output. A follow-up patch for v4.10 rearranges the code to make the warning go away. Signed-off-by: Arnd Bergmann --- arch/x86/crypto/aesni-intel_glue.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) -- 2.9.0 diff --git a/arch/x86/crypto/aesni-intel_glue.c b/arch/x86/crypto/aesni-intel_glue.c index 0ab5ee1..aa8b067 100644 --- a/arch/x86/crypto/aesni-intel_glue.c +++ b/arch/x86/crypto/aesni-intel_glue.c @@ -888,7 +888,7 @@ static int helper_rfc4106_encrypt(struct aead_request *req) unsigned long auth_tag_len = crypto_aead_authsize(tfm); u8 iv[16] __attribute__ ((__aligned__(AESNI_ALIGN))); struct scatter_walk src_sg_walk; - struct scatter_walk dst_sg_walk; + struct scatter_walk dst_sg_walk = {}; unsigned int i; /* Assuming we are supporting rfc4106 64-bit extended */ @@ -968,7 +968,7 @@ static int helper_rfc4106_decrypt(struct aead_request *req) u8 iv[16] __attribute__ ((__aligned__(AESNI_ALIGN))); u8 authTag[16]; struct scatter_walk src_sg_walk; - struct scatter_walk dst_sg_walk; + struct scatter_walk dst_sg_walk = {}; unsigned int i; if (unlikely(req->assoclen != 16 && req->assoclen != 20))