From b03f2e34b8410536132ca887677c10c6b165d955 Mon Sep 17 00:00:00 2001 From: Jiuzhu Dong Date: Fri, 5 Nov 2021 13:52:40 +0800 Subject: [PATCH] lseek: use type:off_t for return value Signed-off-by: Jiuzhu Dong --- drivers/bch/bchdev_driver.c | 4 ++-- fs/vfs/fs_lseek.c | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/drivers/bch/bchdev_driver.c b/drivers/bch/bchdev_driver.c index 7326a81f62..151e62f5b1 100644 --- a/drivers/bch/bchdev_driver.c +++ b/drivers/bch/bchdev_driver.c @@ -223,7 +223,7 @@ static off_t bch_seek(FAR struct file *filep, off_t offset, int whence) FAR struct inode *inode = filep->f_inode; FAR struct bchlib_s *bch; off_t newpos; - int ret; + off_t ret; DEBUGASSERT(inode && inode->i_private); @@ -231,7 +231,7 @@ static off_t bch_seek(FAR struct file *filep, off_t offset, int whence) ret = bchlib_semtake(bch); if (ret < 0) { - return (off_t)ret; + return ret; } /* Determine the new, requested file position */ diff --git a/fs/vfs/fs_lseek.c b/fs/vfs/fs_lseek.c index 6d7a4431a5..18c57e00b5 100644 --- a/fs/vfs/fs_lseek.c +++ b/fs/vfs/fs_lseek.c @@ -57,7 +57,7 @@ off_t file_seek(FAR struct file *filep, off_t offset, int whence) { FAR struct inode *inode; - int ret; + off_t ret; DEBUGASSERT(filep); inode = filep->f_inode; @@ -66,7 +66,7 @@ off_t file_seek(FAR struct file *filep, off_t offset, int whence) if (inode && inode->u.i_ops && inode->u.i_ops->seek) { - ret = (int)inode->u.i_ops->seek(filep, offset, whence); + ret = inode->u.i_ops->seek(filep, offset, whence); if (ret < 0) { return ret; @@ -123,7 +123,7 @@ off_t file_seek(FAR struct file *filep, off_t offset, int whence) off_t nx_seek(int fd, off_t offset, int whence) { FAR struct file *filep; - int ret; + off_t ret; /* Get the file structure corresponding to the file descriptor. */