From da57a7d6aa4242824e9192ae350ac9cc92c2f8a3 Mon Sep 17 00:00:00 2001 From: YAMAMOTO Takashi Date: Thu, 12 Mar 2020 16:29:14 +0900 Subject: [PATCH] Fix a few nxstyle complaints in arm hostfs Unfortunately nxstyle is still not happy because it doesn't like the following construct. I'm not sure what to do here. struct { const char *pathname; long mode; size_t len; } open = { .pathname = pathname, .mode = host_flags_to_mode(flags), .len = strlen(pathname), }; --- arch/arm/src/common/up_hostfs.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/arch/arm/src/common/up_hostfs.c b/arch/arm/src/common/up_hostfs.c index de86975d68..3b86f21d70 100644 --- a/arch/arm/src/common/up_hostfs.c +++ b/arch/arm/src/common/up_hostfs.c @@ -155,6 +155,7 @@ ssize_t host_read(int fd, void *buf, size_t count) .buf = buf, .count = count, }; + ssize_t ret = host_call(HOST_READ, &read); return ret < 0 ? ret : count - ret; } @@ -172,6 +173,7 @@ ssize_t host_write(int fd, const void *buf, size_t count) .buf = buf, .count = count, }; + ssize_t ret = host_call(HOST_WRITE, &write); return ret < 0 ? ret : count - ret; } @@ -201,6 +203,7 @@ off_t host_lseek(int fd, off_t offset, int whence) .fd = fd, .pos = offset, }; + ret = host_call(HOST_SEEK, &seek); if (ret >= 0) { @@ -319,6 +322,7 @@ int host_stat(const char *path, struct stat *buf) if (ret < 0) { /* Since semihosting doesn't support directory yet, */ + ret = 0; /* we have to assume it's a directory here. */ memset(buf, 0, sizeof(*buf)); buf->st_mode = S_IFDIR | 0777;