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: 110858 Delivered-To: patch@linaro.org Received: by 10.140.95.78 with SMTP id h72csp4249454qge; Wed, 23 Aug 2017 08:02:04 -0700 (PDT) X-Received: by 10.98.205.133 with SMTP id o127mr3001784pfg.241.1503500524334; Wed, 23 Aug 2017 08:02:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1503500524; cv=none; d=google.com; s=arc-20160816; b=a5qFYIMyGHBxJMOOo96u4VcPuBQAf7g9Dw8ieakQG6LXcTJlJBO4abKkQNDM5RCmcM yNJkmWzejepXwmNUs4Qw9xEoqMR6lNK63O2ZMqG1H78F9qELs5yQFhkoJAh4tP9IVYLk PSUDxoNvRNzT8RCMZ79J5xl92ruvEB0jN4kjf4wfo6wf5J5ikYvFqXzpdTiSAFfPGvAB 9idEqc7vtroXMLvmpJW9fyvnDhzQesYAeKf2ms76q0EZaEHJdDj6X7JpoWQ1pz1YkGeF I9yGlSwoSIKTNpSNiHnR/c2fqyXpTLz10mcdRsH7tyJwS6KBFlSOu4ac/uG1cZsQZ4yq d3EA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :arc-authentication-results; bh=6uXCEU1WurhNmtuOw/90s2jPxqmwjlD8b5vBnWEIUbI=; b=lATUokj6sSf67EIf4TWTYmvanNQNQLDE3cr/Bstq1KZkgsQQ1EE+1/+XYiQIOgLe17 xb7snEJzzcP4gicAspcS5tmsWTSKi7ocny861vVf2g/OOi2q6bgDvVCIbxrVZLGhHxwy tMAl4PP1TLz0fe61YUMNwG6CtvFWtMwDVfhK1ZOsUUEtgY6SyAQ8eOBrqLkiU9kmpScp V5JFk92i53G+0vViUsNurrhC8BwyHg90ZEJAfTqKGo/wJy3SpoW3lBkegC1ZBJmQQGTn AbyNS1O0acWdKhp+fEJGWRpeOuitaT6MwlEpvqOiMjCnQsuzA01FaCurW1jOvMJASlwl pvHA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id o15si1100159pgc.550.2017.08.23.08.02.03; Wed, 23 Aug 2017 08:02:04 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932110AbdHWPCA (ORCPT + 26 others); Wed, 23 Aug 2017 11:02:00 -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-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 --- drivers/scsi/lpfc/lpfc_debugfs.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- 2.9.0 Signed-off-by: James Smart 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 */