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: 9421553 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 472A760512 for ; Thu, 10 Nov 2016 16:49:52 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 494E129772 for ; Thu, 10 Nov 2016 16:49:52 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 3B83F2977B; Thu, 10 Nov 2016 16:49:52 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id DC9E829772 for ; Thu, 10 Nov 2016 16:49:51 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S935289AbcKJQrc (ORCPT ); Thu, 10 Nov 2016 11:47:32 -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-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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(-) 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))