[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1405064110-22579-9-git-send-email-varkabhadram@gmail.com>
Date: Fri, 11 Jul 2014 13:05:10 +0530
From: varkabhadram@...il.com
To: netdev@...r.kernel.org
Cc: Thomas.Lendacky@....com, geert+renesas@...ux-m68k.org,
ebiederm@...ssion.com, macro@...ux-mips.org,
linux-kernel@...r.kernel.org, davem@...emloft.net,
Varka Bhadram <varkab@...c.in>
Subject: [PATCH net-next 8/8] ethernet: amd: switch case fixes
From: Varka Bhadram <varkab@...c.in>
This patch fix the *swith* case indentation and usage issues
Signed-off-by: Varka Bhadram <varkab@...c.in>
---
drivers/net/ethernet/amd/amd8111e.c | 117 +++++++++++++++++------------------
1 file changed, 58 insertions(+), 59 deletions(-)
diff --git a/drivers/net/ethernet/amd/amd8111e.c b/drivers/net/ethernet/amd/amd8111e.c
index f0d3809..ab2e09b9 100644
--- a/drivers/net/ethernet/amd/amd8111e.c
+++ b/drivers/net/ethernet/amd/amd8111e.c
@@ -197,23 +197,24 @@ static void amd8111e_set_ext_phy(struct net_device *dev)
advert = amd8111e_mdio_read(dev, lp->ext_phy_addr, MII_ADVERTISE);
tmp = advert & ~(ADVERTISE_ALL | ADVERTISE_100BASE4);
switch (lp->ext_phy_option) {
- default:
- case SPEED_AUTONEG: /* advertise all values */
- tmp |= (ADVERTISE_10HALF | ADVERTISE_10FULL |
- ADVERTISE_100HALF | ADVERTISE_100FULL);
- break;
- case SPEED10_HALF:
- tmp |= ADVERTISE_10HALF;
- break;
- case SPEED10_FULL:
- tmp |= ADVERTISE_10FULL;
- break;
- case SPEED100_HALF:
- tmp |= ADVERTISE_100HALF;
- break;
- case SPEED100_FULL:
- tmp |= ADVERTISE_100FULL;
- break;
+ case SPEED_AUTONEG: /* advertise all values */
+ tmp |= (ADVERTISE_10HALF | ADVERTISE_10FULL |
+ ADVERTISE_100HALF | ADVERTISE_100FULL);
+ break;
+ case SPEED10_HALF:
+ tmp |= ADVERTISE_10HALF;
+ break;
+ case SPEED10_FULL:
+ tmp |= ADVERTISE_10FULL;
+ break;
+ case SPEED100_HALF:
+ tmp |= ADVERTISE_100HALF;
+ break;
+ case SPEED100_FULL:
+ tmp |= ADVERTISE_100FULL;
+ break;
+ default:
+ break;
}
if (advert != tmp)
@@ -383,49 +384,47 @@ static int amd8111e_set_coalesce(struct net_device *dev, enum coal_mode cmod)
void __iomem *mmio = lp->mmio;
struct amd8111e_coalesce_conf *coal_conf = &lp->coal_conf;
+ switch (cmod) {
+ case RX_INTR_COAL:
+ timeout = coal_conf->rx_timeout;
+ event_count = coal_conf->rx_event_count;
+ if (timeout > MAX_TIMEOUT ||
+ event_count > MAX_EVENT_COUNT)
+ return -EINVAL;
+
+ timeout = timeout * DELAY_TIMER_CONV;
+ writel(VAL0 | STINTEN, mmio + INTEN0);
+ writel((u32)DLY_INT_A_R0 | (event_count << 16) |
+ timeout, mmio+DLY_INT_A);
+ break;
- switch (cmod)
- {
- case RX_INTR_COAL:
- timeout = coal_conf->rx_timeout;
- event_count = coal_conf->rx_event_count;
- if (timeout > MAX_TIMEOUT ||
- event_count > MAX_EVENT_COUNT)
- return -EINVAL;
-
- timeout = timeout * DELAY_TIMER_CONV;
- writel(VAL0 | STINTEN, mmio + INTEN0);
- writel((u32)DLY_INT_A_R0 | (event_count << 16) |
- timeout, mmio+DLY_INT_A);
- break;
-
- case TX_INTR_COAL:
- timeout = coal_conf->tx_timeout;
- event_count = coal_conf->tx_event_count;
- if (timeout > MAX_TIMEOUT ||
- event_count > MAX_EVENT_COUNT)
- return -EINVAL;
-
-
- timeout = timeout * DELAY_TIMER_CONV;
- writel(VAL0 | STINTEN, mmio + INTEN0);
- writel((u32)DLY_INT_B_T0 | (event_count << 16) |
- timeout, mmio + DLY_INT_B);
- break;
-
- case DISABLE_COAL:
- writel(0, mmio + STVAL);
- writel(STINTEN, mmio + INTEN0);
- writel(0, mmio + DLY_INT_B);
- writel(0, mmio + DLY_INT_A);
- break;
- case ENABLE_COAL:
- /* Start the timer (0.5 sec) */
- writel((u32)SOFT_TIMER_FREQ, mmio + STVAL);
- writel(VAL0 | STINTEN, mmio + INTEN0);
- break;
- default:
- break;
+ case TX_INTR_COAL:
+ timeout = coal_conf->tx_timeout;
+ event_count = coal_conf->tx_event_count;
+ if (timeout > MAX_TIMEOUT ||
+ event_count > MAX_EVENT_COUNT)
+ return -EINVAL;
+
+ timeout = timeout * DELAY_TIMER_CONV;
+ writel(VAL0 | STINTEN, mmio + INTEN0);
+ writel((u32)DLY_INT_B_T0 | (event_count << 16) |
+ timeout, mmio + DLY_INT_B);
+ break;
+
+ case DISABLE_COAL:
+ writel(0, mmio + STVAL);
+ writel(STINTEN, mmio + INTEN0);
+ writel(0, mmio + DLY_INT_B);
+ writel(0, mmio + DLY_INT_A);
+ break;
+
+ case ENABLE_COAL:
+ /* Start the timer (0.5 sec) */
+ writel((u32)SOFT_TIMER_FREQ, mmio + STVAL);
+ writel(VAL0 | STINTEN, mmio + INTEN0);
+ break;
+ default:
+ break;
}
return 0;
--
1.7.9.5
--
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