summaryrefslogtreecommitdiff
path: root/firmware/2lib/2nvstorage.c
diff options
context:
space:
mode:
Diffstat (limited to 'firmware/2lib/2nvstorage.c')
-rw-r--r--firmware/2lib/2nvstorage.c19
1 files changed, 4 insertions, 15 deletions
diff --git a/firmware/2lib/2nvstorage.c b/firmware/2lib/2nvstorage.c
index e3846d30..7af83762 100644
--- a/firmware/2lib/2nvstorage.c
+++ b/firmware/2lib/2nvstorage.c
@@ -76,24 +76,13 @@ void vb2_nv_init(struct vb2_context *ctx)
/* Regenerate CRC */
vb2_nv_regen_crc(ctx);
- /*
- * Set status flag.
- *
- * Note that early in some calling sequences, shared data may
- * not be available. For example, if there is an error
- * allocating the context work buffer, and we're trying to
- * initialize non-volatile storage so we can write a recovery
- * request. In that case, sd will be NULL. So while we don't
- * usually need to check for that in other library functions,
- * here we do.
- */
- if (sd)
- sd->status |= VB2_SD_STATUS_NV_REINIT;
+ /* Set status flag. */
+ sd->status |= VB2_SD_STATUS_NV_REINIT;
+
/* TODO: unit test for status flag being set */
}
- if (sd)
- sd->status |= VB2_SD_STATUS_NV_INIT;
+ sd->status |= VB2_SD_STATUS_NV_INIT;
}
/* Macro for vb2_nv_get() single-bit settings to reduce duplicate code. */