]> granicus.if.org Git - sysstat/commitdiff
code style, blank line after while
authorSteve Kay <stevekay@gmail.com>
Thu, 16 Jun 2022 13:52:07 +0000 (14:52 +0100)
committerSteve Kay <stevekay@gmail.com>
Thu, 16 Jun 2022 13:52:07 +0000 (14:52 +0100)
12 files changed:
cifsiostat.c
common.c
count.c
ioconf.c
iostat.c
mpstat.c
pcp_def_metrics.c
pidstat.c
rd_sensors.c
rd_stats.c
sa_common.c
tapestat.c

index 52e9cabd8516944b3eb3c837f18379935ad56289..03be68ae495bde27a868fd852c38d7d4b2f8a5db 100644 (file)
@@ -141,6 +141,7 @@ struct io_cifs *add_list_cifs(struct io_cifs **clist, char *name)
                return NULL;
 
        while (*clist != NULL) {
+
                c = *clist;
                if ((i = strcmp(c->name, name)) == 0) {
                        /* cifs found in list */
index 5a915e649d7f755716e6f5f798d3469f945e9157..94e94b50f2c4d912aa5b915deffddd46d088e6fc 100644 (file)
--- a/common.c
+++ b/common.c
@@ -948,6 +948,7 @@ char *get_persistent_name_from_pretty(char *pretty)
                return (NULL);
 
        while (persist_names[++i]) {
+
                /* Get absolute path for current persistent name */
                link = get_persistent_name_path(persist_names[i]);
                if (!link)
diff --git a/count.c b/count.c
index 855e212d80874ffa3f87691b1cab2bd0a8a0a192..a66764e4a91c55ff15d1e1c5d7d659abdca639a9 100644 (file)
--- a/count.c
+++ b/count.c
@@ -208,6 +208,7 @@ __nr_t get_irqcpu_nr(char *file, int max_nr_irqcpu, int cpu_nr)
 
        while ((fgets(line, INTERRUPTS_LINE + 11 * cpu_nr , fp) != NULL) &&
               (irq < max_nr_irqcpu)) {
+
                p = strcspn(line, ":");
                if ((p > 0) && (p < 16)) {
                        irq++;
@@ -256,6 +257,7 @@ __nr_t get_diskstats_dev_nr(int count_part, int only_used_dev)
         * the number of lines...
         */
        while (fgets(line, sizeof(line), fp) != NULL) {
+
                if (!count_part) {
                        i = sscanf(line, "%*d %*d %s %lu %*u %*u %*u %lu",
                                   dev_name, &rd_ios, &wr_ios);
index ea2c578a199ac4362ee7b55d701da8fdadbe8f3d..cf0323615206e8ba03eabf3815671f3601b1948a 100644 (file)
--- a/ioconf.c
+++ b/ioconf.c
@@ -107,6 +107,7 @@ static char *ioc_conv(int radix, int nozero, const char *syms,
        }
 
        while (val > 0) {
+
                *--p = syms[j = val % radix];
                val /= radix;
                if (nozero && (j == 0)) {
index 37398401ea87edca710c7ac064e1b25f75c564a2..03f56234a020e49174fc15aa23c4bf30e1443607 100644 (file)
--- a/iostat.c
+++ b/iostat.c
@@ -300,6 +300,7 @@ struct io_device *add_list_device(struct io_device **dlist, char *name, int dtyp
                return NULL;
 
        while (*dlist != NULL) {
+
                d = *dlist;
                if ((i = strcmp(d->name, name)) == 0) {
                        /* Device found in list */
index 5ed9acc17fadc48a960bb92997ab0fdd30da3137..d48f076fa3723952db2cc3997e5947632c3c5f21 100644 (file)
--- a/mpstat.c
+++ b/mpstat.c
@@ -290,6 +290,7 @@ void fwd_irq_values(struct stats_irqcpu *st_ic[], unsigned int c,
        int j;
 
        while (c < last) {
+
                st_irq_i = st_irq[curr] + c + 1;
                st_irq_j = st_irq[!curr] + c + 1;
                st_irq_i->irq_nr = st_irq_j->irq_nr;
@@ -1856,8 +1857,10 @@ void read_interrupts_stat(char *file, struct stats_irqcpu *st_ic[], int ic_nr, i
                 * Parse header line to see which CPUs are online
                 */
                while (fgets(line, INTERRUPTS_LINE + 11 * cpu_nr, fp) != NULL) {
+
                        next = line;
                        while (((cp = strstr(next, "CPU")) != NULL) && (index < cpu_nr)) {
+
                                cpu = strtol(cp + 3, &next, 10);
                                if (cpu >= cpu_nr)
                                        break;
index 303ee0eba657a2c32d26a2ee4d217e72d201df84..bf3e5a213d901d0aa0c4995a7f5605f4b5d62eb3 100644 (file)
@@ -60,6 +60,7 @@ void pcp_def_percpu_int_metrics(struct activity *a, int cpu)
 
        /* Create instance for each interrupt for the current CPU */
        while (list != NULL) {
+
                snprintf(buf, sizeof(buf), "%s::cpu%d", list->item_name, cpu);
                buf[sizeof(buf) - 1] = '\0';
 
@@ -319,6 +320,7 @@ void pcp_def_irq_metrics(struct activity *a)
 
        /* Create instances and metrics for each interrupts for CPU "all" */
        while (list != NULL) {
+
                if (!strcmp(list->item_name, K_LOWERSUM)) {
                        /*
                         * Create metric for interrupt "sum" for CPU "all".
index a9c197f7c1f5f728e91ebb98b54b0725474f746c..4026e27bcb4b126e43968b1a5b27cd0182cffc68 100644 (file)
--- a/pidstat.c
+++ b/pidstat.c
@@ -138,6 +138,7 @@ void sfree_pid(struct st_pid **plist, int force)
        struct st_pid *p;
 
        while (*plist != NULL) {
+
                p = *plist;
                if (!p->exist || force) {
                        *plist = p->next;
@@ -247,6 +248,7 @@ struct st_pid *add_list_pid(struct st_pid **plist, pid_t pid, pid_t tgid)
                 * other TIDs.
                 */
                while (*plist != NULL) {
+
                        p = *plist;
                        if (!p->tgid && (p->pid == pid))
                                /* PID found in list */
@@ -266,6 +268,7 @@ struct st_pid *add_list_pid(struct st_pid **plist, pid_t pid, pid_t tgid)
                 * following its TGID.
                 */
                while (*plist != NULL) {
+
                        p = *plist;
                        if (p->pid == tgid) {
                                /* TGID found in list */
@@ -282,6 +285,7 @@ struct st_pid *add_list_pid(struct st_pid **plist, pid_t pid, pid_t tgid)
 
                plist = &(p->next);
                while (*plist != NULL) {
+
                        p = *plist;
                        if ((p->tgid == tgid_p) && (p->pid == pid))
                                /* TID found in list */
@@ -605,6 +609,7 @@ int read_proc_pid_smap(pid_t pid, struct st_pid *plist, pid_t tgid, int curr)
                return 1;
 
        while ((state < 3) && (fgets(line, sizeof(line), fp) != NULL)) {
+
                switch (state) {
                        case 0:
                                if (strstr(line, "[stack]")) {
@@ -882,6 +887,7 @@ void read_task_stats(pid_t pid, struct st_pid *plist, int curr)
                return;
 
        while ((drp = __readdir(dir)) != NULL) {
+
                if (!isdigit(drp->d_name[0])) {
                        continue;
                }
@@ -951,6 +957,7 @@ void read_stats(int curr)
 
                /* Get directory entries */
                while ((drp = __readdir(dir)) != NULL) {
+
                        if (!isdigit(drp->d_name[0])) {
                                continue;
                        }
index 94830d4d359c6d9cd0c7f777323836baafbdc67d..15d7ce55e2954cc589637b9426edf9cee3e14ff9 100644 (file)
@@ -68,8 +68,10 @@ __nr_t read_fan(struct stats_pwr_fan *st_pwr_fan, __nr_t nr_alloc)
        memset(st_pwr_fan, 0, STATS_PWR_FAN_SIZE);
 
        while ((chip = sensors_get_detected_chips(NULL, &chip_nr))) {
+
                i = 0;
                while ((feature = sensors_get_features(chip, &i))) {
+
                        if (feature->type == SENSORS_FEATURE_FAN) {
                                j = 0;
                                if (fan_read + 1 > nr_alloc)
@@ -78,6 +80,7 @@ __nr_t read_fan(struct stats_pwr_fan *st_pwr_fan, __nr_t nr_alloc)
                                sensors_snprintf_chip_name(st_pwr_fan_i->device, MAX_SENSORS_DEV_LEN, chip);
 
                                while ((sub = sensors_get_all_subfeatures(chip, feature, &j))) {
+
                                        if ((sub->type == SENSORS_SUBFEATURE_FAN_INPUT) &&
                                            (sub->flags & SENSORS_MODE_R)) {
                                                if (sensors_get_value(chip, sub->number, &st_pwr_fan_i->rpm)) {
@@ -130,8 +133,10 @@ __nr_t read_temp(struct stats_pwr_temp *st_pwr_temp, __nr_t nr_alloc)
        memset(st_pwr_temp, 0, STATS_PWR_TEMP_SIZE);
 
        while ((chip = sensors_get_detected_chips(NULL, &chip_nr))) {
+
                i = 0;
                while ((feature = sensors_get_features(chip, &i))) {
+
                        if (feature->type == SENSORS_FEATURE_TEMP) {
                                j = 0;
                                if (temp_read + 1 > nr_alloc)
@@ -140,6 +145,7 @@ __nr_t read_temp(struct stats_pwr_temp *st_pwr_temp, __nr_t nr_alloc)
                                sensors_snprintf_chip_name(st_pwr_temp_i->device, MAX_SENSORS_DEV_LEN, chip);
 
                                while ((sub = sensors_get_all_subfeatures(chip, feature, &j))) {
+
                                        if ((sub->type == SENSORS_SUBFEATURE_TEMP_INPUT) &&
                                                (sub->flags & SENSORS_MODE_R)) {
                                                if (sensors_get_value(chip, sub->number, &st_pwr_temp_i->temp)) {
@@ -197,8 +203,10 @@ __nr_t read_in(struct stats_pwr_in *st_pwr_in, __nr_t nr_alloc)
        memset(st_pwr_in, 0, STATS_PWR_IN_SIZE);
 
        while ((chip = sensors_get_detected_chips(NULL, &chip_nr))) {
+
                i = 0;
                while ((feature = sensors_get_features(chip, &i))) {
+
                        if (feature->type == SENSORS_FEATURE_IN) {
                                j = 0;
                                if (in_read + 1 > nr_alloc)
@@ -207,6 +215,7 @@ __nr_t read_in(struct stats_pwr_in *st_pwr_in, __nr_t nr_alloc)
                                sensors_snprintf_chip_name(st_pwr_in_i->device, MAX_SENSORS_DEV_LEN, chip);
 
                                while ((sub = sensors_get_all_subfeatures(chip, feature, &j))) {
+
                                        if ((sub->type == SENSORS_SUBFEATURE_IN_INPUT) &&
                                                (sub->flags & SENSORS_MODE_R)) {
                                                if (sensors_get_value(chip, sub->number, &st_pwr_in_i->in)) {
@@ -254,8 +263,10 @@ __nr_t get_sensors_nr(sensors_feature_type type) {
        int i;
 
        while ((chip = sensors_get_detected_chips(NULL, &chip_nr))) {
+
                i = 0;
                while ((feature = sensors_get_features(chip, &i))) {
+
                        if (feature->type == type) {
                                count++;
                        }
index 06aceff9545e15cd06eb0f3f68cf399e83759072..3b11598c1298a8f59a0b52db39d1a8a051dc0c40 100644 (file)
@@ -210,9 +210,11 @@ __nr_t read_stat_irq(struct stats_irq *st_irq, __nr_t nr_alloc, __nr_t nr_int)
                 * Parse header line to see which CPUs are online
                 */
                while (fgets(line, INTERRUPTS_LINE + 11 * cpu_nr, fp) != NULL) {
+
                        next = line;
                        while (((cp = strstr(next, "CPU")) != NULL) && (index < cpu_nr)) {
                                cpu = strtol(cp + 3, &next, 10);
+
                                if (cpu + 2 > nr_alloc) {
                                        rc = -1;
                                        goto out;
@@ -570,6 +572,7 @@ void oct2chr(char *str)
        len = strlen(str);
 
        while (i < len - 3) {
+
                if ((str[i] == '\\') &&
                    (str[i + 1] >= '0') && (str[i + 1] <= '3') &&
                    (str[i + 2] >= '0') && (str[i + 2] <= '7') &&
index c2c8ce1434a71bb94efb01cd2c9147e7c1b9a239..da22ee01f3b8b52d7c0091400e43a99ce12374f2 100644 (file)
@@ -427,6 +427,7 @@ int write_all(int fd, const void *buf, int nr_bytes)
        char *buffer = (char *) buf;
 
        while (nr_bytes > 0) {
+
                block = write(fd, &buffer[offset], nr_bytes);
 
                if (block < 0) {
index 3d5795e8e58aced7f5f37b55d9f2fa1952e59ca9..e3d57adcde54519dae0add0b41629b6d78e68979 100644 (file)
@@ -178,6 +178,7 @@ int get_max_tape_drives(void)
                return 0;
 
        while ((entry = readdir(dir)) != NULL) {
+
                if (regexec(&tape_reg, &entry->d_name[0], 1, &match, 0) == 0) {
                        /* d_name[2] to skip the st at the front */
                        tmp = atoi(&entry->d_name[2]) + 1;