[PATCH] staging: fsl-dpaa2: replace simple switch case by if statement

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

 



From: HariPrasath Elango <hariprasath.elango@xxxxxxxxx>

Replace a couple of simple switch cases by if condition

Signed-off-by: HariPrasath Elango <hariprasath.elango@xxxxxxxxx>
---
 drivers/staging/fsl-dpaa2/ethernet/dpaa2-ethtool.c | 11 ++++-------
 1 file changed, 4 insertions(+), 7 deletions(-)

diff --git a/drivers/staging/fsl-dpaa2/ethernet/dpaa2-ethtool.c b/drivers/staging/fsl-dpaa2/ethernet/dpaa2-ethtool.c
index 070a3f2..fb517cb 100644
--- a/drivers/staging/fsl-dpaa2/ethernet/dpaa2-ethtool.c
+++ b/drivers/staging/fsl-dpaa2/ethernet/dpaa2-ethtool.c
@@ -171,8 +171,7 @@ static void dpaa2_eth_get_strings(struct net_device *netdev, u32 stringset,
 	u8 *p = data;
 	int i;
 
-	switch (stringset) {
-	case ETH_SS_STATS:
+	if (stringset == ETH_SS_STATS) {
 		for (i = 0; i < DPAA2_ETH_NUM_STATS; i++) {
 			strlcpy(p, dpaa2_ethtool_stats[i], ETH_GSTRING_LEN);
 			p += ETH_GSTRING_LEN;
@@ -181,18 +180,16 @@ static void dpaa2_eth_get_strings(struct net_device *netdev, u32 stringset,
 			strlcpy(p, dpaa2_ethtool_extras[i], ETH_GSTRING_LEN);
 			p += ETH_GSTRING_LEN;
 		}
-		break;
 	}
 }
 
 static int dpaa2_eth_get_sset_count(struct net_device *net_dev, int sset)
 {
-	switch (sset) {
-	case ETH_SS_STATS: /* ethtool_get_stats(), ethtool_get_drvinfo() */
+	if (sset == ETH_SS_STATS)
+		/* ethtool_get_stats(), ethtool_get_drvinfo() */
 		return DPAA2_ETH_NUM_STATS + DPAA2_ETH_NUM_EXTRA_STATS;
-	default:
+	else
 		return -EOPNOTSUPP;
-	}
 }
 
 /** Fill in hardware counters, as returned by MC.
-- 
2.10.0.GIT

_______________________________________________
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