Skip to content

Commit 1cee16b

Browse files
pennammaidnl
andcommitted
SDCardBlockDevice: avoid double cast
Co-authored-by: Daniele <[email protected]>
1 parent c265d86 commit 1cee16b

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

Diff for: libraries/BlockDevices/SDCardBlockDevice.cpp

+2-1
Original file line numberDiff line numberDiff line change
@@ -368,7 +368,8 @@ int SDCardBlockDevice::read(void *buffer, bd_addr_t add, bd_size_t _size) {
368368
uint32_t start_add_of_block = (add / read_block_size);
369369
rv = FSP_SUCCESS;
370370
for(uint32_t i = 0; i < num_of_blocks && rv == FSP_SUCCESS; i++) {
371-
rv = R_SDHI_Read (&ctrl, (uint8_t *)((uint8_t *)buffer + (i * read_block_size)), start_add_of_block + i, 1);
371+
uint8_t *buf = (uint8_t *)buffer;
372+
rv = R_SDHI_Read (&ctrl, buf + (i * read_block_size), start_add_of_block + i, 1);
372373
if(rv == FSP_SUCCESS) {
373374
rv = wait_for_completition();
374375
}

0 commit comments

Comments
 (0)