Skip to content

Commit eb4d47c

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: "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
2 parents 6a9f70b + 642e641 commit eb4d47c

File tree

4 files changed

+8
-8
lines changed

4 files changed

+8
-8
lines changed

arch/x86/boot/video-vga.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -241,9 +241,9 @@ static int vga_probe(void)
241241
vga_modes,
242242
};
243243
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),
247247
};
248248

249249
struct biosregs ireg, oreg;

arch/x86/entry/vdso/vdso2c.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,7 @@
6565

6666
#include <linux/elf.h>
6767
#include <linux/types.h>
68+
#include <linux/kernel.h>
6869

6970
const char *outfilename;
7071

@@ -151,7 +152,7 @@ extern void bad_put_le(void);
151152
PLE(x, val, 64, PLE(x, val, 32, PLE(x, val, 16, LAST_PLE(x, val))))
152153

153154

154-
#define NSYMS (sizeof(required_syms) / sizeof(required_syms[0]))
155+
#define NSYMS ARRAY_SIZE(required_syms)
155156

156157
#define BITSFUNC3(name, bits, suffix) name##bits##suffix
157158
#define BITSFUNC2(name, bits, suffix) BITSFUNC3(name, bits, suffix)

arch/x86/events/amd/iommu.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -405,7 +405,7 @@ const struct attribute_group *amd_iommu_attr_groups[] = {
405405
NULL,
406406
};
407407

408-
static struct pmu iommu_pmu = {
408+
static const struct pmu iommu_pmu __initconst = {
409409
.event_init = perf_iommu_event_init,
410410
.add = perf_iommu_add,
411411
.del = perf_iommu_del,

arch/x86/platform/intel-mid/device_libs/platform_gpio_keys.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -62,10 +62,9 @@ static struct platform_device pb_device = {
6262
static int __init pb_keys_init(void)
6363
{
6464
struct gpio_keys_button *gb = gpio_button;
65-
int i, num, good = 0;
65+
int i, good = 0;
6666

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++) {
6968
gb[i].gpio = get_gpio_by_name(gb[i].desc);
7069
pr_debug("info[%2d]: name = %s, gpio = %d\n", i, gb[i].desc,
7170
gb[i].gpio);

0 commit comments

Comments
 (0)