* [net-next:master 195/198] net/bridge/br_mdb.c:79:35: sparse: incompatible types in comparison expression (different address spaces)
@ 2012-12-09 2:54 kbuild test robot
2012-12-10 12:36 ` Cong Wang
0 siblings, 1 reply; 3+ messages in thread
From: kbuild test robot @ 2012-12-09 2:54 UTC (permalink / raw)
To: Cong Wang; +Cc: netdev
tree: git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next.git master
head: 9ecb9aabaf634677c77af467f4e3028b09d7bcda
commit: ee07c6e7a6f8a25c18f0a6b18152fbd7499245f6 [195/198] bridge: export multicast database via netlink
sparse warnings:
+ net/bridge/br_mdb.c:79:35: sparse: incompatible types in comparison expression (different address spaces)
vim +79 net/bridge/br_mdb.c
ee07c6e7 Cong Wang 2012-12-07 63 struct hlist_node *h;
ee07c6e7 Cong Wang 2012-12-07 64 struct net_bridge_mdb_entry *mp;
ee07c6e7 Cong Wang 2012-12-07 65 struct net_bridge_port_group *p, **pp;
ee07c6e7 Cong Wang 2012-12-07 66 struct net_bridge_port *port;
ee07c6e7 Cong Wang 2012-12-07 67
ee07c6e7 Cong Wang 2012-12-07 68 hlist_for_each_entry_rcu(mp, h, &mdb->mhash[i], hlist[mdb->ver]) {
ee07c6e7 Cong Wang 2012-12-07 69 if (idx < s_idx)
ee07c6e7 Cong Wang 2012-12-07 70 goto skip;
ee07c6e7 Cong Wang 2012-12-07 71
ee07c6e7 Cong Wang 2012-12-07 72 nest2 = nla_nest_start(skb, MDBA_MDB_ENTRY);
ee07c6e7 Cong Wang 2012-12-07 73 if (nest2 == NULL) {
ee07c6e7 Cong Wang 2012-12-07 74 err = -EMSGSIZE;
ee07c6e7 Cong Wang 2012-12-07 75 goto out;
ee07c6e7 Cong Wang 2012-12-07 76 }
ee07c6e7 Cong Wang 2012-12-07 77
ee07c6e7 Cong Wang 2012-12-07 78 for (pp = &mp->ports;
ee07c6e7 Cong Wang 2012-12-07 @79 (p = rcu_dereference(*pp)) != NULL;
ee07c6e7 Cong Wang 2012-12-07 80 pp = &p->next) {
ee07c6e7 Cong Wang 2012-12-07 81 port = p->port;
ee07c6e7 Cong Wang 2012-12-07 82 if (port) {
ee07c6e7 Cong Wang 2012-12-07 83 struct br_mdb_entry e;
ee07c6e7 Cong Wang 2012-12-07 84 e.ifindex = port->dev->ifindex;
ee07c6e7 Cong Wang 2012-12-07 85 e.addr.u.ip4 = p->addr.u.ip4;
ee07c6e7 Cong Wang 2012-12-07 86 #if IS_ENABLED(CONFIG_IPV6)
ee07c6e7 Cong Wang 2012-12-07 87 e.addr.u.ip6 = p->addr.u.ip6;
---
0-DAY kernel build testing backend Open Source Technology Center
Fengguang Wu, Yuanhan Liu Intel Corporation
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [net-next:master 195/198] net/bridge/br_mdb.c:79:35: sparse: incompatible types in comparison expression (different address spaces)
2012-12-09 2:54 [net-next:master 195/198] net/bridge/br_mdb.c:79:35: sparse: incompatible types in comparison expression (different address spaces) kbuild test robot
@ 2012-12-10 12:36 ` Cong Wang
2012-12-10 12:44 ` Cong Wang
0 siblings, 1 reply; 3+ messages in thread
From: Cong Wang @ 2012-12-10 12:36 UTC (permalink / raw)
To: kbuild test robot; +Cc: netdev
On Sun, 2012-12-09 at 10:54 +0800, kbuild test robot wrote:
> tree: git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next.git master
> head: 9ecb9aabaf634677c77af467f4e3028b09d7bcda
> commit: ee07c6e7a6f8a25c18f0a6b18152fbd7499245f6 [195/198] bridge: export multicast database via netlink
>
>
> sparse warnings:
>
> + net/bridge/br_mdb.c:79:35: sparse: incompatible types in comparison expression (different address spaces)
Hi, Fengguang,
I am not sure if I understand this warning correctly. Does the following
patch fix it?
Thanks!
---------------->
diff --git a/net/bridge/br_mdb.c b/net/bridge/br_mdb.c
index 2528328..0bc0e13 100644
--- a/net/bridge/br_mdb.c
+++ b/net/bridge/br_mdb.c
@@ -77,7 +77,7 @@ static int br_mdb_fill_info(struct sk_buff *skb,
struct netlink_callback *cb,
}
for (pp = &mp->ports;
- (p = rcu_dereference(*pp)) != NULL;
+ (p = rcu_dereference_protected(*pp, 1)) !=
NULL;
pp = &p->next) {
port = p->port;
if (port) {
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [net-next:master 195/198] net/bridge/br_mdb.c:79:35: sparse: incompatible types in comparison expression (different address spaces)
2012-12-10 12:36 ` Cong Wang
@ 2012-12-10 12:44 ` Cong Wang
0 siblings, 0 replies; 3+ messages in thread
From: Cong Wang @ 2012-12-10 12:44 UTC (permalink / raw)
To: kbuild test robot; +Cc: netdev
On Mon, 2012-12-10 at 20:36 +0800, Cong Wang wrote:
> On Sun, 2012-12-09 at 10:54 +0800, kbuild test robot wrote:
> > tree: git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next.git master
> > head: 9ecb9aabaf634677c77af467f4e3028b09d7bcda
> > commit: ee07c6e7a6f8a25c18f0a6b18152fbd7499245f6 [195/198] bridge: export multicast database via netlink
> >
> >
> > sparse warnings:
> >
> > + net/bridge/br_mdb.c:79:35: sparse: incompatible types in comparison expression (different address spaces)
>
> Hi, Fengguang,
>
> I am not sure if I understand this warning correctly. Does the following
> patch fix it?
>
Hmm, no, probably this one:
diff --git a/net/bridge/br_mdb.c b/net/bridge/br_mdb.c
index 2528328..cd6735c 100644
--- a/net/bridge/br_mdb.c
+++ b/net/bridge/br_mdb.c
@@ -63,7 +63,7 @@ static int br_mdb_fill_info(struct sk_buff *skb,
struct netlink_callback *cb,
for (i = 0; i < mdb->max; i++) {
struct hlist_node *h;
struct net_bridge_mdb_entry *mp;
- struct net_bridge_port_group *p, **pp;
+ struct net_bridge_port_group __rcu *p, **pp;
struct net_bridge_port *port;
hlist_for_each_entry_rcu(mp, h, &mdb->mhash[i],
hlist[mdb->ver]) {
^ permalink raw reply related [flat|nested] 3+ messages in thread
end of thread, other threads:[~2012-12-10 12:44 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-12-09 2:54 [net-next:master 195/198] net/bridge/br_mdb.c:79:35: sparse: incompatible types in comparison expression (different address spaces) kbuild test robot
2012-12-10 12:36 ` Cong Wang
2012-12-10 12:44 ` Cong Wang
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).