summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2019-07-08 20:27:24 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2019-07-08 20:27:24 -0400
commit5b7a2095232d026d4537c4be54040c0f10525b5b (patch)
treef32d424a4e78004d2a34bc63f13f66dd6ce94a0b
parent6cfcdad7630de2b2eb09740bdc6ee921de8c785e (diff)
parent53b7607382b0b99d6ae1ef5b1b0fa042b00ac7f4 (diff)
Merge branch 'x86-cleanups-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip
Pull x86 cleanups from Ingo Molnar: "Misc small cleanups: removal of superfluous code and coding style cleanups mostly" * 'x86-cleanups-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: x86/kexec: Make variable static and config dependent x86/defconfigs: Remove useless UEVENT_HELPER_PATH x86/amd_nb: Make hygon_nb_misc_ids static x86/tsc: Move inline keyword to the beginning of function declarations x86/io_delay: Define IO_DELAY macros in C instead of Kconfig x86/io_delay: Break instead of fallthrough in switch statement
-rw-r--r--arch/x86/Kconfig.debug44
-rw-r--r--arch/x86/configs/i386_defconfig1
-rw-r--r--arch/x86/configs/x86_64_defconfig1
-rw-r--r--arch/x86/kernel/amd_nb.c2
-rw-r--r--arch/x86/kernel/crash.c4
-rw-r--r--arch/x86/kernel/io_delay.c38
-rw-r--r--arch/x86/kernel/tsc.c4
7 files changed, 33 insertions, 61 deletions
diff --git a/arch/x86/Kconfig.debug b/arch/x86/Kconfig.debug
index f730680dc818..6791a3c97589 100644
--- a/arch/x86/Kconfig.debug
+++ b/arch/x86/Kconfig.debug
@@ -179,26 +179,6 @@ config X86_DECODER_SELFTEST
179 decoder code. 179 decoder code.
180 If unsure, say "N". 180 If unsure, say "N".
181 181
182#
183# IO delay types:
184#
185
186config IO_DELAY_TYPE_0X80
187 int
188 default "0"
189
190config IO_DELAY_TYPE_0XED
191 int
192 default "1"
193
194config IO_DELAY_TYPE_UDELAY
195 int
196 default "2"
197
198config IO_DELAY_TYPE_NONE
199 int
200 default "3"
201
202choice 182choice
203 prompt "IO delay type" 183 prompt "IO delay type"
204 default IO_DELAY_0X80 184 default IO_DELAY_0X80
@@ -229,30 +209,6 @@ config IO_DELAY_NONE
229 209
230endchoice 210endchoice
231 211
232if IO_DELAY_0X80
233config DEFAULT_IO_DELAY_TYPE
234 int
235 default IO_DELAY_TYPE_0X80
236endif
237
238if IO_DELAY_0XED
239config DEFAULT_IO_DELAY_TYPE
240 int
241 default IO_DELAY_TYPE_0XED
242endif
243
244if IO_DELAY_UDELAY
245config DEFAULT_IO_DELAY_TYPE
246 int
247 default IO_DELAY_TYPE_UDELAY
248endif
249
250if IO_DELAY_NONE
251config DEFAULT_IO_DELAY_TYPE
252 int
253 default IO_DELAY_TYPE_NONE
254endif
255
256config DEBUG_BOOT_PARAMS 212config DEBUG_BOOT_PARAMS
257 bool "Debug boot parameters" 213 bool "Debug boot parameters"
258 depends on DEBUG_KERNEL 214 depends on DEBUG_KERNEL
diff --git a/arch/x86/configs/i386_defconfig b/arch/x86/configs/i386_defconfig
index 2b2481acc661..59ce9ed58430 100644
--- a/arch/x86/configs/i386_defconfig
+++ b/arch/x86/configs/i386_defconfig
@@ -130,7 +130,6 @@ CONFIG_CFG80211=y
130CONFIG_MAC80211=y 130CONFIG_MAC80211=y
131CONFIG_MAC80211_LEDS=y 131CONFIG_MAC80211_LEDS=y
132CONFIG_RFKILL=y 132CONFIG_RFKILL=y
133CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"
134CONFIG_DEVTMPFS=y 133CONFIG_DEVTMPFS=y
135CONFIG_DEVTMPFS_MOUNT=y 134CONFIG_DEVTMPFS_MOUNT=y
136CONFIG_DEBUG_DEVRES=y 135CONFIG_DEBUG_DEVRES=y
diff --git a/arch/x86/configs/x86_64_defconfig b/arch/x86/configs/x86_64_defconfig
index e8829abf063a..d0a5ffeae8df 100644
--- a/arch/x86/configs/x86_64_defconfig
+++ b/arch/x86/configs/x86_64_defconfig
@@ -129,7 +129,6 @@ CONFIG_CFG80211=y
129CONFIG_MAC80211=y 129CONFIG_MAC80211=y
130CONFIG_MAC80211_LEDS=y 130CONFIG_MAC80211_LEDS=y
131CONFIG_RFKILL=y 131CONFIG_RFKILL=y
132CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"
133CONFIG_DEVTMPFS=y 132CONFIG_DEVTMPFS=y
134CONFIG_DEVTMPFS_MOUNT=y 133CONFIG_DEVTMPFS_MOUNT=y
135CONFIG_DEBUG_DEVRES=y 134CONFIG_DEBUG_DEVRES=y
diff --git a/arch/x86/kernel/amd_nb.c b/arch/x86/kernel/amd_nb.c
index 002aedc69393..d63e63b7d1d9 100644
--- a/arch/x86/kernel/amd_nb.c
+++ b/arch/x86/kernel/amd_nb.c
@@ -72,7 +72,7 @@ static const struct pci_device_id hygon_root_ids[] = {
72 {} 72 {}
73}; 73};
74 74
75const struct pci_device_id hygon_nb_misc_ids[] = { 75static const struct pci_device_id hygon_nb_misc_ids[] = {
76 { PCI_DEVICE(PCI_VENDOR_ID_HYGON, PCI_DEVICE_ID_AMD_17H_DF_F3) }, 76 { PCI_DEVICE(PCI_VENDOR_ID_HYGON, PCI_DEVICE_ID_AMD_17H_DF_F3) },
77 {} 77 {}
78}; 78};
diff --git a/arch/x86/kernel/crash.c b/arch/x86/kernel/crash.c
index 84e2d3ddd0eb..a55094b5f452 100644
--- a/arch/x86/kernel/crash.c
+++ b/arch/x86/kernel/crash.c
@@ -56,7 +56,6 @@ struct crash_memmap_data {
56 */ 56 */
57crash_vmclear_fn __rcu *crash_vmclear_loaded_vmcss = NULL; 57crash_vmclear_fn __rcu *crash_vmclear_loaded_vmcss = NULL;
58EXPORT_SYMBOL_GPL(crash_vmclear_loaded_vmcss); 58EXPORT_SYMBOL_GPL(crash_vmclear_loaded_vmcss);
59unsigned long crash_zero_bytes;
60 59
61static inline void cpu_crash_vmclear_loaded_vmcss(void) 60static inline void cpu_crash_vmclear_loaded_vmcss(void)
62{ 61{
@@ -173,6 +172,9 @@ void native_machine_crash_shutdown(struct pt_regs *regs)
173} 172}
174 173
175#ifdef CONFIG_KEXEC_FILE 174#ifdef CONFIG_KEXEC_FILE
175
176static unsigned long crash_zero_bytes;
177
176static int get_nr_ram_ranges_callback(struct resource *res, void *arg) 178static int get_nr_ram_ranges_callback(struct resource *res, void *arg)
177{ 179{
178 unsigned int *nr_ranges = arg; 180 unsigned int *nr_ranges = arg;
diff --git a/arch/x86/kernel/io_delay.c b/arch/x86/kernel/io_delay.c
index 805b7a341aca..fdb6506ceaaa 100644
--- a/arch/x86/kernel/io_delay.c
+++ b/arch/x86/kernel/io_delay.c
@@ -13,7 +13,22 @@
13#include <linux/dmi.h> 13#include <linux/dmi.h>
14#include <linux/io.h> 14#include <linux/io.h>
15 15
16int io_delay_type __read_mostly = CONFIG_DEFAULT_IO_DELAY_TYPE; 16#define IO_DELAY_TYPE_0X80 0
17#define IO_DELAY_TYPE_0XED 1
18#define IO_DELAY_TYPE_UDELAY 2
19#define IO_DELAY_TYPE_NONE 3
20
21#if defined(CONFIG_IO_DELAY_0X80)
22#define DEFAULT_IO_DELAY_TYPE IO_DELAY_TYPE_0X80
23#elif defined(CONFIG_IO_DELAY_0XED)
24#define DEFAULT_IO_DELAY_TYPE IO_DELAY_TYPE_0XED
25#elif defined(CONFIG_IO_DELAY_UDELAY)
26#define DEFAULT_IO_DELAY_TYPE IO_DELAY_TYPE_UDELAY
27#elif defined(CONFIG_IO_DELAY_NONE)
28#define DEFAULT_IO_DELAY_TYPE IO_DELAY_TYPE_NONE
29#endif
30
31int io_delay_type __read_mostly = DEFAULT_IO_DELAY_TYPE;
17 32
18static int __initdata io_delay_override; 33static int __initdata io_delay_override;
19 34
@@ -24,13 +39,13 @@ void native_io_delay(void)
24{ 39{
25 switch (io_delay_type) { 40 switch (io_delay_type) {
26 default: 41 default:
27 case CONFIG_IO_DELAY_TYPE_0X80: 42 case IO_DELAY_TYPE_0X80:
28 asm volatile ("outb %al, $0x80"); 43 asm volatile ("outb %al, $0x80");
29 break; 44 break;
30 case CONFIG_IO_DELAY_TYPE_0XED: 45 case IO_DELAY_TYPE_0XED:
31 asm volatile ("outb %al, $0xed"); 46 asm volatile ("outb %al, $0xed");
32 break; 47 break;
33 case CONFIG_IO_DELAY_TYPE_UDELAY: 48 case IO_DELAY_TYPE_UDELAY:
34 /* 49 /*
35 * 2 usecs is an upper-bound for the outb delay but 50 * 2 usecs is an upper-bound for the outb delay but
36 * note that udelay doesn't have the bus-level 51 * note that udelay doesn't have the bus-level
@@ -39,7 +54,8 @@ void native_io_delay(void)
39 * are shorter until calibrated): 54 * are shorter until calibrated):
40 */ 55 */
41 udelay(2); 56 udelay(2);
42 case CONFIG_IO_DELAY_TYPE_NONE: 57 break;
58 case IO_DELAY_TYPE_NONE:
43 break; 59 break;
44 } 60 }
45} 61}
@@ -47,9 +63,9 @@ EXPORT_SYMBOL(native_io_delay);
47 63
48static int __init dmi_io_delay_0xed_port(const struct dmi_system_id *id) 64static int __init dmi_io_delay_0xed_port(const struct dmi_system_id *id)
49{ 65{
50 if (io_delay_type == CONFIG_IO_DELAY_TYPE_0X80) { 66 if (io_delay_type == IO_DELAY_TYPE_0X80) {
51 pr_notice("%s: using 0xed I/O delay port\n", id->ident); 67 pr_notice("%s: using 0xed I/O delay port\n", id->ident);
52 io_delay_type = CONFIG_IO_DELAY_TYPE_0XED; 68 io_delay_type = IO_DELAY_TYPE_0XED;
53 } 69 }
54 70
55 return 0; 71 return 0;
@@ -115,13 +131,13 @@ static int __init io_delay_param(char *s)
115 return -EINVAL; 131 return -EINVAL;
116 132
117 if (!strcmp(s, "0x80")) 133 if (!strcmp(s, "0x80"))
118 io_delay_type = CONFIG_IO_DELAY_TYPE_0X80; 134 io_delay_type = IO_DELAY_TYPE_0X80;
119 else if (!strcmp(s, "0xed")) 135 else if (!strcmp(s, "0xed"))
120 io_delay_type = CONFIG_IO_DELAY_TYPE_0XED; 136 io_delay_type = IO_DELAY_TYPE_0XED;
121 else if (!strcmp(s, "udelay")) 137 else if (!strcmp(s, "udelay"))
122 io_delay_type = CONFIG_IO_DELAY_TYPE_UDELAY; 138 io_delay_type = IO_DELAY_TYPE_UDELAY;
123 else if (!strcmp(s, "none")) 139 else if (!strcmp(s, "none"))
124 io_delay_type = CONFIG_IO_DELAY_TYPE_NONE; 140 io_delay_type = IO_DELAY_TYPE_NONE;
125 else 141 else
126 return -EINVAL; 142 return -EINVAL;
127 143
diff --git a/arch/x86/kernel/tsc.c b/arch/x86/kernel/tsc.c
index 59b57605e66c..57d87f79558f 100644
--- a/arch/x86/kernel/tsc.c
+++ b/arch/x86/kernel/tsc.c
@@ -59,7 +59,7 @@ struct cyc2ns {
59 59
60static DEFINE_PER_CPU_ALIGNED(struct cyc2ns, cyc2ns); 60static DEFINE_PER_CPU_ALIGNED(struct cyc2ns, cyc2ns);
61 61
62void __always_inline cyc2ns_read_begin(struct cyc2ns_data *data) 62__always_inline void cyc2ns_read_begin(struct cyc2ns_data *data)
63{ 63{
64 int seq, idx; 64 int seq, idx;
65 65
@@ -76,7 +76,7 @@ void __always_inline cyc2ns_read_begin(struct cyc2ns_data *data)
76 } while (unlikely(seq != this_cpu_read(cyc2ns.seq.sequence))); 76 } while (unlikely(seq != this_cpu_read(cyc2ns.seq.sequence)));
77} 77}
78 78
79void __always_inline cyc2ns_read_end(void) 79__always_inline void cyc2ns_read_end(void)
80{ 80{
81 preempt_enable_notrace(); 81 preempt_enable_notrace();
82} 82}