Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

ieee802154: cc2520: switch from BUG_ON() to WARN_ON() on problem

The check is valid but it does not warrant to crash the kernel. A
WARN_ON() is good enough here.
Found by checkpatch.

Signed-off-by: Stefan Schmidt <stefan@osg.samsung.com>
Acked-by: Varka Bhadram <varkabhadram@gmail.com>
Signed-off-by: Stefan Schmidt <stefan@osg.samsung.com>

+4 -4
+4 -4
drivers/net/ieee802154/cc2520.c
··· 517 517 } 518 518 519 519 spin_lock_irqsave(&priv->lock, flags); 520 - BUG_ON(priv->is_tx); 520 + WARN_ON(priv->is_tx); 521 521 priv->is_tx = 1; 522 522 spin_unlock_irqrestore(&priv->lock, flags); 523 523 ··· 643 643 644 644 dev_dbg(&priv->spi->dev, "trying to set channel\n"); 645 645 646 - BUG_ON(page != 0); 647 - BUG_ON(channel < CC2520_MINCHANNEL); 648 - BUG_ON(channel > CC2520_MAXCHANNEL); 646 + WARN_ON(page != 0); 647 + WARN_ON(channel < CC2520_MINCHANNEL); 648 + WARN_ON(channel > CC2520_MAXCHANNEL); 649 649 650 650 ret = cc2520_write_register(priv, CC2520_FREQCTRL, 651 651 11 + 5 * (channel - 11));