From patchwork Wed May 10 03:01:21 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nick Desaulniers X-Patchwork-Id: 760398 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 3wN1H52GkXz9s1h for ; Wed, 10 May 2017 13:01:53 +1000 (AEST) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="iiHOaAIh"; dkim-atps=neutral Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751465AbdEJDBv (ORCPT ); Tue, 9 May 2017 23:01:51 -0400 Received: from mail-pg0-f66.google.com ([74.125.83.66]:35516 "EHLO mail-pg0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751462AbdEJDBu (ORCPT ); Tue, 9 May 2017 23:01:50 -0400 Received: by mail-pg0-f66.google.com with SMTP id i63so2275987pgd.2; Tue, 09 May 2017 20:01:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=yVZvYc63X0W4F6G3Frte1QQPYjoi1PrqTk95Jd1jqqY=; b=iiHOaAIh3FBD14stcNI2MImqj7SF+SU6wlS8awTwUo1SrzbeiPHqs3hPM+x2otdM6k 2DV/Pko5oDbGJwmcKh2FvnOHr7NicYyK7r/hQ1tsFtowWxbQw7baG6m/5Q513LVrTUlq hACkrrduUycNO8V/zhwE8at05k4S/veeGfDYfcIKA55+yAhELelQgUanvrgIxyDInDvT PcbHXft4QFjuehZ3BdQpnllihYmXnRYPLIxT2l+D6U4fTC4bVNevjw03gP76v5DFvjdd 9zmLOwj3vizK+nNfiLoS/XyMEFfXF1yY+RtILVNK/KKc5WcqFnl0LMaZ+A6KF1sDYI3g Wwjw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=yVZvYc63X0W4F6G3Frte1QQPYjoi1PrqTk95Jd1jqqY=; b=gUK24kK8vhWWxCxx3P/T0Zoyo03+14KhBDgMXdWD8aYGjRt0wkgr2xyJdWyRCLZUCv Z00a8ZRsDyd4exGj3uu7y3bK8EGqfBgtn6OJ60Xg7zCd65O87i++Hi3S7Yxoi1ZTAADk 0GJuu/k3/NatgNcyM21JF81j/fsWeJ2OlDnGW7wMZgmDyraceBsvKm6T15nCjx3/VUhR 47MN1HN/2Nv1aplD7ejrl2YjmJHsAldcsBl2IhsLQV27kdIe/UcLrIxyutt+ifhnyKa3 8W0xN8FZPWtU3TnY3tVWS0Cm9hDKZnSXCmfd7EKdJGzQeDk7NBKy7jukVkVhmNeD/gpH VwHQ== X-Gm-Message-State: AODbwcC5mRdndqqHa09VkPy0KTpzDi/Jt4/s8RB3xQxcMawD1kTx1XTK So+6PAsjewQn2A== X-Received: by 10.99.49.11 with SMTP id x11mr3821062pgx.128.1494385309673; Tue, 09 May 2017 20:01:49 -0700 (PDT) Received: from localhost.localdomain ([2601:647:4701:31a:320e:d5ff:febd:81c]) by smtp.googlemail.com with ESMTPSA id r86sm2258348pfb.24.2017.05.09.20.01.48 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 09 May 2017 20:01:48 -0700 (PDT) From: Nick Desaulniers Cc: bhelgaas@google.com, tglx@linutronix.de, mingo@redhat.com, hpa@zytor.com, x86@kernel.org, linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org, Nick Desaulniers Subject: [PATCH] x86/PCI: fix duplicate 'const' declaration specifier Date: Tue, 9 May 2017 20:01:21 -0700 Message-Id: <20170510030121.19667-1-nick.desaulniers@gmail.com> X-Mailer: git-send-email 2.11.0 To: unlisted-recipients:; (no To-header on input) Sender: linux-pci-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org Found with -Wduplicate-decl-specifier, a relatively new compiler flag in GCC7, and Clang. list_for_each_entry() eventually calls container_of(), which marks the loop variable as const. The first argument to list_for_each_entry() is a type, which should not already be marked const, otherwise the loop variable is marked const twice. While this particular call site does not modify the loop variable, trying to do so would already result in a compile time failure, so we can remove the current const. Other call sites do not mark the loop variable const. Signed-off-by: Nick Desaulniers --- arch/x86/pci/mmconfig-shared.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/x86/pci/mmconfig-shared.c b/arch/x86/pci/mmconfig-shared.c index d1b47d5bc9c3..925083ed1b2b 100644 --- a/arch/x86/pci/mmconfig-shared.c +++ b/arch/x86/pci/mmconfig-shared.c @@ -643,7 +643,7 @@ static void __init __pci_mmcfg_init(int early) return; if (pcibios_last_bus < 0) { - const struct pci_mmcfg_region *cfg; + struct pci_mmcfg_region *cfg; list_for_each_entry(cfg, &pci_mmcfg_list, list) { if (cfg->segment)