]> git.ipfire.org Git - thirdparty/mdadm.git/commitdiff
Move ARRAY_SIZE macro to common include file.
authorNeilBrown <neilb@suse.de>
Mon, 9 Sep 2013 23:48:06 +0000 (09:48 +1000)
committerNeilBrown <neilb@suse.de>
Mon, 9 Sep 2013 23:48:06 +0000 (09:48 +1000)
That was super-ddf can use it.

Signed-off-by: NeilBrown <neilb@suse.de>
mdadm.h
probe_roms.c
super-ddf.c

diff --git a/mdadm.h b/mdadm.h
index 91d2713908463e94ba557420bdb31f08f4353c18..2eca60321aa3e86a0dce421a3c09c200c06949be 100644 (file)
--- a/mdadm.h
+++ b/mdadm.h
@@ -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;
index 61297959c979f732cba9f37b6f00f7205a6dab9c..b0b088332bb6ab5f4acb8541a9f0b8b0e5676111 100644 (file)
@@ -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;
index f73a63fe82f2c294135cda189bec322facd65cbe..636d7b496310fe0951bd083dca8412605545134e 100644 (file)
@@ -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,