XuNeo commented on code in PR #18316:
URL: https://github.com/apache/nuttx/pull/18316#discussion_r2758796941
##########
drivers/misc/dev_mem.c:
##########
@@ -126,28 +126,66 @@ static ssize_t devmem_write(FAR struct file *filep, FAR
const char *buffer,
size_t buflen)
{
FAR struct memory_region_s *region = filep->f_inode->i_private;
- uintptr_t dest = filep->f_pos;
uintptr_t start;
uintptr_t end;
ssize_t len;
int i;
for (i = 0; region[i].start != 0 && region[i].end != 0; i++)
{
- start = MAX(dest, region[i].start);
+ start = region[i].start + filep->f_pos;
Review Comment:
Need to calculate the offset in this region based on f_pos.
```
start = region[i].start + filep->f_pos - total_size(previous_regions)
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]