diff options
author | NeilBrown <neilb@suse.de> | 2013-09-10 09:48:06 +1000 |
---|---|---|
committer | NeilBrown <neilb@suse.de> | 2013-09-10 09:48:06 +1000 |
commit | 1c0aebc2bec4d8e7e575c4222600826de3f1b73e (patch) | |
tree | 360da02b6e65739a25e539e9e2259ac00642a657 | |
parent | 7087f02b90ef7b5817193d385b8d83148565bff9 (diff) |
Move ARRAY_SIZE macro to common include file.
That was super-ddf can use it.
Signed-off-by: NeilBrown <neilb@suse.de>
-rw-r--r-- | mdadm.h | 2 | ||||
-rw-r--r-- | probe_roms.c | 2 | ||||
-rw-r--r-- | super-ddf.c | 3 |
3 files changed, 3 insertions, 4 deletions
@@ -178,6 +178,8 @@ extern __off64_t lseek64 __P ((int __fd, __off64_t __offset, int __whence)); (void) (&_max1 == &_max2); \ _max1 > _max2 ? _max1 : _max2; }) +#define ARRAY_SIZE(x) (sizeof(x)/sizeof(x[0])) + /* general information that might be extracted from a superblock */ struct mdinfo { mdu_array_info_t array; diff --git a/probe_roms.c b/probe_roms.c index 61297959..b0b08833 100644 --- a/probe_roms.c +++ b/probe_roms.c @@ -35,8 +35,6 @@ static const int rom_len = 0xf0000 - 0xc0000; /* option-rom memory region */ static int _sigbus; static unsigned long rom_align; -#define ARRAY_SIZE(x) (sizeof(x)/sizeof(x[0])) - static void sigbus(int sig) { _sigbus = 1; diff --git a/super-ddf.c b/super-ddf.c index f73a63fe..636d7b49 100644 --- a/super-ddf.c +++ b/super-ddf.c @@ -1680,8 +1680,7 @@ static const char *vendors_with_variable_volume_UUID[] = { static int volume_id_is_reliable(const struct ddf_super *ddf) { - int n = sizeof(vendors_with_variable_volume_UUID) / - sizeof(vendors_with_variable_volume_UUID[0]); + int n = ARRAY_SIZE(vendors_with_variable_volume_UUID); int i; for (i = 0; i < n; i++) if (!memcmp(ddf->controller.guid, |