Commit 693d86b0 authored by David Gibson's avatar David Gibson Committed by Jeff Garzik

[PATCH] orinoco merge preliminaries - use BUG_ON()

Use BUG_ON() macro instead of explicit if(x) BUG() in various places.
Signed-off-by: default avatarDavid Gibson <hermes@gibson.dropbear.id.au>

Index: working-2.6/drivers/net/wireless/orinoco.c
===================================================================
parent 996ff103
......@@ -1770,11 +1770,10 @@ __orinoco_set_multicast_list(struct net_device *dev)
int i;
for (i = 0; i < mc_count; i++) {
/* Paranoia: */
if (! p)
BUG(); /* Multicast list shorter than mc_count */
if (p->dmi_addrlen != ETH_ALEN)
BUG(); /* Bad address size in multicast list */
/* paranoia: is list shorter than mc_count? */
BUG_ON(! p);
/* paranoia: bad address size in list? */
BUG_ON(p->dmi_addrlen != ETH_ALEN);
memcpy(mclist.addr[i], p->dmi_addr, ETH_ALEN);
p = p->next;
......@@ -3185,8 +3184,7 @@ static int orinoco_ioctl_getrate(struct net_device *dev, struct iw_param *rrq)
ratemode = priv->bitratemode;
if ( (ratemode < 0) || (ratemode >= BITRATE_TABLE_SIZE) )
BUG();
BUG_ON((ratemode < 0) || (ratemode >= BITRATE_TABLE_SIZE));
rrq->value = bitrate_table[ratemode].bitrate * 100000;
rrq->fixed = ! bitrate_table[ratemode].automatic;
......
......@@ -228,10 +228,8 @@ static void orinoco_cs_detach(dev_link_t *link)
for (linkp = &dev_list; *linkp; linkp = &(*linkp)->next)
if (*linkp == link)
break;
if (*linkp == NULL) {
BUG();
return;
}
BUG_ON(*linkp == NULL);
if (link->state & DEV_CONFIG)
orinoco_cs_release(link);
......
......@@ -286,8 +286,7 @@ static void __devexit orinoco_plx_remove_one(struct pci_dev *pdev)
{
struct net_device *dev = pci_get_drvdata(pdev);
if (! dev)
BUG();
BUG_ON(! dev);
unregister_netdev(dev);
......
......@@ -172,8 +172,7 @@ static void __devexit orinoco_tmd_remove_one(struct pci_dev *pdev)
{
struct net_device *dev = pci_get_drvdata(pdev);
if (! dev)
BUG();
BUG_ON(! dev);
unregister_netdev(dev);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment