]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
net: ethernet: mtk_wed: annotate RCU release in attach()
authorJohannes Berg <johannes.berg@intel.com>
Wed, 23 Apr 2025 15:08:08 +0000 (17:08 +0200)
committerJakub Kicinski <kuba@kernel.org>
Fri, 25 Apr 2025 01:22:05 +0000 (18:22 -0700)
There are some sparse warnings in wifi, and it seems that
it's actually possible to annotate a function pointer with
__releases(), making the sparse warnings go away. In a way
that also serves as documentation that rcu_read_unlock()
must be called in the attach method, so add that annotation.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Link: https://patch.msgid.link/20250423150811.456205-2-johannes@sipsolutions.net
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
include/linux/soc/mediatek/mtk_wed.h

index a476648858a66beccd3e604ba97c41044088c460..d8949a4ed0dc9d41b3364e85a21e15d258519c45 100644 (file)
@@ -192,7 +192,7 @@ struct mtk_wed_device {
 };
 
 struct mtk_wed_ops {
-       int (*attach)(struct mtk_wed_device *dev);
+       int (*attach)(struct mtk_wed_device *dev) __releases(RCU);
        int (*tx_ring_setup)(struct mtk_wed_device *dev, int ring,
                             void __iomem *regs, bool reset);
        int (*rx_ring_setup)(struct mtk_wed_device *dev, int ring,