Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752619AbdIAVcs (ORCPT ); Fri, 1 Sep 2017 17:32:48 -0400 Received: from www17.your-server.de ([213.133.104.17]:36297 "EHLO www17.your-server.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752515AbdIAVaK (ORCPT ); Fri, 1 Sep 2017 17:30:10 -0400 From: Thomas Meyer To: linux-kernel@vger.kernel.org Cc: Thomas Meyer Subject: [PATCH 6/6] x86/platform/intel-mid: Use ARRAY_SIZE macro Date: Fri, 1 Sep 2017 23:29:07 +0200 Message-Id: <20170901212907.5662-6-thomas@m3y3r.de> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20170901212907.5662-1-thomas@m3y3r.de> References: <20170901212907.5662-1-thomas@m3y3r.de> X-Authenticated-Sender: thomas@m3y3r.de Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 958 Lines: 23 Found by a coccinelle run with: make coccicheck MODE=patch COCCI=scripts/coccinelle/misc/array_size.cocci Signed-off-by: Thomas Meyer --- arch/x86/platform/intel-mid/device_libs/platform_gpio_keys.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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..8e2fbd35a9e6 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 @@ -64,7 +64,7 @@ static int __init pb_keys_init(void) struct gpio_keys_button *gb = gpio_button; int i, num, good = 0; - num = sizeof(gpio_button) / sizeof(struct gpio_keys_button); + num = ARRAY_SIZE(gpio_button); for (i = 0; i < num; i++) { gb[i].gpio = get_gpio_by_name(gb[i].desc); pr_debug("info[%2d]: name = %s, gpio = %d\n", i, gb[i].desc, -- 2.11.0