Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
home:X0F:HSF
hardinfo
hardinfo-QA_fixes.patch
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File hardinfo-QA_fixes.patch of Package hardinfo
From 0b840c4849c705b98de4a618d433b56553807c40 Mon Sep 17 00:00:00 2001 From: Burt P <pburt0@gmail.com> Date: Fri, 26 Oct 2018 14:12:25 -0500 Subject: [PATCH 1/7] gpu_util: minor fix (#298) E: hardinfo no-return-in-nonvoid-function /home/abuild/rpmbuild/BUILD/hardinfo-20181022T194523/hardinfo/gpu_util.c:37, 405 E: hardinfo no-return-in-nonvoid-function /home/abuild/rpmbuild/BUILD/hardinfo-20181022T194523/hardinfo/gpu_util.c:37, 405 Signed-off-by: Burt P <pburt0@gmail.com> --- hardinfo/gpu_util.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hardinfo/gpu_util.c b/hardinfo/gpu_util.c index ba72b907..3dd61318 100644 --- a/hardinfo/gpu_util.c +++ b/hardinfo/gpu_util.c @@ -28,7 +28,7 @@ nvgpu *nvgpu_new() { return g_new0(nvgpu, 1); } -void *nvgpu_free(nvgpu *s) { +void nvgpu_free(nvgpu *s) { if (s) { free(s->model); free(s->bios_version); From 1224e5cf4a9dc2014fefb80bdf7531bb6bf29ce4 Mon Sep 17 00:00:00 2001 From: Burt P <pburt0@gmail.com> Date: Fri, 26 Oct 2018 19:32:27 -0500 Subject: [PATCH 2/7] pci_util: minor fix (#298) E: hardinfo no-return-in-nonvoid-function /home/abuild/rpmbuild/BUILD/hardinfo-20181022T194523/hardinfo/pci_util.c:202, 160 Signed-off-by: Burt P <pburt0@gmail.com> --- hardinfo/pci_util.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/hardinfo/pci_util.c b/hardinfo/pci_util.c index 40326da2..b04a6e5e 100644 --- a/hardinfo/pci_util.c +++ b/hardinfo/pci_util.c @@ -168,7 +168,8 @@ static gboolean pci_get_device_sysfs(uint32_t dom, uint32_t bus, uint32_t dev, u s->bus = bus; s->device = dev; s->function = func; - _sysfs_bus_pci_read_hex(dom, bus, dev, func, "class", &s->class); + if (! _sysfs_bus_pci_read_hex(dom, bus, dev, func, "class", &s->class) ) + return FALSE; s->class >>= 8; /* TODO: find out why */ _sysfs_bus_pci_read_hex(dom, bus, dev, func, "device", &s->device_id); _sysfs_bus_pci_read_hex(dom, bus, dev, func, "vendor", &s->vendor_id); @@ -198,7 +199,7 @@ static gboolean pci_get_device_sysfs(uint32_t dom, uint32_t bus, uint32_t dev, u s->pcie_width_curr = strtoul(tmp, NULL, 0); free(tmp); } - + return TRUE; } static gboolean pci_get_device_lspci(uint32_t dom, uint32_t bus, uint32_t dev, uint32_t func, pcid *s) { @@ -248,7 +249,7 @@ static gboolean pci_get_device_lspci(uint32_t dom, uint32_t bus, uint32_t dev, u pcid *pci_get_device(uint32_t dom, uint32_t bus, uint32_t dev, uint32_t func) { pcid *s = pcid_new(); - int ok = 0; + gboolean ok = FALSE; if (s) { ok = pci_get_device_sysfs(dom, bus, dev, func, s); ok |= pci_get_device_lspci(dom, bus, dev, func, s); From 86f719bea78b10e7028b40d94508b222b4914ba3 Mon Sep 17 00:00:00 2001 From: Burt P <pburt0@gmail.com> Date: Fri, 26 Oct 2018 19:38:57 -0500 Subject: [PATCH 3/7] bench_results: minor fix (#298) E: hardinfo no-return-in-nonvoid-function /home/abuild/rpmbuild/BUILD/hardinfo-20181022T194523/modules/benchmark/bench_results.c:137 Signed-off-by: Burt P <pburt0@gmail.com> --- modules/benchmark/bench_results.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/benchmark/bench_results.c b/modules/benchmark/bench_results.c index 92790edb..0a2abdc1 100644 --- a/modules/benchmark/bench_results.c +++ b/modules/benchmark/bench_results.c @@ -113,7 +113,7 @@ static int cpu_config_is_close(char *str0, char *str1) { return 0; } -static gen_machine_id(bench_machine *m) { +static void gen_machine_id(bench_machine *m) { char *s; if (m) { if (m->mid != NULL) From 9683d8d5d0c918efd134bf53a54601e297a24dc8 Mon Sep 17 00:00:00 2001 From: Burt P <pburt0@gmail.com> Date: Fri, 26 Oct 2018 19:42:56 -0500 Subject: [PATCH 4/7] spd_decode: minor fix (#298) E: hardinfo no-return-in-nonvoid-function /home/abuild/rpmbuild/BUILD/hardinfo-20181022T194523/modules/devices/spd-decode.c:982 Signed-off-by: Burt P <pburt0@gmail.com> --- modules/devices/spd-decode.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/devices/spd-decode.c b/modules/devices/spd-decode.c index 2db4895b..c1a16dc8 100644 --- a/modules/devices/spd-decode.c +++ b/modules/devices/spd-decode.c @@ -947,7 +947,7 @@ static void decode_ddr_module_size(unsigned char *bytes, int *size) } } -static void *decode_ddr_module_timings(unsigned char *bytes, float *tcl, float *trcd, float *trp, float *tras) +static void decode_ddr_module_timings(unsigned char *bytes, float *tcl, float *trcd, float *trp, float *tras) { float ctime; float highest_cas = 0; From 5abbeccd5b2f960b5e239471abe9e8335238ea43 Mon Sep 17 00:00:00 2001 From: Burt P <pburt0@gmail.com> Date: Fri, 26 Oct 2018 19:53:29 -0500 Subject: [PATCH 5/7] bench/zlib: minor fix, changes results significantly (#298) W: hardinfo uninitialized-variable /home/abuild/rpmbuild/BUILD/hardinfo-20181022T194523/modules/benchmark/zlib.c:28 This change significantly impacts the bench result. All old results should be discarded, IMO. I think I will also attempt to remake this benchmark in a similar way to the blowfish benchmark. See PR #293. Signed-off-by: Burt P <pburt0@gmail.com> --- modules/benchmark/zlib.c | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/modules/benchmark/zlib.c b/modules/benchmark/zlib.c index 2ded59a4..894d8e18 100644 --- a/modules/benchmark/zlib.c +++ b/modules/benchmark/zlib.c @@ -22,10 +22,17 @@ #include "benchmark.h" +/* must be less than or equal to + * file size of ( params.path_data + "benchmark.data" ) */ +#define BENCH_DATA_SIZE 65536 + +#define BENCH_EVENTS 50000 +#define BENCH_WTF_NUMBER 840205128 + static gpointer zlib_for(unsigned int start, unsigned int end, void *data, gint thread_number) { char *compressed; - uLong bound = compressBound(bound); + uLong bound = compressBound(BENCH_DATA_SIZE); unsigned int i; compressed = malloc(bound); @@ -33,11 +40,11 @@ static gpointer zlib_for(unsigned int start, unsigned int end, void *data, gint return NULL; for (i = start; i <= end; i++) { - char uncompressed[65536]; + char uncompressed[BENCH_DATA_SIZE]; uLong compressedBound = bound; uLong destBound = sizeof(uncompressed); - compress(compressed, &compressedBound, data, 65536); + compress(compressed, &compressedBound, data, BENCH_DATA_SIZE); uncompress(uncompressed, &destBound, compressed, compressedBound); } @@ -61,13 +68,13 @@ benchmark_zlib(void) shell_view_set_enabled(FALSE); shell_status_update("Running Zlib benchmark..."); - r = benchmark_parallel_for(0, 0, 50000, zlib_for, tmpsrc); + r = benchmark_parallel_for(0, 0, BENCH_EVENTS, zlib_for, tmpsrc); g_free(bdata_path); g_free(tmpsrc); - //TODO: explain in code comments - gdouble marks = (50000. * 65536.) / (r.elapsed_time * 840205128.); + //TODO: explain in code comments! + gdouble marks = ((double)BENCH_EVENTS * (double)BENCH_DATA_SIZE) / (r.elapsed_time * (double)BENCH_WTF_NUMBER); r.result = marks; bench_results[BENCHMARK_ZLIB] = r; } From 2f9711d58f04bdfa86b69d8d7fb20e276a0919dd Mon Sep 17 00:00:00 2001 From: Burt P <pburt0@gmail.com> Date: Fri, 26 Oct 2018 20:19:56 -0500 Subject: [PATCH 6/7] Perhaps fix implicit-pointer-decl warning for suse (#298) I don't know what -W... would cause this to be checked by the compiler so I can't test it. It's not -Wimplicit-pointer-decl, at least not in gcc 8.2.0. This fix is a guess based on what I've read in other patches trying to fix this. Signed-off-by: Burt P <pburt0@gmail.com> --- includes/hardinfo.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/includes/hardinfo.h b/includes/hardinfo.h index 3412f852..2fdaa4f1 100644 --- a/includes/hardinfo.h +++ b/includes/hardinfo.h @@ -19,6 +19,9 @@ #ifndef __HARDINFO_H__ #define __HARDINFO_H__ +#include <stdio.h> +#include <string.h> +#include <ctype.h> #include <unistd.h> #include <gtk/gtk.h> #include "config.h" From 9b2d09e89ff461831ec4faacd0004dc73d032889 Mon Sep 17 00:00:00 2001 From: Burt P <pburt0@gmail.com> Date: Sat, 27 Oct 2018 12:58:17 -0500 Subject: [PATCH 7/7] enable and fix some warnings Part of (#298). Signed-off-by: Burt P <pburt0@gmail.com> --- CMakeLists.txt | 10 ++++++++++ hardinfo/gpu_util.c | 4 ++-- hardinfo/pci_util.c | 10 ++++------ hardinfo/x_util.c | 12 ++++-------- modules/network.c | 2 ++ 5 files changed, 22 insertions(+), 16 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 697bdac4..b832dc06 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -218,6 +218,16 @@ add_library(uber-graph STATIC ) endif() +set_source_files_properties( + hardinfo/usb_util.c + hardinfo/pci_util.c + hardinfo/gpu_util.c + hardinfo/cpu_util.c + hardinfo/x_util.c + PROPERTIES + COMPILE_FLAGS "-Wall -Wextra -Wno-parentheses -Wno-unused-function" +) + if (HARDINFO_GTK3) add_executable(hardinfo hardinfo/usb_util.c diff --git a/hardinfo/gpu_util.c b/hardinfo/gpu_util.c index 3dd61318..ed406608 100644 --- a/hardinfo/gpu_util.c +++ b/hardinfo/gpu_util.c @@ -257,7 +257,7 @@ gpud *dt_soc_gpu() { { "brcm,bcm2835-vc4", "Broadcom", "VideoCore IV" }, { "arm,mali-450", "ARM", "Mali 450" }, { "arm,mali", "ARM", "Mali family" }, - { NULL, NULL } + { NULL, NULL, NULL } }; char tmp_path[256] = ""; char *dt_gpu_path = NULL; @@ -401,7 +401,7 @@ gpud *gpu_get_device_list() { /* Try other things ... */ - + return list; } 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); diff --git a/hardinfo/x_util.c b/hardinfo/x_util.c index 49372f56..c052f00a 100644 --- a/hardinfo/x_util.c +++ b/hardinfo/x_util.c @@ -54,11 +54,9 @@ static char *simple_line_value(char *line, const char *prefix) { gboolean fill_glx_info(glx_info *glx) { gboolean spawned; - gchar *out, *err, *p, *l, *t, *next_nl; + gchar *out, *err, *p, *l, *next_nl; gchar *glx_cmd = g_strdup("glxinfo"); - int ec; - #define GLX_MATCH_LINE(prefix_str, struct_member) \ if (l = simple_line_value(p, prefix_str)) { glx->struct_member = g_strdup(l); goto glx_next_line; } @@ -120,11 +118,9 @@ void glx_free(glx_info *s) { gboolean fill_xinfo(xinfo *xi) { gboolean spawned; - gchar *out, *err, *p, *l, *t, *next_nl; + gchar *out, *err, *p, *l, *next_nl; gchar *xi_cmd = g_strdup("xdpyinfo"); - int ec; - #define XI_MATCH_LINE(prefix_str, struct_member) \ if (l = simple_line_value(p, prefix_str)) { xi->struct_member = g_strdup(l); goto xi_next_line; } @@ -154,10 +150,10 @@ gboolean fill_xinfo(xinfo *xi) { gboolean fill_xrr_info(xrr_info *xrr) { gboolean spawned; - gchar *out, *err, *p, *l, *t, *next_nl; + gchar *out, *err, *p, *next_nl; gchar *xrr_cmd = g_strdup("xrandr"); - int ec; + x_screen ts; x_output to; char output_id[128]; diff --git a/modules/network.c b/modules/network.c index fa61ddca..274cd893 100644 --- a/modules/network.c +++ b/modules/network.c @@ -27,6 +27,8 @@ #include <sys/stat.h> #include <sys/socket.h> +#include <netinet/in.h> +#include <arpa/inet.h> #include <netdb.h> #include <hardinfo.h>
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor