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
Show file tree
Hide file tree
Changes from all commits
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
12 changes: 8 additions & 4 deletions src/platforms/hosted/cmsis_dap.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion src/platforms/hosted/ftdi_jtag.c
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ static void ftdi_jtag_tms_seq(uint32_t tms_states, const size_t clock_cycles)

static void ftdi_jtag_tdi_seq(const bool final_tms, const uint8_t *const data_in, const size_t clock_cycles)
{
return ftdi_jtag_tdi_tdo_seq(NULL, final_tms, data_in, clock_cycles);
ftdi_jtag_tdi_tdo_seq(NULL, final_tms, data_in, clock_cycles);
}

static bool ftdi_jtag_next(const bool tms, const bool tdi)
Expand Down
35 changes: 22 additions & 13 deletions src/platforms/hosted/platform.c
Original file line number Diff line number Diff line change
Expand Up @@ -270,16 +270,19 @@ void bmda_adiv5_dp_init(adiv5_debug_port_s *const dp)
case BMP_TYPE_BMP:
if (cl_opts.opt_no_hl) {
DEBUG_WARN("Not using HL commands\n");
return;
break;
}
return remote_adiv5_dp_init(dp);
remote_adiv5_dp_init(dp);
break;

#if HOSTED_BMP_ONLY == 0
case BMP_TYPE_STLINK_V2:
return stlink_adiv5_dp_init(dp);
stlink_adiv5_dp_init(dp);
break;

case BMP_TYPE_CMSIS_DAP:
return dap_adiv5_dp_init(dp);
dap_adiv5_dp_init(dp);
break;
#endif

default:
Expand Down Expand Up @@ -357,20 +360,25 @@ void platform_nrst_set_val(bool assert)
{
switch (info.bmp_type) {
case BMP_TYPE_BMP:
return remote_nrst_set_val(assert);
remote_nrst_set_val(assert);
break;

#if HOSTED_BMP_ONLY == 0
case BMP_TYPE_STLINK_V2:
return stlink_nrst_set_val(assert);
stlink_nrst_set_val(assert);
break;

case BMP_TYPE_JLINK:
return jlink_nrst_set_val(assert);
jlink_nrst_set_val(assert);
break;

case BMP_TYPE_FTDI:
return libftdi_nrst_set_val(assert);
libftdi_nrst_set_val(assert);
break;

case BMP_TYPE_CMSIS_DAP:
return dap_nrst_set_val(assert);
dap_nrst_set_val(assert);
break;
#endif

default:
Expand Down Expand Up @@ -536,7 +544,8 @@ void platform_buffer_flush(void)
switch (info.bmp_type) {
#if HOSTED_BMP_ONLY == 0
case BMP_TYPE_FTDI:
return ftdi_buffer_flush();
ftdi_buffer_flush();
break;
#endif

default:
Expand Down Expand Up @@ -685,7 +694,7 @@ void adiv5_ap_write(adiv5_access_port_s *ap, uint16_t addr, uint32_t value)
{
decode_access(addr, ADIV5_LOW_WRITE);
DEBUG_PROTO("0x%08" PRIx32 "\n", value);
return ap->dp->ap_write(ap, addr, value);
ap->dp->ap_write(ap, addr, value);
}

void adiv5_mem_read(adiv5_access_port_s *ap, void *dest, uint32_t src, size_t len)
Expand Down Expand Up @@ -715,11 +724,11 @@ void adiv5_mem_write_sized(adiv5_access_port_s *ap, uint32_t dest, const void *s
if (len > 16U)
DEBUG_PROTO(" ...");
DEBUG_PROTO("\n");
return ap->dp->mem_write(ap, dest, src, len, align);
ap->dp->mem_write(ap, dest, src, len, align);
}

void adiv5_dp_abort(adiv5_debug_port_s *dp, uint32_t abort)
{
DEBUG_PROTO("Abort: %08" PRIx32 "\n", abort);
return dp->abort(dp, abort);
dp->abort(dp, abort);
}
2 changes: 1 addition & 1 deletion src/platforms/hosted/remote/protocol_v0_jtag.c
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ void remote_v0_jtag_tdi_tdo_seq(uint8_t *data_out, bool final_tms, const uint8_t

void remote_v0_jtag_tdi_seq(bool final_tms, const uint8_t *data_in, size_t clock_cycles)
{
return remote_v0_jtag_tdi_tdo_seq(NULL, final_tms, data_in, clock_cycles);
remote_v0_jtag_tdi_tdo_seq(NULL, final_tms, data_in, clock_cycles);
}

bool remote_v0_jtag_next(bool tms, bool tdi)
Expand Down
8 changes: 4 additions & 4 deletions src/target/adiv5.h
Original file line number Diff line number Diff line change
Expand Up @@ -311,7 +311,7 @@ static inline uint32_t adiv5_dp_low_access(adiv5_debug_port_s *dp, uint8_t RnW,

static inline void adiv5_dp_abort(adiv5_debug_port_s *dp, uint32_t abort)
{
return dp->abort(dp, abort);
dp->abort(dp, abort);
}

static inline uint32_t adiv5_ap_read(adiv5_access_port_s *ap, uint16_t addr)
Expand All @@ -321,18 +321,18 @@ static inline uint32_t adiv5_ap_read(adiv5_access_port_s *ap, uint16_t addr)

static inline void adiv5_ap_write(adiv5_access_port_s *ap, uint16_t addr, uint32_t value)
{
return ap->dp->ap_write(ap, addr, value);
ap->dp->ap_write(ap, addr, value);
}

static inline void adiv5_mem_read(adiv5_access_port_s *ap, void *dest, uint32_t src, size_t len)
{
return ap->dp->mem_read(ap, dest, src, len);
ap->dp->mem_read(ap, dest, src, len);
}

static inline void adiv5_mem_write_sized(
adiv5_access_port_s *ap, uint32_t dest, const void *src, size_t len, align_e align)
{
return ap->dp->mem_write(ap, dest, src, len, align);
ap->dp->mem_write(ap, dest, src, len, align);
}

static inline void adiv5_dp_write(adiv5_debug_port_s *dp, uint16_t addr, uint32_t value)
Expand Down
4 changes: 3 additions & 1 deletion src/target/renesas.c
Original file line number Diff line number Diff line change
Expand Up @@ -676,6 +676,7 @@ static void renesas_add_flash(target_s *t, target_addr_t addr, size_t length)
case PNR_SERIES_RA2A1:
case PNR_SERIES_RA4M1:
case PNR_SERIES_RA4W1:
/* FIXME: implement MF3/4 flash */
return;

case PNR_SERIES_RA4M2:
Expand All @@ -692,7 +693,8 @@ static void renesas_add_flash(target_s *t, target_addr_t addr, size_t length)
case PNR_SERIES_RA6T1:
case PNR_SERIES_RA6T2:
t->enter_flash_mode = renesas_enter_flash_mode;
return renesas_add_rv40_flash(t, addr, length);
renesas_add_rv40_flash(t, addr, length);
return;

default:
return;
Expand Down