[PATCH 04/18] PCI: Add PCI_EXP_SLTCAP_*_SHIFT macros

Bjorn Helgaas helgaas at kernel.org
Wed May 18 13:27:29 PDT 2022


On Wed, May 18, 2022 at 10:05:56PM +0200, Marek Behún wrote:
> On Wed, 18 May 2022 21:26:00 +0200
> Pali Rohár <pali at kernel.org> wrote:
> 
> > On Wednesday 18 May 2022 14:23:22 Bjorn Helgaas wrote:
> > > On Sun, Feb 20, 2022 at 08:33:32PM +0100, Marek Behún wrote:  
> > > > From: Pali Rohár <pali at kernel.org>
> > > > 
> > > > These macros allows to easily compose and extract Slot Power Limit and
> > > > Physical Slot Number values from Slot Capability Register.
> > > > 
> > > > Signed-off-by: Pali Rohár <pali at kernel.org>
> > > > Signed-off-by: Marek Behún <kabel at kernel.org>  
> > > 
> > > Acked-by: Bjorn Helgaas <bhelgaas at google.com>
> > > 
> > > We talked about using FIELD_PREP() / FIELD_GET(), which I think would
> > > remove the need for the *_SHIFT macros.  But we can always do that
> > > later.  
> > 
> > I have already done this for pci-mvebu.c driver and patch was merged:
> > https://lore.kernel.org/linux-pci/20220412094946.27069-5-pali@kernel.org/
> > 
> > IIRC we have decided to not use those *_SHIFT macros as it would flood
> > public uapi file and from this file we cannot remove macros due to
> > userspace backward compatibility.
> 
> So should I change patch 5 of the aardvark batch 5 to also use
> FIELD_GET(), so that this patch is not needed?

That would be awesome if you could.  I forgot about the backward
compatibility issue with include/uapi/linux/pci_regs.h

Bjorn



More information about the linux-arm-kernel mailing list