summaryrefslogtreecommitdiff
path: root/ft3658/focaltech_test
diff options
context:
space:
mode:
authormasonwang <masonwang@google.com>2021-08-20 09:55:06 +0800
committerMason Wang <masonwang@google.com>2021-09-09 14:51:38 +0800
commit7b1df9a13c04c7d38924702055e621f9c9e5d9d7 (patch)
treed2f24b3193bf076849b6eec42ac652a18d533991 /ft3658/focaltech_test
parenta9e4782c26fddd06c20411b027c7f7cbcfded3d6 (diff)
downloadfocaltech_touch-7b1df9a13c04c7d38924702055e621f9c9e5d9d7.tar.gz
touch/focaltech: resolve build break on kernel 5.10.
Bug: 196923176 Test: Build pass Signed-off-by: Mason Wang <masonwang@google.com> Change-Id: I85f97ce3e77e348affa207da03a07eb1492c0eab
Diffstat (limited to 'ft3658/focaltech_test')
-rw-r--r--ft3658/focaltech_test/focaltech_test.c9
-rw-r--r--ft3658/focaltech_test/focaltech_test_ini.c5
2 files changed, 6 insertions, 8 deletions
diff --git a/ft3658/focaltech_test/focaltech_test.c b/ft3658/focaltech_test/focaltech_test.c
index 2f5c251..96e9a6c 100644
--- a/ft3658/focaltech_test/focaltech_test.c
+++ b/ft3658/focaltech_test/focaltech_test.c
@@ -1177,12 +1177,12 @@ void show_data_mc_sc(int *data)
#if CSV_SUPPORT || TXT_SUPPORT
static int fts_test_save_test_data(char *file_name, char *data_buf, int len)
{
+#ifdef FTS_VFS_EN
struct file *pfile = NULL;
char filepath[FILE_NAME_LENGTH] = { 0 };
-#ifdef FTS_VFS_EN
+
loff_t pos;
mm_segment_t old_fs;
-#endif
FTS_TEST_FUNC_ENTER();
memset(filepath, 0, sizeof(filepath));
@@ -1196,18 +1196,15 @@ static int fts_test_save_test_data(char *file_name, char *data_buf, int len)
return -EIO;
}
-#ifdef FTS_VFS_EN
old_fs = get_fs();
set_fs(KERNEL_DS);
pos = 0;
vfs_write(pfile, data_buf, len, &pos);
filp_close(pfile, NULL);
set_fs(old_fs);
-#else
- return -EINVAL;
-#endif
FTS_TEST_FUNC_EXIT();
+#endif
return 0;
}
diff --git a/ft3658/focaltech_test/focaltech_test_ini.c b/ft3658/focaltech_test/focaltech_test_ini.c
index 4684a36..991a95e 100644
--- a/ft3658/focaltech_test/focaltech_test_ini.c
+++ b/ft3658/focaltech_test/focaltech_test_ini.c
@@ -230,9 +230,10 @@ static int fts_atoi(char *nptr)
static int fts_test_get_ini_size(char *config_name)
{
+ off_t fsize = 0;
+#ifdef FTS_VFS_EN
struct file *pfile = NULL;
struct inode *inode = NULL;
- off_t fsize = 0;
char filepath[FILE_NAME_LENGTH] = { 0 };
FTS_TEST_FUNC_ENTER();
@@ -258,7 +259,7 @@ static int fts_test_get_ini_size(char *config_name)
filp_close(pfile, NULL);
FTS_TEST_FUNC_ENTER();
-
+#endif
return fsize;
}