White space spring cleaning
authorJens Axboe <axboe@kernel.dk>
Tue, 27 Mar 2012 07:12:39 +0000 (09:12 +0200)
committerJens Axboe <axboe@kernel.dk>
Tue, 27 Mar 2012 07:12:39 +0000 (09:12 +0200)
Lets squash them all, with a bit of tooling help.

Signed-off-by: Jens Axboe <axboe@kernel.dk>
22 files changed:
backend.c
cairo_text_helpers.c
cairo_text_helpers.h
cconv.c
client.c
filesetup.c
gclient.c
gcompat.h
gerror.c
gfio.c
graph.c
io_u.c
ioengines.c
iolog.c
options.c
options.h
parse.c
printing.c
profile.c
server.c
stat.c
tickmarks.c

index 1f5f3c7f567967ab2f0d662eb6ab9845fadd9515..319bd253342e164405d04cc5d1506a1e6f29337e 100644 (file)
--- a/backend.c
+++ b/backend.c
@@ -335,8 +335,8 @@ static int break_on_this_error(struct thread_data *td, enum fio_ddir ddir,
                        return 1;
 
                if (td_non_fatal_error(err)) {
-                       /*
-                        * Continue with the I/Os in case of
+                       /*
+                        * Continue with the I/Os in case of
                         * a non fatal error.
                         */
                        update_error_count(td, err);
@@ -1091,9 +1091,9 @@ static void *thread_main(void *data)
                memcpy(&td->tv_cache, &td->start, sizeof(td->start));
 
                if (td->o.ratemin[0] || td->o.ratemin[1]) {
-                       memcpy(&td->lastrate[0], &td->bw_sample_time,
+                       memcpy(&td->lastrate[0], &td->bw_sample_time,
                                                sizeof(td->bw_sample_time));
-                       memcpy(&td->lastrate[1], &td->bw_sample_time,
+                       memcpy(&td->lastrate[1], &td->bw_sample_time,
                                                sizeof(td->bw_sample_time));
                }
 
index 89b9aa23e01d3d889e234dc3407936fca8234d61..4ab3ac9769ef479bb7b8339b3a38e6316bb245bf 100644 (file)
@@ -12,7 +12,7 @@ static void draw_aligned_text(cairo_t *cr, const char *font, double x, double y,
        double factor, direction;
        cairo_text_extents_t extents;
 
-       switch(alignment) {
+       switch (alignment) {
                case CENTERED:
                        direction = -1.0;
                        factor = 0.5;
@@ -58,7 +58,7 @@ void draw_left_justified_text(cairo_t *cr, const char *font,
        draw_aligned_text(cr, font, x, y, fontsize, text, LEFT_JUSTIFIED);
 }
 
-void draw_vertical_centered_text(cairo_t *cr, const char * font, double x,
+void draw_vertical_centered_text(cairo_t *cr, const char *font, double x,
                                        double y, double fontsize,
                                        const char *text)
 {
index f8157d4c9256fa8eddfdd007ef53d32b33488001..014001ad2f65fde81a0dc01cffb9f4d101367d8f 100644 (file)
@@ -12,7 +12,7 @@ void draw_left_justified_text(cairo_t *cr, const char *font,
                                double x, double y,
                                double fontsize, const char *text);
 
-void draw_vertical_centered_text(cairo_t *cr, const char * font, double x,
+void draw_vertical_centered_text(cairo_t *cr, const char *font, double x,
                                        double y, double fontsize,
                                        const char *text);
 #endif
diff --git a/cconv.c b/cconv.c
index 14ee9c5b2738a2a1fb3d0d49e05ee3f61dde4d3d..502cf82eaa5fc213b83f2189090c2d878ed0f6d1 100644 (file)
--- a/cconv.c
+++ b/cconv.c
@@ -191,8 +191,8 @@ void convert_thread_options_to_cpu(struct thread_options *o,
        for (i = 0; i < FIO_IO_U_LIST_MAX_LEN; i++)
                o->percentile_list[i].u.f = fio_uint64_to_double(le64_to_cpu(top->percentile_list[i].u.i));
 #if 0
-        uint8_t cpumask[FIO_TOP_STR_MAX];
-        uint8_t verify_cpumask[FIO_TOP_STR_MAX];
+       uint8_t cpumask[FIO_TOP_STR_MAX];
+       uint8_t verify_cpumask[FIO_TOP_STR_MAX];
 #endif
 }
 
@@ -370,8 +370,8 @@ void convert_thread_options_to_net(struct thread_options_pack *top,
        for (i = 0; i < FIO_IO_U_LIST_MAX_LEN; i++)
                top->percentile_list[i].u.i = __cpu_to_le64(fio_double_to_uint64(o->percentile_list[i].u.f));
 #if 0
-        uint8_t cpumask[FIO_TOP_STR_MAX];
-        uint8_t verify_cpumask[FIO_TOP_STR_MAX];
+       uint8_t cpumask[FIO_TOP_STR_MAX];
+       uint8_t verify_cpumask[FIO_TOP_STR_MAX];
 #endif
 
 }
index ed8f51e0337c9de5802e320149e8c72d5c7d6846..d1357cbbd28c11508b99e123ca057c5ee2e0343b 100644 (file)
--- a/client.c
+++ b/client.c
@@ -472,7 +472,7 @@ int fio_clients_connect(void)
 
 #ifdef WIN32
        WSADATA wsd;
-       WSAStartup(MAKEWORD(2,2), &wsd);
+       WSAStartup(MAKEWORD(2, 2), &wsd);
 #endif
 
        dprint(FD_NET, "client: connect all\n");
index f3d38290179e80d9eacefb5f2a97ef4abd479720..166ace8c529e02d0afa5cc91fb4ca66d6626cd21 100644 (file)
@@ -94,9 +94,9 @@ static int extend_file(struct thread_data *td, struct fio_file *f)
 
                        r = fallocate(f->fd, FALLOC_FL_KEEP_SIZE, 0,
                                        f->real_file_size);
-                       if (r != 0) {
+                       if (r != 0)
                                td_verror(td, errno, "fallocate");
-                       }
+
                        break;
 #endif /* FIO_HAVE_LINUX_FALLOCATE */
                default:
index 1042eafbd5ea242be0b44992e21a8c33d0e7a2b3..d551351a08d98743f5c90a489ec6b2d9514036df 100644 (file)
--- a/gclient.c
+++ b/gclient.c
@@ -426,7 +426,7 @@ static void gfio_update_client_eta(struct fio_client *client, struct jobs_eta *j
 
                sprintf(dst, " - %s", eta_str);
        }
-               
+
        gfio_update_thread_status(ge, output, perc);
        gdk_threads_leave();
 }
@@ -514,7 +514,7 @@ static void gfio_update_all_eta(struct jobs_eta *je)
 
                sprintf(dst, " - %s", eta_str);
        }
-               
+
        gfio_update_thread_status_all(ui, output, perc);
        gdk_threads_leave();
 }
@@ -963,7 +963,7 @@ static void gfio_show_latency_buckets(struct gfio_client *gc, GtkWidget *vbox,
         */
        if (start == -1U)
                return;
-               
+
        tree_view = gfio_output_lat_buckets(&io_u_lat[start], &ranges[start], end - start + 1);
        ge->lat_bucket_graph = setup_lat_bucket_graph("Latency Buckets", &io_u_lat[start], &ranges[start], end - start + 1, 700.0, 300.0);
 
@@ -980,7 +980,7 @@ static void gfio_show_latency_buckets(struct gfio_client *gc, GtkWidget *vbox,
        gtk_widget_modify_bg(drawing_area, GTK_STATE_NORMAL, &gfio_color_white);
        gtk_container_add(GTK_CONTAINER(completion_vbox), drawing_area);
        g_signal_connect(G_OBJECT(drawing_area), GFIO_DRAW_EVENT, G_CALLBACK(on_expose_lat_drawing_area), ge->lat_bucket_graph);
-        g_signal_connect(G_OBJECT(drawing_area), "configure_event", G_CALLBACK(on_config_lat_drawing_area), ge->lat_bucket_graph);
+       g_signal_connect(G_OBJECT(drawing_area), "configure_event", G_CALLBACK(on_config_lat_drawing_area), ge->lat_bucket_graph);
 
        gtk_box_pack_start(GTK_BOX(hbox), tree_view, TRUE, TRUE, 3);
 }
index 8b8461a8f06c381b860297fbfc044f16b1fac2f6..e0f744434eb45a8a08b556a66811d7ff39815b9a 100644 (file)
--- a/gcompat.h
+++ b/gcompat.h
@@ -12,7 +12,7 @@ void gtk_combo_box_text_append_text(GtkComboBoxText *combo_box, const gchar *tex
 void gtk_combo_box_text_insert_text(GtkComboBoxText *combo_box, gint position, const gchar *text);
 void gtk_combo_box_text_prepend_text(GtkComboBoxText *combo_box, const gchar *text);
 void gtk_combo_box_text_remove(GtkComboBoxText *combo_box, gint position);
-gchar *gtk_combo_box_text_get_active_text  (GtkComboBoxText *combo_box);
+gchar *gtk_combo_box_text_get_active_text(GtkComboBoxText *combo_box);
 
 #define GTK_COMBO_BOX_TEXT     GTK_COMBO_BOX
 #endif /* GTK_MAJOR_VERSION <= 2 && GTK_MINOR_VERSION < 24 */
index 98b51a8b3fe650a77a48168767f0931ec155ca95..303673818b05fad7dbe5044eb5f233d6f14fdcb5 100644 (file)
--- a/gerror.c
+++ b/gerror.c
@@ -9,7 +9,7 @@
 #include "gerror.h"
 
 static void on_info_bar_response(GtkWidget *widget, gint response,
-                                 gpointer data)
+                                gpointer data)
 {
        struct gui *ui = (struct gui *) data;
 
@@ -25,16 +25,15 @@ static void report_error(struct gui_entry *ge, GError *error)
 
        if (ui->error_info_bar == NULL) {
                ui->error_info_bar = gtk_info_bar_new_with_buttons(GTK_STOCK_OK,
-                                                              GTK_RESPONSE_OK,
-                                                              NULL);
+                                               GTK_RESPONSE_OK, NULL);
                g_signal_connect(ui->error_info_bar, "response", G_CALLBACK(on_info_bar_response), ui);
                gtk_info_bar_set_message_type(GTK_INFO_BAR(ui->error_info_bar),
-                                             GTK_MESSAGE_ERROR);
-               
+                                               GTK_MESSAGE_ERROR);
+
                ui->error_label = gtk_label_new(error->message);
                GtkWidget *container = gtk_info_bar_get_content_area(GTK_INFO_BAR(ui->error_info_bar));
                gtk_container_add(GTK_CONTAINER(container), ui->error_label);
-               
+
                gtk_box_pack_start(GTK_BOX(ui->vbox), ui->error_info_bar, FALSE, FALSE, 0);
                gtk_widget_show_all(ui->vbox);
        } else {
diff --git a/gfio.c b/gfio.c
index 6b6d2b824c94b08b91e8d710ae7305499ba94c56..d80e41e0c9a09b5beb2848f445dc7eb98685e019 100644 (file)
--- a/gfio.c
+++ b/gfio.c
@@ -1,7 +1,7 @@
 /*
  * gfio - gui front end for fio - the flexible io tester
  *
- * Copyright (C) 2012 Stephen M. Cameron <stephenmcameron@gmail.com> 
+ * Copyright (C) 2012 Stephen M. Cameron <stephenmcameron@gmail.com>
  * Copyright (C) 2012 Jens Axboe <axboe@kernel.dk>
  *
  * The license below covers all files distributed with fio unless otherwise
@@ -406,11 +406,11 @@ static void ge_widget_destroy(GtkWidget *w, gpointer data)
 
 static void gfio_quit(struct gui *ui)
 {
-        gtk_main_quit();
+       gtk_main_quit();
 }
 
 static void quit_clicked(__attribute__((unused)) GtkWidget *widget,
-                __attribute__((unused)) gpointer data)
+                        gpointer data)
 {
        struct gui *ui = (struct gui *) data;
 
@@ -471,7 +471,7 @@ static void gfio_start_server(struct gui *ui)
 }
 
 static void start_job_clicked(__attribute__((unused)) GtkWidget *widget,
-                gpointer data)
+                             gpointer data)
 {
        struct gui_entry *ge = data;
        struct gfio_client *gc = ge->client;
@@ -876,7 +876,7 @@ static int do_file_open_with_tab(struct gui *ui, const gchar *uri)
        if (get_connection_details(ge)) {
                if (ge_is_new)
                        gtk_widget_destroy(ge->vbox);
-                       
+
                return 1;
        }
 
@@ -1016,7 +1016,7 @@ static void connect_job_entry(GtkWidget *w, gpointer data)
 {
        struct gui *ui = (struct gui *) data;
        struct gui_entry *ge;
-       
+
        ge = get_ge_from_cur_tab(ui);
        if (ge)
                connect_clicked(w, ge);
@@ -1420,7 +1420,7 @@ static GtkWidget *new_client_page(struct gui_entry *ge)
        setup_graphs(&ge->graphs);
 
        /*
-        * Set up alignments for widgets at the bottom of ui, 
+        * Set up alignments for widgets at the bottom of ui,
         * align bottom left, expand horizontally but not vertically
         */
        bottom_align = gtk_alignment_new(0, 1, 1, 0);
@@ -1507,7 +1507,7 @@ static GtkWidget *new_main_page(struct gui *ui)
        setup_graphs(&ui->graphs);
 
        /*
-        * Set up alignments for widgets at the bottom of ui, 
+        * Set up alignments for widgets at the bottom of ui,
         * align bottom left, expand horizontally but not vertically
         */
        bottom_align = gtk_alignment_new(0, 1, 1, 0);
@@ -1670,7 +1670,7 @@ static void init_ui(int *argc, char **argv[], struct gui *ui)
        gtk_settings_set_long_property(settings, "gtk_tooltip_timeout", 10, "gfio setting");
        g_type_init();
        gdk_color_parse("white", &gfio_color_white);
-       
+
        ui->window = gtk_window_new(GTK_WINDOW_TOPLEVEL);
        gtk_window_set_title(GTK_WINDOW(ui->window), "fio");
        gtk_window_set_default_size(GTK_WINDOW(ui->window), 1024, 768);
diff --git a/graph.c b/graph.c
index ba013da449d162a38311ccc7950decb86bc16131..81b1524d705704a21cbcea687487c9625c03091d 100644 (file)
--- a/graph.c
+++ b/graph.c
@@ -1,7 +1,7 @@
 /*
  * gfio - gui front end for fio - the flexible io tester
  *
- * Copyright (C) 2012 Stephen M. Cameron <stephenmcameron@gmail.com> 
+ * Copyright (C) 2012 Stephen M. Cameron <stephenmcameron@gmail.com>
  *
  * The license below covers all files distributed with fio unless otherwise
  * noted in the file itself.
@@ -87,10 +87,10 @@ struct graph {
        graph_axis_unit_change_callback y_axis_unit_change_callback;
        unsigned int base_offset;
        unsigned int dont_graph_all_zeroes;
-       double left_extra;      
-       double right_extra;     
-       double top_extra;       
-       double bottom_extra;    
+       double left_extra;
+       double right_extra;
+       double top_extra;
+       double bottom_extra;
 
        double xtick_zero;
        double xtick_delta;
@@ -263,7 +263,7 @@ static void draw_bars(struct graph *bg, cairo_t *cr, struct graph_label *lb,
                cairo_close_path(cr);
                cairo_fill(cr);
                cairo_stroke(cr);
-               bar_num++;      
+               bar_num++;
        }
 }
 
@@ -271,11 +271,11 @@ static void graph_draw_common(struct graph *g, cairo_t *cr,
        double *x1, double *y1, double *x2, double *y2)
 {
        cairo_set_source_rgb(cr, 0, 0, 0);
-       cairo_set_line_width (cr, 0.8);
+       cairo_set_line_width(cr, 0.8);
 
-       *x1 = 0.10 * g->xdim;   
+       *x1 = 0.10 * g->xdim;
        *x2 = 0.95 * g->xdim;
-       *y1 = 0.10 * g->ydim;   
+       *y1 = 0.10 * g->ydim;
        *y2 = 0.90 * g->ydim;
 
        cairo_move_to(cr, *x1, *y1);
@@ -459,7 +459,7 @@ void bar_graph_draw(struct graph *bg, cairo_t *cr)
                draw_bars(bg, cr, lb, label_offset, bar_width, mindata, maxdata);
                // draw_centered_text(cr, label_offset + (bar_width / 2.0 + bar_width * 0.1), bg->ydim * 0.93,
                draw_centered_text(cr, bg->font, x1 + space_per_label * (i + 0.5), bg->ydim * 0.93,
-                       12.0, lb->label); 
+                       12.0, lb->label);
                i++;
        }
        cairo_stroke(cr);
@@ -498,7 +498,7 @@ static double find_xy_value(struct graph *g, xy_value_extractor getvalue, double
                                first = 0;
                                answer = tmp;
                        }
-                       answer = cmp(tmp, answer);      
+                       answer = cmp(tmp, answer);
                }
        }
 
@@ -618,7 +618,7 @@ static struct graph_label *graph_find_label(struct graph *bg,
 {
        struct flist_head *entry;
        struct graph_label *i;
-       
+
        flist_for_each(entry, &bg->label_list) {
                i = flist_entry(entry, struct graph_label, list);
 
@@ -632,7 +632,7 @@ static struct graph_label *graph_find_label(struct graph *bg,
 graph_label_t graph_add_label(struct graph *bg, const char *label)
 {
        struct graph_label *i;
-       
+
        i = graph_find_label(bg, label);
        if (i)
                return i; /* already present. */
@@ -818,7 +818,7 @@ static void graph_free_values(struct graph_label *l)
        while (!flist_empty(&l->value_list)) {
                i = flist_entry(l->value_list.next, struct graph_value, list);
                graph_value_drop(l, i);
-       }       
+       }
 }
 
 static void graph_free_labels(struct graph *g)
@@ -830,7 +830,7 @@ static void graph_free_labels(struct graph *g)
                flist_del(&i->list);
                graph_free_values(i);
                free(i);
-       }       
+       }
 }
 
 void graph_set_color(struct graph *gr, graph_label_t label, double red,
@@ -878,13 +878,14 @@ void line_graph_set_data_count_limit(struct graph *g, int per_label_limit)
        g->per_label_limit = per_label_limit;
 }
 
-void graph_add_extra_space(struct graph *g, double left_percent, double right_percent,
-                                double top_percent, double bottom_percent)
+void graph_add_extra_space(struct graph *g, double left_percent,
+                          double right_percent, double top_percent,
+                          double bottom_percent)
 {
-       g->left_extra = left_percent;   
-       g->right_extra = right_percent; 
-       g->top_extra = top_percent;     
-       g->bottom_extra = bottom_percent;       
+       g->left_extra = left_percent;
+       g->right_extra = right_percent;
+       g->top_extra = top_percent;
+       g->bottom_extra = bottom_percent;
 }
 
 /*
diff --git a/io_u.c b/io_u.c
index a4f378d811dd87df2481db8756ee463306e44f9e..273cc91cb621176b1bdb50da0261b0313ef95a1b 100644 (file)
--- a/io_u.c
+++ b/io_u.c
@@ -78,7 +78,7 @@ static void mark_random_map(struct thread_data *td, struct io_u *io_u)
                                mask = -1UL;
                        else
                                mask = ((1UL << this_blocks) - 1) << bit;
-       
+
                        if (!(f->file_map[idx] & mask))
                                break;
 
@@ -310,7 +310,7 @@ static int get_next_block(struct thread_data *td, struct io_u *io_u,
                        ret = 1;
                }
        }
-       
+
        if (!ret) {
                if (offset != -1ULL)
                        io_u->offset = offset;
@@ -1427,7 +1427,7 @@ static void io_completed(struct thread_data *td, struct io_u *io_u,
                io_u_log_error(td, io_u);
        }
        if (icd->error && td_non_fatal_error(icd->error) &&
-           (td->o.continue_on_error & td_error_type(io_u->ddir, icd->error))) {
+           (td->o.continue_on_error & td_error_type(io_u->ddir, icd->error))) {
                /*
                 * If there is a non_fatal error, then add to the error count
                 * and clear all the errors.
index bb7833f120a6c5a62ba839750c15bb2e170e8582..b3c2e51f952c735cc81879214598d0c8c1b62879 100644 (file)
@@ -234,7 +234,7 @@ int td_io_getevents(struct thread_data *td, unsigned int min, unsigned int max,
 out:
        if (r >= 0) {
                /*
-                * Reflect that our submitted requests were retrieved with
+                * Reflect that our submitted requests were retrieved with
                 * whatever OS async calls are in the underlying engine.
                 */
                td->io_u_in_flight -= r;
@@ -360,14 +360,14 @@ int td_io_commit(struct thread_data *td)
        if (!td->cur_depth || !td->io_u_queued)
                return 0;
 
-       io_u_mark_depth(td, td->io_u_queued);   
+       io_u_mark_depth(td, td->io_u_queued);
 
        if (td->io_ops->commit) {
                ret = td->io_ops->commit(td);
                if (ret)
                        td_verror(td, -ret, "io commit");
        }
-       
+
        /*
         * Reflect that events were submitted as async IO requests.
         */
@@ -532,7 +532,7 @@ int do_io_u_trim(struct thread_data *td, struct io_u *io_u)
 
        ret = os_trim(f->fd, io_u->offset, io_u->xfer_buflen);
        if (!ret)
-               return io_u->xfer_buflen;;
+               return io_u->xfer_buflen;
 
        io_u->error = ret;
        return 0;
diff --git a/iolog.c b/iolog.c
index 4818cd4593b2e0c9d000f7d001b86cf2ee416e17..0e492363465e9a94ad88433008fbcfdf59485e2f 100644 (file)
--- a/iolog.c
+++ b/iolog.c
@@ -110,7 +110,7 @@ int read_iolog_get(struct thread_data *td, struct io_u *io_u)
 {
        struct io_piece *ipo;
        unsigned long elapsed;
-       
+
        while (!flist_empty(&td->io_log_list)) {
                int ret;
 
@@ -141,11 +141,10 @@ int read_iolog_get(struct thread_data *td, struct io_u *io_u)
                        elapsed = mtime_since_genesis();
                        if (ipo->delay > elapsed)
                                usec_sleep(td, (ipo->delay - elapsed) * 1000);
-                               
                }
 
                free(ipo);
-               
+
                if (io_u->ddir != DDIR_WAIT)
                        return 0;
        }
@@ -370,7 +369,7 @@ static int read_iolog2(struct thread_data *td, FILE *f)
                        ipo->fileno = fileno;
                        ipo->file_action = file_action;
                }
-                       
+
                queue_io_piece(td, ipo);
        }
 
index 161b416378ef506424ac6cbb2988c9380bd32051..d051da12c0b02f8dd8f2774c53f9e1bd5a8ae455 100644 (file)
--- a/options.c
+++ b/options.c
@@ -37,7 +37,7 @@ static int converthexchartoint(char a)
 {
        int base;
 
-       switch(a) {
+       switch (a) {
        case '0'...'9':
                base = '0';
                break;
@@ -50,7 +50,7 @@ static int converthexchartoint(char a)
        default:
                base = 0;
        }
-       return (a - base);
+       return a - base;
 }
 
 static int bs_cmp(const void *p1, const void *p2)
@@ -652,7 +652,7 @@ static int str_verify_pattern_cb(void *data, const char *input)
        struct thread_data *td = data;
        long off;
        int i = 0, j = 0, len, k, base = 10;
-       char* loc1, * loc2;
+       char *loc1, *loc2;
 
        loc1 = strstr(input, "0x");
        loc2 = strstr(input, "0X");
@@ -3014,14 +3014,12 @@ static char *bc_calc(char *str)
 
        sprintf(buf, "echo '%s' | %s", tmp, BC_APP);
        f = popen(buf, "r");
-       if (!f) {
+       if (!f)
                return NULL;
-       }
 
        ret = fread(&buf[tmp - str], 1, 128 - (tmp - str), f);
-       if (ret <= 0) {
+       if (ret <= 0)
                return NULL;
-       }
 
        pclose(f);
        buf[(tmp - str) + ret - 1] = '\0';
index ae51cb3e9b2127d75383126bbc74cf12fd4d3c0e..28bfe9191e84881c15a34337af9de18b1134fc8a 100644 (file)
--- a/options.h
+++ b/options.h
@@ -112,5 +112,6 @@ enum opt_category_group {
 extern struct opt_group *opt_group_from_mask(unsigned int *mask);
 extern struct opt_group *opt_group_cat_from_mask(unsigned int *mask);
 extern struct fio_option *fio_option_find(const char *name);
+extern unsigned int fio_get_kb_base(void *);
 
 #endif
diff --git a/parse.c b/parse.c
index 545c3de56bd9600b3e228f3c392125faf627102c..631701363f13a14989554b4cb9f1f38c7d3bee29 100644 (file)
--- a/parse.c
+++ b/parse.c
@@ -16,7 +16,6 @@
 #include "options.h"
 
 static struct fio_option *__fio_options;
-extern unsigned int fio_get_kb_base(void *);
 
 static int vp_cmp(const void *p1, const void *p2)
 {
@@ -47,7 +46,7 @@ static void posval_sort(struct fio_option *o, struct value_pair *vpmap)
 static void show_option_range(struct fio_option *o,
                                int (*logger)(const char *format, ...))
 {
-       if (o->type == FIO_OPT_FLOAT_LIST){
+       if (o->type == FIO_OPT_FLOAT_LIST) {
                if (isnan(o->minfp) && isnan(o->maxfp))
                        return;
 
@@ -356,7 +355,7 @@ static int __handle_option(struct fio_option *o, const char *ptr, void *data,
                           int first, int more, int curr)
 {
        int il, *ilp;
-       doubleflp;
+       double *flp;
        long long ull, *ullp;
        long ul1, ul2;
        double uf;
@@ -479,7 +478,7 @@ static int __handle_option(struct fio_option *o, const char *ptr, void *data,
                                        o->maxlen);
                        return 1;
                }
-               if(!str_to_float(ptr, &uf)){
+               if (!str_to_float(ptr, &uf)) {
                        log_err("not a floating point value: %s\n", ptr);
                        return 1;
                }
index 4058b7901440e4552c78fbad6fd3d814a9701776..4dcc9861e44ccbdac05b10704ed3ad1b796f7574 100644 (file)
@@ -36,8 +36,8 @@ static void results_draw_page(GtkPrintOperation *operation,
 
        cr = gtk_print_context_get_cairo_context(context);
 
-        cairo_set_source_rgb(cr, 0, 0, 0);
-        cairo_set_line_width (cr, 5.0);
+       cairo_set_source_rgb(cr, 0, 0, 0);
+       cairo_set_line_width(cr, 5.0);
        cairo_move_to(cr, 0.0, 0.0);
        cairo_line_to(cr, print_params.width, print_params.height);
        cairo_move_to(cr, 0.0, print_params.height);
@@ -48,8 +48,8 @@ static void results_draw_page(GtkPrintOperation *operation,
        y = print_params.height / 5.0;
        sprintf(str, "(%g,%g)", x, y);
        draw_right_justified_text(cr, "Sans", x, y, 12.0, str);
-        cairo_set_source_rgb(cr, 0, 0, 0);
-        cairo_set_line_width (cr, 2.0);
+       cairo_set_source_rgb(cr, 0, 0, 0);
+       cairo_set_line_width(cr, 2.0);
        cairo_move_to(cr, x, y - 30.0);
        cairo_line_to(cr, x, y + 30.0);
        cairo_move_to(cr, x - 30, y);
@@ -59,8 +59,8 @@ static void results_draw_page(GtkPrintOperation *operation,
        x *= 2.0;
        sprintf(str, "(%g,%g)", x, y);
        draw_right_justified_text(cr, "Sans", x, y, 12.0, str);
-        cairo_set_source_rgb(cr, 0, 0, 0);
-        cairo_set_line_width (cr, 2.0);
+       cairo_set_source_rgb(cr, 0, 0, 0);
+       cairo_set_line_width(cr, 2.0);
        cairo_move_to(cr, x, y - 30.0);
        cairo_line_to(cr, x, y + 30.0);
        cairo_move_to(cr, x - 30, y);
index c97584372b52c957944a8aac122eba3e5fa183e7..74f14facd6c6d0115bea1af3dc0c328fda1fdfd7 100644 (file)
--- a/profile.c
+++ b/profile.c
@@ -42,7 +42,7 @@ int load_profile(const char *profile)
 static int add_profile_options(struct profile_ops *ops)
 {
        struct fio_option *o;
-       
+
        if (!ops->options)
                return 0;
 
index 274497514484f36a4b22b730bc0127316c6dc16e..664bb556071236022dddfed762a3f18af1b290ec 100644 (file)
--- a/server.c
+++ b/server.c
@@ -276,7 +276,7 @@ struct fio_net_cmd *fio_net_recv_cmd(int sk)
                                struct cmd_text_pdu *pdu = (struct cmd_text_pdu *) cmdret->payload;
                                char *buf = (char *) pdu->buf;
 
-                               buf[pdu->buf_len ] = '\0';
+                               buf[pdu->buf_len] = '\0';
                        } else if (cmdret->opcode == FIO_NET_CMD_JOB) {
                                struct cmd_job_pdu *pdu = (struct cmd_job_pdu *) cmdret->payload;
                                char *buf = (char *) pdu->buf;
@@ -663,7 +663,7 @@ static int handle_command(struct fio_net_cmd *cmd)
                ret = handle_run_cmd(cmd);
                break;
        default:
-               log_err("fio: unknown opcode: %s\n",fio_server_op(cmd->opcode));
+               log_err("fio: unknown opcode: %s\n", fio_server_op(cmd->opcode));
                ret = 1;
        }
 
@@ -692,7 +692,7 @@ static int handle_connection(int sk)
 
                        if (!flist_empty(&job_list))
                                timeout = 100;
-               
+
                        ret = poll(&pfd, 1, timeout);
                        if (ret < 0) {
                                if (errno == EINTR)
@@ -1512,7 +1512,7 @@ int fio_start_server(char *pidfile)
 
 #if defined(WIN32)
        WSADATA wsd;
-       WSAStartup(MAKEWORD(2,2), &wsd);
+       WSAStartup(MAKEWORD(2, 2), &wsd);
 #endif
 
        if (!pidfile)
diff --git a/stat.c b/stat.c
index 70f9e0a1d75e24e5b355e1e9e58078351d364a1a..ac4a00080077c08ba79571340d89ab9598890152 100644 (file)
--- a/stat.c
+++ b/stat.c
@@ -63,12 +63,12 @@ static unsigned int plat_val_to_idx(unsigned int val)
 
        /*
         * Discard the error bits and apply the mask to find the
-         * index for the buckets in the group
+        * index for the buckets in the group
         */
        offset = (FIO_IO_U_PLAT_VAL - 1) & (val >> error_bits);
 
        /* Make sure the index does not exceed (array size - 1) */
-       idx = (base + offset) < (FIO_IO_U_PLAT_NR - 1)?
+       idx = (base + offset) < (FIO_IO_U_PLAT_NR - 1) ?
                (base + offset) : (FIO_IO_U_PLAT_NR - 1);
 
        return idx;
@@ -86,11 +86,11 @@ static unsigned int plat_idx_to_val(unsigned int idx)
 
        /* MSB <= (FIO_IO_U_PLAT_BITS-1), cannot be rounded off. Use
         * all bits of the sample as index */
-       if (idx < (FIO_IO_U_PLAT_VAL << 1) )
+       if (idx < (FIO_IO_U_PLAT_VAL << 1))
                return idx;
 
        /* Find the group and compute the minimum value of that group */
-       error_bits = (idx >> FIO_IO_U_PLAT_BITS) -1;
+       error_bits = (idx >> FIO_IO_U_PLAT_BITS) - 1;
        base = 1 << (error_bits + FIO_IO_U_PLAT_BITS);
 
        /* Find its bucket number of the group */
@@ -140,7 +140,7 @@ unsigned int calc_clat_percentiles(unsigned int *io_u_plat, unsigned long nr,
         * isn't a worry. Also note that this does not work for NaN values.
         */
        if (len > 1)
-               qsort((void*)plist, len, sizeof(plist[0]), double_cmp);
+               qsort((void *)plist, len, sizeof(plist[0]), double_cmp);
 
        /*
         * Calculate bucket values, note down max and min values
@@ -629,7 +629,7 @@ static void show_ddir_status_terse(struct thread_stat *ts,
 }
 
 static void show_thread_status_terse_v2(struct thread_stat *ts,
-                                       struct group_run_stats *rs)
+                                       struct group_run_stats *rs)
 {
        double io_u_dist[FIO_IO_U_MAP_NR];
        double io_u_lat_u[FIO_IO_U_LAT_U_NR];
index 6a964e31a2a3715ebb11d6d93f1cf7b414fe927c..808de676e758120ca6531f9d1328871ef4d9b402 100644 (file)
@@ -3,7 +3,7 @@
 #include <malloc.h>
 #include <string.h>
 
-/* 
+/*
  * adapted from Paul Heckbert's algorithm on p 657-659 of
  * Andrew S. Glassner's book, "Graphics Gems"
  * ISBN 0-12-286166-3
@@ -128,20 +128,20 @@ static void test_range(double x, double y)
        printf("Testing range %g - %g\n", x, y);
        nticks = calc_tickmarks(x, y, 10, &tm);
 
-       for (i = 0; i < nticks; i++) {
+       for (i = 0; i < nticks; i++)
                printf("   (%s) %g\n", tm[i].string, tm[i].value);
-       }
+
        printf("\n\n");
        free(tm);
 }
 
 int main(int argc, char *argv[])
 {
-       test_range(0.0005, 0.008);      
-       test_range(0.5, 0.8);   
-       test_range(5.5, 8.8);   
-       test_range(50.5, 80.8); 
-       test_range(-20, 20.8);  
-       test_range(-30, 700.8); 
+       test_range(0.0005, 0.008);
+       test_range(0.5, 0.8);
+       test_range(5.5, 8.8);
+       test_range(50.5, 80.8);
+       test_range(-20, 20.8);
+       test_range(-30, 700.8);
 }
 #endif