[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH v2 13/15] pci: Drop parse_pci{_seg}()



No user of these functions remain, take the opportunity collapse
the logic in parse_pci_sbdf{_seg}().

Signed-off-by: Teddy Astie <teddy.astie@xxxxxxxxxx>
---
 xen/drivers/pci/pci.c | 46 ++++++++-----------------------------------
 xen/include/xen/pci.h |  6 ------
 2 files changed, 8 insertions(+), 44 deletions(-)

diff --git a/xen/drivers/pci/pci.c b/xen/drivers/pci/pci.c
index a2b49f1b26..4f274e8984 100644
--- a/xen/drivers/pci/pci.c
+++ b/xen/drivers/pci/pci.c
@@ -151,18 +151,7 @@ void pci_intx(const struct pci_dev *pdev, bool enable)
     pci_conf_write16(pdev->sbdf, PCI_COMMAND, cmd);
 }
 
-const char *__init parse_pci(const char *s, unsigned int *seg_p,
-                             unsigned int *bus_p, unsigned int *dev_p,
-                             unsigned int *func_p)
-{
-    bool def_seg;
-
-    return parse_pci_seg(s, seg_p, bus_p, dev_p, func_p, &def_seg);
-}
-
-const char *__init parse_pci_seg(const char *s, unsigned int *seg_p,
-                                 unsigned int *bus_p, unsigned int *dev_p,
-                                 unsigned int *func_p, bool *def_seg)
+const char *__init parse_pci_sbdf_seg(const char *s, pci_sbdf_t *sbdf, bool 
*def_seg)
 {
     unsigned long seg = simple_strtoul(s, &s, 16), bus, dev, func;
 
@@ -180,39 +169,20 @@ const char *__init parse_pci_seg(const char *s, unsigned 
int *seg_p,
         *def_seg = true;
     }
 
-    if ( func_p )
-        func = *s == '.' ? simple_strtoul(s + 1, &s, 0) : 0;
+    func = *s == '.' ? simple_strtoul(s + 1, &s, 0) : 0;
 
-    if ( seg != (seg_p ? (u16)seg : 0) ||
+    if ( seg != (u16)seg ||
          bus != PCI_BUS(PCI_BDF(bus, 0)) ||
          dev != PCI_SLOT(PCI_DEVFN(dev, 0)) ||
-         func != (func_p ? PCI_FUNC(PCI_DEVFN(0, func)) : 0) )
+         func != PCI_FUNC(PCI_DEVFN(0, func)) )
         return NULL;
 
-    if ( seg_p )
-        *seg_p = seg;
-    *bus_p = bus;
-    *dev_p = dev;
-    if ( func_p )
-        *func_p = func;
-
-    return s;
-}
-
-const char *parse_pci_sbdf(const char *s, pci_sbdf_t *sbdf)
-{
-    unsigned int seg, bus, dev, func;
-    const char *out = parse_pci(s, &seg, &bus, &dev, &func);
-
     *sbdf = PCI_SBDF(seg, bus, dev, func);
-    return out;
+    return s;
 }
 
-const char *parse_pci_sbdf_seg(const char *s, pci_sbdf_t *sbdf, bool *def_seg)
+const char *__init parse_pci_sbdf(const char *s, pci_sbdf_t *sbdf)
 {
-    unsigned int seg, bus, dev, func;
-    const char *out = parse_pci_seg(s, &seg, &bus, &dev, &func, def_seg);
-
-    *sbdf = PCI_SBDF(seg, bus, dev, func);
-    return out;
+    bool def_seg;
+    return parse_pci_sbdf_seg(s, sbdf, &def_seg);
 }
diff --git a/xen/include/xen/pci.h b/xen/include/xen/pci.h
index 6b8fcd88dd..71689a2d6b 100644
--- a/xen/include/xen/pci.h
+++ b/xen/include/xen/pci.h
@@ -273,12 +273,6 @@ unsigned int pci_find_ext_capability(const struct pci_dev 
*pdev,
 unsigned int pci_find_next_ext_capability(const struct pci_dev *pdev,
                                           unsigned int start,
                                           unsigned int cap);
-const char *parse_pci(const char *s, unsigned int *seg_p, unsigned int *bus_p,
-                      unsigned int *dev_p, unsigned int *func_p);
-const char *parse_pci_seg(const char *s, unsigned int *seg_p,
-                          unsigned int *bus_p, unsigned int *dev_p,
-                          unsigned int *func_p, bool *def_seg);
-
 const char *parse_pci_sbdf(const char *s, pci_sbdf_t *sbdf);
 const char *parse_pci_sbdf_seg(const char *s, pci_sbdf_t *sbdf, bool *def_seg);
 
-- 
2.54.0



--
Teddy Astie | Vates XCP-ng Developer

XCP-ng & Xen Orchestra - Vates solutions

web: https://vates.tech

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.