Skip to contentSkip to conversation

ieee802154: hwsim: fix rcu address annotation

PATCH In review Alexander Aring 3 participants 3 messages Aug 7, 2018

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ieee802154: hwsim: fix rcu address annotation

This patch fixes the following sparse warning about mismatch rcu attribute for address space annotation:

...
error: incompatible types in comparison expression (different modifiers)
error: incompatible types in comparison expression (different address spaces)
...

Some __rcu annotation was at non-pointers list head structures and one was missing in edge information which is used by rcu_assign_pointer() to update edge setting information.

Cc Stefan Schmidt <[email protected]>
Fixes f25da51fdc38 ("ieee802154: hwsim: add replacement for fakelb")

---
Hopefully I did it right now. Sorry again.

 drivers/net/ieee802154/mac802154_hwsim.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/net/ieee802154/mac802154_hwsim.c +3 -3
index 1982308b9b1c..f4e92054f7df 100644
@@ -36,7 +36,7 @@ MODULE_LICENSE("GPL");
 static LIST_HEAD(hwsim_phys);
 static DEFINE_MUTEX(hwsim_phys_lock);
 
-static __rcu LIST_HEAD(hwsim_ifup_phys);
+static LIST_HEAD(hwsim_ifup_phys);
 
 static struct platform_device *mac802154hwsim_dev;
 
@@ -68,7 +68,7 @@ struct hwsim_edge_info {
 
 struct hwsim_edge {
 	struct hwsim_phy *endpoint;
-	struct hwsim_edge_info *info;
+	struct hwsim_edge_info __rcu *info;
 
 	struct list_head list;
 	struct rcu_head rcu;
@@ -81,7 +81,7 @@ struct hwsim_phy {
 	struct hwsim_pib __rcu *pib;
 
 	bool suspended;
-	struct list_head __rcu edges;
+	struct list_head edges;
 
 	struct list_head list;
 	struct list_head list_ifup;
Signature · 1 line
2.11.0
maintainer
#1 lore raw

Hello Dave.

Quoted 45 lines · Alexander Aring

This patch fixes the following sparse warning about mismatch rcu attribute for address space annotation:

...
error: incompatible types in comparison expression (different modifiers)
error: incompatible types in comparison expression (different address spaces)
...

Some __rcu annotation was at non-pointers list head structures and one was missing in edge information which is used by rcu_assign_pointer() to update edge setting information.

Cc Stefan Schmidt <[email protected]>
Fixes f25da51fdc38 ("ieee802154: hwsim: add replacement for fakelb")

---
Hopefully I did it right now. Sorry again.

 drivers/net/ieee802154/mac802154_hwsim.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/net/ieee802154/mac802154_hwsim.c +2 -2
index 1982308b9b1c..f4e92054f7df 100644
@@ -36,7 +36,7 @@ MODULE_LICENSE("GPL");
 static LIST_HEAD(hwsim_phys);
 static DEFINE_MUTEX(hwsim_phys_lock);
 
-static __rcu LIST_HEAD(hwsim_ifup_phys);
+static LIST_HEAD(hwsim_ifup_phys);
 
 static struct platform_device *mac802154hwsim_dev;
 
@@ -68,7 +68,7 @@ struct hwsim_edge_info {
 
 struct hwsim_edge {
 	struct hwsim_phy *endpoint;
-	struct hwsim_edge_info *info;
+	struct hwsim_edge_info __rcu *info;
 
 	struct list_head list;
 	struct rcu_head rcu;

drivers/net/ieee802154/mac802154_hwsim.c struct hwsim_phy { · line 87

Quoted 8 lines
drivers/net/ieee802154/mac802154_hwsim.c +1 -1
@@ -81,7 +81,7 @@ struct hwsim_phy {
 	struct hwsim_pib __rcu *pib;
 
 	bool suspended;
-	struct list_head __rcu edges;
+	struct list_head edges;
 
 	struct list_head list;
 	struct list_head list_ifup;

Could you apply this patch directly to net-next?
It fixes an issue introduced with my pull request from two days ago. I have nothing else to submit so I would appreciate if you could apply it directly.

regards
Stefan Schmidt

maintainer
#2 lore raw

From: Stefan Schmidt <[email protected]>
Date: Tue, 7 Aug 2018 17:28:43 +0200

Quoted 1 line

Could you apply this patch directly to net-next?

Sure, no problem, done.