aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEric Sesterhenn <snakebyte@gmx.de>2006-10-10 17:33:28 -0400
committerJeff Garzik <jeff@garzik.org>2006-12-02 00:11:55 -0500
commit107ce6d21b746f33f85f4385b9802b3ae928f876 (patch)
tree309accadd55d13fe706cadc9368aa5402381343f
parenta189317fa0e9d425cd3a4c248b06f96d876cf7fd (diff)
[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>
-rw-r--r--drivers/net/depca.c28
1 files changed, 13 insertions, 15 deletions
diff --git a/drivers/net/depca.c b/drivers/net/depca.c
index f87f6e3dc721..5113eef755b9 100644
--- a/drivers/net/depca.c
+++ b/drivers/net/depca.c
@@ -1252,24 +1252,22 @@ static void set_multicast_list(struct net_device *dev)
1252 struct depca_private *lp = (struct depca_private *) dev->priv; 1252 struct depca_private *lp = (struct depca_private *) dev->priv;
1253 u_long ioaddr = dev->base_addr; 1253 u_long ioaddr = dev->base_addr;
1254 1254
1255 if (dev) { 1255 netif_stop_queue(dev);
1256 netif_stop_queue(dev); 1256 while (lp->tx_old != lp->tx_new); /* Wait for the ring to empty */
1257 while (lp->tx_old != lp->tx_new); /* Wait for the ring to empty */
1258
1259 STOP_DEPCA; /* Temporarily stop the depca. */
1260 depca_init_ring(dev); /* Initialize the descriptor rings */
1261 1257
1262 if (dev->flags & IFF_PROMISC) { /* Set promiscuous mode */ 1258 STOP_DEPCA; /* Temporarily stop the depca. */
1263 lp->init_block.mode |= PROM; 1259 depca_init_ring(dev); /* Initialize the descriptor rings */
1264 } else {
1265 SetMulticastFilter(dev);
1266 lp->init_block.mode &= ~PROM; /* Unset promiscuous mode */
1267 }
1268 1260
1269 LoadCSRs(dev); /* Reload CSR3 */ 1261 if (dev->flags & IFF_PROMISC) { /* Set promiscuous mode */
1270 InitRestartDepca(dev); /* Resume normal operation. */ 1262 lp->init_block.mode |= PROM;
1271 netif_start_queue(dev); /* Unlock the TX ring */ 1263 } else {
1264 SetMulticastFilter(dev);
1265 lp->init_block.mode &= ~PROM; /* Unset promiscuous mode */
1272 } 1266 }
1267
1268 LoadCSRs(dev); /* Reload CSR3 */
1269 InitRestartDepca(dev); /* Resume normal operation. */
1270 netif_start_queue(dev); /* Unlock the TX ring */
1273} 1271}
1274 1272
1275/* 1273/*