summaryrefslogtreecommitdiff
path: root/components/fal/src
diff options
context:
space:
mode:
authorShell <[email protected]>2024-03-25 20:29:56 +0800
committerGitHub <[email protected]>2024-03-25 20:29:56 +0800
commit3237efd0898a2e3a58d7c6da17ae8e1e900bda8f (patch)
tree2ffb025cf8e5f01f2ea1a33f1759e16cfb0293b6 /components/fal/src
parentcb6d4515644a6f7e6b6b37878bcc2b59d23b2955 (diff)
fixup d1s (#8671)
Signed-off-by: Shell <[email protected]>
Diffstat (limited to 'components/fal/src')
-rw-r--r--components/fal/src/fal_rtt.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/components/fal/src/fal_rtt.c b/components/fal/src/fal_rtt.c
index 89dcdf4722..bfbe66785b 100644
--- a/components/fal/src/fal_rtt.c
+++ b/components/fal/src/fal_rtt.c
@@ -424,7 +424,7 @@ static int char_dev_fopen(struct dfs_file *fd)
default:
break;
}
- fd->pos = 0;
+ DFS_FILE_POS(fd) = 0;
return RT_EOK;
}
@@ -436,15 +436,15 @@ static int char_dev_fread(struct dfs_file *fd, void *buf, size_t count)
assert(part != RT_NULL);
- if (fd->pos + count > part->fal_part->len)
- count = part->fal_part->len - fd->pos;
+ if (DFS_FILE_POS(fd) + count > part->fal_part->len)
+ count = part->fal_part->len - DFS_FILE_POS(fd);
- ret = fal_partition_read(part->fal_part, fd->pos, buf, count);
+ ret = fal_partition_read(part->fal_part, DFS_FILE_POS(fd), buf, count);
if (ret != (int)(count))
return 0;
- fd->pos += ret;
+ DFS_FILE_POS(fd) += ret;
return ret;
}
@@ -456,15 +456,15 @@ static int char_dev_fwrite(struct dfs_file *fd, const void *buf, size_t count)
assert(part != RT_NULL);
- if (fd->pos + count > part->fal_part->len)
- count = part->fal_part->len - fd->pos;
+ if (DFS_FILE_POS(fd) + count > part->fal_part->len)
+ count = part->fal_part->len - DFS_FILE_POS(fd);
- ret = fal_partition_write(part->fal_part, fd->pos, buf, count);
+ ret = fal_partition_write(part->fal_part, DFS_FILE_POS(fd), buf, count);
if (ret != (int) count)
return 0;
- fd->pos += ret;
+ DFS_FILE_POS(fd) += ret;
return ret;
}