From: Ammar Faizi <[email protected]>
To: Jens Axboe <[email protected]>
Cc: Ammar Faizi <[email protected]>,
Pavel Begunkov <[email protected]>,
io-uring Mailing List <[email protected]>,
GNU/Weeb Mailing List <[email protected]>,
Gilang Fachrezy <[email protected]>,
Muhammad Rizki <[email protected]>,
Alviro Iskandar Setiawan <[email protected]>,
VNLX Kernel Department <[email protected]>
Subject: [PATCH liburing v1 2/7] test/io_uring_setup: Remove unused functions
Date: Thu, 24 Nov 2022 15:00:57 +0700 [thread overview]
Message-ID: <[email protected]> (raw)
In-Reply-To: <[email protected]>
From: Ammar Faizi <[email protected]>
When marking all internal functions as static after an attempt to
integrate `-Wmissing-prototypes` flag. Unused functions are found:
io_uring_setup.c:22:14: error: unused function 'features_string' [-Werror,-Wunused-function]
static char *features_string(struct io_uring_params *p)
^
io_uring_setup.c:44:14: error: unused function 'flags_string' [-Werror,-Wunused-function]
static char *flags_string(struct io_uring_params *p)
^
io_uring_setup.c:83:15: error: unused function 'dump_resv' [-Werror,-Wunused-function]
static char * dump_resv(struct io_uring_params *p)
^
3 errors generated.
make[1]: *** [Makefile:215: io_uring_setup.t] Error 1
make[1]: *** Waiting for unfinished jobs....
Remove them.
Signed-off-by: Ammar Faizi <[email protected]>
---
test/io_uring_setup.c | 82 ++-----------------------------------------
1 file changed, 2 insertions(+), 80 deletions(-)
diff --git a/test/io_uring_setup.c b/test/io_uring_setup.c
index d945421..9e1a353 100644
--- a/test/io_uring_setup.c
+++ b/test/io_uring_setup.c
@@ -19,86 +19,9 @@
#include "../syscall.h"
-char *features_string(struct io_uring_params *p)
-{
- static char flagstr[64];
-
- if (!p || !p->features)
- return "none";
-
- if (p->features & ~IORING_FEAT_SINGLE_MMAP) {
- snprintf(flagstr, 64, "0x%.8x", p->features);
- return flagstr;
- }
-
- if (p->features & IORING_FEAT_SINGLE_MMAP)
- strncat(flagstr, "IORING_FEAT_SINGLE_MMAP", 64 - strlen(flagstr));
-
- return flagstr;
-}
-
-/*
- * Attempt the call with the given args. Return 0 when expect matches
- * the return value of the system call, 1 otherwise.
- */
-char *
-flags_string(struct io_uring_params *p)
-{
- static char flagstr[64];
- int add_pipe = 0;
-
- memset(flagstr, 0, sizeof(flagstr));
-
- if (!p || p->flags == 0)
- return "none";
-
- /*
- * If unsupported flags are present, just print the bitmask.
- */
- if (p->flags & ~(IORING_SETUP_IOPOLL | IORING_SETUP_SQPOLL |
- IORING_SETUP_SQ_AFF)) {
- snprintf(flagstr, 64, "0x%.8x", p->flags);
- return flagstr;
- }
-
- if (p->flags & IORING_SETUP_IOPOLL) {
- strncat(flagstr, "IORING_SETUP_IOPOLL", 64 - strlen(flagstr));
- add_pipe = 1;
- }
- if (p->flags & IORING_SETUP_SQPOLL) {
- if (add_pipe)
- strncat(flagstr, "|", 64 - strlen(flagstr));
- else
- add_pipe = 1;
- strncat(flagstr, "IORING_SETUP_SQPOLL", 64 - strlen(flagstr));
- }
- if (p->flags & IORING_SETUP_SQ_AFF) {
- if (add_pipe)
- strncat(flagstr, "|", 64 - strlen(flagstr));
- strncat(flagstr, "IORING_SETUP_SQ_AFF", 64 - strlen(flagstr));
- }
-
- return flagstr;
-}
-
-char *
-dump_resv(struct io_uring_params *p)
-{
- static char resvstr[4096];
-
- if (!p)
- return "";
-
- sprintf(resvstr, "0x%.8x 0x%.8x 0x%.8x", p->resv[0],
- p->resv[1], p->resv[2]);
-
- return resvstr;
-}
-
/* bogus: setup returns a valid fd on success... expect can't predict the
fd we'll get, so this really only takes 1 parameter: error */
-int
-try_io_uring_setup(unsigned entries, struct io_uring_params *p, int expect)
+int try_io_uring_setup(unsigned entries, struct io_uring_params *p, int expect)
{
int ret;
@@ -123,8 +46,7 @@ try_io_uring_setup(unsigned entries, struct io_uring_params *p, int expect)
return 0;
}
-int
-main(int argc, char **argv)
+int main(int argc, char **argv)
{
int fd;
unsigned int status = 0;
--
Ammar Faizi
next prev parent reply other threads:[~2022-11-24 8:01 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-11-24 8:00 [PATCH liburing v1 0/7] Ensure we mark internal functions and variables as static Ammar Faizi
2022-11-24 8:00 ` [PATCH liburing v1 1/7] liburing.h: Export `__io_uring_flush_sq()` function Ammar Faizi
2022-11-24 10:14 ` Dylan Yudaken
2022-11-24 11:47 ` Ammar Faizi
2022-11-24 13:27 ` Jens Axboe
2022-11-24 8:00 ` Ammar Faizi [this message]
2022-11-24 8:00 ` [PATCH liburing v1 3/7] ucontext-cp: Remove an unused function Ammar Faizi
2022-11-24 8:00 ` [PATCH liburing v1 4/7] tests: Mark internal functions as static Ammar Faizi
2022-11-24 8:01 ` [PATCH liburing v1 5/7] ucontext-cp: " Ammar Faizi
2022-11-24 8:01 ` [PATCH liburing v1 6/7] test/Makefile: Omit `-Wmissing-prototypes` from the C++ compiler flags Ammar Faizi
2022-11-24 8:01 ` [PATCH liburing v1 7/7] github: Add `-Wmissing-prototypes` for GitHub CI bot Ammar Faizi
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 \
[email protected] \
[email protected] \
[email protected] \
[email protected] \
[email protected] \
[email protected] \
[email protected] \
[email protected] \
[email protected] \
[email protected] \
/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