In preparation of raising -Wimplicit-fallthrough to 5, replace all fall-through comments with the fallthrough attribute pseudo-keyword.
(Cédric Le Goater review is for aspeed_adc.c) Reviewed-by: Cédric Le Goater <c...@kaod.org> Signed-off-by: Emmanouil Pitsidianakis <manos.pitsidiana...@linaro.org> --- hw/adc/aspeed_adc.c | 12 ++++++------ hw/adc/zynq-xadc.c | 2 +- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/hw/adc/aspeed_adc.c b/hw/adc/aspeed_adc.c index 0d29663129..f9f5f7bb17 100644 --- a/hw/adc/aspeed_adc.c +++ b/hw/adc/aspeed_adc.c @@ -119,7 +119,7 @@ static uint64_t aspeed_adc_engine_read(void *opaque, hwaddr addr, __func__, s->engine_id, reg - BOUNDS_CHANNEL_0); break; } - /* fallthrough */ + fallthrough; case HYSTERESIS_CHANNEL_8 ... HYSTERESIS_CHANNEL_15: if (s->nr_channels <= 8) { qemu_log_mask(LOG_GUEST_ERROR, "%s: engine[%u]: " @@ -127,7 +127,7 @@ static uint64_t aspeed_adc_engine_read(void *opaque, hwaddr addr, __func__, s->engine_id, reg - HYSTERESIS_CHANNEL_0); break; } - /* fallthrough */ + fallthrough; case BOUNDS_CHANNEL_0 ... BOUNDS_CHANNEL_7: case HYSTERESIS_CHANNEL_0 ... HYSTERESIS_CHANNEL_7: case ENGINE_CONTROL: @@ -145,7 +145,7 @@ static uint64_t aspeed_adc_engine_read(void *opaque, hwaddr addr, __func__, s->engine_id, reg - DATA_CHANNEL_1_AND_0); break; } - /* fallthrough */ + fallthrough; case DATA_CHANNEL_1_AND_0 ... DATA_CHANNEL_7_AND_6: value = read_channel_sample(s, reg); /* Allow 16-bit reads of the data registers */ @@ -194,7 +194,7 @@ static void aspeed_adc_engine_write(void *opaque, hwaddr addr, uint64_t value, __func__, s->engine_id, reg - DATA_CHANNEL_1_AND_0); return; } - /* fallthrough */ + fallthrough; case BOUNDS_CHANNEL_8 ... BOUNDS_CHANNEL_15: if (s->nr_channels <= 8) { qemu_log_mask(LOG_GUEST_ERROR, "%s: engine[%u]: " @@ -202,7 +202,7 @@ static void aspeed_adc_engine_write(void *opaque, hwaddr addr, uint64_t value, __func__, s->engine_id, reg - BOUNDS_CHANNEL_0); return; } - /* fallthrough */ + fallthrough; case DATA_CHANNEL_1_AND_0 ... DATA_CHANNEL_7_AND_6: case BOUNDS_CHANNEL_0 ... BOUNDS_CHANNEL_7: value &= ASPEED_ADC_LH_MASK; @@ -214,7 +214,7 @@ static void aspeed_adc_engine_write(void *opaque, hwaddr addr, uint64_t value, __func__, s->engine_id, reg - HYSTERESIS_CHANNEL_0); return; } - /* fallthrough */ + fallthrough; case HYSTERESIS_CHANNEL_0 ... HYSTERESIS_CHANNEL_7: value &= (ASPEED_ADC_HYST_EN | ASPEED_ADC_LH_MASK); break; diff --git a/hw/adc/zynq-xadc.c b/hw/adc/zynq-xadc.c index 032e19cbd0..a74de3a4fd 100644 --- a/hw/adc/zynq-xadc.c +++ b/hw/adc/zynq-xadc.c @@ -235,7 +235,7 @@ static void zynq_xadc_write(void *opaque, hwaddr offset, uint64_t val, break; case CMD_WRITE: s->xadc_regs[xadc_reg] = xadc_data; - /* fallthrough */ + fallthrough; case CMD_NOP: xadc_push_dfifo(s, 0); break; -- 2.39.2