diff mbox series

[V6,02/10] PCI: Replace magic constant for PCI Sig Vendor ID

Message ID 20220201071952.900068-3-ira.weiny@intel.com
State Superseded
Headers show
Series CXL: Read CDAT and DSMAS data from the device | expand

Commit Message

Ira Weiny Feb. 1, 2022, 7:19 a.m. UTC
From: Ira Weiny <ira.weiny@intel.com>

Based on Bjorn's suggestion[1], now that the PCI Sig Vendor ID is
defined the define should be used in pci_bus_crs_vendor_id() rather than
the hard coded magic value.

Replace the magic value in pci_bus_crs_vendor_id() with
PCI_VENDOR_ID_PCI_SIG.

[1] https://lore.kernel.org/linux-cxl/20211117215044.GA1777828@bhelgaas/

Suggested-by: Bjorn Helgaas <bhelgaas@google.com>
Signed-off-by: Ira Weiny <ira.weiny@intel.com>
---
 drivers/pci/probe.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Dan Williams Feb. 4, 2022, 9:16 p.m. UTC | #1
On Mon, Jan 31, 2022 at 11:20 PM <ira.weiny@intel.com> wrote:
>
> From: Ira Weiny <ira.weiny@intel.com>
>
> Based on Bjorn's suggestion[1], now that the PCI Sig Vendor ID is
> defined the define should be used in pci_bus_crs_vendor_id() rather than
> the hard coded magic value.
>
> Replace the magic value in pci_bus_crs_vendor_id() with
> PCI_VENDOR_ID_PCI_SIG.
>
> [1] https://lore.kernel.org/linux-cxl/20211117215044.GA1777828@bhelgaas/
>
> Suggested-by: Bjorn Helgaas <bhelgaas@google.com>
> Signed-off-by: Ira Weiny <ira.weiny@intel.com>
> ---
>  drivers/pci/probe.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/pci/probe.c b/drivers/pci/probe.c
> index 087d3658f75c..d92dbb136fc9 100644
> --- a/drivers/pci/probe.c
> +++ b/drivers/pci/probe.c
> @@ -2318,7 +2318,7 @@ EXPORT_SYMBOL(pci_alloc_dev);
>
>  static bool pci_bus_crs_vendor_id(u32 l)
>  {
> -       return (l & 0xffff) == 0x0001;
> +       return (l & 0xffff) == PCI_VENDOR_ID_PCI_SIG;
>  }

Looks good to me:

Reviewed-by: Dan Williams <dan.j.williams@intel.com>
Bjorn Helgaas Feb. 4, 2022, 9:49 p.m. UTC | #2
On Mon, Jan 31, 2022 at 11:19:44PM -0800, ira.weiny@intel.com wrote:
> From: Ira Weiny <ira.weiny@intel.com>
> 
> Based on Bjorn's suggestion[1], now that the PCI Sig Vendor ID is
> defined the define should be used in pci_bus_crs_vendor_id() rather than
> the hard coded magic value.
> 
> Replace the magic value in pci_bus_crs_vendor_id() with
> PCI_VENDOR_ID_PCI_SIG.
 
This sentence is plenty; no attribution or link needed.  I appreciate
the acknowledgement, but replacing a magic value isn't a better idea
simply because *I* suggested it ;)

> [1] https://lore.kernel.org/linux-cxl/20211117215044.GA1777828@bhelgaas/
> 
> Suggested-by: Bjorn Helgaas <bhelgaas@google.com>
> Signed-off-by: Ira Weiny <ira.weiny@intel.com>

Acked-by: Bjorn Helgaas <bhelgaas@google.com>

> ---
>  drivers/pci/probe.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/pci/probe.c b/drivers/pci/probe.c
> index 087d3658f75c..d92dbb136fc9 100644
> --- a/drivers/pci/probe.c
> +++ b/drivers/pci/probe.c
> @@ -2318,7 +2318,7 @@ EXPORT_SYMBOL(pci_alloc_dev);
>  
>  static bool pci_bus_crs_vendor_id(u32 l)
>  {
> -	return (l & 0xffff) == 0x0001;
> +	return (l & 0xffff) == PCI_VENDOR_ID_PCI_SIG;
>  }
>  
>  static bool pci_bus_wait_crs(struct pci_bus *bus, int devfn, u32 *l,
> -- 
> 2.31.1
>
Ira Weiny March 15, 2022, 9:48 p.m. UTC | #3
On Fri, Feb 04, 2022 at 03:49:02PM -0600, Bjorn Helgaas wrote:
> On Mon, Jan 31, 2022 at 11:19:44PM -0800, ira.weiny@intel.com wrote:
> > From: Ira Weiny <ira.weiny@intel.com>
> > 
> > Based on Bjorn's suggestion[1], now that the PCI Sig Vendor ID is
> > defined the define should be used in pci_bus_crs_vendor_id() rather than
> > the hard coded magic value.
> > 
> > Replace the magic value in pci_bus_crs_vendor_id() with
> > PCI_VENDOR_ID_PCI_SIG.
>  
> This sentence is plenty; no attribution or link needed.  I appreciate
> the acknowledgement, but replacing a magic value isn't a better idea
> simply because *I* suggested it ;)

Done.

> 
> > [1] https://lore.kernel.org/linux-cxl/20211117215044.GA1777828@bhelgaas/
> > 
> > Suggested-by: Bjorn Helgaas <bhelgaas@google.com>
> > Signed-off-by: Ira Weiny <ira.weiny@intel.com>
> 
> Acked-by: Bjorn Helgaas <bhelgaas@google.com>

Thanks,
Ira

> 
> > ---
> >  drivers/pci/probe.c | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> > 
> > diff --git a/drivers/pci/probe.c b/drivers/pci/probe.c
> > index 087d3658f75c..d92dbb136fc9 100644
> > --- a/drivers/pci/probe.c
> > +++ b/drivers/pci/probe.c
> > @@ -2318,7 +2318,7 @@ EXPORT_SYMBOL(pci_alloc_dev);
> >  
> >  static bool pci_bus_crs_vendor_id(u32 l)
> >  {
> > -	return (l & 0xffff) == 0x0001;
> > +	return (l & 0xffff) == PCI_VENDOR_ID_PCI_SIG;
> >  }
> >  
> >  static bool pci_bus_wait_crs(struct pci_bus *bus, int devfn, u32 *l,
> > -- 
> > 2.31.1
> >
diff mbox series

Patch

diff --git a/drivers/pci/probe.c b/drivers/pci/probe.c
index 087d3658f75c..d92dbb136fc9 100644
--- a/drivers/pci/probe.c
+++ b/drivers/pci/probe.c
@@ -2318,7 +2318,7 @@  EXPORT_SYMBOL(pci_alloc_dev);
 
 static bool pci_bus_crs_vendor_id(u32 l)
 {
-	return (l & 0xffff) == 0x0001;
+	return (l & 0xffff) == PCI_VENDOR_ID_PCI_SIG;
 }
 
 static bool pci_bus_wait_crs(struct pci_bus *bus, int devfn, u32 *l,