Commit 5397db90 authored by Daeseok Youn's avatar Daeseok Youn Committed by Greg Kroah-Hartman

staging: silicom: remove redundant pci_get_drvdata() call

The pci_get_drvdata() and checking NULL for dev are
called twice in while loop in is_bypass_dev().
Signed-off-by: default avatarDaeseok Youn <daeseok.youn@gmail.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 2f4285d1
...@@ -148,8 +148,6 @@ static int is_bypass_dev(int if_index) ...@@ -148,8 +148,6 @@ static int is_bypass_dev(int if_index)
int data = 0; int data = 0;
while ((pdev = pci_get_class(PCI_CLASS_NETWORK_ETHERNET << 8, pdev))) { while ((pdev = pci_get_class(PCI_CLASS_NETWORK_ETHERNET << 8, pdev))) {
dev = pci_get_drvdata(pdev);
if (dev != NULL) {
dev = pci_get_drvdata(pdev); dev = pci_get_drvdata(pdev);
if ((dev != NULL) && (dev->ifindex == if_index)) { if ((dev != NULL) && (dev->ifindex == if_index)) {
if ((pdev->vendor == SILICOM_VID) && if ((pdev->vendor == SILICOM_VID) &&
...@@ -169,9 +167,7 @@ static int is_bypass_dev(int if_index) ...@@ -169,9 +167,7 @@ static int is_bypass_dev(int if_index)
info.cmd = ETHTOOL_GDRVINFO; info.cmd = ETHTOOL_GDRVINFO;
ops->get_drvinfo(dev, &info); ops->get_drvinfo(dev, &info);
for (; bp_desc_array[k]; k++) for (; bp_desc_array[k]; k++)
if (! if (!(strcmp(bp_desc_array[k],
(strcmp
(bp_desc_array[k],
info.driver))) info.driver)))
goto send_cmd; goto send_cmd;
...@@ -182,7 +178,6 @@ static int is_bypass_dev(int if_index) ...@@ -182,7 +178,6 @@ static int is_bypass_dev(int if_index)
return -1; return -1;
} }
} }
}
send_cmd: send_cmd:
ret = do_cmd(dev, &ifr, IS_BYPASS, &data); ret = do_cmd(dev, &ifr, IS_BYPASS, &data);
return ret < 0 ? -1 : ret; return ret < 0 ? -1 : ret;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment