Fix variable shadowing
authorJens Axboe <axboe@kernel.dk>
Tue, 5 Jun 2018 19:44:47 +0000 (13:44 -0600)
committerJens Axboe <axboe@kernel.dk>
Tue, 5 Jun 2018 19:44:47 +0000 (13:44 -0600)
Signed-off-by: Jens Axboe <axboe@kernel.dk>
backend.c
iolog.c
options.c
server.c
stat.c

index 151210a439ba303a18c995d11fa08baac1c3bec7..c52eba58fa10eb4e02768a74d693cc2eee8b3241 100644 (file)
--- a/backend.c
+++ b/backend.c
@@ -1034,7 +1034,7 @@ static void do_io(struct thread_data *td, uint64_t *bytes_done)
 
                if (td->o.io_submit_mode == IO_MODE_OFFLOAD) {
                        const unsigned long blen = io_u->xfer_buflen;
-                       const enum fio_ddir ddir = acct_ddir(io_u);
+                       const enum fio_ddir __ddir = acct_ddir(io_u);
 
                        if (td->error)
                                break;
@@ -1042,14 +1042,14 @@ static void do_io(struct thread_data *td, uint64_t *bytes_done)
                        workqueue_enqueue(&td->io_wq, &io_u->work);
                        ret = FIO_Q_QUEUED;
 
-                       if (ddir_rw(ddir)) {
-                               td->io_issues[ddir]++;
-                               td->io_issue_bytes[ddir] += blen;
-                               td->rate_io_issue_bytes[ddir] += blen;
+                       if (ddir_rw(__ddir)) {
+                               td->io_issues[__ddir]++;
+                               td->io_issue_bytes[__ddir] += blen;
+                               td->rate_io_issue_bytes[__ddir] += blen;
                        }
 
                        if (should_check_rate(td))
-                               td->rate_next_io_time[ddir] = usec_for_io(td, ddir);
+                               td->rate_next_io_time[__ddir] = usec_for_io(td, __ddir);
 
                } else {
                        ret = io_u_submit(td, io_u);
diff --git a/iolog.c b/iolog.c
index d7474724f0d140cd4e66b5136f47aedb2002ddcd..5be3e84b91dab7dacbabce9506b9b7489b02e8b3 100644 (file)
--- a/iolog.c
+++ b/iolog.c
@@ -619,12 +619,12 @@ void setup_log(struct io_log **log, struct log_params *p,
        }
 
        if (l->td && l->td->o.io_submit_mode != IO_MODE_OFFLOAD) {
-               struct io_logs *p;
+               struct io_logs *__p;
 
-               p = calloc(1, sizeof(*l->pending));
-               p->max_samples = DEF_LOG_ENTRIES;
-               p->log = calloc(p->max_samples, log_entry_sz(l));
-               l->pending = p;
+               __p = calloc(1, sizeof(*l->pending));
+               __p->max_samples = DEF_LOG_ENTRIES;
+               __p->log = calloc(__p->max_samples, log_entry_sz(l));
+               l->pending = __p;
        }
 
        if (l->log_offset)
index 445f3d453e88baa1c9a9c4737b16b34fd1aaef38..9fbcd96d9ee1f4987fbbfad8e5eac896e6dd8dad 100644 (file)
--- a/options.c
+++ b/options.c
@@ -1046,8 +1046,6 @@ static int parse_zoned_distribution(struct thread_data *td, const char *input,
        }
 
        if (parse_dryrun()) {
-               int i;
-
                for (i = 0; i < DDIR_RWDIR_CNT; i++) {
                        free(td->o.zone_split[i]);
                        td->o.zone_split[i] = NULL;
index 12c8d6841135437f4b3d06210aaa1ce74c9fd9b2..7e7ffedc7139077a6ea5b86b5e181afb0dd8efb0 100644 (file)
--- a/server.c
+++ b/server.c
@@ -1594,7 +1594,7 @@ void fio_server_send_gs(struct group_run_stats *rs)
 }
 
 void fio_server_send_job_options(struct flist_head *opt_list,
-                                unsigned int groupid)
+                                unsigned int gid)
 {
        struct cmd_job_option pdu;
        struct flist_head *entry;
@@ -1609,12 +1609,12 @@ void fio_server_send_job_options(struct flist_head *opt_list,
                p = flist_entry(entry, struct print_option, list);
                memset(&pdu, 0, sizeof(pdu));
 
-               if (groupid == -1U) {
+               if (gid == -1U) {
                        pdu.global = __cpu_to_le16(1);
                        pdu.groupid = 0;
                } else {
                        pdu.global = 0;
-                       pdu.groupid = cpu_to_le32(groupid);
+                       pdu.groupid = cpu_to_le32(gid);
                }
                len = strlen(p->name);
                if (len >= sizeof(pdu.name)) {
diff --git a/stat.c b/stat.c
index 1effbfe9c5b452c625574a3cce02bd87ccdb074a..5b49dddbb1d0786341902bd4a2b75271db30f466 100644 (file)
--- a/stat.c
+++ b/stat.c
@@ -1398,7 +1398,7 @@ static struct json_object *show_thread_status_json(struct thread_stat *ts,
        if (ts->ss_dur) {
                struct json_object *data;
                struct json_array *iops, *bw;
-               int i, j, k;
+               int j, k, l;
                char ss_buf[64];
 
                snprintf(ss_buf, sizeof(ss_buf), "%s%s:%f%s",
@@ -1434,8 +1434,8 @@ static struct json_object *show_thread_status_json(struct thread_stat *ts,
                        j = ts->ss_head;
                else
                        j = ts->ss_head == 0 ? ts->ss_dur - 1 : ts->ss_head - 1;
-               for (i = 0; i < ts->ss_dur; i++) {
-                       k = (j + i) % ts->ss_dur;
+               for (l = 0; l < ts->ss_dur; l++) {
+                       k = (j + l) % ts->ss_dur;
                        json_array_add_value_int(bw, ts->ss_bw_data[k]);
                        json_array_add_value_int(iops, ts->ss_iops_data[k]);
                }