diff options
author | Eric Sesterhenn <snakebyte@gmx.de> | 2006-10-10 23:33:28 +0200 |
---|---|---|
committer | Jeff Garzik <jeff@garzik.org> | 2006-12-02 06:11:55 +0100 |
commit | 107ce6d21b746f33f85f4385b9802b3ae928f876 (patch) | |
tree | 309accadd55d13fe706cadc9368aa5402381343f | |
parent | [PATCH] forcedeth: power management support (diff) | |
download | linux-107ce6d21b746f33f85f4385b9802b3ae928f876.tar.xz linux-107ce6d21b746f33f85f4385b9802b3ae928f876.zip |
[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.c | 28 |
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) struct depca_private *lp = (struct depca_private *) dev->priv; u_long ioaddr = dev->base_addr; - if (dev) { - netif_stop_queue(dev); - while (lp->tx_old != lp->tx_new); /* Wait for the ring to empty */ - - STOP_DEPCA; /* Temporarily stop the depca. */ - depca_init_ring(dev); /* Initialize the descriptor rings */ + netif_stop_queue(dev); + while (lp->tx_old != lp->tx_new); /* Wait for the ring to empty */ - if (dev->flags & IFF_PROMISC) { /* Set promiscuous mode */ - lp->init_block.mode |= PROM; - } else { - SetMulticastFilter(dev); - lp->init_block.mode &= ~PROM; /* Unset promiscuous mode */ - } + STOP_DEPCA; /* Temporarily stop the depca. */ + depca_init_ring(dev); /* Initialize the descriptor rings */ - LoadCSRs(dev); /* Reload CSR3 */ - InitRestartDepca(dev); /* Resume normal operation. */ - netif_start_queue(dev); /* Unlock the TX ring */ + if (dev->flags & IFF_PROMISC) { /* Set promiscuous mode */ + lp->init_block.mode |= PROM; + } else { + SetMulticastFilter(dev); + 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 */ } /* |