From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 4416131AABC; Tue, 6 Jan 2026 11:16:27 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1767698188; cv=none; b=gErKgHZ4vyVqqHvLOOp8bJs90wupE12lvJ0Nw5FUKkWBTNaoXnD+pOcVPn0iT/c8J613pCeMsgFr7tDzKI1yYyyge+tVwowtBywzCIQaMNY/4okoNGGYGiR01B2NScNMUy7ex9NB00IOqjxPTLHSe5/Jp+zaKdMdyLNlMbyort4= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1767698188; c=relaxed/simple; bh=KAZTfW562W1oYvg6yLMZiwveTP/LAQQ3kkh1Vqc/32Q=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=JZsELDpu6nrX91Tk9EEov0VYE7hskRopsDsT1vcOxmB7K7lWnJC0pKfyj2oVdM8M33f6VZ5L9oB7hwAsNT12f/GOGiQTnyHg6VlT+u+XwgyvbzIlRjbBLTKCBgMX+ymIajr0ZJmeiqcs1rhLxpZbM4vVJakkHjOqWWoSx7RJGbQ= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=Z1K0/H+X; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="Z1K0/H+X" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 528DEC116C6; Tue, 6 Jan 2026 11:16:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1767698187; bh=KAZTfW562W1oYvg6yLMZiwveTP/LAQQ3kkh1Vqc/32Q=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=Z1K0/H+XpY/nY87i0BbOhrc0NiRe8qTneWo9Kclay0A+/ZiYEVXM8rM2Ru8hsNf8y PxNWW770aUY0dfnswiMYnNUyiXyMopWxWKymiXrW+XiA+s5Y09ERidRRZG782OYHhD 4chf+I3fc+I8JmctmpRXqsR1iNYjVBnbR4j2HQFYpy59lZTrFG7rUnvWhWWj//5go4 LXdUEq9t2WGgtOv7/a88UHej4y9EJJGE/vb9oors6pxeMGccynmmEkVG5rYPDW4Rsq 79BH7p4Wrb3LzWNxaEbPknCyslDbxH1Y7TENlLw78noR/6XK39CD77/BuMLy05qqQB oJUN+EE7CvPnw== Date: Tue, 6 Jan 2026 12:16:16 +0100 From: Niklas Cassel To: Manivannan Sadhasivam Cc: Sumit Kumar , Bjorn Helgaas , Jingoo Han , Lorenzo Pieralisi , Krzysztof =?utf-8?Q?Wilczy=C5=84ski?= , Rob Herring , Krzysztof Kozlowski , Alim Akhtar , Richard Zhu , Lucas Stach , Shawn Guo , Sascha Hauer , Pengutronix Kernel Team , Fabio Estevam , Yue Wang , Neil Armstrong , Kevin Hilman , Jerome Brunet , Martin Blumenstingl , Paul Walmsley , Greentime Hu , Samuel Holland , Chuanhua Lei , Marek Vasut , Yoshihiro Shimoda , Geert Uytterhoeven , Magnus Damm , Pratyush Anand , Thierry Reding , Jonathan Hunter , linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-samsung-soc@vger.kernel.org, imx@lists.linux.dev, linux-amlogic@lists.infradead.org, linux-arm-msm@vger.kernel.org, linux-renesas-soc@vger.kernel.org, linux-tegra@vger.kernel.org, linux-riscv@lists.infradead.org Subject: Re: [PATCH 2/2] PCI: dwc: Add multi-port controller support Message-ID: References: <20260105-dt-parser-v1-0-b11c63cb5e2c@oss.qualcomm.com> <20260105-dt-parser-v1-2-b11c63cb5e2c@oss.qualcomm.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: On Tue, Jan 06, 2026 at 11:55:46AM +0100, Niklas Cassel wrote: > For iterating, to avoid manually traversing the array, we could do like > libata and create a simple macro, e.g. ata_qc_for_each(): > https://github.com/torvalds/linux/blob/v6.19-rc4/drivers/ata/libata-eh.c#L851-L854 > https://github.com/torvalds/linux/blob/v6.19-rc4/include/linux/libata.h#L1657-L1659 > > And at least personally, I think my brain will parse dw_pcie_port_for_each() { } > faster than it parses list_for_each_entry(port, &pcie->ports, list) { }, > since it is more unique, but perhaps I am the weird one here :) Or... for_each_dw_pcie_port() We also don't need to supply an integer to the macro, we could do like e.g. for_each_nhlt_endpoint(): https://github.com/torvalds/linux/blob/v6.19-rc4/include/acpi/nhlt.h#L63-L64 which has does "for (unsigned int __i = 0; " in the macro. Kind regards, Niklas