[Skiboot] [PATCH 3/3] libflash/file: Use 64bit ioctl() to erase from MTD

Cyril Bur cyril.bur at au1.ibm.com
Mon Nov 7 17:28:51 AEDT 2016


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 <cyril.bur at au1.ibm.com>
---
 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;
-- 
2.10.2



More information about the Skiboot mailing list