mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-08-24 01:41:39 +00:00
br: remove redundant check and init
Since these checks and initialization are done in dev_ethtool_get_settings called later on, remove this redundancy. Signed-off-by: Jiri Pirko <jpirko@redhat.com> Acked-by: Stephen Hemminger <shemminger@vyatta.com> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
parent
e8aaebc6b2
commit
fa3df928e0
1 changed files with 11 additions and 13 deletions
|
@ -33,8 +33,7 @@
|
||||||
*/
|
*/
|
||||||
static int port_cost(struct net_device *dev)
|
static int port_cost(struct net_device *dev)
|
||||||
{
|
{
|
||||||
if (dev->ethtool_ops && dev->ethtool_ops->get_settings) {
|
struct ethtool_cmd ecmd;
|
||||||
struct ethtool_cmd ecmd = { .cmd = ETHTOOL_GSET, };
|
|
||||||
|
|
||||||
if (!dev_ethtool_get_settings(dev, &ecmd)) {
|
if (!dev_ethtool_get_settings(dev, &ecmd)) {
|
||||||
switch (ethtool_cmd_speed(&ecmd)) {
|
switch (ethtool_cmd_speed(&ecmd)) {
|
||||||
|
@ -48,7 +47,6 @@ static int port_cost(struct net_device *dev)
|
||||||
return 100;
|
return 100;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
/* Old silly heuristics based on name */
|
/* Old silly heuristics based on name */
|
||||||
if (!strncmp(dev->name, "lec", 3))
|
if (!strncmp(dev->name, "lec", 3))
|
||||||
|
|
Loading…
Reference in a new issue