[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20230408140122.25293-4-pali@kernel.org>
Date: Sat, 8 Apr 2023 16:01:12 +0200
From: Pali Rohár <pali@...nel.org>
To: Michael Ellerman <mpe@...erman.id.au>,
Christophe Leroy <christophe.leroy@...roup.eu>,
Nicholas Piggin <npiggin@...il.com>
Cc: linuxppc-dev@...ts.ozlabs.org, linux-kernel@...r.kernel.org
Subject: [PATCH v5 03/13] powerpc/85xx: mpc85xx_{ds/rdb} replace BUG_ON() by WARN_ON()
From: Christophe Leroy <christophe.leroy@...roup.eu>
No need to BUG() in case mpic_alloc() fails. Use WARN_ON().
Signed-off-by: Christophe Leroy <christophe.leroy@...roup.eu>
Signed-off-by: Pali Rohár <pali@...nel.org>
---
arch/powerpc/platforms/85xx/mpc85xx_ds.c | 4 +++-
arch/powerpc/platforms/85xx/mpc85xx_rdb.c | 4 +++-
2 files changed, 6 insertions(+), 2 deletions(-)
diff --git a/arch/powerpc/platforms/85xx/mpc85xx_ds.c b/arch/powerpc/platforms/85xx/mpc85xx_ds.c
index c6016915264c..98cca1102e0b 100644
--- a/arch/powerpc/platforms/85xx/mpc85xx_ds.c
+++ b/arch/powerpc/platforms/85xx/mpc85xx_ds.c
@@ -62,7 +62,9 @@ void __init mpc85xx_ds_pic_init(void)
mpic = mpic_alloc(NULL, 0, flags, 0, 256, " OpenPIC ");
- BUG_ON(mpic == NULL);
+ if (WARN_ON(!mpic))
+ return;
+
mpic_init(mpic);
#ifdef CONFIG_PPC_I8259
diff --git a/arch/powerpc/platforms/85xx/mpc85xx_rdb.c b/arch/powerpc/platforms/85xx/mpc85xx_rdb.c
index c7ce8a79992d..a802053b37b3 100644
--- a/arch/powerpc/platforms/85xx/mpc85xx_rdb.c
+++ b/arch/powerpc/platforms/85xx/mpc85xx_rdb.c
@@ -39,7 +39,9 @@ void __init mpc85xx_rdb_pic_init(void)
mpic = mpic_alloc(NULL, 0, flags, 0, 256, " OpenPIC ");
- BUG_ON(mpic == NULL);
+ if (WARN_ON(!mpic))
+ return;
+
mpic_init(mpic);
}
--
2.20.1
Powered by blists - more mailing lists