[PATCH v5 4/5] PCI: mediatek: convert bool to single flags entry and bitmap

Manivannan Sadhasivam mani at kernel.org
Sun Oct 19 00:20:24 PDT 2025


On Tue, Oct 14, 2025 at 01:46:04PM +0200, AngeloGioacchino Del Regno wrote:
> Il 12/10/25 22:56, Christian Marangi ha scritto:
> > To clean Mediatek SoC PCIe struct, convert all the bool to a bitmap and
> > use a single flags to reference all the values. This permits cleaner
> > addition of new flag without having to define a new bool in the struct.
> > 
> > Signed-off-by: Christian Marangi <ansuelsmth at gmail.com>
> > ---
> >   drivers/pci/controller/pcie-mediatek.c | 28 +++++++++++++++-----------
> >   1 file changed, 16 insertions(+), 12 deletions(-)
> > 
> > diff --git a/drivers/pci/controller/pcie-mediatek.c b/drivers/pci/controller/pcie-mediatek.c
> > index 24cc30a2ab6c..1678461e56d3 100644
> > --- a/drivers/pci/controller/pcie-mediatek.c
> > +++ b/drivers/pci/controller/pcie-mediatek.c
> > @@ -142,24 +142,29 @@
> >   struct mtk_pcie_port;
> > +enum mtk_pcie_flags {
> 
> enum mtk_pcie_quirks seems to be a better fit here, as this is used for... well..
> quirks.
> 
> > +	NEED_FIX_CLASS_ID = BIT(0), /* host's class ID needed to be fixed */
> > +	NEED_FIX_DEVICE_ID = BIT(1), /* host's device ID needed to be fixed */
> > +	NO_MSI = BIT(2), /* Bridge has no MSI support, and relies on an
> > +			  * external block

Add comments as Kernel doc.

> > +			  */
> 
> Also perhaps... MTK_PCIE_FIX_CLASS_ID, MTK_PCIE_FIX_DEV_ID, MTK_PCIE_NO_MSI
> 
> > +};
> > +
> >   /**
> >    * struct mtk_pcie_soc - differentiate between host generations
> > - * @need_fix_class_id: whether this host's class ID needed to be fixed or not
> > - * @need_fix_device_id: whether this host's device ID needed to be fixed or not
> >    * @no_msi: Bridge has no MSI support, and relies on an external block

Forgot to remove @no_msi?

- Mani

-- 
மணிவண்ணன் சதாசிவம்



More information about the linux-arm-kernel mailing list