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: 9421597 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 B083C60722 for ; Thu, 10 Nov 2016 16:51:05 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B85CC29778 for ; Thu, 10 Nov 2016 16:51:05 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id AD3EB29776; Thu, 10 Nov 2016 16:51:05 +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.4 required=2.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RCVD_IN_SORBS_SPAM 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 4DE6229789 for ; Thu, 10 Nov 2016 16:51:05 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S935227AbcKJQqt (ORCPT ); Thu, 10 Nov 2016 11:46:49 -0500 Received: from mout.kundenserver.de ([212.227.126.187]:65234 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S934921AbcKJQqq (ORCPT ); Thu, 10 Nov 2016 11:46:46 -0500 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 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 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= Sender: linux-nfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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);