Skip to content

Commit

Permalink
[PATCH] sky2: don't hard code number of ports
Browse files Browse the repository at this point in the history
It is cleaner, to not loop over both ports if only one exists.

Signed-off-by: Stephen Hemminger <shemminger@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
  • Loading branch information
Stephen Hemminger authored and Linus Torvalds committed Jun 13, 2006
1 parent 2ccc99b commit f05267e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions drivers/net/sky2.c
Original file line number Diff line number Diff line change
Expand Up @@ -3430,7 +3430,7 @@ static int sky2_suspend(struct pci_dev *pdev, pm_message_t state)
if (!(pstate == PCI_D3hot || pstate == PCI_D3cold))
return -EINVAL;

for (i = 0; i < 2; i++) {
for (i = 0; i < hw->ports; i++) {
struct net_device *dev = hw->dev[i];

if (dev) {
Expand Down Expand Up @@ -3460,7 +3460,7 @@ static int sky2_resume(struct pci_dev *pdev)
if (err)
goto out;

for (i = 0; i < 2; i++) {
for (i = 0; i < hw->ports; i++) {
struct net_device *dev = hw->dev[i];
if (dev && netif_running(dev)) {
netif_device_attach(dev);
Expand Down

0 comments on commit f05267e

Please sign in to comment.