[PATCH v2] pinctrl: bcm2835: Replace BUG with WARN_ON

Jason Wang wangborong at cdjrlc.com
Thu Jun 24 16:51:22 PDT 2021


The if condition followed by BUG can be replaced to WARN_ON which is
more compact and formal in linux source.

Signed-off-by: Jason Wang <wangborong at cdjrlc.com>
---

Changes in v2:
 Accept Florian's advice to replace the BUG_ON() with a WARN_ON().

 drivers/pinctrl/bcm/pinctrl-bcm2835.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/pinctrl/bcm/pinctrl-bcm2835.c b/drivers/pinctrl/bcm/pinctrl-bcm2835.c
index 2c87af1180c4..8440c722f6f8 100644
--- a/drivers/pinctrl/bcm/pinctrl-bcm2835.c
+++ b/drivers/pinctrl/bcm/pinctrl-bcm2835.c
@@ -416,8 +416,7 @@ static void bcm2835_gpio_irq_handler(struct irq_desc *desc)
 		}
 	}
 	/* This should not happen, every IRQ has a bank */
-	if (i == BCM2835_NUM_IRQS)
-		BUG();
+	WARN_ON(i == BCM2835_NUM_IRQS);
 
 	chained_irq_enter(host_chip, desc);
 
-- 
2.31.1




More information about the linux-arm-kernel mailing list