Merge branch 'x86-cleanups-for-linus' of git://git.kernel.org/pub/scm/linux/kernel...
authorLinus Torvalds <torvalds@linux-foundation.org>
Tue, 9 Jul 2019 00:27:24 +0000 (17:27 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Tue, 9 Jul 2019 00:27:24 +0000 (17:27 -0700)
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

arch/x86/Kconfig.debug
arch/x86/configs/i386_defconfig
arch/x86/configs/x86_64_defconfig
arch/x86/kernel/amd_nb.c
arch/x86/kernel/crash.c
arch/x86/kernel/io_delay.c
arch/x86/kernel/tsc.c

index f730680dc818603a25d07412108b491bd02f1b20..6791a3c9758939eed4006763be2e59d2e68e1e87 100644 (file)
@@ -179,26 +179,6 @@ config X86_DECODER_SELFTEST
         decoder code.
         If unsure, say "N".
 
-#
-# IO delay types:
-#
-
-config IO_DELAY_TYPE_0X80
-       int
-       default "0"
-
-config IO_DELAY_TYPE_0XED
-       int
-       default "1"
-
-config IO_DELAY_TYPE_UDELAY
-       int
-       default "2"
-
-config IO_DELAY_TYPE_NONE
-       int
-       default "3"
-
 choice
        prompt "IO delay type"
        default IO_DELAY_0X80
@@ -229,30 +209,6 @@ config IO_DELAY_NONE
 
 endchoice
 
-if IO_DELAY_0X80
-config DEFAULT_IO_DELAY_TYPE
-       int
-       default IO_DELAY_TYPE_0X80
-endif
-
-if IO_DELAY_0XED
-config DEFAULT_IO_DELAY_TYPE
-       int
-       default IO_DELAY_TYPE_0XED
-endif
-
-if IO_DELAY_UDELAY
-config DEFAULT_IO_DELAY_TYPE
-       int
-       default IO_DELAY_TYPE_UDELAY
-endif
-
-if IO_DELAY_NONE
-config DEFAULT_IO_DELAY_TYPE
-       int
-       default IO_DELAY_TYPE_NONE
-endif
-
 config DEBUG_BOOT_PARAMS
        bool "Debug boot parameters"
        depends on DEBUG_KERNEL
index 2b2481acc6615ae3825d6ad74b5afbb8ceaf196a..59ce9ed584306cc992e0a42e083d0d5fae9a93ad 100644 (file)
@@ -130,7 +130,6 @@ CONFIG_CFG80211=y
 CONFIG_MAC80211=y
 CONFIG_MAC80211_LEDS=y
 CONFIG_RFKILL=y
-CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"
 CONFIG_DEVTMPFS=y
 CONFIG_DEVTMPFS_MOUNT=y
 CONFIG_DEBUG_DEVRES=y
index e8829abf063acb73f91be93e4f25295a8720778c..d0a5ffeae8dfd2ad4a068d9f85940808ddbc8e1b 100644 (file)
@@ -129,7 +129,6 @@ CONFIG_CFG80211=y
 CONFIG_MAC80211=y
 CONFIG_MAC80211_LEDS=y
 CONFIG_RFKILL=y
-CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"
 CONFIG_DEVTMPFS=y
 CONFIG_DEVTMPFS_MOUNT=y
 CONFIG_DEBUG_DEVRES=y
index 002aedc693933258891f8143d7242781355e82d2..d63e63b7d1d9581d8036a98e439185e460eaffe8 100644 (file)
@@ -72,7 +72,7 @@ static const struct pci_device_id hygon_root_ids[] = {
        {}
 };
 
-const struct pci_device_id hygon_nb_misc_ids[] = {
+static const struct pci_device_id hygon_nb_misc_ids[] = {
        { PCI_DEVICE(PCI_VENDOR_ID_HYGON, PCI_DEVICE_ID_AMD_17H_DF_F3) },
        {}
 };
index 84e2d3ddd0eb3134ea6ceb4517ac9a569aedb8e7..a55094b5f452d462c0dc1130178f0398195cb68f 100644 (file)
@@ -56,7 +56,6 @@ struct crash_memmap_data {
  */
 crash_vmclear_fn __rcu *crash_vmclear_loaded_vmcss = NULL;
 EXPORT_SYMBOL_GPL(crash_vmclear_loaded_vmcss);
-unsigned long crash_zero_bytes;
 
 static inline void cpu_crash_vmclear_loaded_vmcss(void)
 {
@@ -173,6 +172,9 @@ void native_machine_crash_shutdown(struct pt_regs *regs)
 }
 
 #ifdef CONFIG_KEXEC_FILE
+
+static unsigned long crash_zero_bytes;
+
 static int get_nr_ram_ranges_callback(struct resource *res, void *arg)
 {
        unsigned int *nr_ranges = arg;
index 805b7a341aca2e773b67317aea90f334ea0f96d6..fdb6506ceaaaad1436d23e3a9ec1ad0866645161 100644 (file)
 #include <linux/dmi.h>
 #include <linux/io.h>
 
-int io_delay_type __read_mostly = CONFIG_DEFAULT_IO_DELAY_TYPE;
+#define IO_DELAY_TYPE_0X80     0
+#define IO_DELAY_TYPE_0XED     1
+#define IO_DELAY_TYPE_UDELAY   2
+#define IO_DELAY_TYPE_NONE     3
+
+#if defined(CONFIG_IO_DELAY_0X80)
+#define DEFAULT_IO_DELAY_TYPE  IO_DELAY_TYPE_0X80
+#elif defined(CONFIG_IO_DELAY_0XED)
+#define DEFAULT_IO_DELAY_TYPE  IO_DELAY_TYPE_0XED
+#elif defined(CONFIG_IO_DELAY_UDELAY)
+#define DEFAULT_IO_DELAY_TYPE  IO_DELAY_TYPE_UDELAY
+#elif defined(CONFIG_IO_DELAY_NONE)
+#define DEFAULT_IO_DELAY_TYPE  IO_DELAY_TYPE_NONE
+#endif
+
+int io_delay_type __read_mostly = DEFAULT_IO_DELAY_TYPE;
 
 static int __initdata io_delay_override;
 
@@ -24,13 +39,13 @@ void native_io_delay(void)
 {
        switch (io_delay_type) {
        default:
-       case CONFIG_IO_DELAY_TYPE_0X80:
+       case IO_DELAY_TYPE_0X80:
                asm volatile ("outb %al, $0x80");
                break;
-       case CONFIG_IO_DELAY_TYPE_0XED:
+       case IO_DELAY_TYPE_0XED:
                asm volatile ("outb %al, $0xed");
                break;
-       case CONFIG_IO_DELAY_TYPE_UDELAY:
+       case IO_DELAY_TYPE_UDELAY:
                /*
                 * 2 usecs is an upper-bound for the outb delay but
                 * note that udelay doesn't have the bus-level
@@ -39,7 +54,8 @@ void native_io_delay(void)
                 * are shorter until calibrated):
                 */
                udelay(2);
-       case CONFIG_IO_DELAY_TYPE_NONE:
+               break;
+       case IO_DELAY_TYPE_NONE:
                break;
        }
 }
@@ -47,9 +63,9 @@ EXPORT_SYMBOL(native_io_delay);
 
 static int __init dmi_io_delay_0xed_port(const struct dmi_system_id *id)
 {
-       if (io_delay_type == CONFIG_IO_DELAY_TYPE_0X80) {
+       if (io_delay_type == IO_DELAY_TYPE_0X80) {
                pr_notice("%s: using 0xed I/O delay port\n", id->ident);
-               io_delay_type = CONFIG_IO_DELAY_TYPE_0XED;
+               io_delay_type = IO_DELAY_TYPE_0XED;
        }
 
        return 0;
@@ -115,13 +131,13 @@ static int __init io_delay_param(char *s)
                return -EINVAL;
 
        if (!strcmp(s, "0x80"))
-               io_delay_type = CONFIG_IO_DELAY_TYPE_0X80;
+               io_delay_type = IO_DELAY_TYPE_0X80;
        else if (!strcmp(s, "0xed"))
-               io_delay_type = CONFIG_IO_DELAY_TYPE_0XED;
+               io_delay_type = IO_DELAY_TYPE_0XED;
        else if (!strcmp(s, "udelay"))
-               io_delay_type = CONFIG_IO_DELAY_TYPE_UDELAY;
+               io_delay_type = IO_DELAY_TYPE_UDELAY;
        else if (!strcmp(s, "none"))
-               io_delay_type = CONFIG_IO_DELAY_TYPE_NONE;
+               io_delay_type = IO_DELAY_TYPE_NONE;
        else
                return -EINVAL;
 
index 59b57605e66cb5b3f3e84021adaf87c4c7acfe7c..57d87f79558f2306ebc3415ad4d78740e3d97784 100644 (file)
@@ -59,7 +59,7 @@ struct cyc2ns {
 
 static DEFINE_PER_CPU_ALIGNED(struct cyc2ns, cyc2ns);
 
-void __always_inline cyc2ns_read_begin(struct cyc2ns_data *data)
+__always_inline void cyc2ns_read_begin(struct cyc2ns_data *data)
 {
        int seq, idx;
 
@@ -76,7 +76,7 @@ void __always_inline cyc2ns_read_begin(struct cyc2ns_data *data)
        } while (unlikely(seq != this_cpu_read(cyc2ns.seq.sequence)));
 }
 
-void __always_inline cyc2ns_read_end(void)
+__always_inline void cyc2ns_read_end(void)
 {
        preempt_enable_notrace();
 }