Skip to content

Commit 5b7a209

Browse files
committed
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
2 parents 6cfcdad + 53b7607 commit 5b7a209

File tree

7 files changed

+33
-61
lines changed

7 files changed

+33
-61
lines changed

arch/x86/Kconfig.debug

Lines changed: 0 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -179,26 +179,6 @@ config X86_DECODER_SELFTEST
179179
decoder code.
180180
If unsure, say "N".
181181

182-
#
183-
# IO delay types:
184-
#
185-
186-
config IO_DELAY_TYPE_0X80
187-
int
188-
default "0"
189-
190-
config IO_DELAY_TYPE_0XED
191-
int
192-
default "1"
193-
194-
config IO_DELAY_TYPE_UDELAY
195-
int
196-
default "2"
197-
198-
config IO_DELAY_TYPE_NONE
199-
int
200-
default "3"
201-
202182
choice
203183
prompt "IO delay type"
204184
default IO_DELAY_0X80
@@ -229,30 +209,6 @@ config IO_DELAY_NONE
229209

230210
endchoice
231211

232-
if IO_DELAY_0X80
233-
config DEFAULT_IO_DELAY_TYPE
234-
int
235-
default IO_DELAY_TYPE_0X80
236-
endif
237-
238-
if IO_DELAY_0XED
239-
config DEFAULT_IO_DELAY_TYPE
240-
int
241-
default IO_DELAY_TYPE_0XED
242-
endif
243-
244-
if IO_DELAY_UDELAY
245-
config DEFAULT_IO_DELAY_TYPE
246-
int
247-
default IO_DELAY_TYPE_UDELAY
248-
endif
249-
250-
if IO_DELAY_NONE
251-
config DEFAULT_IO_DELAY_TYPE
252-
int
253-
default IO_DELAY_TYPE_NONE
254-
endif
255-
256212
config DEBUG_BOOT_PARAMS
257213
bool "Debug boot parameters"
258214
depends on DEBUG_KERNEL

arch/x86/configs/i386_defconfig

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,6 @@ CONFIG_CFG80211=y
130130
CONFIG_MAC80211=y
131131
CONFIG_MAC80211_LEDS=y
132132
CONFIG_RFKILL=y
133-
CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"
134133
CONFIG_DEVTMPFS=y
135134
CONFIG_DEVTMPFS_MOUNT=y
136135
CONFIG_DEBUG_DEVRES=y

arch/x86/configs/x86_64_defconfig

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,6 @@ CONFIG_CFG80211=y
129129
CONFIG_MAC80211=y
130130
CONFIG_MAC80211_LEDS=y
131131
CONFIG_RFKILL=y
132-
CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"
133132
CONFIG_DEVTMPFS=y
134133
CONFIG_DEVTMPFS_MOUNT=y
135134
CONFIG_DEBUG_DEVRES=y

arch/x86/kernel/amd_nb.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ static const struct pci_device_id hygon_root_ids[] = {
7272
{}
7373
};
7474

75-
const struct pci_device_id hygon_nb_misc_ids[] = {
75+
static const struct pci_device_id hygon_nb_misc_ids[] = {
7676
{ PCI_DEVICE(PCI_VENDOR_ID_HYGON, PCI_DEVICE_ID_AMD_17H_DF_F3) },
7777
{}
7878
};

arch/x86/kernel/crash.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,6 @@ struct crash_memmap_data {
5656
*/
5757
crash_vmclear_fn __rcu *crash_vmclear_loaded_vmcss = NULL;
5858
EXPORT_SYMBOL_GPL(crash_vmclear_loaded_vmcss);
59-
unsigned long crash_zero_bytes;
6059

6160
static inline void cpu_crash_vmclear_loaded_vmcss(void)
6261
{
@@ -173,6 +172,9 @@ void native_machine_crash_shutdown(struct pt_regs *regs)
173172
}
174173

175174
#ifdef CONFIG_KEXEC_FILE
175+
176+
static unsigned long crash_zero_bytes;
177+
176178
static int get_nr_ram_ranges_callback(struct resource *res, void *arg)
177179
{
178180
unsigned int *nr_ranges = arg;

arch/x86/kernel/io_delay.c

Lines changed: 27 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,22 @@
1313
#include <linux/dmi.h>
1414
#include <linux/io.h>
1515

16-
int 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+
31+
int io_delay_type __read_mostly = DEFAULT_IO_DELAY_TYPE;
1732

1833
static int __initdata io_delay_override;
1934

@@ -24,13 +39,13 @@ void native_io_delay(void)
2439
{
2540
switch (io_delay_type) {
2641
default:
27-
case CONFIG_IO_DELAY_TYPE_0X80:
42+
case IO_DELAY_TYPE_0X80:
2843
asm volatile ("outb %al, $0x80");
2944
break;
30-
case CONFIG_IO_DELAY_TYPE_0XED:
45+
case IO_DELAY_TYPE_0XED:
3146
asm volatile ("outb %al, $0xed");
3247
break;
33-
case CONFIG_IO_DELAY_TYPE_UDELAY:
48+
case IO_DELAY_TYPE_UDELAY:
3449
/*
3550
* 2 usecs is an upper-bound for the outb delay but
3651
* note that udelay doesn't have the bus-level
@@ -39,17 +54,18 @@ void native_io_delay(void)
3954
* are shorter until calibrated):
4055
*/
4156
udelay(2);
42-
case CONFIG_IO_DELAY_TYPE_NONE:
57+
break;
58+
case IO_DELAY_TYPE_NONE:
4359
break;
4460
}
4561
}
4662
EXPORT_SYMBOL(native_io_delay);
4763

4864
static int __init dmi_io_delay_0xed_port(const struct dmi_system_id *id)
4965
{
50-
if (io_delay_type == CONFIG_IO_DELAY_TYPE_0X80) {
66+
if (io_delay_type == IO_DELAY_TYPE_0X80) {
5167
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;
5369
}
5470

5571
return 0;
@@ -115,13 +131,13 @@ static int __init io_delay_param(char *s)
115131
return -EINVAL;
116132

117133
if (!strcmp(s, "0x80"))
118-
io_delay_type = CONFIG_IO_DELAY_TYPE_0X80;
134+
io_delay_type = IO_DELAY_TYPE_0X80;
119135
else if (!strcmp(s, "0xed"))
120-
io_delay_type = CONFIG_IO_DELAY_TYPE_0XED;
136+
io_delay_type = IO_DELAY_TYPE_0XED;
121137
else if (!strcmp(s, "udelay"))
122-
io_delay_type = CONFIG_IO_DELAY_TYPE_UDELAY;
138+
io_delay_type = IO_DELAY_TYPE_UDELAY;
123139
else if (!strcmp(s, "none"))
124-
io_delay_type = CONFIG_IO_DELAY_TYPE_NONE;
140+
io_delay_type = IO_DELAY_TYPE_NONE;
125141
else
126142
return -EINVAL;
127143

arch/x86/kernel/tsc.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ struct cyc2ns {
5959

6060
static DEFINE_PER_CPU_ALIGNED(struct cyc2ns, cyc2ns);
6161

62-
void __always_inline cyc2ns_read_begin(struct cyc2ns_data *data)
62+
__always_inline void cyc2ns_read_begin(struct cyc2ns_data *data)
6363
{
6464
int seq, idx;
6565

@@ -76,7 +76,7 @@ void __always_inline cyc2ns_read_begin(struct cyc2ns_data *data)
7676
} while (unlikely(seq != this_cpu_read(cyc2ns.seq.sequence)));
7777
}
7878

79-
void __always_inline cyc2ns_read_end(void)
79+
__always_inline void cyc2ns_read_end(void)
8080
{
8181
preempt_enable_notrace();
8282
}

0 commit comments

Comments
 (0)