From: Jens Axboe Date: Mon, 15 Aug 2016 18:03:39 +0000 (-0600) Subject: Fixup correct sparse warnings X-Git-Tag: fio-2.14~36 X-Git-Url: https://git.kernel.dk/?p=fio.git;a=commitdiff_plain;h=a89ba4b12939c802875a3548a5de3eb64ce86a0a Fixup correct sparse warnings Signed-off-by: Jens Axboe --- diff --git a/client.c b/client.c index d502a4b3..228a0dbf 100644 --- 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; diff --git a/engines/e4defrag.c b/engines/e4defrag.c index 01b084e9..e53636eb 100644 --- a/engines/e4defrag.c +++ b/engines/e4defrag.c @@ -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, diff --git a/engines/glusterfs_async.c b/engines/glusterfs_async.c index 8e42a849..f46cb263 100644 --- a/engines/glusterfs_async.c +++ b/engines/glusterfs_async.c @@ -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; diff --git a/engines/mtd.c b/engines/mtd.c index 7b92c836..3c22a1b1 100644 --- a/engines/mtd.c +++ b/engines/mtd.c @@ -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 a1a00879..8c8101c6 100644 --- 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 975ce6f7..b0c948bd 100644 --- 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; diff --git a/lib/bloom.c b/lib/bloom.c index ee4ba0ba..f4eff575 100644 --- a/lib/bloom.c +++ b/lib/bloom.c @@ -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, diff --git a/lib/mountcheck.c b/lib/mountcheck.c index e37e9f92..e8780eb3 100644 --- a/lib/mountcheck.c +++ b/lib/mountcheck.c @@ -4,6 +4,8 @@ #ifdef CONFIG_GETMNTENT #include +#include "lib/mountcheck.h" + #define MTAB "/etc/mtab" int device_is_mounted(const char *dev) diff --git a/lib/strntol.c b/lib/strntol.c index 713f63bb..adf45bd4 100644 --- a/lib/strntol.c +++ b/lib/strntol.c @@ -2,6 +2,8 @@ #include #include +#include "lib/strntol.h" + long strntol(const char *str, size_t sz, char **end, int base) { /* Expect that digit representation of LONG_MAX/MIN diff --git a/oslib/libmtd.c b/oslib/libmtd.c index 5c9eac27..5b22d6a8 100644 --- a/oslib/libmtd.c +++ b/oslib/libmtd.c @@ -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) { diff --git a/oslib/linux-dev-lookup.c b/oslib/linux-dev-lookup.c index 3a415dde..2bbd14a0 100644 --- a/oslib/linux-dev-lookup.c +++ b/oslib/linux-dev-lookup.c @@ -6,6 +6,7 @@ #include #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) diff --git a/oslib/strlcat.c b/oslib/strlcat.c index 643d4966..3329b833 100644 --- a/oslib/strlcat.c +++ b/oslib/strlcat.c @@ -1,4 +1,5 @@ #include +#include "oslib/strlcat.h" size_t strlcat(char *dst, const char *src, size_t size) { diff --git a/server.c b/server.c index 2fd9b45a..9f2220dd 100644 --- 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 ef9fe7d4..d0eaa477 100644 --- 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; diff --git a/verify.c b/verify.c index 3d9e2687..790ab31d 100644 --- 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;