Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

x86/apm_32: Remove dead function apm_get_battery_status()

This part was commented out 25 years ago in:

commit d43c43b46ebfdb437b78206fcc1992c4d2e8c15e
Author: linus1 <torvalds@linuxfoundation.org>
Date: Tue Sep 7 11:00:00 1999 -0600

Import 2.3.26pre1

and probably no one knows why. Probably it was unused even then.

Just remove it.

[ bp: Expand commit message. ]

Signed-off-by: Kunwu Chan <chentao@kylinos.cn>
Signed-off-by: Borislav Petkov (AMD) <bp@alien8.de>
Link: https://lore.kernel.org/r/20240126030824.579711-1-chentao@kylinos.cn

authored by

Kunwu Chan and committed by
Borislav Petkov (AMD)
e37ae643 7d4002e8

-29
-29
arch/x86/kernel/apm_32.c
··· 1055 1055 return APM_SUCCESS; 1056 1056 } 1057 1057 1058 - #if 0 1059 - static int apm_get_battery_status(u_short which, u_short *status, 1060 - u_short *bat, u_short *life, u_short *nbat) 1061 - { 1062 - u32 eax; 1063 - u32 ebx; 1064 - u32 ecx; 1065 - u32 edx; 1066 - u32 esi; 1067 - 1068 - if (apm_info.connection_version < 0x0102) { 1069 - /* pretend we only have one battery. */ 1070 - if (which != 1) 1071 - return APM_BAD_DEVICE; 1072 - *nbat = 1; 1073 - return apm_get_power_status(status, bat, life); 1074 - } 1075 - 1076 - if (apm_bios_call(APM_FUNC_GET_STATUS, (0x8000 | (which)), 0, &eax, 1077 - &ebx, &ecx, &edx, &esi)) 1078 - return (eax >> 8) & 0xff; 1079 - *status = ebx; 1080 - *bat = ecx; 1081 - *life = edx; 1082 - *nbat = esi; 1083 - return APM_SUCCESS; 1084 - } 1085 - #endif 1086 - 1087 1058 /** 1088 1059 * apm_engage_power_management - enable PM on a device 1089 1060 * @device: identity of device