From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-13.2 required=3.0 tests=DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED,DKIM_VALID,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, MENTIONS_GIT_HOSTING,SIGNED_OFF_BY,SPF_PASS,URIBL_BLOCKED,USER_AGENT_MUTT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id E802CC43381 for ; Wed, 20 Mar 2019 19:11:32 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id BF7ED2175B for ; Wed, 20 Mar 2019 19:11:32 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="vC/2YOUj"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="l0SRsq/N" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org BF7ED2175B Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=EfLIV9hl9FHVBk2sC6wGxaBCVeiuGZNlntg1Q1g2jao=; b=vC/2YOUjZkE4Wf RuWHAhPhK9oCSfMekihU6Nb6CzcW74XCQxQjtsjkpwgKAE5TjZqP4hkc4eRIBy/rd0XpXx0iCcP5J jg3uoFWkAGL4VUj0OhEKc3SO1+CXQ0nghDgGW/wyNbvBdLvsJnj6cGg3HLlAQAVTlwCl0eGZcB7/l niEgXbBghBuMFjP5jTjv3RTPZ7GzUQ8HRl2L/W90OA2vfP9WteoG/zGcBxaqoRDshhuM2xX/38Y/5 xwOM/f03GgTFSD09DNqNe18MeGGagrEEJOwAG5J3fpHjfmm4hU77vK68oChzg6ZHPu8uxr4yCtoQ+ 6csX53plgVkFAzvhByhg==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1h6gcY-0002gN-4y; Wed, 20 Mar 2019 19:11:26 +0000 Received: from mail-ed1-x542.google.com ([2a00:1450:4864:20::542]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1h6gcV-0002fx-JL; Wed, 20 Mar 2019 19:11:24 +0000 Received: by mail-ed1-x542.google.com with SMTP id a25so2970547edc.8; Wed, 20 Mar 2019 12:11:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=mwcvuXQc2Zy4FWiwaPp8T82t32CWbPyz9MfQQvjfrco=; b=l0SRsq/NhQTRYl20LmqsSzTUzVIawGy0JqG4FDemOFYxNHXIwqIXsJJvO8etvlefRJ 0j0sw4fUGy10j86Y+PgoBC7w9RGDdhIAVyBdYNGB5GkpPkCfVIcDvDNJL4DZ9ovsLQel /vjPsajWoVOn/bGqy0Wso06sqsAnzEH+jCnssWJUdR4Gh8bHO9FbTTZHTdXOFNUgktZK JDoK/ZUecTvpfRvXq5TySy45VogVlcwfn/vhEC1chZaX47L4hxK5NN5omJSt5psZkKDU lrqMKHBiK1clpxDoxroMhGt50ZbOs7cGRgCBDThk+hdur6j1X2CGhPmdqn126/92sIM7 PZUA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=mwcvuXQc2Zy4FWiwaPp8T82t32CWbPyz9MfQQvjfrco=; b=ULBckyUsGkgapTulCq1M9vs3aS2VOzkTMmg1O89GCnXcaWdCliz+vv2r7jeDX2ySr5 o+kTcbHiN0HQegMxcqA5t7faIIWdr7VPy7vUbyVigdQQDU6PsnqcQ1pLIiYffRtxAxYm Oco5bFy5OtY7/kpmq6N2RYuxX3cYOGYdWQqGcqutQjc7WmKMfDFBgixS7PKXNwLYctq3 8xZgrUwWdozSSJXM6+yKImu/vWAneRy7nURscx7zYHeq1fDOhMxSjizYKBeyBKzNSLBM uPLWIn+brRbmO7dy0wvyPRURHDt4xxMPrrTqMbiTKTtsqxIiR8eMppl3+Ly3fNzJk6wh w75w== X-Gm-Message-State: APjAAAWVUyUxMaaHKI+Rc0uFnP2qaEWm1c4KhaF9Q9l8rDIGDss2PAmP 0+d5PjsITbs9QQ3JdyxDLuk= X-Google-Smtp-Source: APXvYqxq+YIMPp6D4M8uApHdiQH0o8EeFLXWOFq2HVRWaUp8NRKiKZCUrY1dLGPi5BucDc3Biv4dCA== X-Received: by 2002:a05:6402:1592:: with SMTP id c18mr9099535edv.274.1553109080843; Wed, 20 Mar 2019 12:11:20 -0700 (PDT) Received: from archlinux-ryzen ([2a01:4f9:2a:1fae::2]) by smtp.gmail.com with ESMTPSA id l15sm572644ejn.77.2019.03.20.12.11.19 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Wed, 20 Mar 2019 12:11:20 -0700 (PDT) Date: Wed, 20 Mar 2019 12:11:18 -0700 From: Nathan Chancellor To: Matthias Brugger Subject: Re: [PATCH] soc: mediatek: pwrap: Zero initialize rdata in pwrap_init_cipher Message-ID: <20190320191118.GE28744@archlinux-ryzen> References: <20190307225650.23001-1-natechancellor@gmail.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20190307225650.23001-1-natechancellor@gmail.com> User-Agent: Mutt/1.11.4 (2019-03-13) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190320_121123_633700_46A460BB X-CRM114-Status: GOOD ( 17.82 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: clang-built-linux@googlegroups.com, Nick Desaulniers , linux-mediatek@lists.infradead.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Thu, Mar 07, 2019 at 03:56:51PM -0700, Nathan Chancellor wrote: > When building with -Wsometimes-uninitialized, Clang warns: > > drivers/soc/mediatek/mtk-pmic-wrap.c:1358:6: error: variable 'rdata' is > used uninitialized whenever '||' condition is true > [-Werror,-Wsometimes-uninitialized] > > If pwrap_write returns non-zero, pwrap_read will not be called to > initialize rdata, meaning that we will use some random uninitialized > stack value in our print statement. Zero initialize rdata in case this > happens. > > Link: https://github.com/ClangBuiltLinux/linux/issues/401 > Signed-off-by: Nathan Chancellor > --- > > I don't know if this is better or to just restructure the if statement > below (I'm not an expert in this code so I'll leave that up to the > maintainers to decide). > > drivers/soc/mediatek/mtk-pmic-wrap.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/soc/mediatek/mtk-pmic-wrap.c b/drivers/soc/mediatek/mtk-pmic-wrap.c > index 8236a6c87e19..2f632e8790f7 100644 > --- a/drivers/soc/mediatek/mtk-pmic-wrap.c > +++ b/drivers/soc/mediatek/mtk-pmic-wrap.c > @@ -1281,7 +1281,7 @@ static bool pwrap_is_pmic_cipher_ready(struct pmic_wrapper *wrp) > static int pwrap_init_cipher(struct pmic_wrapper *wrp) > { > int ret; > - u32 rdata; > + u32 rdata = 0; > > pwrap_writel(wrp, 0x1, PWRAP_CIPHER_SWRST); > pwrap_writel(wrp, 0x0, PWRAP_CIPHER_SWRST); > -- > 2.21.0 > Gentle ping (if there was a response to this, I didn't receive it). I know I sent it in the middle of a merge window so I get if it slipped through the cracks. Thanks, Nathan _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel