Skip to content

Commit bfb4794

Browse files
nordicjmfabiobaltieri
authored andcommitted
retention: Increase read size variables to 16-bit
Increases 2 variables to be 16-bits instead of 8-bits to allow for target read sizes, this would only be an issue if someone changed the default retention block size from the default value of 16 to a value over 256 Signed-off-by: Jamie McCrae <[email protected]>
1 parent bf2bdcf commit bfb4794

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

subsys/retention/retention.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ static int retention_checksum(const struct device *dev, uint32_t *output)
9696
*output = 0;
9797

9898
while (pos < end) {
99-
uint8_t read_size = MIN((end - pos), sizeof(buffer));
99+
uint16_t read_size = MIN((end - pos), sizeof(buffer));
100100

101101
rc = retained_mem_read(config->parent, pos, buffer, read_size);
102102

@@ -188,7 +188,7 @@ int retention_is_valid(const struct device *dev)
188188
off_t pos = 0;
189189

190190
while (pos < config->prefix_len) {
191-
uint8_t read_size = MIN((config->prefix_len - pos), sizeof(buffer));
191+
uint16_t read_size = MIN((config->prefix_len - pos), sizeof(buffer));
192192

193193
rc = retained_mem_read(config->parent, (config->offset + pos), buffer,
194194
read_size);

0 commit comments

Comments
 (0)