[fal]修正类型不匹配

This commit is contained in:
chinky 2024-04-12 18:50:36 +08:00 committed by Meco Man
parent d5aff0c963
commit a2ab247d8f
1 changed files with 8 additions and 8 deletions

View File

@ -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 */
};
/**