From patchwork Wed Aug 23 15:01:33 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 9917581 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 8040D603FA for ; Wed, 23 Aug 2017 15:02:14 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 73BA32874A for ; Wed, 23 Aug 2017 15:02:14 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 6882928984; Wed, 23 Aug 2017 15:02:14 +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=unavailable 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 24067289C4 for ; Wed, 23 Aug 2017 15:02:13 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754133AbdHWPB7 (ORCPT ); Wed, 23 Aug 2017 11:01:59 -0400 Received: from mout.kundenserver.de ([212.227.126.134]:57072 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754129AbdHWPB7 (ORCPT ); Wed, 23 Aug 2017 11:01:59 -0400 Received: from wuerfel.lan ([95.208.190.237]) by mrelayeu.kundenserver.de (mreue001 [212.227.15.129]) with ESMTPA (Nemesis) id 0Mfe8p-1dvr0b005b-00P2jt; Wed, 23 Aug 2017 17:01:46 +0200 From: Arnd Bergmann To: James Smart , Dick Kennedy , "James E.J. Bottomley" , "Martin K. Petersen" Cc: Arnd Bergmann , Hannes Reinecke , linux-scsi@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] scsi: lpfc: avoid false-positive gcc-8 warning Date: Wed, 23 Aug 2017 17:01:33 +0200 Message-Id: <20170823150143.2746796-1-arnd@arndb.de> X-Mailer: git-send-email 2.9.0 X-Provags-ID: V03:K0:Siu8aNI2mU2shDWxGqTf+GjGzcAugrXmQ4WNko1N8EzFAdX7Lhu k2/jOjKfbuRe9Hs5NcS5L2dJwhJCprbFGL6zXQmQ7IlFVtu358TZMBBhTnAFGMKSjXyLTdB Pnm0RPjRIQkLZ9JozuW3rzvozMw/aeEUHBh/hJ/JG+TAW+cMZFjycqhyksyQ3sWGOG+WXPd ruGYwjpExV4Ofd2bNhuFw== X-UI-Out-Filterresults: notjunk:1; V01:K0:5hc3q90zGnU=:n7h5M9HEJM3Z4D9SLCJrp0 VmJnP1jPOSA+kKKGt95zGxXRffNKHZK1eResK3UL3lF1GQAESXU1g8r+sTeKCE4a2Zb8KzL8U ZwFatxU9lnaDhJW+1c+BEqmBngmn0g3ElMQyaVMrdXlvUniXTwLZQHQb6gzFsMAgkIhhfXcZA GDaRtWijGQelk9k8sWnv7aA+4zcYdwQg/yMGpRCr8zW1775Tfdvz5JwOSMsV+zJoj3EaHOf76 RKhJt20NWWQlaliJMUE5JOuFcjt9y+fu3NijhkyP2Onl0Hr3N00qDguQ+6sUmlQxUiNDnHjeC Qq05evo1JpuwpSqARtXkE9VetCyZnZc7mG7+dSXLtBi4+BZhoJCEkEGXShvurfXS2oUKIkBCF 61nIC1M1KeUdPEKgki36cQJ5zF4VaKRs2mIzqCeBigY4Xp2jDkPnCXYO4L16ofqRV5TVqfJaB N0faOPdBWoHfm+92/FBBphkbNGgFQW5LevD90MgFmt4zVn0FGm6Zp6T5avLhWo7C5szP0ez/f pRpjwtc89y5nrlEvsVWB2Luof3po+PZ7+/trEa93SKPbj4uQwE5ePN7e52ccTeec6dpt5c/p7 opkevkZp7NuOr+r4q7Zcip2xzHgVr+TTvJ06nen/br/45dTAY0OExDrY7QoD60ywgURljCf5r koOoQXk2wBITmoK/m0PdaKIwuj9XkRygGVg+HnXbzUQrhO2vEmiUwGC3y/xiB81KJd/9AxQDl 5GwGfHZdN9DKpLFkqUtP9dRcx6nGto02JLDMnQ== Sender: linux-scsi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP This is an interesting regression with gcc-8, showing a harmless warning for correct code: In file included from include/linux/kernel.h:13:0, ... from drivers/scsi/lpfc/lpfc_debugfs.c:23: include/linux/printk.h:301:2: error: 'eq' may be used uninitialized in this function [-Werror=maybe-uninitialized] printk(KERN_ERR pr_fmt(fmt), ##__VA_ARGS__) ^~~~~~ In file included from drivers/scsi/lpfc/lpfc_debugfs.c:58:0: drivers/scsi/lpfc/lpfc_debugfs.h:451:31: note: 'eq' was declared here I tried to come up with a reduced test case for gcc here a few times, but every time ended up with code that is actually wrong with older gcc versions missing the bug and gcc-8 finding it. As this is the only false-positive -Wmaybe-uninitialized warnign I got with gcc-8 randconfig builds, I'd suggest we work around it. Making the index variable 'unsigned' is enough to shut up the warning, as gcc can then see that comparing eqidx to phba->io_channel_irqs is fine here. Signed-off-by: Arnd Bergmann Signed-off-by: James Smart --- drivers/scsi/lpfc/lpfc_debugfs.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/scsi/lpfc/lpfc_debugfs.h b/drivers/scsi/lpfc/lpfc_debugfs.h index 7b7d314af0e0..7b7f53a37fd8 100644 --- a/drivers/scsi/lpfc/lpfc_debugfs.h +++ b/drivers/scsi/lpfc/lpfc_debugfs.h @@ -450,7 +450,7 @@ lpfc_debug_dump_cq(struct lpfc_hba *phba, int qtype, int wqidx) { struct lpfc_queue *wq, *cq, *eq; char *qtypestr; - int eqidx; + unsigned int eqidx; /* fcp/nvme wq and cq are 1:1, thus same indexes */