From: Stephen Hemminger <stephen@networkplumber.org>
To: dev@dpdk.org
Cc: Stephen Hemminger <stephen@networkplumber.org>
Subject: [PATCH v2 34/38] app: remove unreachable statements
Date: Mon, 30 Nov 2026 13:49:40 -0800 [thread overview]
Message-ID: <20261130215203.886245-35-stephen@networkplumber.org> (raw)
In-Reply-To: <20261130215203.886245-1-stephen@networkplumber.org>
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 <stephen@networkplumber.org>
---
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
next prev parent reply other threads:[~2026-11-30 21:56 UTC|newest]
Thread overview: 90+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-29 20:48 [PATCH 00/45] remove unused internal symbols and dead code Stephen Hemminger
2026-11-29 20:48 ` [PATCH 01/45] bus/vmbus: do not export unused internal symbol Stephen Hemminger
2026-11-29 20:48 ` [PATCH 02/45] bus/dpaa: remove exports for nonexistent symbols Stephen Hemminger
2026-11-29 20:48 ` [PATCH 03/45] ethdev: do not export internal dummy ops Stephen Hemminger
2026-11-29 20:48 ` [PATCH 04/45] hash: do not export internal toeplitz helper Stephen Hemminger
2026-11-29 20:48 ` [PATCH 05/45] cryptodev: do not export internal device name helper Stephen Hemminger
2026-11-29 20:48 ` [PATCH 06/45] mldev: do not export internal PMD device helpers Stephen Hemminger
2026-11-29 20:48 ` [PATCH 07/45] gpudev: do not export unused internal functions Stephen Hemminger
2026-11-29 20:48 ` [PATCH 08/45] eal/linux: do not export internal VFIO helpers Stephen Hemminger
2026-11-29 20:48 ` [PATCH 09/45] eal/linux: remove unused VFIO device number helper Stephen Hemminger
2026-11-29 20:48 ` [PATCH 10/45] eal: make per-thread epoll instance getter static Stephen Hemminger
2026-11-29 20:48 ` [PATCH 11/45] bus: do not export unused driver unregister functions Stephen Hemminger
2026-11-29 20:48 ` [PATCH 12/45] bus/fslmc: do not export internal symbols used only in the bus Stephen Hemminger
2026-11-29 20:48 ` [PATCH 13/45] bus/dpaa: " Stephen Hemminger
2026-11-29 20:48 ` [PATCH 14/45] common/dpaax: do not export IOVA table dump helper Stephen Hemminger
2026-11-29 20:49 ` [PATCH 15/45] net/nfb: do not export MDIO speed capability helper Stephen Hemminger
2026-11-30 9:56 ` Martin Spinler
2026-11-29 20:49 ` [PATCH 16/45] common/sxe2: do not export internal ioctl channel helpers Stephen Hemminger
2026-11-29 20:49 ` [PATCH 17/45] common/mlx5: do not export internal symbols used only in common code Stephen Hemminger
2026-11-30 10:50 ` Dariusz Sosnowski
2026-11-29 20:49 ` [PATCH 18/45] net/idpf: do not export internal symbols used only in the driver Stephen Hemminger
2026-11-29 20:49 ` [PATCH 19/45] net/iavf: do not export VF reset function Stephen Hemminger
2026-11-29 20:49 ` [PATCH 20/45] eal: do not export unused Windows interrupt handle accessors Stephen Hemminger
2026-11-29 20:49 ` [PATCH 21/45] common/cnxk: do not export internal symbols used only in roc Stephen Hemminger
2026-11-29 20:49 ` [PATCH 22/45] common/sfc_efx: do not export internal symbols unused outside base Stephen Hemminger
2026-11-29 20:49 ` [PATCH 23/45] crypto/cnxk: do not export internal Rx inject helpers Stephen Hemminger
2026-11-29 20:49 ` [PATCH 24/45] net/cnxk: do not export inline inbound mode setter Stephen Hemminger
2026-11-29 20:49 ` [PATCH 25/45] common/sfc_efx: remove unused libefx functions Stephen Hemminger
2026-11-29 20:49 ` [PATCH 26/45] common/cnxk: remove unused roc functions Stephen Hemminger
2026-11-29 20:49 ` [PATCH 27/45] common/mlx5: remove unused internal functions Stephen Hemminger
2026-11-30 10:51 ` Dariusz Sosnowski
2026-11-29 20:49 ` [PATCH 28/45] bus/fslmc: remove unused VFIO helpers Stephen Hemminger
2026-11-29 20:49 ` [PATCH 29/45] bus/dpaa: remove unused FMan and netcfg helpers Stephen Hemminger
2026-11-29 20:49 ` [PATCH 30/45] common/dpaax: remove unused IOVA table dump Stephen Hemminger
2026-11-29 20:49 ` [PATCH 31/45] net/idpf: remove unused queue enable helper Stephen Hemminger
2026-11-29 20:49 ` [PATCH 32/45] gpudev: remove unused attach function Stephen Hemminger
2026-11-29 20:49 ` [PATCH 33/45] cryptodev: remove unused device name helper Stephen Hemminger
2026-11-29 20:49 ` [PATCH 34/45] common/cnxk: remove unused MCS port recovery Stephen Hemminger
2026-11-29 20:49 ` [PATCH 35/45] bus/dpaa: remove unused QMan and BMan functions Stephen Hemminger
2026-11-29 20:49 ` [PATCH 36/45] bus/fslmc: remove unused MC object functions Stephen Hemminger
2026-11-29 20:49 ` [PATCH 37/45] eal: remove unused Windows interrupt handle accessors Stephen Hemminger
2026-11-29 20:49 ` [PATCH 38/45] common/sfc_efx: make efx_family static Stephen Hemminger
2026-11-29 20:49 ` [PATCH 39/45] gpudev: make event notify helper static Stephen Hemminger
2026-11-29 20:49 ` [PATCH 40/45] mldev: make device lookup " Stephen Hemminger
2026-11-29 20:49 ` [PATCH 41/45] bus/fslmc: make internal helpers static Stephen Hemminger
2026-11-29 20:49 ` [PATCH 42/45] net/cnxk: make inline inbound mode setter static Stephen Hemminger
2026-11-29 20:49 ` [PATCH 43/45] common/sxe2: make memory event callback static Stephen Hemminger
2026-11-29 20:49 ` [PATCH 44/45] net/idpf: make internal burst functions static Stephen Hemminger
2026-11-29 20:49 ` [PATCH 45/45] common/cnxk: make internal roc " Stephen Hemminger
2026-11-30 21:49 ` [PATCH v2 00/38] enable unreachable code detection Stephen Hemminger
2026-11-30 21:49 ` [PATCH v2 01/38] net/mlx4: fix unreachable code warnings Stephen Hemminger
2026-11-30 21:49 ` [PATCH v2 02/38] net/mlx5: " Stephen Hemminger
2026-11-30 21:49 ` [PATCH v2 03/38] examples/ipsec-secgw: remove dead code Stephen Hemminger
2026-11-30 21:49 ` [PATCH v2 04/38] eventdev: fix vector adapter instance allocation Stephen Hemminger
2026-11-30 21:49 ` [PATCH v2 05/38] test/eal: skip filesystem test on FreeBSD Stephen Hemminger
2026-12-01 8:58 ` Bruce Richardson
2026-11-30 21:49 ` [PATCH v2 06/38] eal: silence unreachable code in version string Stephen Hemminger
2026-11-30 21:49 ` [PATCH v2 07/38] net/dpaa2: remove debug abort in flow destroy Stephen Hemminger
2026-11-30 21:49 ` [PATCH v2 08/38] app/testpmd: fix unreachable VF traffic error message Stephen Hemminger
2026-11-30 21:49 ` [PATCH v2 09/38] examples/eventdev_pipeline: remove dead continue Stephen Hemminger
2026-11-30 21:49 ` [PATCH v2 10/38] examples/skeleton: handle SIGINT and SIGTERM Stephen Hemminger
2026-12-01 8:59 ` Bruce Richardson
2026-11-30 21:49 ` [PATCH v2 11/38] examples/rxtx_callbacks: " Stephen Hemminger
2026-11-30 21:49 ` [PATCH v2 12/38] examples/service_cores: " Stephen Hemminger
2026-11-30 21:49 ` [PATCH v2 13/38] examples/timer: " Stephen Hemminger
2026-11-30 21:49 ` [PATCH v2 14/38] examples/multi_process: handle SIGINT and SIGTERM in client Stephen Hemminger
2026-11-30 21:49 ` [PATCH v2 15/38] examples/server_node_efd: handle SIGINT and SIGTERM in node Stephen Hemminger
2026-11-30 21:49 ` [PATCH v2 16/38] examples/pipeline: handle SIGINT and SIGTERM Stephen Hemminger
2026-11-30 21:49 ` [PATCH v2 17/38] ethdev: fix unreachable warnings from switch declarations Stephen Hemminger
2026-11-30 21:49 ` [PATCH v2 18/38] config: add per-directory option for -Wunreachable-code Stephen Hemminger
2026-11-30 21:49 ` [PATCH v2 19/38] bus/dpaa: exempt this driver from unreachable code detection Stephen Hemminger
2026-11-30 21:49 ` [PATCH v2 20/38] net/qede: disable unreachable code checks Stephen Hemminger
2026-11-30 21:49 ` [PATCH v2 21/38] net/txgbe: " Stephen Hemminger
2026-11-30 21:49 ` [PATCH v2 22/38] net/ixgbe: disable unreachable code check Stephen Hemminger
2026-11-30 21:49 ` [PATCH v2 23/38] net/ngbe: " Stephen Hemminger
2026-11-30 21:49 ` [PATCH v2 24/38] net/octeontx: replace unreachable code Stephen Hemminger
2026-11-30 21:49 ` [PATCH v2 25/38] common/sfc_efx: disable unreachable code check for base code Stephen Hemminger
2026-11-30 21:49 ` [PATCH v2 26/38] net/dpaa2: check port state before changing TM hierarchy Stephen Hemminger
2026-11-30 21:49 ` [PATCH v2 27/38] net/e1000: disable unreachable code check for base code Stephen Hemminger
2026-11-30 21:49 ` [PATCH v2 28/38] net/ice: " Stephen Hemminger
2026-11-30 21:49 ` [PATCH v2 29/38] raw/ifpga: " Stephen Hemminger
2026-11-30 21:49 ` [PATCH v2 30/38] net/bnxt: disable unreachable code check Stephen Hemminger
2026-11-30 21:49 ` [PATCH v2 31/38] net/ntnic: " Stephen Hemminger
2026-11-30 21:49 ` [PATCH v2 32/38] lib: mark never returning thread functions Stephen Hemminger
2026-11-30 21:49 ` [PATCH v2 33/38] lib: remove unreachable statements Stephen Hemminger
2026-11-30 21:49 ` Stephen Hemminger [this message]
2026-11-30 21:49 ` [PATCH v2 35/38] examples: " Stephen Hemminger
2026-11-30 21:49 ` [PATCH v2 36/38] drivers: " Stephen Hemminger
2026-11-30 21:49 ` [PATCH v2 37/38] efd: mark configuration dependent vector selection Stephen Hemminger
2026-11-30 21:49 ` [PATCH v2 38/38] config: enable unreachable code detection Stephen Hemminger
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 \
--in-reply-to=20261130215203.886245-35-stephen@networkplumber.org \
--to=stephen@networkplumber.org \
--cc=dev@dpdk.org \
/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