Fixup correct sparse warnings
authorJens Axboe <axboe@fb.com>
Mon, 15 Aug 2016 18:03:39 +0000 (12:03 -0600)
committerJens Axboe <axboe@fb.com>
Mon, 15 Aug 2016 18:03:39 +0000 (12:03 -0600)
Signed-off-by: Jens Axboe <axboe@fb.com>
15 files changed:
client.c
engines/e4defrag.c
engines/glusterfs_async.c
engines/mtd.c
init.c
iolog.c
lib/bloom.c
lib/mountcheck.c
lib/strntol.c
oslib/libmtd.c
oslib/linux-dev-lookup.c
oslib/strlcat.c
server.c
stat.c
verify.c

index d502a4b34d4c57a060d96f3c24d4436f4a0bf9bb..228a0dbf9a775d6c251d9d3deec20961291e3dac 100644 (file)
--- a/client.c
+++ b/client.c
@@ -55,9 +55,9 @@ static FLIST_HEAD(eta_list);
 
 static FLIST_HEAD(arg_list);
 
-struct thread_stat client_ts;
-struct group_run_stats client_gs;
-int sum_stat_clients;
+static struct thread_stat client_ts;
+static struct group_run_stats client_gs;
+static int sum_stat_clients;
 
 static int sum_stat_nr;
 static struct json_object *root = NULL;
index 01b084e9699907b97abc7dbb33295e17dacf58c3..e53636eb26e382b3e318abef48bd3b211d2695f1 100644 (file)
@@ -54,7 +54,7 @@ static struct fio_option options[] = {
        },
        {
                .name   = "inplace",
-               .name   = "In Place",
+               .lname  = "In Place",
                .type   = FIO_OPT_INT,
                .off1   = offsetof(struct e4defrag_options, inplace),
                .minval = 0,
index 8e42a84999147838d316926d6504183ec7f31ae0..f46cb263dd781e9f1180d8b19b8ec5c2eb157f04 100644 (file)
@@ -137,7 +137,7 @@ failed:
        return FIO_Q_COMPLETED;
 }
 
-int fio_gf_async_setup(struct thread_data *td)
+static int fio_gf_async_setup(struct thread_data *td)
 {
        struct gf_data *g;
        int r;
index 7b92c836692f388ad3dad8b179ef9687e10694dc..3c22a1b15be99032b53d1bb70a27cf1109811cde 100644 (file)
@@ -16,7 +16,7 @@
 #include "../verify.h"
 #include "../oslib/libmtd.h"
 
-libmtd_t desc;
+static libmtd_t desc;
 
 struct fio_mtd_data {
        struct mtd_dev_info info;
@@ -168,7 +168,7 @@ static int fio_mtd_close_file(struct thread_data *td, struct fio_file *f)
        return generic_close_file(td, f);
 }
 
-int fio_mtd_get_file_size(struct thread_data *td, struct fio_file *f)
+static int fio_mtd_get_file_size(struct thread_data *td, struct fio_file *f)
 {
        struct mtd_dev_info info;
 
diff --git a/init.c b/init.c
index a1a008797d4a9eead366f304388e665eeb98a4ca..8c8101c629d46672b81202a675bbce33720825e6 100644 (file)
--- a/init.c
+++ b/init.c
@@ -47,7 +47,6 @@ static char **job_sections;
 static int nr_job_sections;
 
 int exitall_on_terminate = 0;
-int exitall_on_terminate_error = 0;
 int output_format = FIO_OUTPUT_NORMAL;
 int eta_print = FIO_ETA_AUTO;
 int eta_new_line = 0;
diff --git a/iolog.c b/iolog.c
index 975ce6f7a481c438025992f4b828b6d69378b290..b0c948bd53661d65561fe68277a7cdc298cc280b 100644 (file)
--- a/iolog.c
+++ b/iolog.c
@@ -672,8 +672,8 @@ static inline unsigned long hist_sum(int j, int stride, unsigned int *io_u_plat)
        return sum;
 }
 
-void flush_hist_samples(FILE *f, int hist_coarseness, void *samples,
-                       uint64_t sample_size)
+static void flush_hist_samples(FILE *f, int hist_coarseness, void *samples,
+                              uint64_t sample_size)
 {
        struct io_sample *s;
        int log_offset;
index ee4ba0baabcc80c40d13ede42ccb204d4530c9d9..f4eff575082b171827b8319d16b9c938f7a6a979 100644 (file)
@@ -35,7 +35,7 @@ static uint32_t bloom_fnv(const void *buf, uint32_t len, uint32_t seed)
 
 #define BLOOM_SEED     0x8989
 
-struct bloom_hash hashes[] = {
+static struct bloom_hash hashes[] = {
        {
                .seed = BLOOM_SEED,
                .fn = jhash,
index e37e9f927b0c3cc2ecfca6cd26ea7017eb3c083f..e8780eb3b46a166f81726c9a2966a1a0c901a465 100644 (file)
@@ -4,6 +4,8 @@
 #ifdef CONFIG_GETMNTENT
 #include <mntent.h>
 
+#include "lib/mountcheck.h"
+
 #define MTAB   "/etc/mtab"
 
 int device_is_mounted(const char *dev)
index 713f63bb0c683201f61b545f6ba7386f3dc19055..adf45bd4d6b87996b63eaaf3d50641bd8f431873 100644 (file)
@@ -2,6 +2,8 @@
 #include <stdlib.h>
 #include <limits.h>
 
+#include "lib/strntol.h"
+
 long strntol(const char *str, size_t sz, char **end, int base)
 {
        /* Expect that digit representation of LONG_MAX/MIN
index 5c9eac2778c69a5b4bead766f70d74bdc0939705..5b22d6a8abb453cfd015be3f3f1ea8aef35d4e82 100644 (file)
@@ -1190,7 +1190,7 @@ int mtd_write(libmtd_t desc, const struct mtd_dev_info *mtd, int fd, int eb,
        return 0;
 }
 
-int do_oob_op(libmtd_t desc, const struct mtd_dev_info *mtd, int fd,
+static int do_oob_op(libmtd_t desc, const struct mtd_dev_info *mtd, int fd,
              uint64_t start, uint64_t length, void *data, unsigned int cmd64,
              unsigned int cmd)
 {
index 3a415dde00ea55a73467a691c2bdfb7a325ac1f8..2bbd14a070739c28a74e0be30d0723cbbb7eb589 100644 (file)
@@ -6,6 +6,7 @@
 #include <unistd.h>
 
 #include "../os/os.h"
+#include "oslib/linux-dev-lookup.h"
 
 int blktrace_lookup_device(const char *redirect, char *path, unsigned int maj,
                           unsigned int min)
index 643d4966b4e5369b72c8df9b320b880fc7ca160a..3329b8339fa2409930b6e15bcdb7e2d9d6da0908 100644 (file)
@@ -1,4 +1,5 @@
 #include <string.h>
+#include "oslib/strlcat.h"
 
 size_t strlcat(char *dst, const char *src, size_t size)
 {
index 2fd9b45afb0e60403333440e26555faf270b8846..9f2220dd729274733d48bf1e8472bc6fb943c44e 100644 (file)
--- a/server.c
+++ b/server.c
@@ -622,7 +622,7 @@ static int fio_net_queue_quit(void)
 {
        dprint(FD_NET, "server: sending quit\n");
 
-       return fio_net_queue_cmd(FIO_NET_CMD_QUIT, NULL, 0, 0, SK_F_SIMPLE);
+       return fio_net_queue_cmd(FIO_NET_CMD_QUIT, NULL, 0, NULL, SK_F_SIMPLE);
 }
 
 int fio_net_send_quit(int sk)
@@ -1883,7 +1883,7 @@ void fio_server_send_start(struct thread_data *td)
 
        assert(sk_out->sk != -1);
 
-       fio_net_queue_cmd(FIO_NET_CMD_SERVER_START, NULL, 0, 0, SK_F_SIMPLE);
+       fio_net_queue_cmd(FIO_NET_CMD_SERVER_START, NULL, 0, NULL, SK_F_SIMPLE);
 }
 
 int fio_server_get_verify_state(const char *name, int threadnumber,
diff --git a/stat.c b/stat.c
index ef9fe7d43cade18c4047fc58cdf24efe6bc7a103..d0eaa477cc6625580fa348c99ecdaefabeae1169 100644 (file)
--- a/stat.c
+++ b/stat.c
@@ -1090,8 +1090,8 @@ static void show_thread_status_terse_v3_v4(struct thread_stat *ts,
        log_buf(out, "\n");
 }
 
-void json_add_job_opts(struct json_object *root, const char *name,
-                      struct flist_head *opt_list, bool num_jobs)
+static void json_add_job_opts(struct json_object *root, const char *name,
+                             struct flist_head *opt_list, bool num_jobs)
 {
        struct json_object *dir_object;
        struct flist_head *entry;
index 3d9e26879f0adb914298386b02f9e3c4e9ea2416..790ab31d3cddd68c0aa4379c9d811d048956efa1 100644 (file)
--- a/verify.c
+++ b/verify.c
@@ -41,13 +41,14 @@ void fill_buffer_pattern(struct thread_data *td, void *p, unsigned int len)
        (void)cpy_pattern(td->o.buffer_pattern, td->o.buffer_pattern_bytes, p, len);
 }
 
-void __fill_buffer(struct thread_options *o, unsigned long seed, void *p,
-                  unsigned int len)
+static void __fill_buffer(struct thread_options *o, unsigned long seed, void *p,
+                         unsigned int len)
 {
        __fill_random_buf_percentage(seed, p, o->compress_percentage, len, len, o->buffer_pattern, o->buffer_pattern_bytes);
 }
 
-unsigned long fill_buffer(struct thread_data *td, void *p, unsigned int len)
+static unsigned long fill_buffer(struct thread_data *td, void *p,
+                                unsigned int len)
 {
        struct frand_state *fs = &td->verify_state;
        struct thread_options *o = &td->o;