]> granicus.if.org Git - sysstat/commitdiff
Don't assign values that are never used
authorSebastien GODARD <sysstat@users.noreply.github.com>
Thu, 23 Feb 2023 08:56:08 +0000 (09:56 +0100)
committerSebastien GODARD <sysstat@users.noreply.github.com>
Thu, 23 Feb 2023 08:56:08 +0000 (09:56 +0100)
Signed-off-by: Sebastien GODARD <sysstat@users.noreply.github.com>
count.c
json_stats.c
pcp_def_metrics.c
rd_stats.c
sadf.c
sadf_misc.c

diff --git a/count.c b/count.c
index 49df90b3463bb3921ea800b2028fc144670f1d9e..83b80e028ac9fb77167f5cbe7a3692a2db62abf9 100644 (file)
--- 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)
index 8812d058a0e7ff659fad172e7ee0a7319d13eea8..cbd564366424bfaba00ee725c5ced64846f20a23 100644 (file)
@@ -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, "
index 7217a8d2137cfcb302a18040691a250ad16d7dd7..f4f41b6623282cadf99b004cf817d995cb5a6791 100644 (file)
@@ -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];
 
index 2c88d48c0b09599cf20f97d92abdd991c75079d0..dd5f4277bab1c2a0cc459d9cc3f7140eb2c1d88d 100644 (file)
@@ -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 855b79bfb9359562eac7ea5a3c3c8e1c4dda30ba..c2c3f35b29486660620910d20dd7743fc8ef19bc 100644 (file)
--- 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 */
index eb218e04ec392b979c894ac08d400a06b55b3f3f..e39ca81e61d5fcc9ead5298d3d371b0fc5d0c0d0 100644 (file)
@@ -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) {