[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <yw5ex3su7gjepctaqwkz3u5orcau55hibb2oozdlc2bkdopd3i@ftd34glarexm>
Date: Wed, 25 Jun 2025 15:00:31 -0600
From: Manivannan Sadhasivam <mani@...nel.org>
To: Hans Zhang <18255117159@....com>
Cc: lpieralisi@...nel.org, bhelgaas@...gle.com, kwilczynski@...nel.org,
robh@...nel.org, jingoohan1@...il.com, linux-pci@...r.kernel.org,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH v2 00/13] PCI: dwc: Refactor register access with
dw_pcie_clear_and_set_dword helper
On Wed, Jun 18, 2025 at 11:20:59PM +0800, Hans Zhang wrote:
> Register bit manipulation in DesignWare PCIe controllers currently
> uses repetitive read-modify-write sequences across multiple drivers.
> This pattern leads to code duplication and increases maintenance
> complexity as each driver implements similar logic with minor variations.
>
> This series introduces dw_pcie_clear_and_set_dword() to centralize atomic
> register modification. The helper performs read-clear-set-write operations
> in a single function, replacing open-coded implementations. Subsequent
> patches refactor individual drivers to use this helper, eliminating
> redundant code and ensuring consistent bit handling.
>
> The change reduces overall code size by ~350 lines while improving
> maintainability. Each controller driver is updated in a separate
> patch to preserve bisectability and simplify review.
>
Thanks for the cleanup! I spotted a typo in patch 13/13. Apart from that, I only
have one comment. You are initializing the temp variable like 'val' to 0 and
then ORing it with some fields. Here the initialization part is not necessary.
You could just write the first field directly instead of ORing with a 0
initialized variable.
Rest LGTM!
- Mani
--
மணிவண்ணன் சதாசிவம்
Powered by blists - more mailing lists