diff mbox series

[5/7] rasdaemon: delete multiple definitions of ARRAY_SIZE

Message ID 20191016163401.16980-6-shiju.jose@huawei.com (mailing list archive)
State Accepted
Headers show
Series rasdaemon: add fixes, database closure and signal handling | expand

Commit Message

Shiju Jose Oct. 16, 2019, 4:33 p.m. UTC
This patch deletes multiple definitions of ARRAY_SIZE and
move the definition to a common file.

Signed-off-by: Shiju Jose <shiju.jose@huawei.com>
---
 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 mbox series

Patch

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 <stdint.h>
 #include "config.h"
 
+#define ARRAY_SIZE(x) (sizeof(x)/sizeof(*(x)))
+
 extern long user_hz;
 
 struct ras_events *ras;