From patchwork Thu Aug 20 13:56:39 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Corentin Labbe X-Patchwork-Id: 509058 Return-Path: X-Original-To: incoming-imx@patchwork.ozlabs.org Delivered-To: patchwork-incoming-imx@bilbo.ozlabs.org Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2001:1868:205::9]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id D50D1140291 for ; Thu, 20 Aug 2015 23:59:58 +1000 (AEST) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b=ewIPZEqY; dkim-atps=neutral Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1ZSQL5-0004ro-7U; Thu, 20 Aug 2015 13:57:07 +0000 Received: from mail-wi0-x22c.google.com ([2a00:1450:400c:c05::22c]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1ZSQL2-0004qD-CR for linux-arm-kernel@lists.infradead.org; Thu, 20 Aug 2015 13:57:04 +0000 Received: by wijp15 with SMTP id p15so16947737wij.0 for ; Thu, 20 Aug 2015 06:56:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=subject:to:references:from:message-id:date:user-agent:mime-version :in-reply-to:content-type:content-transfer-encoding; bh=KUUSZq3xIM6WvmTyKbV20/bec9ZLSibdMajPi6M57qk=; b=ewIPZEqYTohceK8sHpKpuBVxGD7xyIN8qUfbLS4+06TDEJBTpVj7TpRiIgCLRE6Ptr mA4hrYTJzzUIA3KY+HKNgZKblHxh1vUADdgmhl0JB64WYrLTQH18sHNTPobHp/qSRIuW Zo9iVY1buYQzIOBy+KlgiBPxepDLZQf/cT5LVwcjEqxc1i0TIvECF/S04XCaSoK0FIfG D0M3/cdJEvHZ67NUpbCVcrGB9WlLEI1G5gZULN9vNReyXEV3ESY0epdOqGlc9B/GOder d1oAZW9+MMjpoJsV9s+ghdvM1rJvmqFcOgr7vOiT9hGT1DEfPA8OWXEznd6EeWvImPUx TQrw== X-Received: by 10.194.78.84 with SMTP id z20mr6380527wjw.141.1440079002009; Thu, 20 Aug 2015 06:56:42 -0700 (PDT) Received: from ?IPv6:2a01:240:fe00:142::2? (cl-323.mrs-01.fr.sixxs.net. [2a01:240:fe00:142::2]) by smtp.googlemail.com with ESMTPSA id j7sm5718754wjz.11.2015.08.20.06.56.40 (version=TLSv1/SSLv3 cipher=OTHER); Thu, 20 Aug 2015 06:56:41 -0700 (PDT) Subject: Re: un4i-ss-cipher.c warning To: Michal Suchanek , Herbert Xu , "David S. Miller" , Maxime Ripard , Linux Kernel Mailing List , linux-crypto@vger.kernel.org, "linux-arm-kernel@lists.infradead.org" References: From: Corentin LABBE Message-ID: <55D5DC97.1040209@gmail.com> Date: Thu, 20 Aug 2015 15:56:39 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.1.0 MIME-Version: 1.0 In-Reply-To: X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20150820_065704_569714_3B6CA33A X-CRM114-Status: GOOD ( 21.20 ) X-Spam-Score: -2.7 (--) X-Spam-Report: SpamAssassin version 3.4.0 on bombadil.infradead.org summary: Content analysis details: (-2.7 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at http://www.dnswl.org/, low trust [2a00:1450:400c:c05:0:0:0:22c listed in] [list.dnswl.org] 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (clabbe.montjoie[at]gmail.com) -0.0 SPF_PASS SPF: sender matches SPF record -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.20 Precedence: list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+incoming-imx=patchwork.ozlabs.org@lists.infradead.org List-Id: linux-imx-kernel.lists.patchwork.ozlabs.org On 19/08/2015 16:35, Michal Suchanek wrote: > Hello, > > when building a kernel with sunxi crypto driver as merged into the > sinxi-wip branch I get a compiler warning. > > I am not sure this is the latest version of the driver. It does not > seem to be in mainline yet. > > Thanks > > Michal > > In file included from /scratch/build/linux/include/linux/printk.h:277:0, > from /scratch/build/linux/include/linux/kernel.h:13, > from /scratch/build/linux/include/linux/clk.h:16, > from > /scratch/build/linux/drivers/crypto/sunxi-ss/sun4i-ss.h:15, > from > /scratch/build/linux/drivers/crypto/sunxi-ss/sun4i-ss-cipher.c:17: > /scratch/build/linux/drivers/crypto/sunxi-ss/sun4i-ss-cipher.c: In > function ‘sun4i_ss_cipher_poll’: > /scratch/build/linux/include/linux/dynamic_debug.h:86:3: warning: > ‘todo’ may be used uninitialized in this function > [-Wmaybe-uninitialized] > __dynamic_dev_dbg(&descriptor, dev, fmt, \ > ^ > /scratch/build/linux/drivers/crypto/sunxi-ss/sun4i-ss-cipher.c:144:15: > note: ‘todo’ was declared here > unsigned int todo; > Hello Thanks for the report, strange that I do not have that warning. todo is always initialized, since oleft and ileft are always > 0 at start. But setting todo to 0 is a simple fix. The following patch will suppress the warning. Regards -- >8 -- From 67f2d0749041b08c4c4ad671ab710b3b83f6dfd3 Mon Sep 17 00:00:00 2001 From: LABBE Corentin Date: Thu, 20 Aug 2015 12:18:46 +0200 Subject: [PATCH] crypto: sun4i-ss: suppress the todo uninitialized warning Signed-off-by: LABBE Corentin --- drivers/crypto/sunxi-ss/sun4i-ss-cipher.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/crypto/sunxi-ss/sun4i-ss-cipher.c b/drivers/crypto/sunxi-ss/sun4i-ss-cipher.c index e070c31..9299914 100644 --- a/drivers/crypto/sunxi-ss/sun4i-ss-cipher.c +++ b/drivers/crypto/sunxi-ss/sun4i-ss-cipher.c @@ -32,7 +32,7 @@ static int sun4i_ss_opti_poll(struct ablkcipher_request *areq) int i, err = 0; unsigned int ileft = areq->nbytes; unsigned int oleft = areq->nbytes; - unsigned int todo; + unsigned int todo = 0; struct sg_mapping_iter mi, mo; unsigned int oi, oo; /* offset for in and out */ @@ -141,7 +141,7 @@ static int sun4i_ss_cipher_poll(struct ablkcipher_request *areq) int i, err = 0; unsigned int ileft = areq->nbytes; unsigned int oleft = areq->nbytes; - unsigned int todo; + unsigned int todo = 0; struct sg_mapping_iter mi, mo; unsigned int oi, oo; /* offset for in and out */ char buf[4 * SS_RX_MAX];/* buffer for linearize SG src */