file_read: fix a bogus cast

This commit is contained in:
YAMAMOTO Takashi 2024-09-17 17:43:56 +09:00 committed by Xiang Xiao
parent a6c3de6e89
commit a78622d7bf

View File

@ -65,7 +65,7 @@
ssize_t file_read(FAR struct file *filep, FAR void *buf, size_t nbytes)
{
FAR struct inode *inode;
int ret = -EBADF;
ssize_t ret = -EBADF;
DEBUGASSERT(filep);
inode = filep->f_inode;
@ -90,9 +90,9 @@ ssize_t file_read(FAR struct file *filep, FAR void *buf, size_t nbytes)
* signature and position in the operations vtable.
*/
ret = (int)inode->u.i_ops->read(filep,
(FAR char *)buf,
(size_t)nbytes);
ret = inode->u.i_ops->read(filep,
(FAR char *)buf,
(size_t)nbytes);
}
/* Return the number of bytes read (or possibly an error code) */