Skip to content

Commit f6d7695

Browse files
author
Paolo Abeni
committed
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 <[email protected]> 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: 11b6e70 ("ipmr: add debug check for mr table cleanup") Signed-off-by: Paolo Abeni <[email protected]> Link: https://patch.msgid.link/ee75faa926b2446b8302ee5fc30e129d2df73b90.1732810228.git.pabeni@redhat.com Signed-off-by: Paolo Abeni <[email protected]>
1 parent 04f5cb4 commit f6d7695

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

net/ipv4/ipmr.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -437,7 +437,7 @@ static void ipmr_free_table(struct mr_table *mrt)
437437
{
438438
struct net *net = read_pnet(&mrt->net);
439439

440-
DEBUG_NET_WARN_ON_ONCE(!ipmr_can_free_table(net));
440+
WARN_ON_ONCE(!ipmr_can_free_table(net));
441441

442442
timer_shutdown_sync(&mrt->ipmr_expire_timer);
443443
mroute_clean_tables(mrt, MRT_FLUSH_VIFS | MRT_FLUSH_VIFS_STATIC |

net/ipv6/ip6mr.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -416,7 +416,7 @@ static void ip6mr_free_table(struct mr_table *mrt)
416416
{
417417
struct net *net = read_pnet(&mrt->net);
418418

419-
DEBUG_NET_WARN_ON_ONCE(!ip6mr_can_free_table(net));
419+
WARN_ON_ONCE(!ip6mr_can_free_table(net));
420420

421421
timer_shutdown_sync(&mrt->ipmr_expire_timer);
422422
mroute_clean_tables(mrt, MRT6_FLUSH_MIFS | MRT6_FLUSH_MIFS_STATIC |

0 commit comments

Comments
 (0)