diff --git a/components/fal/src/fal_rtt.c b/components/fal/src/fal_rtt.c index bfbe66785b..f8d548d9a9 100644 --- a/components/fal/src/fal_rtt.c +++ b/components/fal/src/fal_rtt.c @@ -212,7 +212,7 @@ struct fal_mtd_nor_device const struct fal_partition *fal_part; }; -static rt_ssize_t mtd_nor_dev_read(struct rt_mtd_nor_device* device, rt_off_t offset, rt_uint8_t* data, rt_uint32_t length) +static rt_ssize_t mtd_nor_dev_read(struct rt_mtd_nor_device* device, rt_off_t offset, rt_uint8_t* data, rt_size_t length) { int ret = 0; struct fal_mtd_nor_device *part = (struct fal_mtd_nor_device*) device; @@ -233,7 +233,7 @@ static rt_ssize_t mtd_nor_dev_read(struct rt_mtd_nor_device* device, rt_off_t of return ret; } -static rt_ssize_t mtd_nor_dev_write(struct rt_mtd_nor_device* device, rt_off_t offset, const rt_uint8_t* data, rt_uint32_t length) +static rt_ssize_t mtd_nor_dev_write(struct rt_mtd_nor_device* device, rt_off_t offset, const rt_uint8_t* data, rt_size_t length) { int ret = 0; struct fal_mtd_nor_device *part; @@ -255,7 +255,7 @@ static rt_ssize_t mtd_nor_dev_write(struct rt_mtd_nor_device* device, rt_off_t o return ret; } -static rt_err_t mtd_nor_dev_erase(struct rt_mtd_nor_device* device, rt_off_t offset, rt_uint32_t length) +static rt_err_t mtd_nor_dev_erase(struct rt_mtd_nor_device* device, rt_off_t offset, rt_size_t length) { int ret = 0; struct fal_mtd_nor_device *part; @@ -265,7 +265,7 @@ static rt_err_t mtd_nor_dev_erase(struct rt_mtd_nor_device* device, rt_off_t off ret = fal_partition_erase(part->fal_part, offset, length); - if ((rt_uint32_t)ret != length || ret < 0) + if (ret != (int)length || ret < 0) { return -RT_ERROR; } @@ -277,10 +277,10 @@ static rt_err_t mtd_nor_dev_erase(struct rt_mtd_nor_device* device, rt_off_t off static const struct rt_mtd_nor_driver_ops _ops = { - RT_NULL, - mtd_nor_dev_read, - mtd_nor_dev_write, - mtd_nor_dev_erase, + RT_NULL, /* read_id */ + mtd_nor_dev_read, /* read */ + mtd_nor_dev_write, /* write*/ + mtd_nor_dev_erase, /* erase_block */ }; /**