Skip to content

Commit cd3a21b

Browse files
author
Stefan Schmidt
committed
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>
1 parent a8ab042 commit cd3a21b

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

drivers/net/ieee802154/cc2520.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -517,7 +517,7 @@ cc2520_tx(struct ieee802154_hw *hw, struct sk_buff *skb)
517517
}
518518

519519
spin_lock_irqsave(&priv->lock, flags);
520-
BUG_ON(priv->is_tx);
520+
WARN_ON(priv->is_tx);
521521
priv->is_tx = 1;
522522
spin_unlock_irqrestore(&priv->lock, flags);
523523

@@ -643,9 +643,9 @@ cc2520_set_channel(struct ieee802154_hw *hw, u8 page, u8 channel)
643643

644644
dev_dbg(&priv->spi->dev, "trying to set channel\n");
645645

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);
649649

650650
ret = cc2520_write_register(priv, CC2520_FREQCTRL,
651651
11 + 5 * (channel - 11));

0 commit comments

Comments
 (0)