pktgen: avoid unused-const-variable warning
authorArnd Bergmann <arnd@arndb.de>
Tue, 25 Feb 2025 08:57:14 +0000 (09:57 +0100)
committerPaolo Abeni <pabeni@redhat.com>
Thu, 27 Feb 2025 11:46:41 +0000 (12:46 +0100)
commitaf4a5da8ed54561b7e856534cf62ea07632e7b7b
tree20424969766bdb556d6749413bc1c6fe2a246647
parent0493f7a54e5bcf490f943f7b25ec6e1051832f98
pktgen: avoid unused-const-variable warning

When extra warnings are enable, there are configurations that build
pktgen without CONFIG_XFRM, which leaves a static const variable unused:

net/core/pktgen.c:213:1: error: unused variable 'F_IPSEC' [-Werror,-Wunused-const-variable]
  213 | PKT_FLAGS
      | ^~~~~~~~~
net/core/pktgen.c:197:2: note: expanded from macro 'PKT_FLAGS'
  197 |         pf(IPSEC)               /* ipsec on for flows */                \
      |         ^~~~~~~~~

This could be marked as __maybe_unused, or by making the one use visible
to the compiler by slightly rearranging the #ifdef blocks. The second
variant looks slightly nicer here, so use that.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Reviewed-by: Peter Seiderer <ps.report@gmx.net>
Link: https://patch.msgid.link/20250225085722.469868-1-arnd@kernel.org
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
net/core/pktgen.c