mirror of
https://github.com/apache/nuttx.git
synced 2026-09-13 14:10:18 +00:00
libc/blkoutstream: Remove the redundant check and compute
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
This commit is contained in:
parent
9f1af300cb
commit
00529f1626
1 changed files with 4 additions and 4 deletions
|
|
@ -108,12 +108,12 @@ static int blkoutstream_puts(FAR struct lib_outstream_s *self,
|
|||
self->nput += remain;
|
||||
remain = 0;
|
||||
}
|
||||
else if (remain >= sectorsize)
|
||||
else
|
||||
{
|
||||
size_t copyin = (remain / sectorsize) * sectorsize;
|
||||
size_t nsector = remain / sectorsize;
|
||||
size_t copyin = nsector * sectorsize;
|
||||
|
||||
ret = inode->u.i_bops->write(inode, ptr, sector,
|
||||
remain / sectorsize);
|
||||
ret = inode->u.i_bops->write(inode, ptr, sector, nsector);
|
||||
if (ret < 0)
|
||||
{
|
||||
return ret;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue