public inbox for netdev@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 5/7] ip1000: Modify coding style of ipg_config_autoneg()
@ 2006-08-17 19:47 Jesse Huang
  2006-08-19 10:17 ` Francois Romieu
  0 siblings, 1 reply; 3+ messages in thread
From: Jesse Huang @ 2006-08-17 19:47 UTC (permalink / raw)
  To: romieu, penberg, akpm, dvrabel, linux-kernel, netdev, david,
	jesse

From: Jesse Huang <jesse@icplus.com.tw>

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
diff --git a/drivers/net/ipg.c b/drivers/net/ipg.c
index f859107..be96f93 100644
--- a/drivers/net/ipg.c
+++ b/drivers/net/ipg.c
@@ -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;
 }
 
-- 
1.3.GIT





^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH 5/7] ip1000: Modify coding style of ipg_config_autoneg()
  2006-08-17 19:47 [PATCH 5/7] ip1000: Modify coding style of ipg_config_autoneg() Jesse Huang
@ 2006-08-19 10:17 ` Francois Romieu
  2006-08-21  3:27   ` Jesse Huang
  0 siblings, 1 reply; 3+ messages in thread
From: Francois Romieu @ 2006-08-19 10:17 UTC (permalink / raw)
  To: Jesse Huang; +Cc: penberg, akpm, dvrabel, linux-kernel, netdev, david

Jesse Huang <jesse@icplus.com.tw> :
> From: Jesse Huang <jesse@icplus.com.tw>
> 
> 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
> diff --git a/drivers/net/ipg.c b/drivers/net/ipg.c
> index f859107..be96f93 100644
> --- a/drivers/net/ipg.c
> +++ b/drivers/net/ipg.c
> @@ -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.

-- 
Ueimor

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH 5/7] ip1000: Modify coding style of ipg_config_autoneg()
  2006-08-19 10:17 ` Francois Romieu
@ 2006-08-21  3:27   ` Jesse Huang
  0 siblings, 0 replies; 3+ messages in thread
From: Jesse Huang @ 2006-08-21  3:27 UTC (permalink / raw)
  To: Francois Romieu; +Cc: penberg, akpm, dvrabel, linux-kernel, netdev, david

Hi :

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

Jesse
----- Original Message ----- 
From: "Francois Romieu" <romieu@fr.zoreil.com>
To: "Jesse Huang" <jesse@icplus.com.tw>
Cc: <penberg@cs.Helsinki.FI>; <akpm@osdl.org>; <dvrabel@cantab.net>;
<linux-kernel@vger.kernel.org>; <netdev@vger.kernel.org>;
<david@pleyades.net>
Sent: Saturday, August 19, 2006 6:17 PM
Subject: Re: [PATCH 5/7] ip1000: Modify coding style of ipg_config_autoneg()


Jesse Huang <jesse@icplus.com.tw> :
> From: Jesse Huang <jesse@icplus.com.tw>
>
> 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
> diff --git a/drivers/net/ipg.c b/drivers/net/ipg.c
> index f859107..be96f93 100644
> --- a/drivers/net/ipg.c
> +++ b/drivers/net/ipg.c
> @@ -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.

-- 
Ueimor

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2006-08-21  3:27 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-08-17 19:47 [PATCH 5/7] ip1000: Modify coding style of ipg_config_autoneg() Jesse Huang
2006-08-19 10:17 ` Francois Romieu
2006-08-21  3:27   ` Jesse Huang

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox