MIPS: SGI-IP27: use WARN_ON() output
authorYury Norov <yury.norov@gmail.com>
Tue, 16 Apr 2024 17:37:11 +0000 (10:37 -0700)
committerThomas Bogendoerfer <tsbogend@alpha.franken.de>
Fri, 3 May 2024 12:22:04 +0000 (14:22 +0200)
WARN_ON() propagates the result of conditional expression, and it can be
used to return early in the following expression in the arch_init_irq().

This is a no-op cleanup, except that compiler may optimize the error paths
better because WARN_ON() implies 'unlikely()'.

Signed-off-by: Yury Norov <yury.norov@gmail.com>
Signed-off-by: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
arch/mips/sgi-ip27/ip27-irq.c

index d8acdf0439d27a37f270bbe1aacff6a9661d2d02..00e63e9ef61d8a477ae9935491c038549bab08da 100644 (file)
@@ -289,13 +289,12 @@ void __init arch_init_irq(void)
        bitmap_set(hub_irq_map, NI_BRDCAST_ERR_A, MSC_PANIC_INTR - NI_BRDCAST_ERR_A + 1);
 
        fn = irq_domain_alloc_named_fwnode("HUB");
-       WARN_ON(fn == NULL);
-       if (!fn)
+       if (WARN_ON(fn == NULL))
                return;
+
        domain = irq_domain_create_linear(fn, IP27_HUB_IRQ_COUNT,
                                          &hub_domain_ops, NULL);
-       WARN_ON(domain == NULL);
-       if (!domain)
+       if (WARN_ON(domain == NULL))
                return;
 
        irq_set_default_host(domain);