]> www.infradead.org Git - users/mchehab/rasdaemon.git/commitdiff
rasdaemon: delete multiple definitions of ARRAY_SIZE
authorShiju Jose <shiju.jose@huawei.com>
Wed, 16 Oct 2019 16:33:59 +0000 (17:33 +0100)
committerMauro Carvalho Chehab <mchehab+huawei@kernel.org>
Wed, 20 Nov 2019 04:16:24 +0000 (05:16 +0100)
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>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
ras-diskerror-handler.c
ras-mce-handler.h
ras-record.c
ras-record.h

index 271dfac82d3c869e336b562f4fdfd58d5b7d8397..68c0c77548f6a6e0c0e98ac6c5c1f77534fcb9a8 100644 (file)
@@ -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;
index 94395eb51a56eace581b4a21ad9bfa5dd86bbc04..4d615b430508f711275ee93932251d1ac5dd05e4 100644 (file)
@@ -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,
index ae5d359c2daa20199a678b93356de4f96b20521d..8f1c550f98b177d0d0b644a3558fdcbbbc091765 100644 (file)
@@ -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
  */
index 5311c67caf441956732a5a33b7fd7b281c3759d5..c9af5ae83f944fbf50d194452f1b6f01e6279ce4 100644 (file)
@@ -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;