From: "Darrick J. Wong" <djwong@kernel.org>
To: Eric Sandeen <sandeen@redhat.com>
Cc: fstests@vger.kernel.org
Subject: Re: [PATCH 4/7] lib: fix empty arg function prototypes
Date: Thu, 6 Feb 2025 14:45:41 -0800 [thread overview]
Message-ID: <20250206224541.GQ21799@frogsfrogsfrogs> (raw)
In-Reply-To: <20250206212145.7732-5-sandeen@redhat.com>
On Thu, Feb 06, 2025 at 03:19:59PM -0600, Eric Sandeen wrote:
> Several function prototypes used () when in fact they take
> arguments. Fix those to make sparse happy.
>
> Signed-off-by: Eric Sandeen <sandeen@redhat.com>
> ---
> include/random_range.h | 2 +-
> include/write_log.h | 2 +-
> lib/random_range.c | 6 ++----
> lib/string_to_tokens.c | 1 -
> lib/tlibio.c | 2 +-
> lib/write_log.c | 2 +-
> 6 files changed, 6 insertions(+), 9 deletions(-)
>
> diff --git a/include/random_range.h b/include/random_range.h
> index b47aef9e..c352c5a9 100644
> --- a/include/random_range.h
> +++ b/include/random_range.h
> @@ -6,7 +6,7 @@
> #ifndef _RANDOM_RANGE_H_
> #define _RANDOM_RANGE_H_
>
> -int parse_ranges ( char *, int, int, int, int (*)(), char **, char ** );
> +int parse_ranges ( char *, int, int, int, int (*)(char *, int *), char **, char ** );
> int range_min ( char *, int );
> int range_max ( char *, int );
> int range_mult ( char *, int );
> diff --git a/include/write_log.h b/include/write_log.h
> index 025ebac0..d02f898a 100644
> --- a/include/write_log.h
> +++ b/include/write_log.h
> @@ -125,7 +125,7 @@ extern int wlog_close(struct wlog_file *wfile);
> extern int wlog_record_write(struct wlog_file *wfile,
> struct wlog_rec *wrec, long offset);
> extern int wlog_scan_backward(struct wlog_file *wfile, int nrecs,
> - int (*func)(struct wlog_rec *rec),
> + int (*func)(struct wlog_rec *rec, long data),
This is a very similar version to what's in
testcases/kernel/fs/doio/write_log.c in the LTP source.
Maybe it's time to clean up both versions?
Reviewed-by: "Darrick J. Wong" <djwong@kernel.org>
--D
> long data);
> #else
> int wlog_open();
> diff --git a/lib/random_range.c b/lib/random_range.c
> index 680bf71c..0b38eb7f 100644
> --- a/lib/random_range.c
> +++ b/lib/random_range.c
> @@ -69,7 +69,7 @@ struct range {
> * parse_range() returns -1 on error, or the number of ranges parsed.
> */
>
> -static int str_to_int();
> +static int str_to_int(char *str, int *ip);
> static long long divider(long long, long long, long long, long long);
>
> int
> @@ -78,7 +78,7 @@ parse_ranges(
> int defmin,
> int defmax,
> int defmult,
> - int (*parse_func)(),
> + int (*parse_func)(char *str, int *ip),
> char **rangeptr,
> char **errptr)
> {
> @@ -570,8 +570,6 @@ printf(" diff = %lld, half = %lld, med = %lld\n", diff, half, med);
> void
> random_range_seed(long s)
> {
> - extern void srand48();
> -
> srand48(s);
> }
>
> diff --git a/lib/string_to_tokens.c b/lib/string_to_tokens.c
> index 08df9fcc..8383ed4c 100644
> --- a/lib/string_to_tokens.c
> +++ b/lib/string_to_tokens.c
> @@ -54,7 +54,6 @@ int
> string_to_tokens(char *arg_string, char *arg_array[], int array_size, char *separator)
> {
> int num_toks = 0; /* number of tokens found */
> - char *strtok();
>
> if ( arg_array == NULL || array_size <= 1 || separator == NULL )
> return -1;
> diff --git a/lib/tlibio.c b/lib/tlibio.c
> index 3c23bf4d..19192b38 100644
> --- a/lib/tlibio.c
> +++ b/lib/tlibio.c
> @@ -75,7 +75,7 @@
>
>
> #ifndef linux
> -static void lio_async_signal_handler();
> +static void lio_async_signal_handler(int sig);
> #endif
>
> /*
> diff --git a/lib/write_log.c b/lib/write_log.c
> index c82cc1f4..e04fed4b 100644
> --- a/lib/write_log.c
> +++ b/lib/write_log.c
> @@ -217,7 +217,7 @@ int
> wlog_scan_backward(
> struct wlog_file *wfile,
> int nrecs,
> - int (*func)(),
> + int (*func)(struct wlog_rec *, long data),
> long data)
> {
> int fd, leftover, nbytes, offset, recnum, reclen;
> --
> 2.48.0
>
>
next prev parent reply other threads:[~2025-02-06 22:45 UTC|newest]
Thread overview: 26+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-02-06 21:19 [PATCH 0/7] fstests: enable sparse checking & fix fallout Eric Sandeen
2025-02-06 21:19 ` [PATCH 1/7] fstests: enable sparse checking with make C=[12] Eric Sandeen
2025-02-06 22:36 ` Darrick J. Wong
2025-02-07 4:56 ` Christoph Hellwig
2025-02-06 21:19 ` [PATCH 2/7] builddefs: define linux Eric Sandeen
2025-02-06 22:39 ` Darrick J. Wong
2025-02-07 1:09 ` Eric Sandeen
2025-02-07 2:01 ` Darrick J. Wong
2025-02-07 4:57 ` Christoph Hellwig
2025-02-07 5:06 ` Darrick J. Wong
2025-02-06 21:19 ` [PATCH 3/7] lib: Fix non-ANSI function declarations Eric Sandeen
2025-02-06 22:39 ` Darrick J. Wong
2025-02-07 4:59 ` Christoph Hellwig
2025-02-06 21:19 ` [PATCH 4/7] lib: fix empty arg function prototypes Eric Sandeen
2025-02-06 22:45 ` Darrick J. Wong [this message]
2025-02-07 4:59 ` Christoph Hellwig
2025-02-06 21:20 ` [PATCH 5/7] lib: replace aiocb_t with struct aiocb Eric Sandeen
2025-02-06 22:46 ` Darrick J. Wong
2025-02-07 5:00 ` Christoph Hellwig
2025-02-06 21:20 ` [PATCH 6/7] lib: make a few symbols static Eric Sandeen
2025-02-06 22:46 ` Darrick J. Wong
2025-02-07 5:00 ` Christoph Hellwig
2025-02-06 21:20 ` [PATCH 7/7] lib: remove random.c Eric Sandeen
2025-02-06 22:47 ` Darrick J. Wong
2025-02-07 5:01 ` Christoph Hellwig
-- strict thread matches above, loose matches on Subject: below --
2025-03-10 18:29 [PATCH 0/7 V2] fstests: enable sparse checking & fix fallout Eric Sandeen
2025-03-10 18:29 ` [PATCH 4/7] lib: fix empty arg function prototypes Eric Sandeen
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20250206224541.GQ21799@frogsfrogsfrogs \
--to=djwong@kernel.org \
--cc=fstests@vger.kernel.org \
--cc=sandeen@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox