* [Patch net-next v4] netpoll: fix some sparse warnings in various places
@ 2013-02-16 8:37 Cong Wang
2013-02-16 9:18 ` Jiri Pirko
0 siblings, 1 reply; 3+ messages in thread
From: Cong Wang @ 2013-02-16 8:37 UTC (permalink / raw)
To: netdev
Cc: Eric Dumazet, Jiri Pirko, Vlad Yasevich, Stephen Hemminger,
David S. Miller, Cong Wang
From: Cong Wang <amwang@redhat.com>
This fixes sparse warnings like the one below:
drivers/net/team/team.c:953:25: warning: incorrect type in return expression (different address spaces)
drivers/net/team/team.c:953:25: expected struct netpoll_info *
drivers/net/team/team.c:953:25: got struct netpoll_info [noderef] <asn:4>*npinfo
Cc: Eric Dumazet <eric.dumazet@gmail.com>
Cc: Jiri Pirko <jiri@resnulli.us>
Cc: Vlad Yasevich <vyasevic@redhat.com>
Cc: Stephen Hemminger <stephen@networkplumber.org>
Cc: David S. Miller <davem@davemloft.net>
Signed-off-by: Cong Wang <amwang@redhat.com>
---
diff --git a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c
index 94c1534..71ad0f2 100644
--- a/drivers/net/bonding/bond_main.c
+++ b/drivers/net/bonding/bond_main.c
@@ -1302,7 +1302,7 @@ static int bond_netpoll_setup(struct net_device *dev, struct netpoll_info *ni, g
static struct netpoll_info *bond_netpoll_info(struct bonding *bond)
{
- return bond->dev->npinfo;
+ return rcu_access_pointer(bond->dev->npinfo);
}
#else
diff --git a/drivers/net/team/team.c b/drivers/net/team/team.c
index 05c5efe..03e5949 100644
--- a/drivers/net/team/team.c
+++ b/drivers/net/team/team.c
@@ -950,7 +950,7 @@ static void team_port_disable_netpoll(struct team_port *port)
static struct netpoll_info *team_netpoll_info(struct team *team)
{
- return team->dev->npinfo;
+ return rcu_access_pointer(team->dev->npinfo);
}
#else
diff --git a/net/bridge/br_private.h b/net/bridge/br_private.h
index 6d314c4..699d5c4 100644
--- a/net/bridge/br_private.h
+++ b/net/bridge/br_private.h
@@ -330,7 +330,7 @@ extern netdev_tx_t br_dev_xmit(struct sk_buff *skb,
#ifdef CONFIG_NET_POLL_CONTROLLER
static inline struct netpoll_info *br_netpoll_info(struct net_bridge *br)
{
- return br->dev->npinfo;
+ return rcu_access_pointer(br->dev->npinfo);
}
static inline void br_netpoll_send_skb(const struct net_bridge_port *p,
^ permalink raw reply related [flat|nested] 3+ messages in thread* Re: [Patch net-next v4] netpoll: fix some sparse warnings in various places
2013-02-16 8:37 [Patch net-next v4] netpoll: fix some sparse warnings in various places Cong Wang
@ 2013-02-16 9:18 ` Jiri Pirko
2013-02-18 2:55 ` Cong Wang
0 siblings, 1 reply; 3+ messages in thread
From: Jiri Pirko @ 2013-02-16 9:18 UTC (permalink / raw)
To: Cong Wang
Cc: netdev, Eric Dumazet, Vlad Yasevich, Stephen Hemminger,
David S. Miller
Sat, Feb 16, 2013 at 09:37:53AM CET, amwang@redhat.com wrote:
>From: Cong Wang <amwang@redhat.com>
>
>This fixes sparse warnings like the one below:
>
>drivers/net/team/team.c:953:25: warning: incorrect type in return expression (different address spaces)
>drivers/net/team/team.c:953:25: expected struct netpoll_info *
>drivers/net/team/team.c:953:25: got struct netpoll_info [noderef] <asn:4>*npinfo
>
>Cc: Eric Dumazet <eric.dumazet@gmail.com>
>Cc: Jiri Pirko <jiri@resnulli.us>
>Cc: Vlad Yasevich <vyasevic@redhat.com>
>Cc: Stephen Hemminger <stephen@networkplumber.org>
>Cc: David S. Miller <davem@davemloft.net>
>Signed-off-by: Cong Wang <amwang@redhat.com>
>
>---
>diff --git a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c
>index 94c1534..71ad0f2 100644
>--- a/drivers/net/bonding/bond_main.c
>+++ b/drivers/net/bonding/bond_main.c
>@@ -1302,7 +1302,7 @@ static int bond_netpoll_setup(struct net_device *dev, struct netpoll_info *ni, g
>
> static struct netpoll_info *bond_netpoll_info(struct bonding *bond)
> {
>- return bond->dev->npinfo;
>+ return rcu_access_pointer(bond->dev->npinfo);
> }
>
> #else
>diff --git a/drivers/net/team/team.c b/drivers/net/team/team.c
>index 05c5efe..03e5949 100644
>--- a/drivers/net/team/team.c
>+++ b/drivers/net/team/team.c
>@@ -950,7 +950,7 @@ static void team_port_disable_netpoll(struct team_port *port)
>
> static struct netpoll_info *team_netpoll_info(struct team *team)
> {
>- return team->dev->npinfo;
>+ return rcu_access_pointer(team->dev->npinfo);
> }
>
> #else
>diff --git a/net/bridge/br_private.h b/net/bridge/br_private.h
>index 6d314c4..699d5c4 100644
>--- a/net/bridge/br_private.h
>+++ b/net/bridge/br_private.h
>@@ -330,7 +330,7 @@ extern netdev_tx_t br_dev_xmit(struct sk_buff *skb,
> #ifdef CONFIG_NET_POLL_CONTROLLER
> static inline struct netpoll_info *br_netpoll_info(struct net_bridge *br)
> {
>- return br->dev->npinfo;
>+ return rcu_access_pointer(br->dev->npinfo);
> }
>
> static inline void br_netpoll_send_skb(const struct net_bridge_port *p,
Hmm. I'm just wondering if there wouldn't be nicer for these functions to
return bool if you just want to know if npinfo is null or not. This
notation seems a bit confusing to me.
^ permalink raw reply [flat|nested] 3+ messages in thread* Re: [Patch net-next v4] netpoll: fix some sparse warnings in various places
2013-02-16 9:18 ` Jiri Pirko
@ 2013-02-18 2:55 ` Cong Wang
0 siblings, 0 replies; 3+ messages in thread
From: Cong Wang @ 2013-02-18 2:55 UTC (permalink / raw)
To: Jiri Pirko
Cc: netdev, Eric Dumazet, Vlad Yasevich, Stephen Hemminger,
David S. Miller
On Sat, 2013-02-16 at 10:18 +0100, Jiri Pirko wrote:
>
> Hmm. I'm just wondering if there wouldn't be nicer for these functions
> to
> return bool if you just want to know if npinfo is null or not. This
> notation seems a bit confusing to me.
Yes, makes sense.
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2013-02-18 2:55 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-02-16 8:37 [Patch net-next v4] netpoll: fix some sparse warnings in various places Cong Wang
2013-02-16 9:18 ` Jiri Pirko
2013-02-18 2:55 ` 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).