From 29f8126a0112c2125aa8b150314521cbc5c7d9fd Mon Sep 17 00:00:00 2001 From: Burt P Date: Fri, 10 Jan 2020 11:07:39 -0600 Subject: pci: sort list of devices Signed-off-by: Burt P --- hardinfo/pci_util.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'hardinfo/pci_util.c') diff --git a/hardinfo/pci_util.c b/hardinfo/pci_util.c index 9502b23b..69150732 100644 --- a/hardinfo/pci_util.c +++ b/hardinfo/pci_util.c @@ -151,6 +151,11 @@ static gboolean pci_lookup_ids(pcid *d) { return ret; } +gint pcid_cmp_by_addy(const pcid* a, const pcid* b) { + if (!a || !b) return (!!a - !!b); + return g_strcmp0(a->slot_str, b->slot_str); +} + void pcid_free(pcid *s) { if (s) { g_free(s->slot_str); -- cgit v1.2.3