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


Groups > linux.kernel > #1626469 > unrolled thread

[PATCH 07/28] objtool: Drop ARRAY_SIZE() definition, tools/include/linux/kernel.h has it now

Started byArnaldo Carvalho de Melo <acme@kernel.org>
First post2017-04-19 18:30 +0200
Last post2017-04-19 18:30 +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 07/28] objtool: Drop ARRAY_SIZE() definition, tools/include/linux/kernel.h has it now Arnaldo Carvalho de Melo <acme@kernel.org> - 2017-04-19 18:30 +0200

#1626469 — [PATCH 07/28] objtool: Drop ARRAY_SIZE() definition, tools/include/linux/kernel.h has it now

FromArnaldo Carvalho de Melo <acme@kernel.org>
Date2017-04-19 18:30 +0200
Subject[PATCH 07/28] objtool: Drop ARRAY_SIZE() definition, tools/include/linux/kernel.h has it now
Message-ID<ty0Er-5Fr-49@gated-at.bofh.it>
From: Arnaldo Carvalho de Melo <acme@redhat.com>

And with the goodies present in the kernel.h counterpart, i.e. checking
that the parameter is an array at build time.

Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: David Ahern <dsahern@gmail.com>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Josh Poimboeuf <jpoimboe@redhat.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Wang Nan <wangnan0@huawei.com>
Link: http://lkml.kernel.org/n/tip-roiwxwgwgld4kygn65if60wa@git.kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
 tools/objtool/builtin-check.c | 3 +--
 tools/objtool/objtool.c       | 3 +--
 2 files changed, 2 insertions(+), 4 deletions(-)

diff --git a/tools/objtool/builtin-check.c b/tools/objtool/builtin-check.c
index 066086dd59a8..282a60368b14 100644
--- a/tools/objtool/builtin-check.c
+++ b/tools/objtool/builtin-check.c
@@ -36,8 +36,7 @@
 #include "warn.h"
 
 #include <linux/hashtable.h>
-
-#define ARRAY_SIZE(x) (sizeof(x) / sizeof((x)[0]))
+#include <linux/kernel.h>
 
 #define STATE_FP_SAVED		0x1
 #define STATE_FP_SETUP		0x2
diff --git a/tools/objtool/objtool.c b/tools/objtool/objtool.c
index 46c326db4f46..ecc5b1b5d15d 100644
--- a/tools/objtool/objtool.c
+++ b/tools/objtool/objtool.c
@@ -31,11 +31,10 @@
 #include <stdlib.h>
 #include <subcmd/exec-cmd.h>
 #include <subcmd/pager.h>
+#include <linux/kernel.h>
 
 #include "builtin.h"
 
-#define ARRAY_SIZE(x) (sizeof(x)/sizeof(x[0]))
-
 struct cmd_struct {
 	const char *name;
 	int (*fn)(int, const char **);
-- 
2.9.3

[toc] | [standalone]


Back to top | Article view | linux.kernel


csiph-web