summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYongqin Liu <yongqin.liu@linaro.org>2018-04-11 01:55:34 +0800
committerYongqin Liu <yongqin.liu@linaro.org>2018-04-10 17:58:17 +0000
commit1d90a1684a25943964fee7cc918a86340b35eec3 (patch)
treef50f527c931de1a34d08a34f35f49446af50bec1
parent6b967d7ea2c507fbeeab0d3b830550c23f0adb8c (diff)
downloadlinaro-android-kernel-test-1d90a1684a25943964fee7cc918a86340b35eec3.tar.gz
Fix compiling problen reported by P Preview
Change-Id: I5543aa7a259cf990791f98e844f8daff043e75b6 Signed-off-by: Yongqin Liu <yongqin.liu@linaro.org>
-rw-r--r--Android.mk28
-rw-r--r--ashmemtest-basic/ashmemtest.c13
-rw-r--r--ashmemtest-expanded/Android.mk2
-rw-r--r--dosfstools/src/Android.mk1
-rw-r--r--dosfstools/src/mkdosfs.c12
-rw-r--r--sync-basic/Android.mk1
-rw-r--r--sync-basic/sync-basic.c2
-rw-r--r--vfat-volid/Android.mk1
8 files changed, 47 insertions, 13 deletions
diff --git a/Android.mk b/Android.mk
new file mode 100644
index 0000000..1648f44
--- /dev/null
+++ b/Android.mk
@@ -0,0 +1,28 @@
+#
+# Copyright (C) 2015 The Android Open-Source Project
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
+# WARNING: Everything listed here will be built on ALL platforms,
+# including x86, the emulator, and the SDK. Modules must be uniquely
+# named (liblights.panda), and must build everywhere, or limit themselves
+# to only building on ARM if they include assembly. Individual makefiles
+# are responsible for having their own logic, for fine-grained control.
+
+LOCAL_PATH := $(call my-dir)
+
+# if some modules are built directly from this directory (not subdirectories),
+# their rules should be written here.
+
+include $(call all-makefiles-under,$(LOCAL_PATH))
diff --git a/ashmemtest-basic/ashmemtest.c b/ashmemtest-basic/ashmemtest.c
index df1177b..ca41c28 100644
--- a/ashmemtest-basic/ashmemtest.c
+++ b/ashmemtest-basic/ashmemtest.c
@@ -154,7 +154,7 @@ void ashmem_anonymous_region (void)
void ashmem_named_region (void)
{
- int fd, ret, i;
+ int fd, ret;
char name[ASHMEM_NAME_LEN], name2[ASHMEM_NAME_LEN];
strcpy(testname, __func__);
@@ -332,8 +332,8 @@ void ashmem_size (void)
/* check whether set and get sizes match */
fd = test_open_and_set_size (ashmemdev, O_RDWR, pagesize);
ret = ioctl (fd, ASHMEM_GET_SIZE, 0);
- if (ret != pagesize)
- fatal (0, "size mismatch: expect %ld, got %d", pagesize, ret);
+ if ((unsigned long)ret != pagesize)
+ fatal (0, "size mismatch: expect %ld, got %d", pagesize, ret);
test_close (fd);
printf ("[%s]: test passed\n", __func__);
@@ -342,7 +342,8 @@ void ashmem_size (void)
void ashmem_mmap (void)
{
void *mem;
- int i, fd, ret;
+ int fd;
+ size_t i;
size_t size = pagesize * 4;
char *pattern = alloca (size);
@@ -350,7 +351,7 @@ void ashmem_mmap (void)
/* fill the random pattern */
for (i = 0; i < size; i++)
- pattern[i] = 'a' + rand () % ('z' - 'a');
+ pattern[i] = 'a' + rand () % ('z' - 'a');
/* write the pattern to ashmem region, then compare with origin */
fd = test_open_and_set_size (ashmemdev, O_RDWR, size);
@@ -502,7 +503,7 @@ void ashmem_purge (void)
printf ("[%s]: test passed\n", __func__);
}
-int main(int argc, char *argv[])
+int main(int argc __unused, char *argv[] __unused)
{
snprintf (ashmemdev, sizeof (ashmemdev), "/%s", ASHMEM_NAME_DEF);
pagesize = getpagesize ();
diff --git a/ashmemtest-expanded/Android.mk b/ashmemtest-expanded/Android.mk
index 6659be4..5735bb7 100644
--- a/ashmemtest-expanded/Android.mk
+++ b/ashmemtest-expanded/Android.mk
@@ -15,5 +15,7 @@ include $(CLEAR_VARS)
LOCAL_SRC_FILES := ashmemtest-expanded.l
LOCAL_MODULE := ashmemtest-expanded
LOCAL_MODULE_TAGS := optional tests
+LOCAL_CFLAGS += -Wno-unused-function
+LOCAL_CFLAGS += -Wno-unneeded-internal-declaration
include $(BUILD_EXECUTABLE)
diff --git a/dosfstools/src/Android.mk b/dosfstools/src/Android.mk
index 3898668..2b26dde 100644
--- a/dosfstools/src/Android.mk
+++ b/dosfstools/src/Android.mk
@@ -8,6 +8,7 @@ LOCAL_SRC_FILES := mkdosfs.c endian.c
LOCAL_C_INCLUDES := external/linaro-android-kernel-test/dosfstools/src
LOCAL_CFLAGS := -O2 -g -W -Wall -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -DMOUNTED=_PATH_MOUNTED
+LOCAL_CFLAGS += "-D__unused=__attribute__((unused))"
LOCAL_MODULE := mkfs.vfat
LOCAL_MODULE_TAGS := optional tests
diff --git a/dosfstools/src/mkdosfs.c b/dosfstools/src/mkdosfs.c
index cff46c7..5b46dbd 100644
--- a/dosfstools/src/mkdosfs.c
+++ b/dosfstools/src/mkdosfs.c
@@ -389,9 +389,9 @@ static long do_check(char *buffer, int try, off_t current_block)
/* Alarm clock handler - display the status of the quest for bad blocks! Then retrigger the alarm for five senconds
later (so we can come here again) */
-static void alarm_intr(int alnum)
+static void alarm_intr(int alnum __unused)
{
- if (currently_testing >= blocks)
+ if ((unsigned long long)currently_testing >= blocks)
return;
signal(SIGALRM, alarm_intr);
@@ -419,8 +419,8 @@ static void check_blocks(void)
alarm(5);
}
try = TEST_BUFFER_BLOCKS;
- while (currently_testing < blocks) {
- if (currently_testing + try > blocks)
+ while ((unsigned long long)currently_testing < blocks) {
+ if ((unsigned long long)currently_testing + try > blocks)
try = blocks - currently_testing;
got = do_check(blkbuf, try, currently_testing);
currently_testing += got;
@@ -516,7 +516,7 @@ static unsigned long long count_blocks(char *filename, int *remainder)
/* Check to see if the specified device is currently mounted - abort if it is */
-static void check_mount(char *device_name)
+static void check_mount(char *device_name __unused)
{
#if 0
FILE *f;
@@ -1148,7 +1148,7 @@ static void setup_tables(void)
start_data_block = (start_data_sector + SECTORS_PER_BLOCK - 1) /
SECTORS_PER_BLOCK;
- if (blocks < start_data_block + 32) /* Arbitrary undersize file system! */
+ if (blocks < (unsigned long long)start_data_block + 32) /* Arbitrary undersize file system! */
die("Too few blocks for viable file system");
if (verbose) {
diff --git a/sync-basic/Android.mk b/sync-basic/Android.mk
index b65ea1e..75c3072 100644
--- a/sync-basic/Android.mk
+++ b/sync-basic/Android.mk
@@ -15,5 +15,6 @@ include $(CLEAR_VARS)
LOCAL_SRC_FILES := sync-basic.c
LOCAL_MODULE := sync-basic
LOCAL_MODULE_TAGS := optional tests
+LOCAL_CFLAGS += "-D__unused=__attribute__((unused))"
include $(BUILD_EXECUTABLE)
diff --git a/sync-basic/sync-basic.c b/sync-basic/sync-basic.c
index 7b60e32..7ddd035 100644
--- a/sync-basic/sync-basic.c
+++ b/sync-basic/sync-basic.c
@@ -319,7 +319,7 @@ void fence_merge_invalid (void)
pass(NULL);
}
-int main (int argc, char *argv[])
+int main (int argc __unused, char *argv[] __unused)
{
/* 0 - just try to open */
testno++;
diff --git a/vfat-volid/Android.mk b/vfat-volid/Android.mk
index 095e0cf..0587ef2 100644
--- a/vfat-volid/Android.mk
+++ b/vfat-volid/Android.mk
@@ -17,5 +17,6 @@ include $(CLEAR_VARS)
LOCAL_SRC_FILES := vfat-volid.c
LOCAL_MODULE := vfat-volid
LOCAL_MODULE_TAGS := optional tests
+LOCAL_CFLAGS += -Wno-error=\#warnings
include $(BUILD_EXECUTABLE)