From: Ammar Faizi <[email protected]>
To: Jens Axboe <[email protected]>
Cc: Ammar Faizi <[email protected]>,
Dylan Yudaken <[email protected]>,
Pavel Begunkov <[email protected]>,
Gilang Fachrezy <[email protected]>,
Muhammad Rizki <[email protected]>,
Alviro Iskandar Setiawan <[email protected]>,
VNLX Kernel Department <[email protected]>,
io-uring Mailing List <[email protected]>,
GNU/Weeb Mailing List <[email protected]>
Subject: [PATCH liburing v2 3/8] test/io_uring_setup: Remove unused functions
Date: Thu, 24 Nov 2022 23:28:56 +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 16:29 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-11-24 16:28 [PATCH liburing v2 0/8] Ensure we mark non-exported functions and variables as static Ammar Faizi
2022-11-24 16:28 ` [PATCH liburing v2 1/8] queue: Fix typo "entererd" -> "entered" Ammar Faizi
2022-11-24 16:28 ` [PATCH liburing v2 2/8] queue: Mark `__io_uring_flush_sq()` as static Ammar Faizi
2022-11-24 16:28 ` Ammar Faizi [this message]
2022-11-24 16:28 ` [PATCH liburing v2 4/8] ucontext-cp: Remove an unused function Ammar Faizi
2022-11-24 16:28 ` [PATCH liburing v2 5/8] tests: Mark non-exported functions as static Ammar Faizi
2022-11-24 16:28 ` [PATCH liburing v2 6/8] ucontext-cp: Mark a non-exported function " Ammar Faizi
2022-11-24 16:29 ` [PATCH liburing v2 7/8] test/Makefile: Omit `-Wmissing-prototypes` from the C++ compiler flags Ammar Faizi
2022-11-24 16:29 ` [PATCH liburing v2 8/8] github: Add `-Wmissing-prototypes` for GitHub CI bot Ammar Faizi
2022-11-28 14:15 ` [PATCH liburing v2 0/8] Ensure we mark non-exported functions and variables as static Jens Axboe
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] \
[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