[1/2] bus/pci: rename devargs parameter id to addr

Message ID 20181003194039.7202-1-thomas@monjalon.net (mailing list archive)
State Accepted, archived
Delegated to: Thomas Monjalon
Headers
Series [1/2] bus/pci: rename devargs parameter id to addr |

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/Intel-compilation success Compilation OK

Commit Message

Thomas Monjalon Oct. 3, 2018, 7:40 p.m. UTC
  We could match devices by their PCI id (vendor id, device id, etc).
But for now, only matching by PCI address is implemented.
The devargs parameter "id" is renamed "addr" to reflect its real meaning.

Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
---
 drivers/bus/pci/pci_params.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
  

Comments

Andrew Rybchenko Oct. 10, 2018, 6:48 a.m. UTC | #1
On 10/3/18 10:40 PM, Thomas Monjalon wrote:
> We could match devices by their PCI id (vendor id, device id, etc).
> But for now, only matching by PCI address is implemented.
> The devargs parameter "id" is renamed "addr" to reflect its real meaning.
>
> Signed-off-by: Thomas Monjalon <thomas@monjalon.net>

Reviewed-by: Andrew Rybchenko <arybchenko@solarflare.com>
  
Thomas Monjalon Oct. 11, 2018, 12:02 p.m. UTC | #2
10/10/2018 08:48, Andrew Rybchenko:
> On 10/3/18 10:40 PM, Thomas Monjalon wrote:
> > We could match devices by their PCI id (vendor id, device id, etc).
> > But for now, only matching by PCI address is implemented.
> > The devargs parameter "id" is renamed "addr" to reflect its real meaning.
> >
> > Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
> 
> Reviewed-by: Andrew Rybchenko <arybchenko@solarflare.com>

Series applied
  

Patch

diff --git a/drivers/bus/pci/pci_params.c b/drivers/bus/pci/pci_params.c
index 7630d4845..77b722ba9 100644
--- a/drivers/bus/pci/pci_params.c
+++ b/drivers/bus/pci/pci_params.c
@@ -12,12 +12,12 @@ 
 #include "private.h"
 
 enum pci_params {
-	RTE_PCI_PARAMS_ID,
+	RTE_PCI_PARAMS_ADDR,
 	RTE_PCI_PARAMS_MAX,
 };
 
 static const char * const pci_params_keys[] = {
-	[RTE_PCI_PARAMS_ID] = "id",
+	[RTE_PCI_PARAMS_ADDR] = "addr",
 	[RTE_PCI_PARAMS_MAX] = NULL,
 };
 
@@ -47,7 +47,7 @@  pci_dev_match(const struct rte_device *dev,
 		return 0;
 	pdev = RTE_DEV_TO_PCI_CONST(dev);
 	/* if any field does not match. */
-	if (rte_kvargs_process(kvlist, "id",
+	if (rte_kvargs_process(kvlist, pci_params_keys[RTE_PCI_PARAMS_ADDR],
 			       &pci_addr_kv_cmp,
 			       (void *)(intptr_t)&pdev->addr))
 		return 1;