Skip to content

Commit

Permalink
Merge branch 'x86-cleanups-for-linus' of git://git.kernel.org/pub/scm…
Browse files Browse the repository at this point in the history
…/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
  • Loading branch information
torvalds committed Nov 14, 2017
2 parents 6a9f70b + 642e641 commit eb4d47c
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
6 changes: 3 additions & 3 deletions arch/x86/boot/video-vga.c
Original file line number Diff line number Diff line change
Expand Up @@ -241,9 +241,9 @@ static int vga_probe(void)
vga_modes,
};
static int mode_count[] = {
sizeof(cga_modes)/sizeof(struct mode_info),
sizeof(ega_modes)/sizeof(struct mode_info),
sizeof(vga_modes)/sizeof(struct mode_info),
ARRAY_SIZE(cga_modes),
ARRAY_SIZE(ega_modes),
ARRAY_SIZE(vga_modes),
};

struct biosregs ireg, oreg;
Expand Down
3 changes: 2 additions & 1 deletion arch/x86/entry/vdso/vdso2c.c
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@

#include <linux/elf.h>
#include <linux/types.h>
#include <linux/kernel.h>

const char *outfilename;

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


#define NSYMS (sizeof(required_syms) / sizeof(required_syms[0]))
#define NSYMS ARRAY_SIZE(required_syms)

#define BITSFUNC3(name, bits, suffix) name##bits##suffix
#define BITSFUNC2(name, bits, suffix) BITSFUNC3(name, bits, suffix)
Expand Down
2 changes: 1 addition & 1 deletion arch/x86/events/amd/iommu.c
Original file line number Diff line number Diff line change
Expand Up @@ -405,7 +405,7 @@ const struct attribute_group *amd_iommu_attr_groups[] = {
NULL,
};

static struct pmu iommu_pmu = {
static const struct pmu iommu_pmu __initconst = {
.event_init = perf_iommu_event_init,
.add = perf_iommu_add,
.del = perf_iommu_del,
Expand Down
5 changes: 2 additions & 3 deletions arch/x86/platform/intel-mid/device_libs/platform_gpio_keys.c
Original file line number Diff line number Diff line change
Expand Up @@ -62,10 +62,9 @@ static struct platform_device pb_device = {
static int __init pb_keys_init(void)
{
struct gpio_keys_button *gb = gpio_button;
int i, num, good = 0;
int i, good = 0;

num = sizeof(gpio_button) / sizeof(struct gpio_keys_button);
for (i = 0; i < num; i++) {
for (i = 0; i < ARRAY_SIZE(gpio_button); i++) {
gb[i].gpio = get_gpio_by_name(gb[i].desc);
pr_debug("info[%2d]: name = %s, gpio = %d\n", i, gb[i].desc,
gb[i].gpio);
Expand Down

0 comments on commit eb4d47c

Please sign in to comment.