From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 0FB87C6FD19 for ; Fri, 10 Mar 2023 22:16:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=8QD3bc+u7D4F6AvvQ+JoXbdWUx7K1X/YQNk1psXqDMk=; b=chwRfqxY9gyHko sRv8xqufH9JEc0AsEFx+Hs5wpYw5T3W57f4+nCcrV2PjLU0Oe7M9LK85BExDzfkU1WNohm2xrenPK UlZUTj2w7oFgS9Zr7s8letXQgpDcdD6H1dWPEOFsd2vAIu653Ba3GXB15iHLS3bfpfOjlwppG9/qz g0s01kol0x+wL83EbvlcZCy50pZN6H6CHV8FixunNse7lqPgagp4WE4OGBqx+NK+O9gV/XILfL90w 9Y6NpMocswfCzeoisSkrvdM24oNZkq0odBT5AOWmgtpYEuoE8Wip3dMuBP99SlRVGrX9ApVrxemWy to/WOM3SCCFjdZnpk9ew==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1pal1h-00GLxT-Pn; Fri, 10 Mar 2023 22:15:49 +0000 Received: from ams.source.kernel.org ([2604:1380:4601:e00::1]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1pal1f-00GLwb-16 for linux-arm-kernel@lists.infradead.org; Fri, 10 Mar 2023 22:15:48 +0000 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id BDC6BB82428; Fri, 10 Mar 2023 22:15:44 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 749CFC433EF; Fri, 10 Mar 2023 22:15:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1678486543; bh=DBl3XYhVnPnvHREV6khsX0zced8HUvT1CffAKeLd3Ro=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=OfS4jME/FTj7znUmYf295mHvCJSGHW15meDAWvWzrPF00ribhkkR54Qzq1xN8JWLo 4ifTzybHNa9ZODC6VxC42vmMGTVR8rpuWOM6tKK420xu8RHuuxnRruXC7YKzvCsgbR u/3W/J52kt+Sw35gEY+GHE+yc90z2JKYQ8ziYt9KjcC+XD8bNVo3dAsYq1L9Dq9Z0P F78mqifIRtEWY9l2xPq1eww1JPlj0DytsnzKq9XlcZ3XWB4shMaJ1Gp356DNbpjhAm fT6kd6cAHwWNZ9v/mPpirze0bthx/rOXMwvra8reVtn+1Ve3YO1CPCN4cOH1gbnOxg +A+CV4nR0FY6w== Date: Fri, 10 Mar 2023 15:15:38 -0700 From: Keith Busch To: Andy Shevchenko Cc: =?iso-8859-1?Q?Micka=EBl_Sala=FCn?= , Mika Westerberg , Krzysztof =?utf-8?Q?Wilczy=C5=84ski?= , Michael Ellerman , Randy Dunlap , Arnd Bergmann , Bjorn Helgaas , "Rafael J. Wysocki" , Niklas Schnelle , Pali =?iso-8859-1?Q?Roh=E1r?= , "Maciej W. Rozycki" , Juergen Gross , Dominik Brodowski , linux-kernel@vger.kernel.org, linux-alpha@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mips@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, linux-sh@vger.kernel.org, sparclinux@vger.kernel.org, linux-pci@vger.kernel.org, xen-devel@lists.xenproject.org, linux-acpi@vger.kernel.org, Miguel Ojeda , Richard Henderson , Ivan Kokshaysky , Matt Turner , Russell King , Andrew Lunn , Sebastian Hesselbarth , Gregory Clement , Thomas Bogendoerfer , Nicholas Piggin , Christophe Leroy , Anatolij Gustschin , Yoshinori Sato , Rich Felker , John Paul Adrian Glaubitz , "David S. Miller" , Bjorn Helgaas , Stefano Stabellini , Oleksandr Tyshchenko Subject: Re: [PATCH v4 1/4] PCI: Introduce pci_dev_for_each_resource() Message-ID: References: <20230310171416.23356-1-andriy.shevchenko@linux.intel.com> <20230310171416.23356-2-andriy.shevchenko@linux.intel.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20230310171416.23356-2-andriy.shevchenko@linux.intel.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230310_141547_251782_D656E8F3 X-CRM114-Status: GOOD ( 10.51 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Fri, Mar 10, 2023 at 07:14:13PM +0200, Andy Shevchenko wrote: > +#define __pci_dev_for_each_resource(dev, res, __i, vartype) \ > + for (vartype __i = 0; \ > + res = &(dev)->resource[__i], __i < PCI_NUM_RESOURCES; \ > + __i++) ... > +#define pci_dev_for_each_resource_p(dev, res) \ > + __pci_dev_for_each_resource(dev, res, i, unsigned int) It looks dangerous to have a macro declare a variable when starting a new scope. How do you know the name 'i' won't clash with something defined above? _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel