diff options
author | Burt P <pburt0@gmail.com> | 2018-10-27 12:58:17 -0500 |
---|---|---|
committer | Leandro A. F. Pereira <leandro@hardinfo.org> | 2018-12-02 02:07:23 -0800 |
commit | 95e53cda009f498a88f64ef71803a168cb08856c (patch) | |
tree | dacc6f84e8ed93db85708b1f58df8705a5d52f8a /hardinfo/pci_util.c | |
parent | 58a9f093fc830ad3d17a77423136be30db631934 (diff) |
enable and fix some warnings
Part of (#298).
Signed-off-by: Burt P <pburt0@gmail.com>
Diffstat (limited to 'hardinfo/pci_util.c')
-rw-r--r-- | hardinfo/pci_util.c | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/hardinfo/pci_util.c b/hardinfo/pci_util.c index b04a6e5e..aeb2e839 100644 --- a/hardinfo/pci_util.c +++ b/hardinfo/pci_util.c @@ -80,9 +80,7 @@ static char *lspci_line_value(char *line, const char *prefix) { /* read output line of lspci -vmmnn */ static int lspci_line_string_and_code(char *line, char *prefix, char **str, uint32_t *code) { char *l = lspci_line_value(line, prefix); - char buff[512] = ""; char *e; - int ec; if (l) { e = strchr(l, 0); @@ -97,7 +95,7 @@ static int lspci_line_string_and_code(char *line, char *prefix, char **str, uint static gboolean pci_fill_details(pcid *s) { gboolean spawned; - gchar *out, *err, *p, *l, *t, *next_nl; + gchar *out, *err, *p, *l, *next_nl; gchar *pci_loc = pci_address_str(s->domain, s->bus, s->device, s->function); gchar *lspci_cmd = g_strdup_printf("lspci -D -s %s -vvv", pci_loc); @@ -154,9 +152,9 @@ gboolean _sysfs_bus_pci_read_hex(uint32_t dom, uint32_t bus, uint32_t dev, uint3 if (ec) { *val = tval; return TRUE; - } else - return FALSE; + } } + return FALSE; } /* https://www.kernel.org/doc/Documentation/ABI/testing/sysfs-bus-pci */ @@ -204,7 +202,7 @@ static gboolean pci_get_device_sysfs(uint32_t dom, uint32_t bus, uint32_t dev, u static gboolean pci_get_device_lspci(uint32_t dom, uint32_t bus, uint32_t dev, uint32_t func, pcid *s) { gboolean spawned; - gchar *out, *err, *p, *l, *t, *next_nl; + gchar *out, *err, *p, *l, *next_nl; gchar *pci_loc = pci_address_str(dom, bus, dev, func); gchar *lspci_cmd = g_strdup_printf("lspci -D -s %s -vmmnn", pci_loc); |