DPDK-dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Stephen Hemminger <stephen@networkplumber.org>
To: dev@dpdk.org
Cc: Stephen Hemminger <stephen@networkplumber.org>,
	Reshma Pattan <reshma.pattan@intel.com>,
	Kai Ji <kai.ji@intel.com>, Wisam Jaddo <wisamm@nvidia.com>,
	Elena Agostini <eagostini@nvidia.com>,
	Aman Singh <aman.deep.singh@intel.com>,
	Ori Kam <orika@nvidia.com>, Anoob Joseph <anoobj@marvell.com>,
	Akhil Goyal <gakhil@marvell.com>,
	Fan Zhang <fanzhang.oss@gmail.com>
Subject: [PATCH 33/37] app: remove unreachable statements
Date: Sun, 29 Nov 2026 16:27:18 -0800	[thread overview]
Message-ID: <20261130002752.2342213-34-stephen@networkplumber.org> (raw)
In-Reply-To: <20261130002752.2342213-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


  parent reply	other threads:[~2026-11-30  0:31 UTC|newest]

Thread overview: 47+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-30  0:26 [PATCH 00/37] enable unreachable code detection Stephen Hemminger
2026-11-30  0:26 ` [PATCH 01/37] net/mlx4: fix unreachable code warnings Stephen Hemminger
2026-11-30  0:26 ` [PATCH 02/37] net/mlx5: " Stephen Hemminger
2026-11-30  0:26 ` [PATCH 03/37] eventdev: fix vector adapter instance allocation Stephen Hemminger
2026-11-30  0:26 ` [PATCH 04/37] eal: silence unreachable code in version string Stephen Hemminger
2026-11-30  9:13   ` Bruce Richardson
2026-11-30  0:26 ` [PATCH 05/37] net/dpaa2: remove debug abort in flow destroy Stephen Hemminger
2026-11-30  0:26 ` [PATCH 06/37] app/testpmd: fix unreachable VF traffic error message Stephen Hemminger
2026-11-30  0:26 ` [PATCH 07/37] examples/eventdev_pipeline: remove dead continue Stephen Hemminger
2026-11-30  0:26 ` [PATCH 08/37] examples/ipsec-secgw: remove unreachable config error path Stephen Hemminger
2026-11-30  9:52   ` Radu Nicolau
2026-11-30  0:26 ` [PATCH 09/37] examples/skeleton: handle SIGINT and SIGTERM Stephen Hemminger
2026-11-30  0:26 ` [PATCH 10/37] examples/rxtx_callbacks: " Stephen Hemminger
2026-11-30  0:26 ` [PATCH 11/37] examples/service_cores: " Stephen Hemminger
2026-11-30  0:26 ` [PATCH 12/37] examples/timer: " Stephen Hemminger
2026-11-30  0:26 ` [PATCH 13/37] examples/multi_process: handle SIGINT and SIGTERM in client Stephen Hemminger
2026-11-30  0:26 ` [PATCH 14/37] examples/server_node_efd: handle SIGINT and SIGTERM in node Stephen Hemminger
2026-11-30  0:27 ` [PATCH 15/37] examples/pipeline: handle SIGINT and SIGTERM Stephen Hemminger
2026-11-30  0:27 ` [PATCH 16/37] ethdev: fix unreachable warnings from switch declarations Stephen Hemminger
2026-11-30  0:27 ` [PATCH 17/37] config: add per-directory option for -Wunreachable-code Stephen Hemminger
2026-11-30  0:27 ` [PATCH 18/37] bus/dpaa: exempt this driver from unreachable code detection Stephen Hemminger
2026-11-30  0:27 ` [PATCH 19/37] net/qede: disable unreachable code checks Stephen Hemminger
2026-11-30  0:27 ` [PATCH 20/37] net/txgbe: " Stephen Hemminger
2026-11-30  0:27 ` [PATCH 21/37] net/ixgbe: disable unreachable code check Stephen Hemminger
2026-11-30  9:14   ` Bruce Richardson
2026-11-30  0:27 ` [PATCH 22/37] net/ngbe: " Stephen Hemminger
2026-11-30  0:27 ` [PATCH 23/37] net/octeontx: replace unreachable code Stephen Hemminger
2026-11-30  0:27 ` [PATCH 24/37] common/sfc_efx: disable unreachable code check for base code Stephen Hemminger
2026-11-30  0:27 ` [PATCH 25/37] net/dpaa2: check port state before changing TM hierarchy Stephen Hemminger
2026-11-30  0:27 ` [PATCH 26/37] net/e1000: disable unreachable code check for base code Stephen Hemminger
2026-11-30  9:14   ` Bruce Richardson
2026-11-30  0:27 ` [PATCH 27/37] net/ice: " Stephen Hemminger
2026-11-30  9:16   ` Bruce Richardson
2026-11-30  0:27 ` [PATCH 28/37] raw/ifpga: " Stephen Hemminger
2026-11-30  9:43   ` Bruce Richardson
2026-11-30  0:27 ` [PATCH 29/37] net/bnxt: disable unreachable code check Stephen Hemminger
2026-11-30  0:27 ` [PATCH 30/37] net/ntnic: " Stephen Hemminger
2026-11-30  0:27 ` [PATCH 31/37] lib: mark never returning thread functions Stephen Hemminger
2026-11-30  9:44   ` Bruce Richardson
2026-11-30  0:27 ` [PATCH 32/37] lib: remove unreachable statements Stephen Hemminger
2026-11-30  0:27 ` Stephen Hemminger [this message]
2026-11-30  0:27 ` [PATCH 34/37] examples: " Stephen Hemminger
2026-11-30  9:45   ` Bruce Richardson
2026-11-30  0:27 ` [PATCH 35/37] drivers: " Stephen Hemminger
2026-11-30 10:59   ` Dariusz Sosnowski
2026-11-30  0:27 ` [PATCH 36/37] efd: mark configuration dependent vector selection Stephen Hemminger
2026-11-30  0:27 ` [PATCH 37/37] 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=20261130002752.2342213-34-stephen@networkplumber.org \
    --to=stephen@networkplumber.org \
    --cc=aman.deep.singh@intel.com \
    --cc=anoobj@marvell.com \
    --cc=dev@dpdk.org \
    --cc=eagostini@nvidia.com \
    --cc=fanzhang.oss@gmail.com \
    --cc=gakhil@marvell.com \
    --cc=kai.ji@intel.com \
    --cc=orika@nvidia.com \
    --cc=reshma.pattan@intel.com \
    --cc=wisamm@nvidia.com \
    /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