Merge pull request #5846 from geky/fix-block-addr-overflow

littlefs: Fix block addr overflow
pull/5865/head
Cruz Monrreal 2018-01-16 15:53:30 -06:00 committed by GitHub
commit 25aa0e6d37
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 3 deletions

View File

@ -85,19 +85,19 @@ static int lfs_totype(int type)
static int lfs_bd_read(const struct lfs_config *c, lfs_block_t block,
lfs_off_t off, void *buffer, lfs_size_t size) {
BlockDevice *bd = (BlockDevice *)c->context;
return bd->read(buffer, block*c->block_size + off, size);
return bd->read(buffer, (bd_addr_t)block*c->block_size + off, size);
}
static int lfs_bd_prog(const struct lfs_config *c, lfs_block_t block,
lfs_off_t off, const void *buffer, lfs_size_t size) {
BlockDevice *bd = (BlockDevice *)c->context;
return bd->program(buffer, block*c->block_size + off, size);
return bd->program(buffer, (bd_addr_t)block*c->block_size + off, size);
}
static int lfs_bd_erase(const struct lfs_config *c, lfs_block_t block)
{
BlockDevice *bd = (BlockDevice *)c->context;
return bd->erase(block*c->block_size, c->block_size);
return bd->erase((bd_addr_t)block*c->block_size, c->block_size);
}
static int lfs_bd_sync(const struct lfs_config *c)