From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id DF263606A31C for ; Mon, 30 Nov 2026 00:31:39 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=networkplumber-org.20260707.gappssmtp.com header.i=@networkplumber-org.20260707.gappssmtp.com header.a=rsa-sha256 header.s=20260707 header.b=I5mT2lMv Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 78F3240E6E; Mon, 30 Nov 2026 01:28:39 +0100 (CET) Received: from mail-pj1-f50.google.com (mail-pj1-f50.google.com [209.85.216.50]) by mails.dpdk.org (Postfix) with ESMTPS id 9CB3B40E26 for ; Mon, 30 Nov 2026 01:28:30 +0100 (CET) Received: by mail-pj1-f50.google.com with SMTP id 98e67ed59e1d1-3b421e8d111so6415820a91.3 for ; Sun, 29 Nov 2026 16:28:30 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20260707.gappssmtp.com; s=20260707; t=1795998509; x=1796603309; darn=dpdk.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to:content-type; bh=B4C+w+3HmDM191Chs027PXsEovKDJFojWslkOAQE2ts=; b=I5mT2lMvRXPqXm3+2+A6uy9eQOluF+Qq1TYbztFBsxEmS6KOOolHZ1zp9lyBMhTJsz 9cjcTTx3goCK/O7Lrj0bTXRI0UcexhBSVBE3vf2KrH0YMJLi6qk3WGjVIT0bpDaUjRqQ i0KPjLe5MGd8wCtbJZmvMrNfGoyKAadfBa0g8ZZD2Ezt7WAsyuXnngBV/DX3+zt5wii4 U6U04/9a99xf2fUQ0xBHBHOi1pLvqcQiU2JYOCo/lpzw+QL1gU6bXKwQ8+gaDlXS8dRI y7KL9iJs+/k5HvpYOPU4OwxojFqUmx+zPYi3Crj/SF2J9LGq7YT5F9nXFcUcVqPhc5SE Lqvw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1795998509; x=1796603309; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to:content-type; bh=B4C+w+3HmDM191Chs027PXsEovKDJFojWslkOAQE2ts=; b=Ubw2qy5GFplpLHoq8r78t5V2PBKPHuz9RqwYTc7fqLtwzE3jle6FkAo8C1b8MImL92 3is/f/FZ3qYJQqm4oY7qRMYJADWjs5O3NP+2i07+g4CajkmeZxLyVmpqbSItrKscyHRj 67lOn83tgC+SHV1ZBo2D3/FKjmk5ZV4Zq7s7WJZUfFcO6FCSkZZmbbNM7ukhBDBFWBF3 ubrnedXgB+HLE8L9l9Nc509Oof746iUIxS+hkrNxN5lt6eooi9ZPo2ghVrlXsy71Dox0 OTmTPCdO8OEzP8MOs6XnVipYLbuGmLJMsjHj38Oe8on+6kERt8nIM5pWrwVWpjA0h6/a RXAg== X-Gm-Message-State: APuU4Z8tif/Q61nc0OB606IlX1+8ZaKOXkcn1ItToWvJgSTpuyZbw/A/ ai/JxwEjID0+foUEOuQU4VmFfqRethLzJGbPWEfFsraay4vhTYdZjk3zrijiHkhq8bWkDD5ot/G fLrEPR6U= X-Gm-Gg: AZFdTZfBm6/i9pI6+jvNATIbc/Fx4pK6M6nV2ztUFXVRtAzqK1SHa2CoDC6kn4AUMoK HNj3oGtTeJ3KNUh6WHQv0g+cnzvqWxnr4VLWEry4muzO4d9TGI5vbdF6EieduMbuaOhVnhu4H7L 9Dp3bTF2UOsmmM4NiFUFK25LeqsPqMlw1t7f71te+n39QoRv+7FBVepm6kiXvYIMxCgP4X4xfPP /IKgqOLw4ZNzQGuhcx3XzemdFsKIWsQ6fzaiRbONRr3wl7kktdNvy1KkpqbRSusl2Ezu41QDpxh b9qZKc/9TITxJw3Y1Ulhcp9b1b5KFcmJXzLu+C+FUBcNdXpBRMrO68m5TOhLfO97+U9qnW7JG8R ytvqgEZEV3uPrAa5B1rN2iQAGR8eNDfa3waGF7GdP2lnPvuJ6+DHfB/IvGB/FtTBe3D0wiTYPyg dw7TcYMdlPIQUGMYRVt9CPL5Kdw207xPZvHPq68TtCsqxrCaWW9o0OZLAN2xGrLmpUBYGTCKmOV 2LQEshpqyn7xrueVFdFUkpm8N6b/i0ibDgLHvj6fwcyg5Fd3uMb53yq7K77NCdWaXBx5c2oSAbk uqEuOs5HfLWMA7J+F6m0BauM3R0lpf5CrVOhPGWnXmYWk8Rm/KfWCVX3kGKaDOqEAXcW X-Received: by 2002:a17:90b:2e8c:b0:3b3:b373:6a6a with SMTP id 98e67ed59e1d1-3b41c9e45c3mr32502304a91.28.1795998508967; Sun, 29 Nov 2026 16:28:28 -0800 (PST) Received: from phoenix.lan (204-195-112-43.wavecable.com. [204.195.112.43]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-3b44b21e19fsm19455840a91.0.2026.11.29.16.28.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 29 Nov 2026 16:28:28 -0800 (PST) From: Stephen Hemminger To: dev@dpdk.org Cc: Stephen Hemminger , Reshma Pattan , Kai Ji , Wisam Jaddo , Elena Agostini , Aman Singh , Ori Kam , Anoob Joseph , Akhil Goyal , Fan Zhang Subject: [PATCH 33/37] app: remove unreachable statements Date: Sun, 29 Nov 2026 16:27:18 -0800 Message-ID: <20261130002752.2342213-34-stephen@networkplumber.org> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20261130002752.2342213-1-stephen@networkplumber.org> References: <20261130002752.2342213-1-stephen@networkplumber.org> X-Archived-By: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Archive: List-Post: List-Help: List-Subscribe: , X-Spam-Status: No, score=-16.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, USER_AGENT_GIT autolearn=ham autolearn_force=no version=4.0.1 X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-26) on aws-us-west-2-korg-listserv-alma10-1 Clang with -Wunreachable-code-aggressive reports break statements after a return or rte_exit(), and returns after a switch where every case returns. Remove them. Extra defensive code does not help: with the trailing return gone, adding a case that forgets to return becomes a compiler error instead of silently returning zero. Signed-off-by: Stephen Hemminger --- app/dumpcap/main.c | 1 - app/pdump/main.c | 1 - app/test-compress-perf/comp_perf_options_parse.c | 1 - app/test-crypto-perf/cperf_ops.c | 1 - app/test-crypto-perf/cperf_options_parsing.c | 1 - app/test-flow-perf/main.c | 1 - app/test-gpudev/main.c | 1 - app/test-pmd/parameters.c | 2 -- app/test-regex/main.c | 2 -- app/test-security-perf/test_security_perf.c | 1 - app/test/test_cryptodev.c | 9 --------- app/test/test_cryptodev_crosscheck.c | 6 ------ app/test/test_eal_flags.c | 1 - 13 files changed, 28 deletions(-) diff --git a/app/dumpcap/main.c b/app/dumpcap/main.c index 47483535fc..32bb65a97a 100644 --- a/app/dumpcap/main.c +++ b/app/dumpcap/main.c @@ -401,7 +401,6 @@ static void parse_opts(int argc, char **argv) case 'b': rte_exit(EXIT_FAILURE, "multiple files not implemented\n"); - break; case 'c': stop.packets = get_uint(optarg, "packet_count", 0); break; diff --git a/app/pdump/main.c b/app/pdump/main.c index 1f6135b20e..6f33b777d9 100644 --- a/app/pdump/main.c +++ b/app/pdump/main.c @@ -617,7 +617,6 @@ configure_vdev(uint16_t port_id) rte_exit(EXIT_FAILURE, "promiscuous mode enable failed: %s\n", rte_strerror(-ret)); - return ret; } return 0; diff --git a/app/test-compress-perf/comp_perf_options_parse.c b/app/test-compress-perf/comp_perf_options_parse.c index 16d31c7e90..3cb8dbdd7f 100644 --- a/app/test-compress-perf/comp_perf_options_parse.c +++ b/app/test-compress-perf/comp_perf_options_parse.c @@ -709,7 +709,6 @@ comp_perf_options_parse(struct comp_test_data *test_data, int argc, char **argv) case 'h': usage(argv[0]); exit(EXIT_SUCCESS); - break; /* long options */ case 0: retval = comp_perf_opts_parse_long(opt_idx, test_data); diff --git a/app/test-crypto-perf/cperf_ops.c b/app/test-crypto-perf/cperf_ops.c index 1c8d1e263a..68432755f5 100644 --- a/app/test-crypto-perf/cperf_ops.c +++ b/app/test-crypto-perf/cperf_ops.c @@ -122,7 +122,6 @@ cperf_set_ops_asym_ecdsa(struct rte_crypto_op **ops, default: rte_panic("Unsupported ECDSA operation type %d\n", options->op_type); - break; } asym_op->ecdsa.message.data = ecdsa_curve_data->message.data; diff --git a/app/test-crypto-perf/cperf_options_parsing.c b/app/test-crypto-perf/cperf_options_parsing.c index b1b0abbcbc..61ce3af7e4 100644 --- a/app/test-crypto-perf/cperf_options_parsing.c +++ b/app/test-crypto-perf/cperf_options_parsing.c @@ -1258,7 +1258,6 @@ cperf_options_parse(struct cperf_options *options, int argc, char **argv) case 'h': usage(argv[0]); exit(EXIT_SUCCESS); - break; /* long options */ case 0: retval = cperf_opts_parse_long(opt_idx, options); diff --git a/app/test-flow-perf/main.c b/app/test-flow-perf/main.c index 6636d1517f..c529f55c73 100644 --- a/app/test-flow-perf/main.c +++ b/app/test-flow-perf/main.c @@ -986,7 +986,6 @@ args_parse(int argc, char **argv) usage(argv[0]); rte_exit(EXIT_FAILURE, "Invalid option: %s\n", argv[optind - 1]); - break; } } if (rules_count % rules_batch != 0) { diff --git a/app/test-gpudev/main.c b/app/test-gpudev/main.c index f065e6cd81..4bf0c1a09d 100644 --- a/app/test-gpudev/main.c +++ b/app/test-gpudev/main.c @@ -57,7 +57,6 @@ args_parse(int argc, char **argv) default: usage(argv[0]); rte_exit(EXIT_FAILURE, "Invalid option: %s\n", argv[optind]); - break; } } } diff --git a/app/test-pmd/parameters.c b/app/test-pmd/parameters.c index 9967e49881..0668c7d240 100644 --- a/app/test-pmd/parameters.c +++ b/app/test-pmd/parameters.c @@ -975,7 +975,6 @@ launch_args_parse(int argc, char** argv) case 'h': usage(argv[0]); exit(EXIT_SUCCESS); - break; case TESTPMD_OPT_CMDLINE_FILE_NUM: case TESTPMD_OPT_CMDLINE_FILE_NOECHO_NUM: if (cmdline_file_count >= RTE_DIM(cmdline_files)) { @@ -1797,7 +1796,6 @@ launch_args_parse(int argc, char** argv) fprintf(stderr, "Invalid option: %s\n", argv[optind - 1]); rte_exit(EXIT_FAILURE, "Command line is incomplete or incorrect\n"); - break; } } diff --git a/app/test-regex/main.c b/app/test-regex/main.c index 81719f2e04..a27a9b73b7 100644 --- a/app/test-regex/main.c +++ b/app/test-regex/main.c @@ -173,7 +173,6 @@ args_parse(int argc, char **argv, char *rules_file, char *data_file, default: usage(argv[0]); rte_exit(EXIT_FAILURE, "Invalid option: %s\n", argv[optind]); - break; } } @@ -530,7 +529,6 @@ run_regex(void *args) default: rte_exit(EXIT_FAILURE, "Invalid match mode value\n"); - break; } pos += act_job_len; actual_jobs++; diff --git a/app/test-security-perf/test_security_perf.c b/app/test-security-perf/test_security_perf.c index dd377a6027..4dc3c117eb 100644 --- a/app/test-security-perf/test_security_perf.c +++ b/app/test-security-perf/test_security_perf.c @@ -464,7 +464,6 @@ args_parse(int argc, char **argv) usage(argv[0]); rte_exit(EXIT_FAILURE, "Invalid option: %s\n", argv[opt_idx - 1]); - break; } } diff --git a/app/test/test_cryptodev.c b/app/test/test_cryptodev.c index eb955766bc..8086377f19 100644 --- a/app/test/test_cryptodev.c +++ b/app/test/test_cryptodev.c @@ -3759,8 +3759,6 @@ test_snow3g_authentication_verify(const struct snow3g_hash_test_data *tdata) return 0; else return -1; - - return 0; } static int @@ -3939,8 +3937,6 @@ test_kasumi_authentication_verify(const struct kasumi_hash_test_data *tdata) return 0; else return -1; - - return 0; } static int @@ -3983,7 +3979,6 @@ static int test_snow3g_hash_verify_test_case_1(void) { return test_snow3g_authentication_verify(&snow3g_hash_test_case_1); - } static int @@ -6879,8 +6874,6 @@ test_zuc_authentication(const struct wireless_test_data *tdata, return 0; else return -1; - - return 0; } static int @@ -20097,8 +20090,6 @@ test_NIA_helper(const void *td) return 0; else return -1; - - return 0; } static int diff --git a/app/test/test_cryptodev_crosscheck.c b/app/test/test_cryptodev_crosscheck.c index bb21c3bc50..e3cb15737a 100644 --- a/app/test/test_cryptodev_crosscheck.c +++ b/app/test/test_cryptodev_crosscheck.c @@ -152,7 +152,6 @@ profile_create(const struct rte_cryptodev_symmetric_capability *capa, break; default: rte_panic("Wrong capability profile type: %i\n", capability_type); - break; } break; case RTE_CRYPTO_SYM_XFORM_CIPHER: @@ -171,7 +170,6 @@ profile_create(const struct rte_cryptodev_symmetric_capability *capa, break; default: rte_panic("Wrong capability profile type: %i\n", capability_type); - break; } break; case RTE_CRYPTO_SYM_XFORM_AEAD: @@ -193,12 +191,10 @@ profile_create(const struct rte_cryptodev_symmetric_capability *capa, break; default: rte_panic("Wrong capability profile type: %i\n", capability_type); - break; } break; default: rte_panic("Wrong xform profile type: %i\n", capa->xform_type); - break; } profile.input_buf_len = RTE_ALIGN_CEIL(input_len, profile.block_size); @@ -254,7 +250,6 @@ sym_capability_to_idx(const struct rte_cryptodev_symmetric_capability *cap) break; default: rte_panic("Wrong capability profile type: %i\n", cap_idx.type); - break; } return cap_idx; @@ -457,7 +452,6 @@ crosscheck_init(void) break; default: rte_panic("Wrong capability profile type: %i\n", cap->xform_type); - break; } } diff --git a/app/test/test_eal_flags.c b/app/test/test_eal_flags.c index dcfdc42eca..b059f5d929 100644 --- a/app/test/test_eal_flags.c +++ b/app/test/test_eal_flags.c @@ -214,7 +214,6 @@ process_hugefiles(const char *prefix, enum hugepage_action action) result = 1; goto end; } - break; case HUGEPAGE_DELETE: { char file_path[PATH_MAX]; -- 2.53.0