Skip to content

Commit

Permalink
Merge branch 'upstream-linus' of master.kernel.org:/pub/scm/linux/ker…
Browse files Browse the repository at this point in the history
…nel/git/jgarzik/netdev-2.6

* 'upstream-linus' of master.kernel.org:/pub/scm/linux/kernel/git/jgarzik/netdev-2.6:
  Fix myri10ge NAPI oops & warnings
  Fix region size check in mpc5200 FEC driver
  mpc5200: Fix Kconfig dependancies on MPC5200 FEC device driver
  • Loading branch information
Linus Torvalds committed Nov 1, 2007
2 parents 54866f0 + c956a24 commit 3ce4af1
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 8 deletions.
4 changes: 1 addition & 3 deletions drivers/net/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -1883,9 +1883,7 @@ config FEC2

config FEC_MPC52xx
tristate "MPC52xx FEC driver"
depends on PPC_MPC52xx
select PPC_BESTCOMM
select PPC_BESTCOMM_FEC
depends on PPC_MERGE && PPC_MPC52xx && PPC_BESTCOMM_FEC
select CRC32
select PHYLIB
---help---
Expand Down
4 changes: 2 additions & 2 deletions drivers/net/fec_mpc52xx.c
Original file line number Diff line number Diff line change
Expand Up @@ -879,9 +879,9 @@ mpc52xx_fec_probe(struct of_device *op, const struct of_device_id *match)
"Error while parsing device node resource\n" );
return rv;
}
if ((mem.end - mem.start + 1) != sizeof(struct mpc52xx_fec)) {
if ((mem.end - mem.start + 1) < sizeof(struct mpc52xx_fec)) {
printk(KERN_ERR DRIVER_NAME
" - invalid resource size (%lx != %x), check mpc52xx_devices.c\n",
" - invalid resource size (%lx < %x), check mpc52xx_devices.c\n",
(unsigned long)(mem.end - mem.start + 1), sizeof(struct mpc52xx_fec));
return -EINVAL;
}
Expand Down
6 changes: 3 additions & 3 deletions drivers/net/myri10ge/myri10ge.c
Original file line number Diff line number Diff line change
Expand Up @@ -1151,7 +1151,7 @@ static inline int myri10ge_clean_rx_done(struct myri10ge_priv *mgp, int budget)
u16 length;
__wsum checksum;

while (rx_done->entry[idx].length != 0 && work_done++ < budget) {
while (rx_done->entry[idx].length != 0 && work_done < budget) {
length = ntohs(rx_done->entry[idx].length);
rx_done->entry[idx].length = 0;
checksum = csum_unfold(rx_done->entry[idx].checksum);
Expand All @@ -1167,6 +1167,7 @@ static inline int myri10ge_clean_rx_done(struct myri10ge_priv *mgp, int budget)
rx_bytes += rx_ok * (unsigned long)length;
cnt++;
idx = cnt & (myri10ge_max_intr_slots - 1);
work_done++;
}
rx_done->idx = idx;
rx_done->cnt = cnt;
Expand Down Expand Up @@ -1233,13 +1234,12 @@ static int myri10ge_poll(struct napi_struct *napi, int budget)
struct myri10ge_priv *mgp =
container_of(napi, struct myri10ge_priv, napi);
struct net_device *netdev = mgp->dev;
struct myri10ge_rx_done *rx_done = &mgp->rx_done;
int work_done;

/* process as many rx events as NAPI will allow */
work_done = myri10ge_clean_rx_done(mgp, budget);

if (rx_done->entry[rx_done->idx].length == 0 || !netif_running(netdev)) {
if (work_done < budget || !netif_running(netdev)) {
netif_rx_complete(netdev, napi);
put_be32(htonl(3), mgp->irq_claim);
}
Expand Down

0 comments on commit 3ce4af1

Please sign in to comment.