]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
ipmr: fix build with clang and DEBUG_NET disabled.
authorPaolo Abeni <pabeni@redhat.com>
Thu, 28 Nov 2024 16:18:04 +0000 (17:18 +0100)
committerPaolo Abeni <pabeni@redhat.com>
Thu, 28 Nov 2024 16:40:54 +0000 (17:40 +0100)
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

index 383ea8b91cc78c17b1d68a801c2e0d0dbebcfe17..c5b8ec5c0a8c041e67554a3736ef624a155f6a99 100644 (file)
@@ -437,7 +437,7 @@ static void ipmr_free_table(struct mr_table *mrt)
 {
        struct net *net = read_pnet(&mrt->net);
 
-       DEBUG_NET_WARN_ON_ONCE(!ipmr_can_free_table(net));
+       WARN_ON_ONCE(!ipmr_can_free_table(net));
 
        timer_shutdown_sync(&mrt->ipmr_expire_timer);
        mroute_clean_tables(mrt, MRT_FLUSH_VIFS | MRT_FLUSH_VIFS_STATIC |
index 4147890fe98ff93e74d1feeea63a5931ab1ac553..7f1902ac35862c96397e82eda0ee78d8748d88ef 100644 (file)
@@ -416,7 +416,7 @@ static void ip6mr_free_table(struct mr_table *mrt)
 {
        struct net *net = read_pnet(&mrt->net);
 
-       DEBUG_NET_WARN_ON_ONCE(!ip6mr_can_free_table(net));
+       WARN_ON_ONCE(!ip6mr_can_free_table(net));
 
        timer_shutdown_sync(&mrt->ipmr_expire_timer);
        mroute_clean_tables(mrt, MRT6_FLUSH_MIFS | MRT6_FLUSH_MIFS_STATIC |