Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752601AbdIAVaM (ORCPT ); Fri, 1 Sep 2017 17:30:12 -0400 Received: from www17.your-server.de ([213.133.104.17]:36293 "EHLO www17.your-server.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752397AbdIAVaJ (ORCPT ); Fri, 1 Sep 2017 17:30:09 -0400 From: Thomas Meyer To: linux-kernel@vger.kernel.org Cc: Thomas Meyer Subject: [PATCH 2/6] perf dwarf: Use ARRAY_SIZE macro Date: Fri, 1 Sep 2017 23:29:03 +0200 Message-Id: <20170901212907.5662-2-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: 881 Lines: 23 Found by a coccinelle run with: make coccicheck MODE=patch COCCI=scripts/coccinelle/misc/array_size.cocci Signed-off-by: Thomas Meyer --- tools/perf/arch/x86/util/dwarf-regs.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/perf/arch/x86/util/dwarf-regs.c b/tools/perf/arch/x86/util/dwarf-regs.c index 1f86ee8fb831..d9d4626b0fa9 100644 --- a/tools/perf/arch/x86/util/dwarf-regs.c +++ b/tools/perf/arch/x86/util/dwarf-regs.c @@ -103,7 +103,7 @@ static const struct pt_regs_offset x86_64_regoffset_table[] = { #endif /* Minus 1 for the ending REG_OFFSET_END */ -#define ARCH_MAX_REGS ((sizeof(regoffset_table) / sizeof(regoffset_table[0])) - 1) +#define ARCH_MAX_REGS (ARRAY_SIZE(regoffset_table) - 1) /* Return architecture dependent register string (for kprobe-tracer) */ const char *get_arch_regstr(unsigned int n) -- 2.11.0