[PATCH v0 37/42] sparc: Check notifier registration return value

From: Borislav Petkov
Date: Mon Nov 08 2021 - 05:15:14 EST


From: Borislav Petkov <bp@xxxxxxx>

Avoid homegrown notifier registration checks.

No functional changes.

Signed-off-by: Borislav Petkov <bp@xxxxxxx>
Cc: sparclinux@xxxxxxxxxxxxxxx
---
arch/sparc/kernel/sstate.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/arch/sparc/kernel/sstate.c b/arch/sparc/kernel/sstate.c
index 3bcc4ddc6911..4e29e8977609 100644
--- a/arch/sparc/kernel/sstate.c
+++ b/arch/sparc/kernel/sstate.c
@@ -106,8 +106,10 @@ static int __init sstate_init(void)

do_set_sstate(HV_SOFT_STATE_TRANSITION, booting_msg);

- atomic_notifier_chain_register(&panic_notifier_list,
- &sstate_panic_block);
+ if (atomic_notifier_chain_register(&panic_notifier_list,
+ &sstate_panic_block))
+ pr_warn("Soft state panic notifier already registered\n");
+
register_reboot_notifier(&sstate_reboot_notifier);

return 0;
--
2.29.2