From bf35333b62b54d4ee5e8ea0121fbb37477b3189d Mon Sep 17 00:00:00 2001 From: Shiju Jose Date: Wed, 16 Oct 2019 17:33:59 +0100 Subject: [PATCH] rasdaemon: delete multiple definitions of ARRAY_SIZE This patch deletes multiple definitions of ARRAY_SIZE and move the definition to a common file. Signed-off-by: Shiju Jose Signed-off-by: Mauro Carvalho Chehab --- ras-diskerror-handler.c | 2 -- ras-mce-handler.h | 3 --- ras-record.c | 3 --- ras-record.h | 2 ++ 4 files changed, 2 insertions(+), 8 deletions(-) diff --git a/ras-diskerror-handler.c b/ras-diskerror-handler.c index 271dfac..68c0c77 100644 --- a/ras-diskerror-handler.c +++ b/ras-diskerror-handler.c @@ -50,8 +50,6 @@ static const struct { { -EIO, "I/O error" }, }; -#define ARRAY_SIZE(x) (sizeof(x)/sizeof(*(x))) - static const char *get_blk_error(int err) { int i; diff --git a/ras-mce-handler.h b/ras-mce-handler.h index 94395eb..4d615b4 100644 --- a/ras-mce-handler.h +++ b/ras-mce-handler.h @@ -24,9 +24,6 @@ #include "ras-events.h" #include "libtrace/event-parse.h" - -#define ARRAY_SIZE(x) (sizeof(x)/sizeof(*(x))) - enum cputype { CPU_GENERIC, CPU_P6OLD, diff --git a/ras-record.c b/ras-record.c index ae5d359..8f1c550 100644 --- a/ras-record.c +++ b/ras-record.c @@ -35,9 +35,6 @@ #define SQLITE_RAS_DB RASSTATEDIR "/" RAS_DB_FNAME - -#define ARRAY_SIZE(x) (sizeof(x)/sizeof(*(x))) - /* * Table and functions to handle ras:mc_event */ diff --git a/ras-record.h b/ras-record.h index 5311c67..c9af5ae 100644 --- a/ras-record.h +++ b/ras-record.h @@ -23,6 +23,8 @@ #include #include "config.h" +#define ARRAY_SIZE(x) (sizeof(x)/sizeof(*(x))) + extern long user_hz; struct ras_events *ras; -- 2.50.1