Patchwork [net-next] netpoll: add RCU annotation to npinfo field

login
register
mail settings
Submitter Amerigo Wang
Date Jan. 23, 2013, 7:29 a.m.
Message ID <1358926179-7168-1-git-send-email-amwang@redhat.com>
Download mbox | patch
Permalink /patch/214825/
State Accepted
Delegated to: David Miller
Headers show

Comments

Amerigo Wang - Jan. 23, 2013, 7:29 a.m.
From: Cong Wang <amwang@redhat.com>

dev->npinfo is protected by RCU.

This fixes the following sparse warnings:

net/core/netpoll.c:177:48: error: incompatible types in comparison expression (different address spaces)
net/core/netpoll.c:200:35: error: incompatible types in comparison expression (different address spaces)
net/core/netpoll.c:221:35: error: incompatible types in comparison expression (different address spaces)
net/core/netpoll.c:327:18: error: incompatible types in comparison expression (different address spaces)

Cc: Eric Dumazet <eric.dumazet@gmail.com>
Cc: David S. Miller <davem@davemloft.net>
Signed-off-by: Cong Wang <amwang@redhat.com>

---
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
David Miller - Jan. 28, 2013, 11:33 p.m.
From: Cong Wang <amwang@redhat.com>
Date: Wed, 23 Jan 2013 15:29:39 +0800

> From: Cong Wang <amwang@redhat.com>
> 
> dev->npinfo is protected by RCU.
> 
> This fixes the following sparse warnings:
> 
> net/core/netpoll.c:177:48: error: incompatible types in comparison expression (different address spaces)
> net/core/netpoll.c:200:35: error: incompatible types in comparison expression (different address spaces)
> net/core/netpoll.c:221:35: error: incompatible types in comparison expression (different address spaces)
> net/core/netpoll.c:327:18: error: incompatible types in comparison expression (different address spaces)
> 
> Cc: Eric Dumazet <eric.dumazet@gmail.com>
> Cc: David S. Miller <davem@davemloft.net>
> Signed-off-by: Cong Wang <amwang@redhat.com>

Applied.
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Patch

diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h
index 549f5ad..85b0949 100644
--- a/include/linux/netdevice.h
+++ b/include/linux/netdevice.h
@@ -1272,7 +1272,7 @@  struct net_device {
 	void (*destructor)(struct net_device *dev);
 
 #ifdef CONFIG_NETPOLL
-	struct netpoll_info	*npinfo;
+	struct netpoll_info __rcu	*npinfo;
 #endif
 
 #ifdef CONFIG_NET_NS