Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1435204

[PATCH v3 net-next 7/9] net: hns: remove redundant hns_mac_dev_to_enet_if()

From Yisen Zhuang <Yisen.Zhuang@huawei.com>
Newsgroups linux.kernel
Subject [PATCH v3 net-next 7/9] net: hns: remove redundant hns_mac_dev_to_enet_if()
Date 2016-07-01 11:30 +0200
Message-ID <rQ2VQ-4RO-15@gated-at.bofh.it> (permalink)
References <rQ2M9-4Op-21@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


From: Kejian Yan <yankejian@huawei.com>

The sequence of hns_mac_dev_to_enet_if() is the same as
hns_get_enet_interface(), and hns_get_enet_interface() is called
by initialization to get the mac mode. And the mode is not changed
anywhere. Thus add hns_mac_dev_to_enet_if() function to get the mac
mode is obviously redundant.

Reported-by: Jinchuan Tian <tianjinchuan1@huawei.com>
Signed-off-by: Kejian Yan <yankejian@huawei.com>
Signed-off-by: Yisen Zhuang <Yisen.Zhuang@huawei.com>
---
 drivers/net/ethernet/hisilicon/hns/hns_dsaf_mac.c | 15 ---------------
 1 file changed, 15 deletions(-)

diff --git a/drivers/net/ethernet/hisilicon/hns/hns_dsaf_mac.c b/drivers/net/ethernet/hisilicon/hns/hns_dsaf_mac.c
index c526558..d2effcc 100644
--- a/drivers/net/ethernet/hisilicon/hns/hns_dsaf_mac.c
+++ b/drivers/net/ethernet/hisilicon/hns/hns_dsaf_mac.c
@@ -56,20 +56,6 @@ static const enum mac_mode g_mac_mode_1000[] = {
 	[PHY_INTERFACE_MODE_RTBI]   = MAC_MODE_RTBI_1000
 };
 
-static enum mac_mode hns_mac_dev_to_enet_if(const struct hns_mac_cb *mac_cb)
-{
-	switch (mac_cb->max_speed) {
-	case MAC_SPEED_100:
-		return g_mac_mode_100[mac_cb->phy_if];
-	case MAC_SPEED_1000:
-		return g_mac_mode_1000[mac_cb->phy_if];
-	case MAC_SPEED_10000:
-		return MAC_MODE_XGMII_10000;
-	default:
-		return MAC_MODE_MII_100;
-	}
-}
-
 static enum mac_mode hns_get_enet_interface(const struct hns_mac_cb *mac_cb)
 {
 	switch (mac_cb->max_speed) {
@@ -134,7 +120,6 @@ void hns_mac_adjust_link(struct hns_mac_cb *mac_cb, int speed, int duplex)
 
 	mac_cb->speed = speed;
 	mac_cb->half_duplex = !duplex;
-	mac_ctrl_drv->mac_mode = hns_mac_dev_to_enet_if(mac_cb);
 
 	if (mac_ctrl_drv->adjust_link) {
 		ret = mac_ctrl_drv->adjust_link(mac_ctrl_drv,
-- 
1.9.1

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH v3 net-next 0/9] net: hns: fix the typo of hns Yisen Zhuang <Yisen.Zhuang@huawei.com> - 2016-07-01 11:30 +0200
  [PATCH v3 net-next 6/9] net: hns: normalize two different loop Yisen Zhuang <Yisen.Zhuang@huawei.com> - 2016-07-01 11:30 +0200
  [PATCH v3 net-next 4/9] net: hns: delete redundant parenthese Yisen Zhuang <Yisen.Zhuang@huawei.com> - 2016-07-01 11:30 +0200
  [PATCH v3 net-next 7/9] net: hns: remove redundant hns_mac_dev_to_enet_if() Yisen Zhuang <Yisen.Zhuang@huawei.com> - 2016-07-01 11:30 +0200
  [PATCH v3 net-next 1/9] MAINTAINERS: add maintainers for hns driver Yisen Zhuang <Yisen.Zhuang@huawei.com> - 2016-07-01 11:30 +0200
  [PATCH v3 net-next 2/9] net: hns: fix code style about hns driver Yisen Zhuang <Yisen.Zhuang@huawei.com> - 2016-07-01 11:30 +0200
  Re: [PATCH v3 net-next 0/9] net: hns: fix the typo of hns David Miller <davem@davemloft.net> - 2016-07-01 23:00 +0200

csiph-web