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 <jamie.mccrae@nordicsemi.no>
This commit is contained in:
parent
bf2bdcf6f7
commit
bfb4794c36
1 changed files with 2 additions and 2 deletions
|
|
@ -96,7 +96,7 @@ static int retention_checksum(const struct device *dev, uint32_t *output)
|
||||||
*output = 0;
|
*output = 0;
|
||||||
|
|
||||||
while (pos < end) {
|
while (pos < end) {
|
||||||
uint8_t read_size = MIN((end - pos), sizeof(buffer));
|
uint16_t read_size = MIN((end - pos), sizeof(buffer));
|
||||||
|
|
||||||
rc = retained_mem_read(config->parent, pos, buffer, read_size);
|
rc = retained_mem_read(config->parent, pos, buffer, read_size);
|
||||||
|
|
||||||
|
|
@ -188,7 +188,7 @@ int retention_is_valid(const struct device *dev)
|
||||||
off_t pos = 0;
|
off_t pos = 0;
|
||||||
|
|
||||||
while (pos < config->prefix_len) {
|
while (pos < config->prefix_len) {
|
||||||
uint8_t read_size = MIN((config->prefix_len - pos), sizeof(buffer));
|
uint16_t read_size = MIN((config->prefix_len - pos), sizeof(buffer));
|
||||||
|
|
||||||
rc = retained_mem_read(config->parent, (config->offset + pos), buffer,
|
rc = retained_mem_read(config->parent, (config->offset + pos), buffer,
|
||||||
read_size);
|
read_size);
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue