diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2017-11-13 19:58:05 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2017-11-13 19:58:05 -0500 |
commit | eb4d47c8ce5bc2dac5f9ffc27dc9594f6bc2cacb (patch) | |
tree | 0a46192f06e408d2f4bbe1d5c3ce1903074de1e3 | |
parent | 6a9f70b0a5b3ca5db1dd5c7743ca555bfca2ae08 (diff) | |
parent | 642e641cbea57e559720b9df09889ffcf525cf04 (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:
"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
-rw-r--r-- | arch/x86/boot/video-vga.c | 6 | ||||
-rw-r--r-- | arch/x86/entry/vdso/vdso2c.c | 3 | ||||
-rw-r--r-- | arch/x86/events/amd/iommu.c | 2 | ||||
-rw-r--r-- | arch/x86/platform/intel-mid/device_libs/platform_gpio_keys.c | 5 |
4 files changed, 8 insertions, 8 deletions
diff --git a/arch/x86/boot/video-vga.c b/arch/x86/boot/video-vga.c index 45bc9402aa49..a14c5178d4ba 100644 --- a/arch/x86/boot/video-vga.c +++ b/arch/x86/boot/video-vga.c | |||
@@ -241,9 +241,9 @@ static int vga_probe(void) | |||
241 | vga_modes, | 241 | vga_modes, |
242 | }; | 242 | }; |
243 | static int mode_count[] = { | 243 | static int mode_count[] = { |
244 | sizeof(cga_modes)/sizeof(struct mode_info), | 244 | ARRAY_SIZE(cga_modes), |
245 | sizeof(ega_modes)/sizeof(struct mode_info), | 245 | ARRAY_SIZE(ega_modes), |
246 | sizeof(vga_modes)/sizeof(struct mode_info), | 246 | ARRAY_SIZE(vga_modes), |
247 | }; | 247 | }; |
248 | 248 | ||
249 | struct biosregs ireg, oreg; | 249 | struct biosregs ireg, oreg; |
diff --git a/arch/x86/entry/vdso/vdso2c.c b/arch/x86/entry/vdso/vdso2c.c index 0780a443a53b..4674f58581a1 100644 --- a/arch/x86/entry/vdso/vdso2c.c +++ b/arch/x86/entry/vdso/vdso2c.c | |||
@@ -65,6 +65,7 @@ | |||
65 | 65 | ||
66 | #include <linux/elf.h> | 66 | #include <linux/elf.h> |
67 | #include <linux/types.h> | 67 | #include <linux/types.h> |
68 | #include <linux/kernel.h> | ||
68 | 69 | ||
69 | const char *outfilename; | 70 | const char *outfilename; |
70 | 71 | ||
@@ -151,7 +152,7 @@ extern void bad_put_le(void); | |||
151 | PLE(x, val, 64, PLE(x, val, 32, PLE(x, val, 16, LAST_PLE(x, val)))) | 152 | PLE(x, val, 64, PLE(x, val, 32, PLE(x, val, 16, LAST_PLE(x, val)))) |
152 | 153 | ||
153 | 154 | ||
154 | #define NSYMS (sizeof(required_syms) / sizeof(required_syms[0])) | 155 | #define NSYMS ARRAY_SIZE(required_syms) |
155 | 156 | ||
156 | #define BITSFUNC3(name, bits, suffix) name##bits##suffix | 157 | #define BITSFUNC3(name, bits, suffix) name##bits##suffix |
157 | #define BITSFUNC2(name, bits, suffix) BITSFUNC3(name, bits, suffix) | 158 | #define BITSFUNC2(name, bits, suffix) BITSFUNC3(name, bits, suffix) |
diff --git a/arch/x86/events/amd/iommu.c b/arch/x86/events/amd/iommu.c index 3641e24fdac5..38b5d41b0c37 100644 --- a/arch/x86/events/amd/iommu.c +++ b/arch/x86/events/amd/iommu.c | |||
@@ -405,7 +405,7 @@ const struct attribute_group *amd_iommu_attr_groups[] = { | |||
405 | NULL, | 405 | NULL, |
406 | }; | 406 | }; |
407 | 407 | ||
408 | static struct pmu iommu_pmu = { | 408 | static const struct pmu iommu_pmu __initconst = { |
409 | .event_init = perf_iommu_event_init, | 409 | .event_init = perf_iommu_event_init, |
410 | .add = perf_iommu_add, | 410 | .add = perf_iommu_add, |
411 | .del = perf_iommu_del, | 411 | .del = perf_iommu_del, |
diff --git a/arch/x86/platform/intel-mid/device_libs/platform_gpio_keys.c b/arch/x86/platform/intel-mid/device_libs/platform_gpio_keys.c index 74283875c7e8..e639e3116acf 100644 --- a/arch/x86/platform/intel-mid/device_libs/platform_gpio_keys.c +++ b/arch/x86/platform/intel-mid/device_libs/platform_gpio_keys.c | |||
@@ -62,10 +62,9 @@ static struct platform_device pb_device = { | |||
62 | static int __init pb_keys_init(void) | 62 | static int __init pb_keys_init(void) |
63 | { | 63 | { |
64 | struct gpio_keys_button *gb = gpio_button; | 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); | 67 | for (i = 0; i < ARRAY_SIZE(gpio_button); i++) { |
68 | for (i = 0; i < num; i++) { | ||
69 | gb[i].gpio = get_gpio_by_name(gb[i].desc); | 68 | gb[i].gpio = get_gpio_by_name(gb[i].desc); |
70 | pr_debug("info[%2d]: name = %s, gpio = %d\n", i, gb[i].desc, | 69 | pr_debug("info[%2d]: name = %s, gpio = %d\n", i, gb[i].desc, |
71 | gb[i].gpio); | 70 | gb[i].gpio); |