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 8B1C38166D; Thu, 24 Nov 2022 08:01:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gnuweeb.org; s=default; t=1669276891; bh=Ov7T+cVML2fZWPau1xESLQDyLzqpY18IJ9L7HJxRzOs=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=mZRYIAAY8L9Y59rUYByV3IydQoela8luIfbCXQuNtwC3gG0PSRI2VEA36q7zS8n2d tfcJUIUtU7DW3D3tfFWg/YDts2FR8fKzc1AHzUUmA0ADojhUwn87BW0I3A6m+FD9/O amV3RLGc2bgwzwnpo1KsNE8x8Q+cXSikTZE1lvsLoaoWENjM80ZiLG+XN2eSiXOD04 sK/Gxneyapm6ix7CPjfSRXATjesdRg0A1vHWLxjK3e3xI+eYzOcltRFVQg9KKpGvr/ FoCh8C7FBW3ZijQBuel12uq/Niwhq09QuSfo4ICfpEBfT5g0s5vY1ttqPsFRI3nTmi Qdpz25hc+BClg== From: Ammar Faizi To: Jens Axboe Cc: Ammar Faizi , Pavel Begunkov , io-uring Mailing List , GNU/Weeb Mailing List , Gilang Fachrezy , Muhammad Rizki , Alviro Iskandar Setiawan , VNLX Kernel Department Subject: [PATCH liburing v1 2/7] test/io_uring_setup: Remove unused functions Date: Thu, 24 Nov 2022 15:00:57 +0700 Message-Id: <20221124075846.3784701-3-ammar.faizi@intel.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20221124075846.3784701-1-ammar.faizi@intel.com> References: <20221124075846.3784701-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