Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1725353 > unrolled thread

[PATCH 2/6] perf dwarf: Use ARRAY_SIZE macro

Started byThomas Meyer <thomas@m3y3r.de>
First post2017-09-01 23:40 +0200
Last post2017-09-01 23:40 +0200
Articles 1 — 1 participant

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  [PATCH 2/6] perf dwarf: Use ARRAY_SIZE macro Thomas Meyer <thomas@m3y3r.de> - 2017-09-01 23:40 +0200

#1725353 — [PATCH 2/6] perf dwarf: Use ARRAY_SIZE macro

FromThomas Meyer <thomas@m3y3r.de>
Date2017-09-01 23:40 +0200
Subject[PATCH 2/6] perf dwarf: Use ARRAY_SIZE macro
Message-ID<ul1Pr-2fo-11@gated-at.bofh.it>
Found by a coccinelle run with:
make coccicheck MODE=patch COCCI=scripts/coccinelle/misc/array_size.cocci

Signed-off-by: Thomas Meyer <thomas@m3y3r.de>
---
 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

[toc] | [standalone]


Back to top | Article view | linux.kernel


csiph-web