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


Groups > linux.kernel > #1725362

[PATCH 3/6] ia64: Use ARRAY_SIZE macro

From Thomas Meyer <thomas@m3y3r.de>
Newsgroups linux.kernel
Subject [PATCH 3/6] ia64: Use ARRAY_SIZE macro
Date 2017-09-01 23:40 +0200
Message-ID <ul1Ps-2fo-31@gated-at.bofh.it> (permalink)
References <ul1Pr-2fo-9@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


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>
---
 arch/ia64/kernel/perfmon.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/ia64/kernel/perfmon.c b/arch/ia64/kernel/perfmon.c
index 09f86ebfcc7b..f1be357a4288 100644
--- a/arch/ia64/kernel/perfmon.c
+++ b/arch/ia64/kernel/perfmon.c
@@ -4653,7 +4653,7 @@ static pfm_cmd_desc_t pfm_cmd_tab[]={
 /* 32 */PFM_CMD(pfm_write_ibrs, PFM_CMD_PCLRWS, PFM_CMD_ARG_MANY, pfarg_dbreg_t, NULL),
 /* 33 */PFM_CMD(pfm_write_dbrs, PFM_CMD_PCLRWS, PFM_CMD_ARG_MANY, pfarg_dbreg_t, NULL)
 };
-#define PFM_CMD_COUNT	(sizeof(pfm_cmd_tab)/sizeof(pfm_cmd_desc_t))
+#define PFM_CMD_COUNT	ARRAY_SIZE(pfm_cmd_tab)
 
 static int
 pfm_check_task_state(pfm_context_t *ctx, int cmd, unsigned long flags)
-- 
2.11.0

Back to linux.kernel | Previous | NextPrevious in thread | Find similar | Unroll thread


Thread

[PATCH 1/6] perf tools: Use ARRAY_SIZE macro Thomas Meyer <thomas@m3y3r.de> - 2017-09-01 23:40 +0200
  [PATCH 6/6] x86/platform/intel-mid: Use ARRAY_SIZE macro Thomas Meyer <thomas@m3y3r.de> - 2017-09-01 23:40 +0200
  [PATCH 3/6] ia64: Use ARRAY_SIZE macro Thomas Meyer <thomas@m3y3r.de> - 2017-09-01 23:40 +0200

csiph-web