aboutsummaryrefslogtreecommitdiff
path: root/net/hsr/hsr_framereg.h
diff options
context:
space:
mode:
authorGravatar Juhee Kang <claudiajkang@gmail.com> 2022-02-20 15:32:50 +0000
committerGravatar Jakub Kicinski <kuba@kernel.org> 2022-02-21 20:43:10 -0800
commita0b92e0514bb3c5e57c33fd720724a629f67e042 (patch)
treefae08e62f84df38c62de933e627229b72e3fa056 /net/hsr/hsr_framereg.h
parentMerge branch 'octeontx2-ptp-updates' (diff)
downloadlinux-a0b92e0514bb3c5e57c33fd720724a629f67e042.tar.gz
linux-a0b92e0514bb3c5e57c33fd720724a629f67e042.tar.bz2
linux-a0b92e0514bb3c5e57c33fd720724a629f67e042.zip
net: hsr: fix hsr build error when lockdep is not enabled
In hsr, lockdep_is_held() is needed for rcu_dereference_bh_check(). But if lockdep is not enabled, lockdep_is_held() causes a build error: ERROR: modpost: "lockdep_is_held" [net/hsr/hsr.ko] undefined! Thus, this patch solved by adding lockdep_hsr_is_held(). This helper function calls the lockdep_is_held() when lockdep is enabled, and returns 1 if not defined. Fixes: e7f27420681f ("net: hsr: fix suspicious RCU usage warning in hsr_node_get_first()") Reported-by: Eric Dumazet <eric.dumazet@gmail.com> Signed-off-by: Juhee Kang <claudiajkang@gmail.com> Link: https://lore.kernel.org/r/20220220153250.5285-1-claudiajkang@gmail.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Diffstat (limited to 'net/hsr/hsr_framereg.h')
-rw-r--r--net/hsr/hsr_framereg.h8
1 files changed, 7 insertions, 1 deletions
diff --git a/net/hsr/hsr_framereg.h b/net/hsr/hsr_framereg.h
index 2efd03fb3465..f3762e9e42b5 100644
--- a/net/hsr/hsr_framereg.h
+++ b/net/hsr/hsr_framereg.h
@@ -28,8 +28,14 @@ struct hsr_frame_info {
bool is_from_san;
};
+#ifdef CONFIG_LOCKDEP
+int lockdep_hsr_is_held(spinlock_t *lock);
+#else
+#define lockdep_hsr_is_held(lock) 1
+#endif
+
u32 hsr_mac_hash(struct hsr_priv *hsr, const unsigned char *addr);
-struct hsr_node *hsr_node_get_first(struct hlist_head *head, int cond);
+struct hsr_node *hsr_node_get_first(struct hlist_head *head, spinlock_t *lock);
void hsr_del_self_node(struct hsr_priv *hsr);
void hsr_del_nodes(struct hlist_head *node_db);
struct hsr_node *hsr_get_node(struct hsr_port *port, struct hlist_head *node_db,