diff --git a/drivers/bch/bchdev_driver.c b/drivers/bch/bchdev_driver.c index 151e62f5b1..b51e73a0a2 100644 --- a/drivers/bch/bchdev_driver.c +++ b/drivers/bch/bchdev_driver.c @@ -294,7 +294,7 @@ static ssize_t bch_read(FAR struct file *filep, FAR char *buffer, size_t len) { FAR struct inode *inode = filep->f_inode; FAR struct bchlib_s *bch; - int ret; + ssize_t ret; DEBUGASSERT(inode && inode->i_private); bch = (FAR struct bchlib_s *)inode->i_private; @@ -302,13 +302,13 @@ static ssize_t bch_read(FAR struct file *filep, FAR char *buffer, size_t len) ret = bchlib_semtake(bch); if (ret < 0) { - return (ssize_t)ret; + return ret; } ret = bchlib_read(bch, buffer, filep->f_pos, len); if (ret > 0) { - filep->f_pos += len; + filep->f_pos += ret; } bchlib_semgive(bch); @@ -324,7 +324,7 @@ static ssize_t bch_write(FAR struct file *filep, FAR const char *buffer, { FAR struct inode *inode = filep->f_inode; FAR struct bchlib_s *bch; - int ret = -EACCES; + ssize_t ret = -EACCES; DEBUGASSERT(inode && inode->i_private); bch = (FAR struct bchlib_s *)inode->i_private; @@ -334,13 +334,13 @@ static ssize_t bch_write(FAR struct file *filep, FAR const char *buffer, ret = bchlib_semtake(bch); if (ret < 0) { - return (ssize_t)ret; + return ret; } ret = bchlib_write(bch, buffer, filep->f_pos, len); if (ret > 0) { - filep->f_pos += len; + filep->f_pos += ret; } bchlib_semgive(bch);