Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix: warning pedantic void return #1598

Merged
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
hosted/cmsis_dap: fix void return pedantic warning
ISO C forbids 'return' with expression in function returning void
perigoso authored and rg-silva committed Aug 10, 2023
commit 5cc398135230afa1d45dcc96fdaa816e95fa918c
12 changes: 8 additions & 4 deletions src/platforms/hosted/cmsis_dap.c
Original file line number Diff line number Diff line change
@@ -479,8 +479,10 @@ static void dap_mem_read(adiv5_access_port_s *ap, void *dest, uint32_t src, size
align_e align = MIN(ALIGNOF(src), ALIGNOF(len));
DEBUG_WIRE("dap_mem_read @ %" PRIx32 " len %zu, align %d\n", src, len, align);
/* If the read can be done in a single transaction, use the dap_read_single() fast-path */
if ((1U << align) == len)
return dap_read_single(ap, dest, src, align);
if ((1U << align) == len) {
dap_read_single(ap, dest, src, align);
return;
}
/* Otherwise proceed blockwise */
const size_t blocks_per_transfer = (report_size - 4U) >> 2U;
uint8_t *const data = (uint8_t *)dest;
@@ -514,8 +516,10 @@ static void dap_mem_write(adiv5_access_port_s *ap, uint32_t dest, const void *sr
return;
DEBUG_WIRE("memwrite @ %" PRIx32 " len %zu, align %d\n", dest, len, align);
/* If the write can be done in a single transaction, use the dap_write_single() fast-path */
if ((1U << align) == len)
return dap_write_single(ap, dest, src, align);
if ((1U << align) == len) {
dap_write_single(ap, dest, src, align);
return;
}
/* Otherwise proceed blockwise */
const size_t blocks_per_transfer = (report_size - 4U) >> 2U;
const uint8_t *const data = (const uint8_t *)src;