summaryrefslogtreecommitdiff
path: root/arch/x86/platform/intel-mid/device_libs
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2017-11-13 16:58:05 -0800
committerLinus Torvalds <torvalds@linux-foundation.org>2017-11-13 16:58:05 -0800
commiteb4d47c8ce5bc2dac5f9ffc27dc9594f6bc2cacb (patch)
tree0a46192f06e408d2f4bbe1d5c3ce1903074de1e3 /arch/x86/platform/intel-mid/device_libs
parent6a9f70b0a5b3ca5db1dd5c7743ca555bfca2ae08 (diff)
parent642e641cbea57e559720b9df09889ffcf525cf04 (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
Diffstat (limited to 'arch/x86/platform/intel-mid/device_libs')
-rw-r--r--arch/x86/platform/intel-mid/device_libs/platform_gpio_keys.c5
1 files changed, 2 insertions, 3 deletions
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 = {
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);