objtool: Drop ARRAY_SIZE() definition, tools/include/linux/kernel.h has it now
authorArnaldo Carvalho de Melo <acme@redhat.com>
Mon, 17 Apr 2017 14:58:55 +0000 (11:58 -0300)
committerArnaldo Carvalho de Melo <acme@redhat.com>
Wed, 19 Apr 2017 16:01:44 +0000 (13:01 -0300)
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
tools/objtool/objtool.c

index 066086dd59a8017e293993a50d2f432d47441cfe..282a60368b14df9e88b304d7e60aac77fd8e6bc0 100644 (file)
@@ -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
index 46c326db4f464e4bef4a073c93c52c61c4262e77..ecc5b1b5d15df6fddd1fe27d929f92f5111b8894 100644 (file)
 #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 **);