[PATCH] staging: octeon: use atomic_long_t

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Use atomic_long_t, so that we can avoid some 32 vs. 64-bit ifdeffery.

Signed-off-by: Aaro Koskinen <aaro.koskinen@xxxxxx>
---
 drivers/staging/octeon/ethernet-rx.c | 24 ++++++------------------
 drivers/staging/octeon/ethernet.c    |  9 ++-------
 2 files changed, 8 insertions(+), 25 deletions(-)

diff --git a/drivers/staging/octeon/ethernet-rx.c b/drivers/staging/octeon/ethernet-rx.c
index 6aed3cf..b14d851 100644
--- a/drivers/staging/octeon/ethernet-rx.c
+++ b/drivers/staging/octeon/ethernet-rx.c
@@ -364,17 +364,10 @@ static int cvm_oct_napi_poll(struct napi_struct *napi, int budget)
 
 				/* Increment RX stats for virtual ports */
 				if (port >= CVMX_PIP_NUM_INPUT_PORTS) {
-#ifdef CONFIG_64BIT
-					atomic64_add(1,
-						     (atomic64_t *)&priv->stats.rx_packets);
-					atomic64_add(skb->len,
-						     (atomic64_t *)&priv->stats.rx_bytes);
-#else
-					atomic_add(1,
-						   (atomic_t *)&priv->stats.rx_packets);
-					atomic_add(skb->len,
-						   (atomic_t *)&priv->stats.rx_bytes);
-#endif
+					atomic_long_add(1,
+							(atomic_long_t *)&priv->stats.rx_packets);
+					atomic_long_add(skb->len,
+							(atomic_long_t *)&priv->stats.rx_bytes);
 				}
 				netif_receive_skb(skb);
 			} else {
@@ -383,13 +376,8 @@ static int cvm_oct_napi_poll(struct napi_struct *napi, int budget)
 				  printk_ratelimited("%s: Device not up, packet dropped\n",
 					   dev->name);
 				*/
-#ifdef CONFIG_64BIT
-				atomic64_add(1,
-					     (atomic64_t *)&priv->stats.rx_dropped);
-#else
-				atomic_add(1,
-					   (atomic_t *)&priv->stats.rx_dropped);
-#endif
+				atomic_long_add(1,
+						(atomic_long_t *)&priv->stats.rx_dropped);
 				dev_kfree_skb_irq(skb);
 			}
 		} else {
diff --git a/drivers/staging/octeon/ethernet.c b/drivers/staging/octeon/ethernet.c
index 8d239e2..6e385a4 100644
--- a/drivers/staging/octeon/ethernet.c
+++ b/drivers/staging/octeon/ethernet.c
@@ -231,13 +231,8 @@ static struct net_device_stats *cvm_oct_common_get_stats(struct net_device *dev)
 		 * The drop counter must be incremented atomically
 		 * since the RX tasklet also increments it.
 		 */
-#ifdef CONFIG_64BIT
-		atomic64_add(rx_status.dropped_packets,
-			     (atomic64_t *)&priv->stats.rx_dropped);
-#else
-		atomic_add(rx_status.dropped_packets,
-			     (atomic_t *)&priv->stats.rx_dropped);
-#endif
+		atomic_long_add(rx_status.dropped_packets,
+				(atomic_long_t *)&priv->stats.rx_dropped);
 	}
 
 	return &priv->stats;
-- 
2.4.0

_______________________________________________
devel mailing list
devel@xxxxxxxxxxxxxxxxxxxxxx
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel



[Index of Archives]     [Linux Driver Backports]     [DMA Engine]     [Linux GPIO]     [Linux SPI]     [Video for Linux]     [Linux USB Devel]     [Linux Coverity]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]
  Powered by Linux