* Re: [net-next:master 257/266] drivers/net/team/team_mode_loadbalance.c:99:30: sparse: incompatible types in comparison expression (different address spaces) [not found] ` <20120620124913.GF2432@linux.vnet.ibm.com> @ 2012-06-20 13:11 ` Eric Dumazet 2012-06-20 13:23 ` Jiri Pirko 0 siblings, 1 reply; 2+ messages in thread From: Eric Dumazet @ 2012-06-20 13:11 UTC (permalink / raw) To: paulmck; +Cc: Fengguang Wu, Jiri Pirko, LKML, netdev On Wed, 2012-06-20 at 05:49 -0700, Paul E. McKenney wrote: > On Wed, Jun 20, 2012 at 02:50:55PM +0800, Fengguang Wu wrote: > > [CC Paul, the RCU maintainer] > > > > On Wed, Jun 20, 2012 at 08:36:07AM +0200, Jiri Pirko wrote: > > > Wed, Jun 20, 2012 at 06:27:43AM CEST, wfg@linux.intel.com wrote: > > > >Hi Jiri, > > > > > > > >There are new sparse warnings show up in > > > > > > > >tree: git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next.git master > > > >head: 677a3d60fb3153f786a0d28fcf0287670e7bd3c2 > > > >commit: ab8250d70063f77929fc404c02390a1f64d66416 [257/266] team: lb: introduce infrastructure for userspace driven tx loadbalancing > > > > > > > >All sparse warnings: > > > > > > > >drivers/net/team/team_mode_loadbalance.c:99:30: sparse: incompatible types in comparison expression (different address spaces) > > > > > > > >drivers/net/team/team_mode_loadbalance.c:99: > > > > 96 struct lb_port_mapping *pm; > > > > 97 > > > > 98 pm = &lb_priv->ex->tx_hash_to_port_mapping[i]; > > > > > 99 if (pm->port == port) { > > > > > > This looks like your checker does not like > > > (struct team_port __rcu *) == (struct team_port *) > > > But I wonder why (or how should I fix that) > > Because you said that it was an RCU-protected pointer, but then did > not use an RCU primitive to access it. In this case, where you are > just using the value but not dereferencing it, you can use > rcu_access_pointer(). Yes, and please Jiri change the rcu_assign_pointer(pm->port, NULL); by RCU_INIT_POINTER(pm->port, NULL); ^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [net-next:master 257/266] drivers/net/team/team_mode_loadbalance.c:99:30: sparse: incompatible types in comparison expression (different address spaces) 2012-06-20 13:11 ` [net-next:master 257/266] drivers/net/team/team_mode_loadbalance.c:99:30: sparse: incompatible types in comparison expression (different address spaces) Eric Dumazet @ 2012-06-20 13:23 ` Jiri Pirko 0 siblings, 0 replies; 2+ messages in thread From: Jiri Pirko @ 2012-06-20 13:23 UTC (permalink / raw) To: Eric Dumazet; +Cc: paulmck, Fengguang Wu, LKML, netdev Wed, Jun 20, 2012 at 03:11:49PM CEST, eric.dumazet@gmail.com wrote: >On Wed, 2012-06-20 at 05:49 -0700, Paul E. McKenney wrote: >> On Wed, Jun 20, 2012 at 02:50:55PM +0800, Fengguang Wu wrote: >> > [CC Paul, the RCU maintainer] >> > >> > On Wed, Jun 20, 2012 at 08:36:07AM +0200, Jiri Pirko wrote: >> > > Wed, Jun 20, 2012 at 06:27:43AM CEST, wfg@linux.intel.com wrote: >> > > >Hi Jiri, >> > > > >> > > >There are new sparse warnings show up in >> > > > >> > > >tree: git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next.git master >> > > >head: 677a3d60fb3153f786a0d28fcf0287670e7bd3c2 >> > > >commit: ab8250d70063f77929fc404c02390a1f64d66416 [257/266] team: lb: introduce infrastructure for userspace driven tx loadbalancing >> > > > >> > > >All sparse warnings: >> > > > >> > > >drivers/net/team/team_mode_loadbalance.c:99:30: sparse: incompatible types in comparison expression (different address spaces) >> > > > >> > > >drivers/net/team/team_mode_loadbalance.c:99: >> > > > 96 struct lb_port_mapping *pm; >> > > > 97 >> > > > 98 pm = &lb_priv->ex->tx_hash_to_port_mapping[i]; >> > > > > 99 if (pm->port == port) { >> > > >> > > This looks like your checker does not like >> > > (struct team_port __rcu *) == (struct team_port *) >> > > But I wonder why (or how should I fix that) >> >> Because you said that it was an RCU-protected pointer, but then did >> not use an RCU primitive to access it. In this case, where you are >> just using the value but not dereferencing it, you can use >> rcu_access_pointer(). > >Yes, and please Jiri change the > >rcu_assign_pointer(pm->port, NULL); > >by > >RCU_INIT_POINTER(pm->port, NULL); Will do. > > > ^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2012-06-20 13:23 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <20120620042743.GA7640@localhost>
[not found] ` <20120620063607.GA1491@minipsycho>
[not found] ` <20120620065055.GA5872@localhost>
[not found] ` <20120620124913.GF2432@linux.vnet.ibm.com>
2012-06-20 13:11 ` [net-next:master 257/266] drivers/net/team/team_mode_loadbalance.c:99:30: sparse: incompatible types in comparison expression (different address spaces) Eric Dumazet
2012-06-20 13:23 ` Jiri Pirko
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox