diff options
author | наб <[email protected]> | 2021-12-11 02:24:35 +0100 |
---|---|---|
committer | Brian Behlendorf <[email protected]> | 2021-12-21 12:05:12 -0800 |
commit | cf8d708b7a17d301b09dc9513ad5e2741083895d (patch) | |
tree | e0afba6fad3a2e2a33cb107c9f831f1336b98ed7 | |
parent | 1fedd012472a6d6923eec153ee69ec0b9b13518a (diff) |
tests: fix unused, remove argsused
Reviewed-by: Brian Behlendorf <[email protected]>
Signed-off-by: Ahelenia Ziemiańska <[email protected]>
Closes #12835
14 files changed, 18 insertions, 21 deletions
diff --git a/tests/zfs-tests/cmd/btree_test/btree_test.c b/tests/zfs-tests/cmd/btree_test/btree_test.c index 8de14ff2a..aaad4e47e 100644 --- a/tests/zfs-tests/cmd/btree_test/btree_test.c +++ b/tests/zfs-tests/cmd/btree_test/btree_test.c @@ -294,6 +294,7 @@ drain_tree(zfs_btree_t *bt, char *why) static int stress_tree(zfs_btree_t *bt, char *why) { + (void) why; avl_tree_t avl; int_node_t *node; struct timeval tp; diff --git a/tests/zfs-tests/cmd/largest_file/largest_file.c b/tests/zfs-tests/cmd/largest_file/largest_file.c index 00e1019cc..912607640 100644 --- a/tests/zfs-tests/cmd/largest_file/largest_file.c +++ b/tests/zfs-tests/cmd/largest_file/largest_file.c @@ -137,9 +137,9 @@ usage(char *name) exit(1); } -/* ARGSUSED */ static void sigxfsz(int signo) { + (void) signo; (void) printf("\nlargest_file: sigxfsz() caught SIGXFSZ\n"); } diff --git a/tests/zfs-tests/cmd/mmap_libaio/mmap_libaio.c b/tests/zfs-tests/cmd/mmap_libaio/mmap_libaio.c index 21119ebca..a02f46d91 100644 --- a/tests/zfs-tests/cmd/mmap_libaio/mmap_libaio.c +++ b/tests/zfs-tests/cmd/mmap_libaio/mmap_libaio.c @@ -52,6 +52,7 @@ do_sync_io(struct iocb *iocb) int main(int argc, char **argv) { + (void) argc; char *buf; int page_size = getpagesize(); int buf_size = strtol(argv[2], NULL, 0); diff --git a/tests/zfs-tests/cmd/rename_dir/rename_dir.c b/tests/zfs-tests/cmd/rename_dir/rename_dir.c index 5f80f7229..897ec7b84 100644 --- a/tests/zfs-tests/cmd/rename_dir/rename_dir.c +++ b/tests/zfs-tests/cmd/rename_dir/rename_dir.c @@ -49,7 +49,7 @@ #include <strings.h> int -main(int argc, char *argvp[]) +main(void) { int i = 1; diff --git a/tests/zfs-tests/cmd/rm_lnkcnt_zero_file/rm_lnkcnt_zero_file.c b/tests/zfs-tests/cmd/rm_lnkcnt_zero_file/rm_lnkcnt_zero_file.c index e262ecefe..f8b6e3e80 100644 --- a/tests/zfs-tests/cmd/rm_lnkcnt_zero_file/rm_lnkcnt_zero_file.c +++ b/tests/zfs-tests/cmd/rm_lnkcnt_zero_file/rm_lnkcnt_zero_file.c @@ -55,10 +55,10 @@ pickidx(void) return (random() % 1000); } -/* ARGSUSED */ static void * mover(void *a) { + (void) a; char buf[256]; int idx, len, ret; @@ -75,10 +75,10 @@ mover(void *a) return (NULL); } -/* ARGSUSED */ static void * cleaner(void *a) { + (void) a; char buf[256]; int idx, len, ret; diff --git a/tests/zfs-tests/cmd/xattrtest/xattrtest.c b/tests/zfs-tests/cmd/xattrtest/xattrtest.c index 0b68126c0..49b6629ba 100644 --- a/tests/zfs-tests/cmd/xattrtest/xattrtest.c +++ b/tests/zfs-tests/cmd/xattrtest/xattrtest.c @@ -96,12 +96,12 @@ static char script[PATH_MAX] = "/bin/true"; static char xattrbytes[XATTR_SIZE_MAX]; static int -usage(int argc, char **argv) +usage(char *argv0) { fprintf(stderr, "usage: %s [-hvycdrRk] [-n <nth>] [-f <files>] [-x <xattrs>]\n" " [-s <bytes>] [-p <path>] [-t <script> ] [-o <phase>]\n", - argv[0]); + argv0); fprintf(stderr, " --help -h This help\n" @@ -136,7 +136,7 @@ parse_args(int argc, char **argv) while ((c = getopt_long(argc, argv, shortopts, longopts, NULL)) != -1) { switch (c) { case 'h': - return (usage(argc, argv)); + return (usage(argv[0])); case 'v': verbose++; break; diff --git a/tests/zfs-tests/tests/functional/cli_root/zpool_events/ereports.c b/tests/zfs-tests/tests/functional/cli_root/zpool_events/ereports.c index f82524000..bff3bb1ee 100644 --- a/tests/zfs-tests/tests/functional/cli_root/zpool_events/ereports.c +++ b/tests/zfs-tests/tests/functional/cli_root/zpool_events/ereports.c @@ -146,9 +146,8 @@ ereports_dump(libzfs_handle_t *zhdl, int zevent_fd) } } -/* ARGSUSED */ int -main(int argc, char **argv) +main(void) { libzfs_handle_t *hdl; int fd; diff --git a/tests/zfs-tests/tests/functional/ctime/ctime.c b/tests/zfs-tests/tests/functional/ctime/ctime.c index b755be2fe..41dcf6abc 100644 --- a/tests/zfs-tests/tests/functional/ctime/ctime.c +++ b/tests/zfs-tests/tests/functional/ctime/ctime.c @@ -303,9 +303,8 @@ static timetest_t timetest_table[] = { #define NCOMMAND (sizeof (timetest_table) / sizeof (timetest_table[0])) -/* ARGSUSED */ int -main(int argc, char *argv[]) +main(void) { int i, ret, fd; char *penv[] = {"TESTDIR", "TESTFILE0"}; diff --git a/tests/zfs-tests/tests/functional/hkdf/hkdf_test.c b/tests/zfs-tests/tests/functional/hkdf/hkdf_test.c index dd23da332..5fff3e09e 100644 --- a/tests/zfs-tests/tests/functional/hkdf/hkdf_test.c +++ b/tests/zfs-tests/tests/functional/hkdf/hkdf_test.c @@ -211,7 +211,7 @@ run_test(int i, hkdf_tv_t *tv) } int -main(int argc, char **argv) +main(void) { int ret, i; diff --git a/tests/zfs-tests/tests/functional/libzfs/many_fds.c b/tests/zfs-tests/tests/functional/libzfs/many_fds.c index e09ed60ee..6def57c5a 100644 --- a/tests/zfs-tests/tests/functional/libzfs/many_fds.c +++ b/tests/zfs-tests/tests/functional/libzfs/many_fds.c @@ -35,9 +35,8 @@ /* * Check if libzfs works with more than 255 held file handles. */ -/* ARGSUSED */ int -main(int argc, char **argv) +main(void) { int i; struct rlimit limit; diff --git a/tests/zfs-tests/tests/functional/tmpfile/tmpfile_001_pos.c b/tests/zfs-tests/tests/functional/tmpfile/tmpfile_001_pos.c index b0c236081..d40da0d2b 100644 --- a/tests/zfs-tests/tests/functional/tmpfile/tmpfile_001_pos.c +++ b/tests/zfs-tests/tests/functional/tmpfile/tmpfile_001_pos.c @@ -31,15 +31,13 @@ static void fill_random(char *buf, int len) { - int i; srand(time(NULL)); - for (i = 0; i < len; i++) { + for (int i = 0; i < len; i++) buf[i] = (char)rand(); - } } int -main(int argc, char *argv[]) +main(void) { int i, fd; char buf1[BSZ], buf2[BSZ] = {}; diff --git a/tests/zfs-tests/tests/functional/tmpfile/tmpfile_002_pos.c b/tests/zfs-tests/tests/functional/tmpfile/tmpfile_002_pos.c index c92e6127d..55d939abd 100644 --- a/tests/zfs-tests/tests/functional/tmpfile/tmpfile_002_pos.c +++ b/tests/zfs-tests/tests/functional/tmpfile/tmpfile_002_pos.c @@ -25,7 +25,7 @@ */ int -main(int argc, char *argv[]) +main(void) { int i, fd, ret; char spath[1024], dpath[1024]; diff --git a/tests/zfs-tests/tests/functional/tmpfile/tmpfile_003_pos.c b/tests/zfs-tests/tests/functional/tmpfile/tmpfile_003_pos.c index 477ef3f81..58aa90512 100644 --- a/tests/zfs-tests/tests/functional/tmpfile/tmpfile_003_pos.c +++ b/tests/zfs-tests/tests/functional/tmpfile/tmpfile_003_pos.c @@ -24,7 +24,7 @@ */ int -main(int argc, char *argv[]) +main(void) { int i, fd; char spath[1024], dpath[1024]; diff --git a/tests/zfs-tests/tests/functional/tmpfile/tmpfile_stat_mode.c b/tests/zfs-tests/tests/functional/tmpfile/tmpfile_stat_mode.c index bf71d429c..c72ea2bb6 100644 --- a/tests/zfs-tests/tests/functional/tmpfile/tmpfile_stat_mode.c +++ b/tests/zfs-tests/tests/functional/tmpfile/tmpfile_stat_mode.c @@ -110,7 +110,7 @@ test_stat_mode(mode_t mask) } int -main(int argc, char *argv[]) +main(void) { fprintf(stdout, "Verify stat(2) for O_TMPFILE file considers umask.\n"); |