FS/XFS testing framework
 help / color / mirror / Atom feed
From: Eric Sandeen <sandeen@redhat.com>
To: fstests@vger.kernel.org
Cc: djwong@kernel.org, hch@infradead.org,
	Eric Sandeen <sandeen@redhat.com>, Christoph Hellwig <hch@lst.de>
Subject: [PATCH 4/7] lib: fix empty arg function prototypes
Date: Mon, 10 Mar 2025 13:29:06 -0500	[thread overview]
Message-ID: <20250310182954.1396724-5-sandeen@redhat.com> (raw)
In-Reply-To: <20250310182954.1396724-1-sandeen@redhat.com>

Several function prototypes used () when in fact they take
arguments. Fix those to make sparse happy.

Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Reviewed-by: "Darrick J. Wong" <djwong@kernel.org>
Reviewed-by: Christoph Hellwig <hch@lst.de>
---
 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 6b088416..a7ad2ee4 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),
 				   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 17ab34ee..75f10cec 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 32567a1c..eb3fa2b3 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


  parent reply	other threads:[~2025-03-10 18:30 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-03-10 18:29 [PATCH 0/7 V2] fstests: enable sparse checking & fix fallout Eric Sandeen
2025-03-10 18:29 ` [PATCH 1/7] fstests: enable sparse checking with make C=[12] Eric Sandeen
2025-03-10 18:29 ` [PATCH 2/7] treewide: check for #ifdef __linux__ not linux Eric Sandeen
2025-03-11  7:37   ` Christoph Hellwig
2025-03-11 13:44     ` Eric Sandeen
2025-03-11 13:46   ` [PATCH 2/7 V3] " Eric Sandeen
2025-03-11 15:25     ` Darrick J. Wong
2025-03-10 18:29 ` [PATCH 3/7] lib: Fix non-ANSI function declarations Eric Sandeen
2025-03-10 18:29 ` Eric Sandeen [this message]
2025-03-10 18:29 ` [PATCH 5/7] lib: replace aiocb_t with struct aiocb Eric Sandeen
2025-03-10 18:29 ` [PATCH 6/7] lib: make a few symbols static Eric Sandeen
2025-03-10 18:29 ` [PATCH 7/7] lib: remove random.c Eric Sandeen
2025-03-16 14:54   ` Zorro Lang
2025-03-16 15:48     ` Eric Sandeen
2025-03-16 16:40       ` Darrick J. Wong
2025-03-16 18:06         ` Eric Sandeen
2025-03-16 16:42       ` Zorro Lang
  -- strict thread matches above, loose matches on Subject: below --
2025-02-06 21:19 [PATCH 0/7] fstests: enable sparse checking & fix fallout Eric Sandeen
2025-02-06 21:19 ` [PATCH 4/7] lib: fix empty arg function prototypes Eric Sandeen
2025-02-06 22:45   ` Darrick J. Wong
2025-02-07  4:59   ` Christoph Hellwig

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=20250310182954.1396724-5-sandeen@redhat.com \
    --to=sandeen@redhat.com \
    --cc=djwong@kernel.org \
    --cc=fstests@vger.kernel.org \
    --cc=hch@infradead.org \
    --cc=hch@lst.de \
    /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