From: Cristian Rodríguez Date: Wed, 21 May 2014 16:45:19 +0000 (-0400) Subject: mdadm: Do not reimplment offsetof X-Git-Tag: mdadm-3.3.1~13 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=04f903b21ad4d68aa8630433dc2b07edfbc0ad0f;p=thirdparty%2Fmdadm.git mdadm: Do not reimplment offsetof Proper implementations have offsetof in stddef.h Signed-off-by: NeilBrown --- diff --git a/Grow.c b/Grow.c index 202b6ef4..2af6c96e 100644 --- a/Grow.c +++ b/Grow.c @@ -24,6 +24,7 @@ #include "mdadm.h" #include "dlink.h" #include +#include #include #include #include @@ -34,10 +35,6 @@ #include "md_u.h" #include "md_p.h" -#ifndef offsetof -#define offsetof(t,f) ((size_t)&(((t*)0)->f)) -#endif - int restore_backup(struct supertype *st, struct mdinfo *content, int working_disks, diff --git a/super-ddf.c b/super-ddf.c index f9121995..64893e07 100644 --- a/super-ddf.c +++ b/super-ddf.c @@ -30,6 +30,7 @@ #include "mdmon.h" #include "sha1.h" #include +#include /* a non-official T10 name for creation GUIDs */ static char T10[] = "Linux-MD"; @@ -536,10 +537,6 @@ static int init_super_ddf_bvd(struct supertype *st, char *name, char *homehost, int *uuid, unsigned long long data_offset); -#ifndef offsetof -#define offsetof(t,f) ((size_t)&(((t*)0)->f)) -#endif - #if DEBUG static void pr_state(struct ddf_super *ddf, const char *msg) { diff --git a/super1.c b/super1.c index 1bc5216f..7cf9b518 100644 --- a/super1.c +++ b/super1.c @@ -22,6 +22,7 @@ * Email: */ +#include #include "mdadm.h" /* * The version-1 superblock : @@ -133,9 +134,6 @@ struct misc_dev_info { |MD_FEATURE_NEW_OFFSET \ ) -#ifndef offsetof -#define offsetof(t,f) ((size_t)&(((t*)0)->f)) -#endif static unsigned int calc_sb_1_csum(struct mdp_superblock_1 * sb) { unsigned int disk_csum, csum;