[<prev] [next>] [day] [month] [year] [list]
Message-ID: <ba3nzxffdpuz2eo5kbpm5iez2rcdves3qpd4kvnmshxwjburwo@tarta.nabijaczleweli.xyz>
Date: Fri, 17 Oct 2025 00:05:10 +0200
From:
Ahelenia Ziemiańska <nabijaczleweli@...ijaczleweli.xyz>
To: Jiri Kosina <jikos@...nel.org>, Arnd Bergmann <arnd@...db.de>,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>, linux-kernel@...r.kernel.org
Subject: [PATCH] apm-emulation: remove unused __apm_get_power_status
The API for apm_get_power_status is "call it if it isn't NULL",
except it's also initialised with a no-op __apm_get_power_status.
This was added alongside apm_get_power_status in 2007.
The apm_get_power_status symbol is used in these files:
arch/arm/mach-pxa/sharpsl_pm.c:extern void (*apm_get_power_status)(struct apm_power_info *);
arch/arm/mach-pxa/sharpsl_pm.c: apm_get_power_status = sharpsl_apm_get_power_status;
arch/sh/boards/mach-hp6xx/hp6xx_apm.c: apm_get_power_status = hp6x0_apm_get_power_status;
drivers/char/apm-emulation.c:void (*apm_get_power_status)(struct apm_power_info *) = __apm_get_power_status;
drivers/char/apm-emulation.c:EXPORT_SYMBOL(apm_get_power_status);
drivers/char/apm-emulation.c: if (apm_get_power_status)
drivers/char/apm-emulation.c: apm_get_power_status(&info);
drivers/macintosh/apm_emu.c: apm_get_power_status = pmu_apm_get_power_status;
drivers/macintosh/apm_emu.c: if (apm_get_power_status == pmu_apm_get_power_status)
drivers/macintosh/apm_emu.c: apm_get_power_status = NULL;
drivers/power/supply/apm_power.c: apm_get_power_status = apm_battery_apm_get_power_status;
drivers/power/supply/apm_power.c: apm_get_power_status = NULL;
include/linux/apm-emulation.h:extern void (*apm_get_power_status)(struct apm_power_info *);
All of them are compatible with the API (post-remove UAFs notwithstanding)
and don't even read it except to compare with their own values;
on a cursory glance this doesn't seem to have ever not been the case.
Fixes: 7726942fb15e ("[APM] Add shared version of APM emulation")
Signed-off-by: Ahelenia Ziemiańska <nabijaczleweli@...ijaczleweli.xyz>
---
drivers/char/apm-emulation.c | 10 +---------
1 file changed, 1 insertion(+), 9 deletions(-)
diff --git a/drivers/char/apm-emulation.c b/drivers/char/apm-emulation.c
index 53ce352f7197..4aa5d1c76f83 100644
--- a/drivers/char/apm-emulation.c
+++ b/drivers/char/apm-emulation.c
@@ -142,18 +142,10 @@ static struct apm_queue kapmd_queue;
static DEFINE_MUTEX(state_lock);
-/*
- * Compatibility cruft until the IPAQ people move over to the new
- * interface.
- */
-static void __apm_get_power_status(struct apm_power_info *info)
-{
-}
-
/*
* This allows machines to provide their own "apm get power status" function.
*/
-void (*apm_get_power_status)(struct apm_power_info *) = __apm_get_power_status;
+void (*apm_get_power_status)(struct apm_power_info *);
EXPORT_SYMBOL(apm_get_power_status);
--
2.39.5
Download attachment "signature.asc" of type "application/pgp-signature" (834 bytes)
Powered by blists - more mailing lists