summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorUwe Kleine-König <u.kleine-koenig@pengutronix.de>2017-12-21 11:35:08 +0100
committerChris Ball <chris@printf.net>2018-02-16 20:19:40 -0500
commita1a6120c34133d87bedfb04ab06ce43097c5e0d2 (patch)
tree5e0880ef9eb20382e636cfd4dfcace871e4c1481
parentcf7b3fe48917a8b5d2005404142a3ba0cf0fa7ad (diff)
downloadmmc-utils-old-a1a6120c34133d87bedfb04ab06ce43097c5e0d2.tar.gz
mmc-utils: move offsetof from mmc.h to only user
offsetof isn't mmc specific, so remove it from mmc.h. As there is only a single user define it there. Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Signed-off-by: Chris Ball <chris@printf.net>
-rw-r--r--mmc.h4
-rw-r--r--mmc_cmds.c4
2 files changed, 4 insertions, 4 deletions
diff --git a/mmc.h b/mmc.h
index d01a55f..285c1f1 100644
--- a/mmc.h
+++ b/mmc.h
@@ -19,10 +19,6 @@
#include <linux/mmc/ioctl.h>
-#ifndef offsetof
-#define offsetof(TYPE, MEMBER) ((size_t) &((TYPE *)0)->MEMBER)
-#endif
-
/* From kernel linux/major.h */
#define MMC_BLOCK_MAJOR 179
diff --git a/mmc_cmds.c b/mmc_cmds.c
index f1c70fb..cec947d 100644
--- a/mmc_cmds.c
+++ b/mmc_cmds.c
@@ -38,6 +38,10 @@
#include "mmc_cmds.h"
#include "3rdparty/hmac_sha/hmac_sha2.h"
+#ifndef offsetof
+#define offsetof(TYPE, MEMBER) ((size_t) &((TYPE *)0)->MEMBER)
+#endif
+
#define WP_BLKS_PER_QUERY 32
#define USER_WP_PERM_PSWD_DIS 0x80