linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] pinctrl: bcm2835: Replace BUG with BUG_ON
@ 2021-06-24  6:49 Jason Wang
  2021-06-24 16:22 ` Florian Fainelli
  2021-07-23 15:47 ` Linus Walleij
  0 siblings, 2 replies; 3+ messages in thread
From: Jason Wang @ 2021-06-24  6:49 UTC (permalink / raw)
  To: linus.walleij
  Cc: nsaenz, f.fainelli, rjui, sbranden, bcm-kernel-feedback-list,
	phil, iivanov, linux-gpio, linux-rpi-kernel, linux-arm-kernel,
	linux-kernel, Jason Wang

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

Signed-off-by: Jason Wang <wangborong@cdjrlc.com>
---
 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();
+	BUG_ON(i == BCM2835_NUM_IRQS);
 
 	chained_irq_enter(host_chip, desc);
 
-- 
2.31.1


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] pinctrl: bcm2835: Replace BUG with BUG_ON
  2021-06-24  6:49 [PATCH] pinctrl: bcm2835: Replace BUG with BUG_ON Jason Wang
@ 2021-06-24 16:22 ` Florian Fainelli
  2021-07-23 15:47 ` Linus Walleij
  1 sibling, 0 replies; 3+ messages in thread
From: Florian Fainelli @ 2021-06-24 16:22 UTC (permalink / raw)
  To: Jason Wang, linus.walleij
  Cc: nsaenz, rjui, sbranden, bcm-kernel-feedback-list, phil, iivanov,
	linux-gpio, linux-rpi-kernel, linux-arm-kernel, linux-kernel

On 6/23/21 11:49 PM, Jason Wang wrote:
> The if condition followed by BUG can be replaced to BUG_ON which is
> more compact and formal in linux source.
> 
> Signed-off-by: Jason Wang <wangborong@cdjrlc.com>

Acked-by: Florian Fainelli <f.fainelli@gmail.com>

Although I would rather completely remove this BUG_ON() and replace it
with a WARN_ON() instead, no need to kill the machine for such a
problem, however unlikely it is to appear.
-- 
Florian

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] pinctrl: bcm2835: Replace BUG with BUG_ON
  2021-06-24  6:49 [PATCH] pinctrl: bcm2835: Replace BUG with BUG_ON Jason Wang
  2021-06-24 16:22 ` Florian Fainelli
@ 2021-07-23 15:47 ` Linus Walleij
  1 sibling, 0 replies; 3+ messages in thread
From: Linus Walleij @ 2021-07-23 15:47 UTC (permalink / raw)
  To: wangborong
  Cc: Nicolas Saenz Julienne, Florian Fainelli, Ray Jui, Scott Branden,
	bcm-kernel-feedback-list, Phil Elwell, Ivan T. Ivanov,
	open list:GPIO SUBSYSTEM, linux-rpi-kernel, Linux ARM,
	linux-kernel

On Thu, Jun 24, 2021 at 8:50 AM Jason Wang <wangborong@cdjrlc.com> wrote:

> The if condition followed by BUG can be replaced to BUG_ON which is
> more compact and formal in linux source.
>
> Signed-off-by: Jason Wang <wangborong@cdjrlc.com>

Patch applied.

Yours,
Linus Walleij

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2021-07-23 15:52 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-06-24  6:49 [PATCH] pinctrl: bcm2835: Replace BUG with BUG_ON Jason Wang
2021-06-24 16:22 ` Florian Fainelli
2021-07-23 15:47 ` Linus Walleij

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).