Skip to content

Commit

Permalink
ieee802154: cc2520: switch from BUG_ON() to WARN_ON() on problem
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Stefan Schmidt committed Nov 6, 2017
1 parent a8ab042 commit cd3a21b
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions drivers/net/ieee802154/cc2520.c
Original file line number Diff line number Diff line change
Expand Up @@ -517,7 +517,7 @@ cc2520_tx(struct ieee802154_hw *hw, struct sk_buff *skb)
}

spin_lock_irqsave(&priv->lock, flags);
BUG_ON(priv->is_tx);
WARN_ON(priv->is_tx);
priv->is_tx = 1;
spin_unlock_irqrestore(&priv->lock, flags);

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

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

BUG_ON(page != 0);
BUG_ON(channel < CC2520_MINCHANNEL);
BUG_ON(channel > CC2520_MAXCHANNEL);
WARN_ON(page != 0);
WARN_ON(channel < CC2520_MINCHANNEL);
WARN_ON(channel > CC2520_MAXCHANNEL);

ret = cc2520_write_register(priv, CC2520_FREQCTRL,
11 + 5 * (channel - 11));
Expand Down

0 comments on commit cd3a21b

Please sign in to comment.