Skip to contentSkip to conversation

ip1000: Modify coding style of ipg_config_autoneg()

PATCH In review Jesse Huang 2 participants 3 messages Aug 17, 2006 – Aug 21, 2006

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 5/7 ip1000: Modify coding style of ipg_config_autoneg()

From: Jesse Huang <[email protected]>

This is only coding style modify for ipg_config_autoneg(). Thanks for the suggestion form Francois.

Change Logs:
Modify coding style of ipg_config_autoneg()

---

 drivers/net/ipg.c |   17 ++++++++++-------
 1 files changed, 10 insertions(+), 7 deletions(-)

737498ca620437d8179e21be4d5220333066cbbd

drivers/net/ipg.c +10 -7
index f859107..be96f93 100644
@@ -491,11 +491,13 @@ static int ipg_config_autoneg(struct net
 	int fullduplex;
 	int txflowcontrol;
 	int rxflowcontrol;
+	long MacCtrlValue;
 
 	IPG_DEBUG_MSG("_config_autoneg\n");
 
 	asicctrl = ioread32(ioaddr + ASIC_CTRL);
-	phyctrl = ioread32(ioaddr + PHY_CTRL);
+   	phyctrl = ioread8(ioaddr + PHY_CTRL);
+   	MacCtrlValue = ioread32(ioaddr + MAC_CTRL);
 
 	/* Set flags for use in resolving auto-negotation, assuming
 	 * non-1000Mbps, half duplex, no flow control.
@@ -547,22 +549,22 @@ static int ipg_config_autoneg(struct net
 		/* Configure IPG for full duplex operation. */
 		printk(KERN_INFO "setting full duplex, ");
 
-		iowrite32(ioread32(ioaddr + MAC_CTRL) | IPG_MC_DUPLEX_SELECT_FD, ioaddr + MAC_CTRL);
+		MacCtrlValue |= IPG_MC_DUPLEX_SELECT_FD;
 
 		if (txflowcontrol == 1) {
 			printk("TX flow control");
-			iowrite32(ioread32(ioaddr + MAC_CTRL) | IPG_MC_TX_FLOW_CONTROL_ENABLE, ioaddr + MAC_CTRL);
+			MacCtrlValue |= IPG_MC_TX_FLOW_CONTROL_ENABLE;
 		} else {
 			printk("no TX flow control");
-			iowrite32(ioread32(ioaddr + MAC_CTRL) & ~IPG_MC_TX_FLOW_CONTROL_ENABLE, ioaddr + MAC_CTRL);
+			MacCtrlValue &= ~IPG_MC_TX_FLOW_CONTROL_ENABLE;
 		}
 
 		if (rxflowcontrol == 1) {
 			printk(", RX flow control.");
-			iowrite32(ioread32(ioaddr+MAC_CTRL) | IPG_MC_RX_FLOW_CONTROL_ENABLE, ioaddr + MAC_CTRL);
+			MacCtrlValue |= IPG_MC_RX_FLOW_CONTROL_ENABLE;
 		} else {
 			printk(", no RX flow control.");
-			iowrite32(ioread32(ioaddr+MAC_CTRL) & ~IPG_MC_RX_FLOW_CONTROL_ENABLE, ioaddr + MAC_CTRL);
+			MacCtrlValue = MacCtrlValue & ~IPG_MC_RX_FLOW_CONTROL_ENABLE;
 		}
 
 		printk("\n");
@@ -570,8 +572,9 @@ static int ipg_config_autoneg(struct net
 		/* Configure IPG for half duplex operation. */
 	        printk(KERN_INFO "setting half duplex, no TX flow control, no RX flow control.\n");
 
-		iowrite32(ioread32(ioaddr+MAC_CTRL) & ~IPG_MC_DUPLEX_SELECT_FD & ~IPG_MC_TX_FLOW_CONTROL_ENABLE & ~IPG_MC_RX_FLOW_CONTROL_ENABLE, ioaddr + MAC_CTRL);
+		MacCtrlValue &= ~IPG_MC_DUPLEX_SELECT_FD & ~IPG_MC_TX_FLOW_CONTROL_ENABLE & ~IPG_MC_RX_FLOW_CONTROL_ENABLE;
 	}
+	iowrite32(MacCtrlValue , ioaddr+MAC_CTRL);
 	return 0;
 }
 
Signature · 1 line
1.3.GIT
#1 lore raw

Jesse Huang <[email protected]> :

Quoted 19 lines

From: Jesse Huang <[email protected]>

This is only coding style modify for ipg_config_autoneg(). Thanks for the suggestion form Francois.

Change Logs:
Modify coding style of ipg_config_autoneg()

---

 drivers/net/ipg.c |   17 ++++++++++-------
 1 files changed, 10 insertions(+), 7 deletions(-)

737498ca620437d8179e21be4d5220333066cbbd

drivers/net/ipg.c +0 -0
index f859107..be96f93 100644

drivers/net/ipg.c static int ipg_config_autoneg(struct net · line 494

Quoted 4 lines
drivers/net/ipg.c +1 -0
@@ -491,11 +491,13 @@ static int ipg_config_autoneg(struct net
 	int fullduplex;
 	int txflowcontrol;
 	int rxflowcontrol;
+	long MacCtrlValue;

Mixed case variables are not exactly welcome.

Signature · 1 line
Ueimor
#2 lore raw

Hi :

Ok, I will remove the Mixed case variables. Thanks.

Jesse
----- Original Message -----
From: "Francois Romieu" <[email protected]>
To: "Jesse Huang" <[email protected]>
Cc: <[email protected]>; <[email protected]>; <[email protected]>; <[email protected]>; <[email protected]>; <[email protected]>
Sent: Saturday, August 19, 2006 6:17 PM
Subject: Re: [PATCH 5/7] ip1000: Modify coding style of ipg_config_autoneg()

Jesse Huang <[email protected]> :

Quoted 19 lines

From: Jesse Huang <[email protected]>

This is only coding style modify for ipg_config_autoneg(). Thanks for the suggestion form Francois.

Change Logs:
Modify coding style of ipg_config_autoneg()

---

 drivers/net/ipg.c |   17 ++++++++++-------
 1 files changed, 10 insertions(+), 7 deletions(-)

737498ca620437d8179e21be4d5220333066cbbd

drivers/net/ipg.c +0 -0
index f859107..be96f93 100644

drivers/net/ipg.c static int ipg_config_autoneg(struct net · line 494

Quoted 4 lines
drivers/net/ipg.c +1 -0
@@ -491,11 +491,13 @@ static int ipg_config_autoneg(struct net
 int fullduplex;
 int txflowcontrol;
 int rxflowcontrol;
+ long MacCtrlValue;

Mixed case variables are not exactly welcome.

Signature · 1 line
Ueimor