aboutsummaryrefslogtreecommitdiff
path: root/modules/devices/pci.c
diff options
context:
space:
mode:
authorBurt P <pburt0@gmail.com>2020-01-10 10:46:07 -0600
committerLeandro A. F. Pereira <leandro@hardinfo.org>2020-01-17 16:14:30 -0800
commit7114175cdb6ff611dfb164959c5aec2099f9e887 (patch)
tree3a4b654ff073049804cbb21a98703d6f4a0ffb85 /modules/devices/pci.c
parent1b66b4442410ef6a7f9939845977d0fd9d840f71 (diff)
pci_util: use GSList for pcid_list
Signed-off-by: Burt P <pburt0@gmail.com>
Diffstat (limited to 'modules/devices/pci.c')
-rw-r--r--modules/devices/pci.c22
1 files changed, 10 insertions, 12 deletions
diff --git a/modules/devices/pci.c b/modules/devices/pci.c
index 14f51a94..04a8a0cf 100644
--- a/modules/devices/pci.c
+++ b/modules/devices/pci.c
@@ -176,19 +176,17 @@ void scan_pci_do(void) {
gchar *pci_icons = g_strdup("");
- pcid *list = pci_get_device_list(0,0);
- pcid *curr = list;
-
- int c = pcid_list_count(list);
-
- if (c > 0) {
- while(curr) {
- pci_icons = _pci_dev(curr, pci_icons);
- curr=curr->next;
- }
-
- pcid_list_free(list);
+ pcid_list list = pci_get_device_list(0,0);
+ GSList *l = list;
+
+ int c = 0;
+ while(l) {
+ pcid *curr = (pcid*)l->data;
+ pci_icons = _pci_dev(curr, pci_icons);
+ c++;
+ l=l->next;
}
+ pcid_list_free(list);
if (c) {
pci_list = g_strconcat(pci_list, "[$ShellParam$]\n", "ViewType=1\n", pci_icons, NULL);