Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

[PATCH] sky2: don't hard code number of ports

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>

authored by

Stephen Hemminger and committed by
Linus Torvalds
f05267e7 2ccc99b7

+2 -2
+2 -2
drivers/net/sky2.c
··· 3430 3430 if (!(pstate == PCI_D3hot || pstate == PCI_D3cold)) 3431 3431 return -EINVAL; 3432 3432 3433 - for (i = 0; i < 2; i++) { 3433 + for (i = 0; i < hw->ports; i++) { 3434 3434 struct net_device *dev = hw->dev[i]; 3435 3435 3436 3436 if (dev) { ··· 3460 3460 if (err) 3461 3461 goto out; 3462 3462 3463 - for (i = 0; i < 2; i++) { 3463 + for (i = 0; i < hw->ports; i++) { 3464 3464 struct net_device *dev = hw->dev[i]; 3465 3465 if (dev && netif_running(dev)) { 3466 3466 netif_device_attach(dev);