From e5720d3fe94f5b85c374520b89fb8fbb2143df94 Mon Sep 17 00:00:00 2001 From: Cyril Bur Date: Tue, 8 Nov 2016 17:08:41 +1100 Subject: libflash/file: Use 64bit ioctl() to erase from MTD While we'll 'never' have flash chips larger than 32bit, work was recently done to blocklevel for it to be 64bit compatible for other backends. Since there is a 64bit ioctl() lets use it. There is currently no known case where 32bit is not sufficient but this doesn't mean someone might not do something strange in the future. Signed-off-by: Cyril Bur Reviewed-by: Joel Stanley Signed-off-by: Stewart Smith --- libflash/file.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libflash/file.c b/libflash/file.c index 946726c..5f074cf 100644 --- a/libflash/file.c +++ b/libflash/file.c @@ -130,12 +130,12 @@ static int file_erase(struct blocklevel_device *bl, uint64_t dst, uint64_t len) static int mtd_erase(struct blocklevel_device *bl, uint64_t dst, uint64_t len) { struct file_data *file_data = container_of(bl, struct file_data, bl); - struct erase_info_user erase_info = { + struct erase_info_user64 erase_info = { .start = dst, .length = len }; - if (ioctl(file_data->fd, MEMERASE, &erase_info) == -1) + if (ioctl(file_data->fd, MEMERASE64, &erase_info) == -1) return FLASH_ERR_PARM_ERROR; return 0; -- cgit v1.1