From patchwork Thu Nov 10 16:44:48 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 693335 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@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 3tF88c6XJGz9t2b for ; Fri, 11 Nov 2016 03:46:56 +1100 (AEDT) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.85_2 #1 (Red Hat Linux)) id 1c4sV5-0003hR-3I; Thu, 10 Nov 2016 16:46:55 +0000 Received: from mout.kundenserver.de ([212.227.126.187]) by bombadil.infradead.org with esmtps (Exim 4.85_2 #1 (Red Hat Linux)) id 1c4sUm-0003IP-8c for linux-snps-arc@lists.infradead.org; Thu, 10 Nov 2016 16:46:39 +0000 Received: from wuerfel.lan ([78.43.20.153]) by mrelayeu.kundenserver.de (mreue002 [212.227.15.129]) with ESMTPA (Nemesis) id 0LbmDM-1cU05B1Zfo-00jJoZ; Thu, 10 Nov 2016 17:45:41 +0100 From: Arnd Bergmann To: Linus Torvalds Subject: [PATCH v2 05/11] s390: pci: don't print uninitialized data for debugging Date: Thu, 10 Nov 2016 17:44:48 +0100 Message-Id: <20161110164454.293477-6-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> X-Provags-ID: V03:K0:pvDyEnuvpp9XQut/2OwDmXf7OQ7R/lKLFRs9r2Lrg0I4mKXcbK7 6GoIPKP1A1Oz4Pl0qBLR+VX6jhcoPQFEPUCGC0oo8HgWJkm9K1CuQQCvgdim4IS2BDysuaC nmCMTmlL3dzjeCD72vI8StNofcCb+9GKTptFwdUAJwLWG3PsKgNJg+qu85cqePko4lOkE+q uVVdoeyjkLWbLsVuU7MDQ== X-UI-Out-Filterresults: notjunk:1; V01:K0:7UFD2cHaibY=:1OVUeWs+1bpYSWoMRn5Wc7 NpdiIhoTqdXD5zFI64+YIEG6pNnHkcgaHU4sKpJe5lO9wMQqqe17uhWmv6vMYm3FEVtB3PUel qE0DTYbAm3S+ZEOc5SzkfLEUtKtWulncHxQD5xiAd/n4ay/aYnryj3smINX87OcVNTC3kKvbV hMMt304QuG4mUe0Vrhak8++m+w7Yik1PvKomRrRoe+dAoXS+ZWZYSTBXMn2H4AFj/AcdbXWjm 6OzyriX6sN85/6YgzN0B2TyHyPnwdqqRAQVxXFaNF/rt7mIeyyyjjDW2xCyv6jqUNBhFbGjus iu162300sgmb6vht8CffS2jSEvTN+ROo3eLt0yKWwZPvgPVlt4EAZwy1vpukNsnks39W9SD4A kLiQmse6S+fUZHk8XbfF2qQMZhN9fAE7czaMRkJPyipohlmGzk0QINitfGrW/GIgDqzjpx9e2 RjCFdIJtiy7fU5U0wW07YHTsaMiLWL5Kibc4AZ9JZwB1WGCEUjrfq4HBBz5befWiecyhxOAoq ITFQ0WFqgIl1ACa2fZYQ4yhrmDLOhuIJ8qXRHD+9VRSfBquyNu0XoisnOY3XYYgGGvJVvotCd LTQIzIr0ZXLHUzyjReea6EFtd0stQK3dbdVopuYvlPLPloT8lcWu1alKIdNlG56MWkLPfXa/W f+G0G06s0kkMpOV6s1SQdtWyi66CkWC2DvXaIDkkxAcU3o5Ov3WGjf/SoB9dknArVwOs= X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20161110_084636_850385_C923987D X-CRM114-Status: GOOD ( 12.40 ) X-Spam-Score: -1.9 (-) X-Spam-Report: SpamAssassin version 3.4.0 on bombadil.infradead.org summary: Content analysis details: (-1.9 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at http://www.dnswl.org/, no trust [212.227.126.187 listed in list.dnswl.org] -0.0 RCVD_IN_MSPIKE_H2 RBL: Average reputation (+2) [212.227.126.187 listed in wl.mailspike.net] -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] X-BeenThere: linux-snps-arc@lists.infradead.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: Linux on Synopsys ARC Processors List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Sean Young , Trond Myklebust , linux-s390@vger.kernel.org, Herbert Xu , x86@kernel.org, Sebastian Ott , Russell King , Javier Martinez Canillas , Ilya Dryomov , linux-snps-arc@lists.infradead.org, linux-media@vger.kernel.org, Arnd Bergmann , linux-kbuild@vger.kernel.org, Jiri Kosina , Michal Marek , nios2-dev@lists.rocketboards.org, Mauro Carvalho Chehab , linux-nfs@vger.kernel.org, linux-kernel@vger.kernel.org, Anna Schumaker , "Luis R . Rodriguez" , linux-crypto@vger.kernel.org, Martin Schwidefsky , Ley Foon Tan , Andrew Morton , "David S. Miller" , Jonathan Cameron MIME-Version: 1.0 Sender: "linux-snps-arc" Errors-To: linux-snps-arc-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org gcc correctly warns about an incorrect use of the 'pa' variable in case we pass an empty scatterlist to __s390_dma_map_sg: arch/s390/pci/pci_dma.c: In function '__s390_dma_map_sg': arch/s390/pci/pci_dma.c:309:13: warning: 'pa' may be used uninitialized in this function [-Wmaybe-uninitialized] This adds a bogus initialization to the function to sanitize the debug output. I would have preferred a solution without the initialization, but I only got the report from the kbuild bot after turning on the warning again, and didn't manage to reproduce it myself. Signed-off-by: Arnd Bergmann Acked-by: Sebastian Ott Acked-by: Martin Schwidefsky --- arch/s390/pci/pci_dma.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/s390/pci/pci_dma.c b/arch/s390/pci/pci_dma.c index 7350c8b..6b2f72f 100644 --- a/arch/s390/pci/pci_dma.c +++ b/arch/s390/pci/pci_dma.c @@ -423,7 +423,7 @@ static int __s390_dma_map_sg(struct device *dev, struct scatterlist *sg, dma_addr_t dma_addr_base, dma_addr; int flags = ZPCI_PTE_VALID; struct scatterlist *s; - unsigned long pa; + unsigned long pa = 0; int ret; size = PAGE_ALIGN(size);