You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by pk...@apache.org on 2022/07/22 14:10:29 UTC

[incubator-nuttx] 04/04: rpmsgfs: fix nx_style

This is an automated email from the ASF dual-hosted git repository.

pkarashchenko pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-nuttx.git

commit 1e5568b030ba60910654e38f7db870d5bba789e2
Author: ligd <li...@xiaomi.com>
AuthorDate: Fri Jul 22 12:38:27 2022 +0800

    rpmsgfs: fix nx_style
    
    Signed-off-by: ligd <li...@xiaomi.com>
---
 fs/rpmsgfs/rpmsgfs_client.c | 2 +-
 fs/rpmsgfs/rpmsgfs_server.c | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/fs/rpmsgfs/rpmsgfs_client.c b/fs/rpmsgfs/rpmsgfs_client.c
index 48d17e49d1..670031a557 100644
--- a/fs/rpmsgfs/rpmsgfs_client.c
+++ b/fs/rpmsgfs/rpmsgfs_client.c
@@ -484,7 +484,7 @@ ssize_t rpmsgfs_client_read(FAR void *handle, int fd,
 
 out:
   nxsem_destroy(&cookie.sem);
-  return read.iov_len ? read.iov_len : ret;
+  return read.iov_len > 0 ? read.iov_len : ret;
 }
 
 ssize_t rpmsgfs_client_write(FAR void *handle, int fd,
diff --git a/fs/rpmsgfs/rpmsgfs_server.c b/fs/rpmsgfs/rpmsgfs_server.c
index a93da84335..23175ed49d 100644
--- a/fs/rpmsgfs/rpmsgfs_server.c
+++ b/fs/rpmsgfs/rpmsgfs_server.c
@@ -378,7 +378,7 @@ static int rpmsgfs_read_handler(FAR struct rpmsg_endpoint *ept,
   while (read < msg->count)
     {
       rsp = rpmsg_get_tx_payload_buffer(ept, &space, true);
-      if (!rsp)
+      if (rsp == NULL)
         {
           return -ENOMEM;
         }