drivers/mtd/bch: fix size_t overflow when offset > 4GB

Signed-off-by: dongjiuzhu1 <dongjiuzhu1@xiaomi.com>
This commit is contained in:
dongjiuzhu1 2024-05-08 19:49:11 +08:00 committed by Xiang Xiao
parent 9d5b9b7c05
commit c978f2fe4c
5 changed files with 6 additions and 6 deletions

View File

@ -64,7 +64,7 @@
*
****************************************************************************/
ssize_t bchlib_read(FAR void *handle, FAR char *buffer, size_t offset,
ssize_t bchlib_read(FAR void *handle, FAR char *buffer, off_t offset,
size_t len)
{
FAR struct bchlib_s *bch = (FAR struct bchlib_s *)handle;

View File

@ -50,7 +50,7 @@
*
****************************************************************************/
ssize_t bchlib_write(FAR void *handle, FAR const char *buffer, size_t offset,
ssize_t bchlib_write(FAR void *handle, FAR const char *buffer, off_t offset,
size_t len)
{
FAR struct bchlib_s *bch = (FAR struct bchlib_s *)handle;

View File

@ -725,7 +725,7 @@ static int mtd_loop_ioctl(FAR struct file *filep, int cmd,
*
****************************************************************************/
FAR struct mtd_dev_s *filemtd_initialize(FAR const char *path, size_t offset,
FAR struct mtd_dev_s *filemtd_initialize(FAR const char *path, off_t offset,
int16_t sectsize, int32_t erasesize)
{
FAR struct file_dev_s *priv;

View File

@ -231,7 +231,7 @@ int bchlib_teardown(FAR void *handle);
*
****************************************************************************/
ssize_t bchlib_read(FAR void *handle, FAR char *buffer, size_t offset,
ssize_t bchlib_read(FAR void *handle, FAR char *buffer, off_t offset,
size_t len);
/****************************************************************************
@ -243,7 +243,7 @@ ssize_t bchlib_read(FAR void *handle, FAR char *buffer, size_t offset,
*
****************************************************************************/
ssize_t bchlib_write(FAR void *handle, FAR const char *buffer, size_t offset,
ssize_t bchlib_write(FAR void *handle, FAR const char *buffer, off_t offset,
size_t len);
/****************************************************************************

View File

@ -657,7 +657,7 @@ FAR struct mtd_dev_s *w25qxxxjv_initialize(FAR struct qspi_dev_s *qspi,
*
****************************************************************************/
FAR struct mtd_dev_s *filemtd_initialize(FAR const char *path, size_t offset,
FAR struct mtd_dev_s *filemtd_initialize(FAR const char *path, off_t offset,
int16_t sectsize,
int32_t erasesize);