Skip to content

Commit

Permalink
tests: fix unused, remove argsused
Browse files Browse the repository at this point in the history
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Ahelenia Ziemiańska <nabijaczleweli@nabijaczleweli.xyz>
Closes openzfs#12835
  • Loading branch information
nabijaczleweli authored and nicman23 committed Aug 22, 2022
1 parent 86091d1 commit f109595
Show file tree
Hide file tree
Showing 14 changed files with 18 additions and 21 deletions.
1 change: 1 addition & 0 deletions tests/zfs-tests/cmd/btree_test/btree_test.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion tests/zfs-tests/cmd/largest_file/largest_file.c
Original file line number Diff line number Diff line change
Expand Up @@ -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");
}
1 change: 1 addition & 0 deletions tests/zfs-tests/cmd/mmap_libaio/mmap_libaio.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion tests/zfs-tests/cmd/rename_dir/rename_dir.c
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
#include <strings.h>

int
main(int argc, char *argvp[])
main(void)
{
int i = 1;

Expand Down
4 changes: 2 additions & 2 deletions tests/zfs-tests/cmd/rm_lnkcnt_zero_file/rm_lnkcnt_zero_file.c
Original file line number Diff line number Diff line change
Expand Up @@ -55,10 +55,10 @@ pickidx(void)
return (random() % 1000);
}

/* ARGSUSED */
static void *
mover(void *a)
{
(void) a;
char buf[256];
int idx, len, ret;

Expand All @@ -75,10 +75,10 @@ mover(void *a)
return (NULL);
}

/* ARGSUSED */
static void *
cleaner(void *a)
{
(void) a;
char buf[256];
int idx, len, ret;

Expand Down
6 changes: 3 additions & 3 deletions tests/zfs-tests/cmd/xattrtest/xattrtest.c
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
3 changes: 1 addition & 2 deletions tests/zfs-tests/tests/functional/ctime/ctime.c
Original file line number Diff line number Diff line change
Expand Up @@ -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"};
Expand Down
2 changes: 1 addition & 1 deletion tests/zfs-tests/tests/functional/hkdf/hkdf_test.c
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,7 @@ run_test(int i, hkdf_tv_t *tv)
}

int
main(int argc, char **argv)
main(void)
{
int ret, i;

Expand Down
3 changes: 1 addition & 2 deletions tests/zfs-tests/tests/functional/libzfs/many_fds.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
6 changes: 2 additions & 4 deletions tests/zfs-tests/tests/functional/tmpfile/tmpfile_001_pos.c
Original file line number Diff line number Diff line change
Expand Up @@ -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] = {};
Expand Down
2 changes: 1 addition & 1 deletion tests/zfs-tests/tests/functional/tmpfile/tmpfile_002_pos.c
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
*/

int
main(int argc, char *argv[])
main(void)
{
int i, fd, ret;
char spath[1024], dpath[1024];
Expand Down
2 changes: 1 addition & 1 deletion tests/zfs-tests/tests/functional/tmpfile/tmpfile_003_pos.c
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
*/

int
main(int argc, char *argv[])
main(void)
{
int i, fd;
char spath[1024], dpath[1024];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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");

Expand Down

0 comments on commit f109595

Please sign in to comment.