diff mbox

[2/2] CPU_TOPOLOGY: supported on Android platform.

Message ID 1374749329-21281-1-git-send-email-shaojie.sun@linaro.com
State New
Headers show

Commit Message

sunshaojie July 25, 2013, 10:48 a.m. UTC
add Android.mk, so we can build it on android platform.

Signed-off-by: Shaojie Sun <shaojie.sun@linaro.com>
---
 Android.mk |   19 +++++++++++++++++++
 list.h     |    2 ++
 topology.c |    4 ----
 3 files changed, 21 insertions(+), 4 deletions(-)
 create mode 100644 Android.mk
diff mbox

Patch

diff --git a/Android.mk b/Android.mk
new file mode 100644
index 0000000..05d5cfa
--- /dev/null
+++ b/Android.mk
@@ -0,0 +1,19 @@ 
+LOCAL_PATH := $(call my-dir)
+include $(CLEAR_VARS)
+
+
+LOCAL_MODULE_TAGS := optional
+LOCAL_SHARED_LIBRARIES := libstlport
+
+#LOCAL_STATIC_LIBRARIES := libncurses
+
+LOCAL_MODULE := cpu_topology
+
+#LOCAL_CPPFLAGS += -DDEFINE_ETHTOOL_CMD \
+
+LOCAL_C_INCLUDES +=	bionic \
+
+LOCAL_SRC_FILES += \
+	topology.c
+
+include $(BUILD_EXECUTABLE)
diff --git a/list.h b/list.h
index e2d79b1..6db4c62 100644
--- a/list.h
+++ b/list.h
@@ -336,8 +336,10 @@  static inline void list_splice_tail_init(struct list_head *list,
 	}
 }
 
+#undef offsetof
 #define offsetof(s, m)      ((size_t)&(((s *)0)->m))
 
+#undef container_of
 #define container_of(ptr, type, member) ({			\
 	const typeof(((type *)0)->member) * __mptr = (ptr);	\
 	(type *)((char *)__mptr - offsetof(type, member)); })
diff --git a/topology.c b/topology.c
index ae72dd9..0902541 100644
--- a/topology.c
+++ b/topology.c
@@ -297,10 +297,6 @@  static int folder_scan(char *path, folder_filter_t filter)
 	if (ret < 0)
 		return -1;
 
-	ret = basename(basedir) ? 0 : -1;
-	if (ret < 0)
-		goto out_free_basedir;
-
 	while (!readdir_r(dir, &dirent, &direntp)) {
 
 		if (!direntp)