From patchwork Fri Sep 22 12:14:04 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefan Schmidt X-Patchwork-Id: 9965953 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 8D02D600C5 for ; Fri, 22 Sep 2017 12:14:30 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 739B72988E for ; Fri, 22 Sep 2017 12:14:30 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 6868729893; Fri, 22 Sep 2017 12:14:30 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id EFEA22988E for ; Fri, 22 Sep 2017 12:14:29 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752356AbdIVMO3 (ORCPT ); Fri, 22 Sep 2017 08:14:29 -0400 Received: from proxima.lasnet.de ([78.47.171.185]:54892 "EHLO proxima.lasnet.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752337AbdIVMO3 (ORCPT ); Fri, 22 Sep 2017 08:14:29 -0400 Received: from work.Speedport_W_724V_09011603_05_010 (pD9F78968.dip0.t-ipconnect.de [217.247.137.104]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) (Authenticated sender: stefan@sostec.de) by proxima.lasnet.de (Postfix) with ESMTPSA id D750CC6772; Fri, 22 Sep 2017 14:14:27 +0200 (CEST) From: Stefan Schmidt To: linux-wpan@vger.kernel.org Cc: Alexander Aring , michael.hennerich@analog.com, h.morris@cascoda.com, linuxdev@cascoda.com, varkabhadram@gmail.com, alan@signal11.us, Stefan Schmidt Subject: [PATCH 13/14] ieee802154: cc2520: switch from BUG_ON() to WARN_ON() on problem Date: Fri, 22 Sep 2017 14:14:04 +0200 Message-Id: <20170922121405.31789-14-stefan@osg.samsung.com> X-Mailer: git-send-email 2.13.5 In-Reply-To: <20170922121405.31789-1-stefan@osg.samsung.com> References: <20170922121405.31789-1-stefan@osg.samsung.com> Sender: linux-wpan-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wpan@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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 --- drivers/net/ieee802154/cc2520.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/net/ieee802154/cc2520.c b/drivers/net/ieee802154/cc2520.c index 735b9f5f9754..0c89d3edf901 100644 --- a/drivers/net/ieee802154/cc2520.c +++ b/drivers/net/ieee802154/cc2520.c @@ -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); @@ -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));