From 81001519730d9d9277f0ab935e3088e4f6e95286 Mon Sep 17 00:00:00 2001 From: Sebastien GODARD Date: Thu, 23 Feb 2023 09:56:08 +0100 Subject: [PATCH] Don't assign values that are never used Signed-off-by: Sebastien GODARD --- count.c | 2 +- json_stats.c | 1 - pcp_def_metrics.c | 8 ++++---- rd_stats.c | 4 ++-- sadf.c | 2 +- sadf_misc.c | 2 +- 6 files changed, 9 insertions(+), 10 deletions(-) diff --git a/count.c b/count.c index 49df90b..83b80e0 100644 --- a/count.c +++ b/count.c @@ -440,7 +440,7 @@ __nr_t get_filesystem_nr(void) char line[512], fs_name[MAX_FS_LEN], mountp[256], type[128]; char *pos = 0, *pos2 = 0; __nr_t fs = 0; - int skip = 0, skip_next = 0; + int skip, skip_next = 0; struct statvfs buf; if ((fp = fopen(MTAB, "r")) == NULL) diff --git a/json_stats.c b/json_stats.c index 8812d05..cbd5643 100644 --- a/json_stats.c +++ b/json_stats.c @@ -595,7 +595,6 @@ __print_funct_t json_print_memory_stats(struct activity *a, int curr, int tab, if (sep) { printf(", "); } - sep = TRUE; printf("\"swpfree\": %llu, " "\"swpused\": %llu, " diff --git a/pcp_def_metrics.c b/pcp_def_metrics.c index 7217a8d..f4f41b6 100644 --- a/pcp_def_metrics.c +++ b/pcp_def_metrics.c @@ -1558,7 +1558,7 @@ void pcp_def_huge_metrics() void pcp_def_pwr_fan_metrics(struct activity *a) { #ifdef HAVE_PCP - int inst = 0; + int inst; static pmInDom indom = PM_INDOM_NULL; char buf[16]; @@ -1597,7 +1597,7 @@ void pcp_def_pwr_fan_metrics(struct activity *a) void pcp_def_pwr_temp_metrics(struct activity *a) { #ifdef HAVE_PCP - int inst = 0; + int inst; static pmInDom indom = PM_INDOM_NULL; char buf[16]; @@ -1636,7 +1636,7 @@ void pcp_def_pwr_temp_metrics(struct activity *a) void pcp_def_pwr_in_metrics(struct activity *a) { #ifdef HAVE_PCP - int inst = 0; + int inst; static pmInDom indom = PM_INDOM_NULL; char buf[16]; @@ -1711,7 +1711,7 @@ void pcp_def_pwr_bat_metrics(struct activity *a) void pcp_def_pwr_usb_metrics(struct activity *a) { #ifdef HAVE_PCP - int inst = 0; + int inst; static pmInDom indom = PM_INDOM_NULL; char buf[16]; diff --git a/rd_stats.c b/rd_stats.c index 2c88d48..dd5f427 100644 --- a/rd_stats.c +++ b/rd_stats.c @@ -1039,7 +1039,7 @@ __nr_t read_kernel_tables(struct stats_ktables *st_ktables) { FILE *fp; unsigned long long parm; - int rc = 0; + int rc; /* Open /proc/sys/fs/dentry-state file */ if ((fp = fopen(FDENTRY_STATE, "r")) != NULL) { @@ -2592,7 +2592,7 @@ __nr_t read_filesystem(struct stats_filesystem *st_filesystem, __nr_t nr_alloc) { FILE *fp; char line[512], fs_name[MAX_FS_LEN], mountp[256], type[128]; - int skip = 0, skip_next = 0, fs; + int skip, skip_next = 0, fs; char *pos = 0, *pos2 = 0; __nr_t fs_read = 0; struct stats_filesystem *st_filesystem_i; diff --git a/sadf.c b/sadf.c index 855b79b..c2c3f35 100644 --- a/sadf.c +++ b/sadf.c @@ -1240,7 +1240,7 @@ void logic2_display_loop(int ifd, char *file, struct file_activity *file_actlst, { int i, p; int curr = 1, rtype; - int eosaf = TRUE, reset = FALSE; + int eosaf = TRUE, reset; long cnt = 1; /* Read system statistics from file */ diff --git a/sadf_misc.c b/sadf_misc.c index eb218e0..e39ca81 100644 --- a/sadf_misc.c +++ b/sadf_misc.c @@ -1348,7 +1348,7 @@ __printf_funct_t print_svg_header(void *parm, int action, char *dfile, char *my_ struct svg_hdr_parm *hdr_parm = (struct svg_hdr_parm *) parm; struct tm rectime; time_t t = file_hdr->sa_ust_time; - unsigned int height = 0, ht = 0; + unsigned int height, ht = 0; int i, p; if (action & F_BEGIN) { -- 2.40.0