Skip to content

Commit 444192d

Browse files
Revert "[nrf fromtree] settings_fcb: Fix storing the data"
This reverts commit 92e513f. Signed-off-by: Martí Bolívar <[email protected]>
1 parent bdad488 commit 444192d

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

subsys/settings/src/settings_fcb.c

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -317,16 +317,12 @@ static int settings_fcb_save_priv(struct settings_store *cs, const char *name,
317317
wbs = cf->cf_fcb.f_align;
318318
len = settings_line_len_calc(name, val_len);
319319

320-
for (i = 0; i < cf->cf_fcb.f_sector_cnt; i++) {
320+
for (i = 0; i < cf->cf_fcb.f_sector_cnt - 1; i++) {
321321
rc = fcb_append(&cf->cf_fcb, len, &loc.loc);
322322
if (rc != -ENOSPC) {
323323
break;
324324
}
325-
326-
/* FCB can compress up to cf->cf_fcb.f_sector_cnt - 1 times. */
327-
if (i < (cf->cf_fcb.f_sector_cnt - 1)) {
328-
settings_fcb_compress(cf);
329-
}
325+
settings_fcb_compress(cf);
330326
}
331327
if (rc) {
332328
return -EINVAL;

0 commit comments

Comments
 (0)