Fix compiler warning on clang-23.

  dpaa_of.c:14:12: warning: variable 'alive' set but not used
        [-Wunused-but-set-global]

The 'alive' flag is only read by DPAAX_HWWARN, which expands to an empty
statement and discards its condition unless RTE_LIBRTE_DPAAX_DEBUG is
defined. Make the empty expansion consume its argument so the condition
is still checked in a non-debug build.

Fixes: 8c83f28cc8a4 ("common/dpaax: move OF library from DPAA bus")
Cc: [email protected]

Signed-off-by: Stephen Hemminger <[email protected]>
---
 drivers/common/dpaax/dpaax_logs.h | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/common/dpaax/dpaax_logs.h 
b/drivers/common/dpaax/dpaax_logs.h
index 90f0c98863..431a16f45a 100644
--- a/drivers/common/dpaax/dpaax_logs.h
+++ b/drivers/common/dpaax/dpaax_logs.h
@@ -5,6 +5,7 @@
 #ifndef _DPAAX_LOGS_H_
 #define _DPAAX_LOGS_H_
 
+#include <rte_common.h>
 #include <rte_log.h>
 
 extern int dpaax_logger;
@@ -17,7 +18,7 @@ extern int dpaax_logger;
                        DPAAX_LOG(DEBUG, "WARN: " fmt, ##__VA_ARGS__); \
        } while (0)
 #else
-#define DPAAX_HWWARN(cond, fmt, ...) do { } while (0)
+#define DPAAX_HWWARN(cond, fmt, ...) do { RTE_SET_USED(cond); } while (0)
 #endif
 
 #define DPAAX_LOG(level, ...) \
-- 
2.53.0

Reply via email to