[PATCH 09/15] x86/APM: remove APM_BIOS_MAGIC

From: наб
Date: Wed Oct 26 2022 - 18:44:06 EST


We have largely moved away from this approach,
and we have better debugging instrumentation nowadays: kill it

Ref: https://lore.kernel.org/linux-doc/YyMlovoskUcHLEb7@xxxxxxxxx/
Signed-off-by: Ahelenia Ziemiańska <nabijaczleweli@xxxxxxxxxxxxxxxxxx>
---
Documentation/process/magic-number.rst | 1 -
.../translations/it_IT/process/magic-number.rst | 1 -
.../translations/zh_CN/process/magic-number.rst | 1 -
.../translations/zh_TW/process/magic-number.rst | 1 -
arch/x86/kernel/apm_32.c | 9 +--------
5 files changed, 1 insertion(+), 12 deletions(-)

diff --git a/Documentation/process/magic-number.rst b/Documentation/process/magic-number.rst
index d8ffbc21872e..77a96a79c7e8 100644
--- a/Documentation/process/magic-number.rst
+++ b/Documentation/process/magic-number.rst
@@ -68,7 +68,6 @@ Changelog::
===================== ================ ======================== ==========================================
Magic Name Number Structure File
===================== ================ ======================== ==========================================
-APM_BIOS_MAGIC 0x4101 apm_user ``arch/x86/kernel/apm_32.c``
FASYNC_MAGIC 0x4601 fasync_struct ``include/linux/fs.h``
SLIP_MAGIC 0x5302 slip ``drivers/net/slip.h``
HDLCDRV_MAGIC 0x5ac6e778 hdlcdrv_state ``include/linux/hdlcdrv.h``
diff --git a/Documentation/translations/it_IT/process/magic-number.rst b/Documentation/translations/it_IT/process/magic-number.rst
index 0e59704aa617..ef509265a3df 100644
--- a/Documentation/translations/it_IT/process/magic-number.rst
+++ b/Documentation/translations/it_IT/process/magic-number.rst
@@ -74,7 +74,6 @@ Registro dei cambiamenti::
===================== ================ ======================== ==========================================
Nome magico Numero Struttura File
===================== ================ ======================== ==========================================
-APM_BIOS_MAGIC 0x4101 apm_user ``arch/x86/kernel/apm_32.c``
FASYNC_MAGIC 0x4601 fasync_struct ``include/linux/fs.h``
SLIP_MAGIC 0x5302 slip ``drivers/net/slip.h``
HDLCDRV_MAGIC 0x5ac6e778 hdlcdrv_state ``include/linux/hdlcdrv.h``
diff --git a/Documentation/translations/zh_CN/process/magic-number.rst b/Documentation/translations/zh_CN/process/magic-number.rst
index 17a73661ef17..6437c408dd67 100644
--- a/Documentation/translations/zh_CN/process/magic-number.rst
+++ b/Documentation/translations/zh_CN/process/magic-number.rst
@@ -57,7 +57,6 @@ Linux 魔术数
===================== ================ ======================== ==========================================
魔术数名 数字 结构 文件
===================== ================ ======================== ==========================================
-APM_BIOS_MAGIC 0x4101 apm_user ``arch/x86/kernel/apm_32.c``
FASYNC_MAGIC 0x4601 fasync_struct ``include/linux/fs.h``
SLIP_MAGIC 0x5302 slip ``drivers/net/slip.h``
HDLCDRV_MAGIC 0x5ac6e778 hdlcdrv_state ``include/linux/hdlcdrv.h``
diff --git a/Documentation/translations/zh_TW/process/magic-number.rst b/Documentation/translations/zh_TW/process/magic-number.rst
index 9d44d49b93bf..453cc205e6c3 100644
--- a/Documentation/translations/zh_TW/process/magic-number.rst
+++ b/Documentation/translations/zh_TW/process/magic-number.rst
@@ -60,7 +60,6 @@ Linux 魔術數
===================== ================ ======================== ==========================================
魔術數名 數字 結構 文件
===================== ================ ======================== ==========================================
-APM_BIOS_MAGIC 0x4101 apm_user ``arch/x86/kernel/apm_32.c``
FASYNC_MAGIC 0x4601 fasync_struct ``include/linux/fs.h``
SLIP_MAGIC 0x5302 slip ``drivers/net/slip.h``
HDLCDRV_MAGIC 0x5ac6e778 hdlcdrv_state ``include/linux/hdlcdrv.h``
diff --git a/arch/x86/kernel/apm_32.c b/arch/x86/kernel/apm_32.c
index 60e330cdbd17..f3dd21dc56b7 100644
--- a/arch/x86/kernel/apm_32.c
+++ b/arch/x86/kernel/apm_32.c
@@ -330,7 +330,6 @@ extern int (*console_blank_hook)(int);
* The per-file APM data
*/
struct apm_user {
- int magic;
struct apm_user *next;
unsigned int suser: 1;
unsigned int writer: 1;
@@ -346,11 +345,6 @@ struct apm_user {
apm_event_t events[APM_MAX_EVENTS];
};

-/*
- * The magic number in apm_user
- */
-#define APM_BIOS_MAGIC 0x4101
-
/*
* idle percentage above which bios idle calls are done
*/
@@ -1459,7 +1453,7 @@ static void apm_mainloop(void)

static int check_apm_user(struct apm_user *as, const char *func)
{
- if (as == NULL || as->magic != APM_BIOS_MAGIC) {
+ if (as == NULL) {
pr_err("%s passed bad filp\n", func);
return 1;
}
@@ -1616,7 +1610,6 @@ static int do_open(struct inode *inode, struct file *filp)
if (as == NULL)
return -ENOMEM;

- as->magic = APM_BIOS_MAGIC;
as->event_tail = as->event_head = 0;
as->suspends_pending = as->standbys_pending = 0;
as->suspends_read = as->standbys_read = 0;
--
2.30.2

Attachment: signature.asc
Description: PGP signature