diff mbox series

[v0,31/42] parisc: Check notifier registration return value

Message ID 20211108101157.15189-32-bp@alien8.de (mailing list archive)
State Not Applicable
Headers show
Series None | expand

Commit Message

Borislav Petkov Nov. 8, 2021, 10:11 a.m. UTC
From: Borislav Petkov <bp@suse.de>

Avoid homegrown notifier registration checks.

No functional changes.

Signed-off-by: Borislav Petkov <bp@suse.de>
Cc: linux-parisc@vger.kernel.org
---
 arch/parisc/kernel/pdc_chassis.c | 5 +++--
 drivers/parisc/power.c           | 5 +++--
 2 files changed, 6 insertions(+), 4 deletions(-)
diff mbox series

Patch

diff --git a/arch/parisc/kernel/pdc_chassis.c b/arch/parisc/kernel/pdc_chassis.c
index da154406d368..8bedc9faa791 100644
--- a/arch/parisc/kernel/pdc_chassis.c
+++ b/arch/parisc/kernel/pdc_chassis.c
@@ -135,8 +135,9 @@  void __init parisc_pdc_chassis_init(void)
 				PDC_CHASSIS_VER);
 
 		/* initialize panic notifier chain */
-		atomic_notifier_chain_register(&panic_notifier_list,
-				&pdc_chassis_panic_block);
+		if (atomic_notifier_chain_register(&panic_notifier_list,
+						   &pdc_chassis_panic_block))
+			printk(KERN_WARNING "Panic notifier already registered\n");
 
 		/* initialize reboot notifier chain */
 		register_reboot_notifier(&pdc_chassis_reboot_block);
diff --git a/drivers/parisc/power.c b/drivers/parisc/power.c
index 456776bd8ee6..26dabaa1e5f8 100644
--- a/drivers/parisc/power.c
+++ b/drivers/parisc/power.c
@@ -230,8 +230,9 @@  static int __init power_init(void)
 	}
 
 	/* Register a call for panic conditions. */
-	atomic_notifier_chain_register(&panic_notifier_list,
-			&parisc_panic_block);
+
+	if (atomic_notifier_chain_register(&panic_notifier_list, &parisc_panic_block))
+		pr_warn("Panic notifier already registered\n");
 
 	return 0;
 }