block: sandbox: Add support for SYS_64BIT_LBA
PATCH 1/1 block: sandbox: Add support for SYS_64BIT_LBA
In order to use SYS_64BIT_LBA with this driver we need for "start" to also be of type lbaint_t and to then use the correct printf format characters.
Signed-off-by Tom Rini <[email protected]>
--- drivers/block/sandbox.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
drivers/block/sandbox.c +4 -4
@@ -18,7 +18,7 @@DECLARE_GLOBAL_DATA_PTR ;static unsigned long host_block_read (struct udevice *dev, -unsigned long start,lbaint_t blkcnt, +lbaint_t start,lbaint_t blkcnt,void *buffer) {struct blk_desc *desc =dev_get_uclass_plat (dev);
@@ -26,7 +26,7 @@ static unsigned long host_block_read(struct udevice *dev,struct host_sb_plat *plat =dev_get_plat (host_dev);if (os_lseek (plat->fd, start * desc->blksz,OS_SEEK_SET ) <0 ) { -printf ("ERROR: Invalid block %lx\n" , start); +printf ("ERROR: Invalid block " LBAF "\n" , start);return -1 ; }ssize_t len =os_read (plat->fd, buffer, blkcnt * desc->blksz);
@@ -37,7 +37,7 @@ static unsigned long host_block_read(struct udevice *dev, }static unsigned long host_block_write (struct udevice *dev, -unsigned long start,lbaint_t blkcnt, +lbaint_t start,lbaint_t blkcnt,const void *buffer) {struct blk_desc *desc =dev_get_uclass_plat (dev);
@@ -45,7 +45,7 @@ static unsigned long host_block_write(struct udevice *dev,struct host_sb_plat *plat =dev_get_plat (host_dev);if (os_lseek (plat->fd, start * desc->blksz,OS_SEEK_SET ) <0 ) { -printf ("ERROR: Invalid block %lx\n" , start); +printf ("ERROR: Invalid block " LBAF "\n" , start);return -1 ; }ssize_t len =os_write (plat->fd, buffer, blkcnt * desc->blksz);
Signature · 1 line
2.43.0
Quoted 41 lines · Tom Rini
In order to use
SYS_64BIT_LBAwith this driver we need for "start" to also be of typelbaint_tand to then use the correct printf format characters.Signed-off-by Tom Rini <[email protected]>--- drivers/block/sandbox.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)drivers/block/sandbox.c +3
-3@@ -18,7 +18,7 @@DECLARE_GLOBAL_DATA_PTR ;static unsigned long host_block_read (struct udevice *dev, -unsigned long start,lbaint_t blkcnt, +lbaint_t start,lbaint_t blkcnt,void *buffer) {struct blk_desc *desc =dev_get_uclass_plat (dev);@@ -26,7 +26,7 @@ static unsigned long host_block_read(struct udevice *dev,struct host_sb_plat *plat =dev_get_plat (host_dev);if (os_lseek (plat->fd, start * desc->blksz,OS_SEEK_SET ) <0 ) { -printf ("ERROR: Invalid block %lx\n" , start); +printf ("ERROR: Invalid block " LBAF "\n" , start);return -1 ; }ssize_t len =os_read (plat->fd, buffer, blkcnt * desc->blksz);@@ -37,7 +37,7 @@ static unsigned long host_block_read(struct udevice *dev, }static unsigned long host_block_write (struct udevice *dev, -unsigned long start,lbaint_t blkcnt, +lbaint_t start,lbaint_t blkcnt,const void *buffer) {struct blk_desc *desc =dev_get_uclass_plat (dev);
drivers/block/sandbox.c static unsigned long host_block_write(struct udevice *dev, · line 51
Quoted 8 lines
drivers/block/sandbox.c +1
-1@@ -45,7 +45,7 @@ static unsigned long host_block_write(struct udevice *dev,struct host_sb_plat *plat =dev_get_plat (host_dev);if (os_lseek (plat->fd, start * desc->blksz,OS_SEEK_SET ) <0 ) { -printf ("ERROR: Invalid block %lx\n" , start); +printf ("ERROR: Invalid block " LBAF "\n" , start);return -1 ; }ssize_t len =os_write (plat->fd, buffer, blkcnt * desc->blksz);
Reviewed-by Andrew Goodbody <[email protected]>
Quoted 5 lines · Tom Rini
In order to use
SYS_64BIT_LBAwith this driver we need for "start" to also be of typelbaint_tand to then use the correct printf format characters.
Applied to u-boot/master, thanks!
[1/1] block: sandbox: Add support for SYS_64BIT_LBA
commit: 53bd87651e45b32efa398dd5e433d8b93d781445
Signature · 1 line
Tom