lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [day] [month] [year] [list]
Date:	8 Jan 2008 07:32:16 -0500
From:	linux@...izon.com
To:	netdev@...r.kernel.org, romieu@...zoreil.com
Cc:	akpm@...ux-foundation.org, davem@...emloft.net, linux@...izon.com
Subject: [PATCH 2/3] drivers/net/ipg.c: convert Jumbo.FoundStart to bool

This is a fairly basic code cleanup that annoyed me while working
on the first patch.
---
diff --git a/drivers/net/ipg.h b/drivers/net/ipg.h
index d5d092c..5d7cc84 100644
--- a/drivers/net/ipg.h
+++ b/drivers/net/ipg.h
@@ -789,11 +789,6 @@ struct ipg_rx {
 	__le64 frag_info;
 };
 
-struct SJumbo {
-	int FoundStart;
-	int CurrentSize;
-	struct sk_buff *skb;
-};
 /* Structure of IPG NIC specific data. */
 struct ipg_nic_private {
 	void __iomem *ioaddr;
@@ -809,7 +804,11 @@ struct ipg_nic_private {
 	unsigned int rx_dirty;
 // Add by Grace 2005/05/19
 #ifdef JUMBO_FRAME
-	struct SJumbo Jumbo;
+	struct SJumbo {
+		bool FoundStart;
+		int CurrentSize;
+		struct sk_buff *skb;
+	} Jumbo;
 #endif
 	unsigned int rx_buf_sz;
 	struct pci_dev *pdev;
diff --git a/drivers/net/ipg.h b/drivers/net/ipg.h
index d5d092c..5d7cc84 100644
--- a/drivers/net/ipg.h
+++ b/drivers/net/ipg.h
@@ -789,11 +789,6 @@ struct ipg_rx {
 	__le64 frag_info;
 };
 
-struct SJumbo {
-	int FoundStart;
-	int CurrentSize;
-	struct sk_buff *skb;
-};
 /* Structure of IPG NIC specific data. */
 struct ipg_nic_private {
 	void __iomem *ioaddr;
@@ -809,7 +804,11 @@ struct ipg_nic_private {
 	unsigned int rx_dirty;
 // Add by Grace 2005/05/19
 #ifdef JUMBO_FRAME
-	struct SJumbo Jumbo;
+	struct SJumbo {
+		bool FoundStart;
+		int CurrentSize;
+		struct sk_buff *skb;
+	} Jumbo;
 #endif
 	unsigned int rx_buf_sz;
 	struct pci_dev *pdev;
diff --git a/drivers/net/ipg.c b/drivers/net/ipg.c
index a0dfba5..3860fcd 100644
--- a/drivers/net/ipg.c
+++ b/drivers/net/ipg.c
@@ -1206,7 +1206,7 @@ static void ipg_nic_rx_with_start_and_end(struct net_device *dev,
 
 	if (jumbo->FoundStart) {
 		IPG_DEV_KFREE_SKB(jumbo->skb);
-		jumbo->FoundStart = 0;
+		jumbo->FoundStart = false;
 		jumbo->CurrentSize = 0;
 		jumbo->skb = NULL;
 	}
@@ -1257,7 +1257,7 @@ static void ipg_nic_rx_with_start(struct net_device *dev,
 
 	skb_put(skb, IPG_RXFRAG_SIZE);
 
-	jumbo->FoundStart = 1;
+	jumbo->FoundStart = true;
 	jumbo->CurrentSize = IPG_RXFRAG_SIZE;
 	jumbo->skb = skb;
 
@@ -1303,14 +1303,14 @@ static void ipg_nic_rx_with_end(struct net_device *dev,
 		}
 
 		dev->last_rx = jiffies;
-		jumbo->FoundStart = 0;
+		jumbo->FoundStart = false;
 		jumbo->CurrentSize = 0;
 		jumbo->skb = NULL;
 
 		ipg_nic_rx_free_skb(dev, entry);
 	} else {
 		IPG_DEV_KFREE_SKB(jumbo->skb);
-		jumbo->FoundStart = 0;
+		jumbo->FoundStart = false;
 		jumbo->CurrentSize = 0;
 		jumbo->skb = NULL;
 	}
@@ -1340,7 +1340,7 @@ static void ipg_nic_rx_no_start_no_end(struct net_device *dev,
 		}
 	} else {
 		IPG_DEV_KFREE_SKB(jumbo->skb);
-		jumbo->FoundStart = 0;
+		jumbo->FoundStart = false;
 		jumbo->CurrentSize = 0;
 		jumbo->skb = NULL;
 	}
@@ -1840,7 +1840,7 @@ static int ipg_nic_open(struct net_device *dev)
 
 #ifdef JUMBO_FRAME
 	/* initialize JUMBO Frame control variable */
-	sp->Jumbo.FoundStart = 0;
+	sp->Jumbo.FoundStart = false;
 	sp->Jumbo.CurrentSize = 0;
 	sp->Jumbo.skb = 0;
 	dev->mtu = IPG_TXFRAG_SIZE;
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Powered by blists - more mailing lists