hc
2024-02-20 102a0743326a03cd1a1202ceda21e175b7d3575c
kernel/arch/x86/kernel/check.c
....@@ -1,4 +1,7 @@
11 // SPDX-License-Identifier: GPL-2.0
2
+
3
+#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
4
+
25 #include <linux/init.h>
36 #include <linux/sched.h>
47 #include <linux/kthread.h>
....@@ -6,6 +9,7 @@
69 #include <linux/memblock.h>
710
811 #include <asm/proto.h>
12
+#include <asm/setup.h>
913
1014 /*
1115 * Some BIOSes seem to corrupt the low 64k of memory during events
....@@ -41,6 +45,7 @@
4145 return ret;
4246
4347 memory_corruption_check = val;
48
+
4449 return 0;
4550 }
4651 early_param("memory_corruption_check", set_corruption_check);
....@@ -128,11 +133,11 @@
128133 }
129134
130135 if (num_scan_areas)
131
- printk(KERN_INFO "Scanning %d areas for low memory corruption\n", num_scan_areas);
136
+ pr_info("Scanning %d areas for low memory corruption\n", num_scan_areas);
132137 }
133138
134139
135
-void check_for_bios_corruption(void)
140
+static void check_for_bios_corruption(void)
136141 {
137142 int i;
138143 int corruption = 0;
....@@ -147,8 +152,7 @@
147152 for (; size; addr++, size -= sizeof(unsigned long)) {
148153 if (!*addr)
149154 continue;
150
- printk(KERN_ERR "Corrupted low memory at %p (%lx phys) = %08lx\n",
151
- addr, __pa(addr), *addr);
155
+ pr_err("Corrupted low memory at %p (%lx phys) = %08lx\n", addr, __pa(addr), *addr);
152156 corruption = 1;
153157 *addr = 0;
154158 }
....@@ -172,11 +176,11 @@
172176 if (!num_scan_areas || !memory_corruption_check || corruption_check_period == 0)
173177 return 0;
174178
175
- printk(KERN_INFO "Scanning for low memory corruption every %d seconds\n",
176
- corruption_check_period);
179
+ pr_info("Scanning for low memory corruption every %d seconds\n", corruption_check_period);
177180
178181 /* First time we run the checks right away */
179182 schedule_delayed_work(&bios_check_work, 0);
183
+
180184 return 0;
181185 }
182186 device_initcall(start_periodic_check_for_corruption);