ipmr: fix build with clang and DEBUG_NET disabled.
commitf6d7695b5ae22092fa2cc42529bb7462f7e0c4ad
authorPaolo Abeni <pabeni@redhat.com>
Thu, 28 Nov 2024 16:18:04 +0000 (28 17:18 +0100)
committerPaolo Abeni <pabeni@redhat.com>
Thu, 28 Nov 2024 16:40:54 +0000 (28 17:40 +0100)
tree5bc08a375ce51ae47e069d6bc95ce734a2cbb50e
parent04f5cb48995d51deed0af71aaba1b8699511313f
ipmr: fix build with clang and DEBUG_NET disabled.

Sasha reported a build issue in ipmr::

net/ipv4/ipmr.c:320:13: error: function 'ipmr_can_free_table' is not \
needed and will not be emitted \
[-Werror,-Wunneeded-internal-declaration]
   320 | static bool ipmr_can_free_table(struct net *net)

Apparently clang is too smart with BUILD_BUG_ON_INVALID(), let's
fallback to a plain WARN_ON_ONCE().

Reported-by: Sasha Levin <sashal@kernel.org>
Closes: https://qa-reports.linaro.org/lkft/sashal-linus-next/build/v6.11-25635-g6813e2326f1e/testrun/26111580/suite/build/test/clang-nightly-lkftconfig/details/
Fixes: 11b6e701bce9 ("ipmr: add debug check for mr table cleanup")
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
Link: https://patch.msgid.link/ee75faa926b2446b8302ee5fc30e129d2df73b90.1732810228.git.pabeni@redhat.com
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
net/ipv4/ipmr.c
net/ipv6/ip6mr.c