[PATCH] Remove unnecessary check in drivers/net/depca.c
This was spotted by coverity (cid #793). All callers dereference dev before calling this functions, and we dereference it earlier in the function, when initializing lp. Signed-off-by: Eric Sesterhenn <snakebyte@gmx.de> Cc: Jeff Garzik <jeff@garzik.org> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Jeff Garzik <jeff@garzik.org>
This commit is contained in:
parent
a189317fa0
commit
107ce6d21b
1 changed files with 13 additions and 15 deletions
|
@ -1252,24 +1252,22 @@ static void set_multicast_list(struct net_device *dev)
|
||||||
struct depca_private *lp = (struct depca_private *) dev->priv;
|
struct depca_private *lp = (struct depca_private *) dev->priv;
|
||||||
u_long ioaddr = dev->base_addr;
|
u_long ioaddr = dev->base_addr;
|
||||||
|
|
||||||
if (dev) {
|
netif_stop_queue(dev);
|
||||||
netif_stop_queue(dev);
|
while (lp->tx_old != lp->tx_new); /* Wait for the ring to empty */
|
||||||
while (lp->tx_old != lp->tx_new); /* Wait for the ring to empty */
|
|
||||||
|
|
||||||
STOP_DEPCA; /* Temporarily stop the depca. */
|
STOP_DEPCA; /* Temporarily stop the depca. */
|
||||||
depca_init_ring(dev); /* Initialize the descriptor rings */
|
depca_init_ring(dev); /* Initialize the descriptor rings */
|
||||||
|
|
||||||
if (dev->flags & IFF_PROMISC) { /* Set promiscuous mode */
|
if (dev->flags & IFF_PROMISC) { /* Set promiscuous mode */
|
||||||
lp->init_block.mode |= PROM;
|
lp->init_block.mode |= PROM;
|
||||||
} else {
|
} else {
|
||||||
SetMulticastFilter(dev);
|
SetMulticastFilter(dev);
|
||||||
lp->init_block.mode &= ~PROM; /* Unset promiscuous mode */
|
lp->init_block.mode &= ~PROM; /* Unset promiscuous mode */
|
||||||
}
|
|
||||||
|
|
||||||
LoadCSRs(dev); /* Reload CSR3 */
|
|
||||||
InitRestartDepca(dev); /* Resume normal operation. */
|
|
||||||
netif_start_queue(dev); /* Unlock the TX ring */
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
LoadCSRs(dev); /* Reload CSR3 */
|
||||||
|
InitRestartDepca(dev); /* Resume normal operation. */
|
||||||
|
netif_start_queue(dev); /* Unlock the TX ring */
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
Loading…
Add table
Reference in a new issue