rxa_intr_thread() and vhost_user_client_reconnect() loop forever,
so the return after the loop can never be reached and clang
reports it with -Wunreachable-code-aggressive.

Removing the return is not enough: GCC does not notice that the
loop never exits and warns that a non void function has no return
statement. Mark both functions __rte_noreturn instead, which is
what they are, and drop the dead return.

Signed-off-by: Stephen Hemminger <[email protected]>
---
 lib/eventdev/rte_event_eth_rx_adapter.c | 4 +---
 lib/vhost/socket.c                      | 4 +---
 2 files changed, 2 insertions(+), 6 deletions(-)

diff --git a/lib/eventdev/rte_event_eth_rx_adapter.c 
b/lib/eventdev/rte_event_eth_rx_adapter.c
index 26c0a26db1..ba264d0ba0 100644
--- a/lib/eventdev/rte_event_eth_rx_adapter.c
+++ b/lib/eventdev/rte_event_eth_rx_adapter.c
@@ -1163,7 +1163,7 @@ rxa_intr_ring_del_entries(struct event_eth_rx_adapter 
*rx_adapter,
  * These events are picked up by rxa_intr_ring_dequeue() which is invoked from
  * the adapter service function.
  */
-static uint32_t
+static __rte_noreturn uint32_t
 rxa_intr_thread(void *arg)
 {
        struct event_eth_rx_adapter *rx_adapter = arg;
@@ -1181,8 +1181,6 @@ rxa_intr_thread(void *arg)
                                        epoll_events[i].epdata.data);
                }
        }
-
-       return 0;
 }
 
 /* Dequeue <port, q> from interrupt ring and enqueue received
diff --git a/lib/vhost/socket.c b/lib/vhost/socket.c
index 2d3fe1fd53..dd32bb69e2 100644
--- a/lib/vhost/socket.c
+++ b/lib/vhost/socket.c
@@ -446,7 +446,7 @@ vhost_user_connect_nonblock(char *path, int fd, struct 
sockaddr *un, size_t sz)
        return 0;
 }
 
-static uint32_t
+static __rte_noreturn uint32_t
 vhost_user_client_reconnect(void *arg __rte_unused)
 {
        int ret;
@@ -486,8 +486,6 @@ vhost_user_client_reconnect(void *arg __rte_unused)
                pthread_mutex_unlock(&reconn_list.mutex);
                sleep(1);
        }
-
-       return 0;
 }
 
 static int
-- 
2.53.0

Reply via email to