Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/littlefs-project/littlefs.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristopher Haster <chaster@utexas.edu>2019-08-09 02:50:15 +0300
committerGitHub <noreply@github.com>2019-08-09 02:50:15 +0300
commit9d1f1211a96a693995a40d5aeb00d637646b9475 (patch)
tree4b35627d1f18a9963261b96593af507579e6f7dd
parent151104c790c18ea20a8c98995f5f637e93719c7a (diff)
parentf85ff1d2f8da6559a524d9e7fdb99ce7534e5ad2 (diff)
Merge pull request #253 from pabigot/pr/20190730a
lfs: correct alignment restriction on lookahead buffer
-rw-r--r--lfs.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/lfs.c b/lfs.c
index e7c4dae..cabb8c9 100644
--- a/lfs.c
+++ b/lfs.c
@@ -3412,10 +3412,10 @@ static int lfs_init(lfs_t *lfs, const struct lfs_config *cfg) {
lfs_cache_zero(lfs, &lfs->rcache);
lfs_cache_zero(lfs, &lfs->pcache);
- // setup lookahead, must be multiple of 64-bits
+ // setup lookahead, must be multiple of 64-bits, 32-bit aligned
LFS_ASSERT(lfs->cfg->lookahead_size > 0);
LFS_ASSERT(lfs->cfg->lookahead_size % 8 == 0 &&
- (uintptr_t)lfs->cfg->lookahead_buffer % 8 == 0);
+ (uintptr_t)lfs->cfg->lookahead_buffer % 4 == 0);
if (lfs->cfg->lookahead_buffer) {
lfs->free.buffer = lfs->cfg->lookahead_buffer;
} else {