fix for art-pi smart

This commit is contained in:
xiao-mang
2024-04-19 14:48:17 +08:00
committed by Rbb666
parent 84e6b3c393
commit 98204c249b
3 changed files with 32 additions and 40 deletions

View File

@@ -184,7 +184,7 @@ void page_read(struct rt_varea *varea, struct rt_aspace_io_msg *msg)
varea->start, varea->size, varea->offset, varea->attr, varea->flag);
ret = dfs_aspace_mmap_read(file, varea, msg);
if (ret >= 0)
if (ret > 0)
{
msg->response.status = MM_FAULT_STATUS_OK;
if (ret < ARCH_PAGE_SIZE)

View File

@@ -1105,7 +1105,7 @@ int dfs_aspace_read(struct dfs_file *file, void *buf, size_t count, off_t *pos)
}
len = count > len ? len : count;
if (len > 0)
if (len)
{
rt_memcpy(ptr, page->page + *pos - page->fpos, len);
ptr += len;