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

Merge branch 'x86-cleanups-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip

Pull x86 cleanups from Ingo Molnar:
"Two changes: Propagate const/__initconst, and use ARRAY_SIZE() some
more"

* 'x86-cleanups-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
x86/events/amd/iommu: Make iommu_pmu const and __initconst
x86: Use ARRAY_SIZE

+8 -8
+3 -3
arch/x86/boot/video-vga.c
··· 241 241 vga_modes, 242 242 }; 243 243 static int mode_count[] = { 244 - sizeof(cga_modes)/sizeof(struct mode_info), 245 - sizeof(ega_modes)/sizeof(struct mode_info), 246 - sizeof(vga_modes)/sizeof(struct mode_info), 244 + ARRAY_SIZE(cga_modes), 245 + ARRAY_SIZE(ega_modes), 246 + ARRAY_SIZE(vga_modes), 247 247 }; 248 248 249 249 struct biosregs ireg, oreg;
+2 -1
arch/x86/entry/vdso/vdso2c.c
··· 65 65 66 66 #include <linux/elf.h> 67 67 #include <linux/types.h> 68 + #include <linux/kernel.h> 68 69 69 70 const char *outfilename; 70 71 ··· 152 151 PLE(x, val, 64, PLE(x, val, 32, PLE(x, val, 16, LAST_PLE(x, val)))) 153 152 154 153 155 - #define NSYMS (sizeof(required_syms) / sizeof(required_syms[0])) 154 + #define NSYMS ARRAY_SIZE(required_syms) 156 155 157 156 #define BITSFUNC3(name, bits, suffix) name##bits##suffix 158 157 #define BITSFUNC2(name, bits, suffix) BITSFUNC3(name, bits, suffix)
+1 -1
arch/x86/events/amd/iommu.c
··· 405 405 NULL, 406 406 }; 407 407 408 - static struct pmu iommu_pmu = { 408 + static const struct pmu iommu_pmu __initconst = { 409 409 .event_init = perf_iommu_event_init, 410 410 .add = perf_iommu_add, 411 411 .del = perf_iommu_del,
+2 -3
arch/x86/platform/intel-mid/device_libs/platform_gpio_keys.c
··· 62 62 static int __init pb_keys_init(void) 63 63 { 64 64 struct gpio_keys_button *gb = gpio_button; 65 - int i, num, good = 0; 65 + int i, good = 0; 66 66 67 - num = sizeof(gpio_button) / sizeof(struct gpio_keys_button); 68 - for (i = 0; i < num; i++) { 67 + for (i = 0; i < ARRAY_SIZE(gpio_button); i++) { 69 68 gb[i].gpio = get_gpio_by_name(gb[i].desc); 70 69 pr_debug("info[%2d]: name = %s, gpio = %d\n", i, gb[i].desc, 71 70 gb[i].gpio);