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
1 changed files with 4 additions and 4 deletions

View File

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