[PATCH 52/77] sbni: use internal net_device_stats

Previous thread: [PATCH 01/77] atm: convert mpc device to using netdev_ops by Stephen Hemminger on Friday, March 20, 2009 - 10:35 pm. (3 messages)

Next thread: [PATCH 51/77] labether: convert to net_device_ops by Stephen Hemminger on Friday, March 20, 2009 - 10:36 pm. (2 messages)
From: Stephen Hemminger
Date: Friday, March 20, 2009 - 10:36 pm

Convert to use existing net_device_stats.
This driver,
      has bad style,
      	of using commas,
	   when brackets should be used...

Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>

--- a/drivers/net/wan/sbni.c	2009-03-20 17:14:16.263027723 -0700
+++ b/drivers/net/wan/sbni.c	2009-03-20 17:22:27.542840306 -0700
@@ -68,7 +68,6 @@
 /* device private data */
 
 struct net_local {
-	struct net_device_stats	stats;
 	struct timer_list	watchdog;
 
 	spinlock_t	lock;
@@ -117,7 +116,6 @@ static int  sbni_open( struct net_device
 static int  sbni_close( struct net_device * );
 static int  sbni_start_xmit( struct sk_buff *, struct net_device * );
 static int  sbni_ioctl( struct net_device *, struct ifreq *, int );
-static struct net_device_stats  *sbni_get_stats( struct net_device * );
 static void  set_multicast_list( struct net_device * );
 
 static irqreturn_t sbni_interrupt( int, void * );
@@ -723,13 +721,11 @@ upload_data( struct net_device  *dev,  u
 			nl->wait_frameno = 0,
 			nl->inppos = 0,
 #ifdef CONFIG_SBNI_MULTILINE
-			((struct net_local *)netdev_priv(nl->master))
-				->stats.rx_errors++,
-			((struct net_local *)netdev_priv(nl->master))
-				->stats.rx_missed_errors++;
+			nl->master->stats.rx_errors++,
+			nl->master->stats.rx_missed_errors++;
 #else
-			nl->stats.rx_errors++,
-			nl->stats.rx_missed_errors++;
+		        dev->stats.rx_errors++,
+			dev->stats.rx_missed_errors++;
 #endif
 			/* now skip all frames until is_first != 0 */
 	} else
@@ -742,13 +738,11 @@ upload_data( struct net_device  *dev,  u
 		 */
 		nl->wait_frameno = 0,
 #ifdef CONFIG_SBNI_MULTILINE
-		((struct net_local *)netdev_priv(nl->master))
-			->stats.rx_errors++,
-		((struct net_local *)netdev_priv(nl->master))
-			->stats.rx_crc_errors++;
+		nl->master->stats.rx_errors++,
+		nl->master->stats.rx_crc_errors++;
 #else
-		nl->stats.rx_errors++,
-		nl->stats.rx_crc_errors++;
+		dev->stats.rx_errors++,
+		dev->stats.rx_crc_errors++;
 #endif
 
 	return  ...
From: David Miller
Date: Saturday, March 21, 2009 - 10:47 pm

From: Stephen Hemminger <shemminger@vyatta.com>

Applied.
--

Previous thread: [PATCH 01/77] atm: convert mpc device to using netdev_ops by Stephen Hemminger on Friday, March 20, 2009 - 10:35 pm. (3 messages)

Next thread: [PATCH 51/77] labether: convert to net_device_ops by Stephen Hemminger on Friday, March 20, 2009 - 10:36 pm. (2 messages)