net: loopback driver cleanup

loopback driver uses dev->ml_priv to store its percpu stats pointer.
It uses ugly casts "(void __percpu __force *)" to shut up sparse
complains.

Define an union to better document we use ml_priv in loopback driver and
define a lstats field with appropriate types.

Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
Eric Dumazet 2010-09-23 23:51:51 +00:00 committed by David S. Miller
parent 83180af0b0
commit a7855c78a2
2 changed files with 9 additions and 17 deletions

View file

@ -1050,8 +1050,10 @@ struct net_device {
#endif
/* mid-layer private */
void *ml_priv;
union {
void *ml_priv;
struct pcpu_lstats __percpu *lstats; /* loopback stats */
};
/* GARP */
struct garp_port *garp_port;