From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on gnuweeb.org X-Spam-Level: X-Spam-Status: No, score=-0.8 required=5.0 tests=ALL_TRUSTED,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NO_DNS_FOR_FROM,URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.6 Received: from localhost.localdomain (unknown [182.253.183.240]) by gnuweeb.org (Postfix) with ESMTPSA id A9CD381754; Thu, 24 Nov 2022 16:29:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gnuweeb.org; s=default; t=1669307366; bh=Ov7T+cVML2fZWPau1xESLQDyLzqpY18IJ9L7HJxRzOs=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=lIBFbsbD/mCTU7jwTy94VYUTOgEke5VjBkoYDXe8R3CLW8xO5Fk0ucoeYtS/nQ57u v4PdC/s+zFggn9kvV3XIBIfSQnPyp5L1TCYRFqVCyiq4eKAYYS+5zKh9SnV1LZZ0JS lnXCUmag/nsWulKpdlH76tgQhiOqY4IVfP1FTJaDeSOZwse5qtw6N4amn0lnFJ2Dj9 A4M9lm81+5ZDMu8bMO3vRVarWD6zPQVbIBWv9TBkH2uESm0U0ZNm1Uy1K+0gO0RJly /8/U8dh2lajJQ4ZURbHS8wmZQ70rZ4zxfcdDqc1QpkJTAXrIR0QpkoQBiPGr+rlvBe rkz/aNqt7P7JQ== From: Ammar Faizi To: Jens Axboe Cc: Ammar Faizi , Dylan Yudaken , Pavel Begunkov , Gilang Fachrezy , Muhammad Rizki , Alviro Iskandar Setiawan , VNLX Kernel Department , io-uring Mailing List , GNU/Weeb Mailing List Subject: [PATCH liburing v2 3/8] test/io_uring_setup: Remove unused functions Date: Thu, 24 Nov 2022 23:28:56 +0700 Message-Id: <20221124162633.3856761-4-ammar.faizi@intel.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20221124162633.3856761-1-ammar.faizi@intel.com> References: <20221124162633.3856761-1-ammar.faizi@intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit List-Id: From: Ammar Faizi 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 --- 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