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>,
	Chas Williams <3chas3@gmail.com>,
	"Min Hu (Connor)" <humin29@huawei.com>,
	Jingjing Wu <jingjing.wu@intel.com>,
	Bhagyada Modali <bhagyada.modali@amd.com>,
	Raghavendra Ningoji <raghavendra.ningoji@amd.com>,
	Maxime Coquelin <maxime.coquelin@redhat.com>,
	Chenbo Xia <chenbox@nvidia.com>
Subject: [PATCH 34/37] examples: remove unreachable statements
Date: Sun, 29 Nov 2026 16:27:19 -0800	[thread overview]
Message-ID: <20261130002752.2342213-35-stephen@networkplumber.org> (raw)
In-Reply-To: <20261130002752.2342213-1-stephen@networkplumber.org>

Clang with -Wunreachable-code-aggressive reports break and return
statements after rte_exit(), which does not return.

Remove them.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
 examples/bond/main.c           | 1 -
 examples/l2fwd-jobstats/main.c | 2 --
 examples/l3fwd/main.c          | 4 ----
 examples/ntb/ntb_fwd.c         | 1 -
 examples/vhost/main.c          | 4 +---
 5 files changed, 1 insertion(+), 11 deletions(-)

diff --git a/examples/bond/main.c b/examples/bond/main.c
index 99359cd6fb..1d11a6687d 100644
--- a/examples/bond/main.c
+++ b/examples/bond/main.c
@@ -292,7 +292,6 @@ bond_port_init(void)
 		rte_exit(EXIT_FAILURE,
 				"port %u: promiscuous mode enable failed: %s\n",
 				BOND_PORT, rte_strerror(-retval));
-		return;
 	}
 
 	struct rte_ether_addr addr;
diff --git a/examples/l2fwd-jobstats/main.c b/examples/l2fwd-jobstats/main.c
index f654831897..e6c0cfddc9 100644
--- a/examples/l2fwd-jobstats/main.c
+++ b/examples/l2fwd-jobstats/main.c
@@ -949,8 +949,6 @@ main(int argc, char **argv)
 			rte_exit(EXIT_FAILURE,
 				 "rte_eth_promiscuous_enable:err=%s, port=%u\n",
 				 rte_strerror(-ret), portid);
-			return ret;
-
 		}
 
 		printf("Port %u, MAC address: " RTE_ETHER_ADDR_PRT_FMT "\n\n",
diff --git a/examples/l3fwd/main.c b/examples/l3fwd/main.c
index 5d061a1cf7..f7e6ac7eec 100644
--- a/examples/l3fwd/main.c
+++ b/examples/l3fwd/main.c
@@ -619,8 +619,6 @@ parse_queue_size(const char *queue_size_arg, uint16_t *queue_size, int rx)
 			rte_exit(EXIT_FAILURE, "Invalid rx-queue-size\n");
 		else
 			rte_exit(EXIT_FAILURE, "Invalid tx-queue-size\n");
-
-		return;
 	}
 
 	if (value > UINT16_MAX) {
@@ -630,8 +628,6 @@ parse_queue_size(const char *queue_size_arg, uint16_t *queue_size, int rx)
 		else
 			rte_exit(EXIT_FAILURE, "tx-queue-size %lu > %d\n",
 				value, UINT16_MAX);
-
-		return;
 	}
 
 	*queue_size = value;
diff --git a/examples/ntb/ntb_fwd.c b/examples/ntb/ntb_fwd.c
index a53e8aae24..075ad355f0 100644
--- a/examples/ntb/ntb_fwd.c
+++ b/examples/ntb/ntb_fwd.c
@@ -1081,7 +1081,6 @@ ntb_parse_args(int argc, char **argv)
 			ntb_usage(prgname);
 			rte_exit(EXIT_FAILURE,
 				 "Command line is incomplete or incorrect.\n");
-			break;
 		}
 	}
 }
diff --git a/examples/vhost/main.c b/examples/vhost/main.c
index e7434fd189..b1ad7ac676 100644
--- a/examples/vhost/main.c
+++ b/examples/vhost/main.c
@@ -1431,7 +1431,7 @@ static const struct rte_vhost_device_ops virtio_net_device_ops =
  * This is a thread will wake up after a period to print stats if the user has
  * enabled them.
  */
-static uint32_t
+static __rte_noreturn uint32_t
 print_stats(__rte_unused void *arg)
 {
 	struct vhost_dev *vdev;
@@ -1475,8 +1475,6 @@ print_stats(__rte_unused void *arg)
 
 		fflush(stdout);
 	}
-
-	return 0;
 }
 
 static void
-- 
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 ` [PATCH 33/37] app: " Stephen Hemminger
2026-11-30  0:27 ` Stephen Hemminger [this message]
2026-11-30  9:45   ` [PATCH 34/37] examples: " 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-35-stephen@networkplumber.org \
    --to=stephen@networkplumber.org \
    --cc=3chas3@gmail.com \
    --cc=bhagyada.modali@amd.com \
    --cc=chenbox@nvidia.com \
    --cc=dev@dpdk.org \
    --cc=humin29@huawei.com \
    --cc=jingjing.wu@intel.com \
    --cc=maxime.coquelin@redhat.com \
    --cc=raghavendra.ningoji@amd.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