Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

timers/x86/hpet: Type adjustments

Standardize on bool instead of an inconsistent mixture of u8 and plain 'int'.

Also use u32 or 'unsigned int' instead of 'unsigned long' when a 32-bit type
suffices, generating slightly better code on x86-64.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Cc: Andy Lutomirski <luto@amacapital.net>
Cc: Borislav Petkov <bp@alien8.de>
Cc: Brian Gerst <brgerst@gmail.com>
Cc: Denys Vlasenko <dvlasenk@redhat.com>
Cc: H. Peter Anvin <hpa@zytor.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Link: http://lkml.kernel.org/r/5624E3A002000078000AC49A@prv-mh.provo.novell.com
Signed-off-by: Ingo Molnar <mingo@kernel.org>

authored by

Jan Beulich and committed by
Ingo Molnar
3d45ac4b 3bc2159f

+19 -20
+3 -3
arch/x86/include/asm/hpet.h
··· 63 63 /* hpet memory map physical address */ 64 64 extern unsigned long hpet_address; 65 65 extern unsigned long force_hpet_address; 66 - extern int boot_hpet_disable; 66 + extern bool boot_hpet_disable; 67 67 extern u8 hpet_blockid; 68 - extern int hpet_force_user; 69 - extern u8 hpet_msi_disable; 68 + extern bool hpet_force_user; 69 + extern bool hpet_msi_disable; 70 70 extern int is_hpet_enabled(void); 71 71 extern int hpet_enable(void); 72 72 extern void hpet_disable(void);
+1 -1
arch/x86/kernel/early-quirks.c
··· 584 584 static void __init force_disable_hpet(int num, int slot, int func) 585 585 { 586 586 #ifdef CONFIG_HPET_TIMER 587 - boot_hpet_disable = 1; 587 + boot_hpet_disable = true; 588 588 pr_info("x86/hpet: Will disable the HPET for this platform because it's not reliable\n"); 589 589 #endif 590 590 }
+14 -15
arch/x86/kernel/hpet.c
··· 37 37 */ 38 38 unsigned long hpet_address; 39 39 u8 hpet_blockid; /* OS timer block num */ 40 - u8 hpet_msi_disable; 40 + bool hpet_msi_disable; 41 41 42 42 #ifdef CONFIG_PCI_MSI 43 - static unsigned long hpet_num_timers; 43 + static unsigned int hpet_num_timers; 44 44 #endif 45 45 static void __iomem *hpet_virt_address; 46 46 ··· 86 86 /* 87 87 * HPET command line enable / disable 88 88 */ 89 - int boot_hpet_disable; 90 - int hpet_force_user; 91 - static int hpet_verbose; 89 + bool boot_hpet_disable; 90 + bool hpet_force_user; 91 + static bool hpet_verbose; 92 92 93 93 static int __init hpet_setup(char *str) 94 94 { ··· 98 98 if (next) 99 99 *next++ = 0; 100 100 if (!strncmp("disable", str, 7)) 101 - boot_hpet_disable = 1; 101 + boot_hpet_disable = true; 102 102 if (!strncmp("force", str, 5)) 103 - hpet_force_user = 1; 103 + hpet_force_user = true; 104 104 if (!strncmp("verbose", str, 7)) 105 - hpet_verbose = 1; 105 + hpet_verbose = true; 106 106 str = next; 107 107 } 108 108 return 1; ··· 111 111 112 112 static int __init disable_hpet(char *str) 113 113 { 114 - boot_hpet_disable = 1; 114 + boot_hpet_disable = true; 115 115 return 1; 116 116 } 117 117 __setup("nohpet", disable_hpet); ··· 124 124 /* 125 125 * HPET timer interrupt enable / disable 126 126 */ 127 - static int hpet_legacy_int_enabled; 127 + static bool hpet_legacy_int_enabled; 128 128 129 129 /** 130 130 * is_hpet_enabled - check whether the hpet timer interrupt is enabled ··· 230 230 231 231 static void hpet_stop_counter(void) 232 232 { 233 - unsigned long cfg = hpet_readl(HPET_CFG); 233 + u32 cfg = hpet_readl(HPET_CFG); 234 234 cfg &= ~HPET_CFG_ENABLE; 235 235 hpet_writel(cfg, HPET_CFG); 236 236 } ··· 272 272 273 273 cfg |= HPET_CFG_LEGACY; 274 274 hpet_writel(cfg, HPET_CFG); 275 - hpet_legacy_int_enabled = 1; 275 + hpet_legacy_int_enabled = true; 276 276 } 277 277 278 278 static void hpet_legacy_clockevent_register(void) ··· 983 983 cfg = *hpet_boot_cfg; 984 984 else if (hpet_legacy_int_enabled) { 985 985 cfg &= ~HPET_CFG_LEGACY; 986 - hpet_legacy_int_enabled = 0; 986 + hpet_legacy_int_enabled = false; 987 987 } 988 988 cfg &= ~HPET_CFG_ENABLE; 989 989 hpet_writel(cfg, HPET_CFG); ··· 1121 1121 1122 1122 static void hpet_disable_rtc_channel(void) 1123 1123 { 1124 - unsigned long cfg; 1125 - cfg = hpet_readl(HPET_T1_CFG); 1124 + u32 cfg = hpet_readl(HPET_T1_CFG); 1126 1125 cfg &= ~HPET_TN_ENABLE; 1127 1126 hpet_writel(cfg, HPET_T1_CFG); 1128 1127 }
+1 -1
arch/x86/kernel/quirks.c
··· 524 524 */ 525 525 static void force_disable_hpet_msi(struct pci_dev *unused) 526 526 { 527 - hpet_msi_disable = 1; 527 + hpet_msi_disable = true; 528 528 } 529 529 530 530 DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_ATI, PCI_DEVICE_ID_ATI_SBX00_SMBUS,