Skip to content

Commit 0061459

Browse files
committed
objtool: Drop ARRAY_SIZE() definition, tools/include/linux/kernel.h has it now
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>
1 parent 877a7a1 commit 0061459

2 files changed

Lines changed: 2 additions & 4 deletions

File tree

‎tools/objtool/builtin-check.c‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,7 @@
3636
#include "warn.h"
3737

3838
#include <linux/hashtable.h>
39-
40-
#define ARRAY_SIZE(x) (sizeof(x) / sizeof((x)[0]))
39+
#include <linux/kernel.h>
4140

4241
#define STATE_FP_SAVED 0x1
4342
#define STATE_FP_SETUP 0x2

‎tools/objtool/objtool.c‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,11 +31,10 @@
3131
#include <stdlib.h>
3232
#include <subcmd/exec-cmd.h>
3333
#include <subcmd/pager.h>
34+
#include <linux/kernel.h>
3435

3536
#include "builtin.h"
3637

37-
#define ARRAY_SIZE(x) (sizeof(x)/sizeof(x[0]))
38-
3938
struct cmd_struct {
4039
const char *name;
4140
int (*fn)(int, const char **);

0 commit comments

Comments
 (0)