lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <20250608174235.116424-1-linux@treblig.org>
Date: Sun,  8 Jun 2025 18:42:35 +0100
From: linux@...blig.org
To: akpm@...ux-foundation.org,
	dmitry.osipenko@...labora.com
Cc: linux-kernel@...r.kernel.org,
	"Dr. David Alan Gilbert" <linux@...blig.org>
Subject: [PATCH] reboot: Remove unused unregister_platform_power_off

From: "Dr. David Alan Gilbert" <linux@...blig.org>

unregister_platform_power_off() was added as part of 2022's
commit fb61375ecfba ("kernel/reboot: Add register_platform_power_off()")
but has remained unused.

Remove it.

Note it's a pair with register_platform_power_off() so
seems symmetric; however, I think platforms are chosen
and then stay that way for the boot - so don't
get unregistered.

Signed-off-by: Dr. David Alan Gilbert <linux@...blig.org>
---
 include/linux/reboot.h |  1 -
 kernel/reboot.c        | 16 ----------------
 2 files changed, 17 deletions(-)

diff --git a/include/linux/reboot.h b/include/linux/reboot.h
index aa08c3bbbf59..82c0a373c58c 100644
--- a/include/linux/reboot.h
+++ b/include/linux/reboot.h
@@ -161,7 +161,6 @@ int devm_register_restart_handler(struct device *dev,
 				  void *cb_data);
 
 int register_platform_power_off(void (*power_off)(void));
-void unregister_platform_power_off(void (*power_off)(void));
 
 /*
  * Architecture independent implemenations of sys_reboot commands.
diff --git a/kernel/reboot.c b/kernel/reboot.c
index ec087827c85c..515716afc101 100644
--- a/kernel/reboot.c
+++ b/kernel/reboot.c
@@ -626,22 +626,6 @@ int register_platform_power_off(void (*power_off)(void))
 }
 EXPORT_SYMBOL_GPL(register_platform_power_off);
 
-/**
- *	unregister_platform_power_off - Unregister platform-level power-off callback
- *	@power_off: Power-off callback
- *
- *	Unregisters previously registered platform power-off callback.
- */
-void unregister_platform_power_off(void (*power_off)(void))
-{
-	if (platform_power_off_handler &&
-	    platform_power_off_handler->cb_data == power_off) {
-		unregister_sys_off_handler(platform_power_off_handler);
-		platform_power_off_handler = NULL;
-	}
-}
-EXPORT_SYMBOL_GPL(unregister_platform_power_off);
-
 static int legacy_pm_power_off(struct sys_off_data *data)
 {
 	if (pm_power_off)
-- 
2.49.0


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ