* [RFC PATCH v3 01/78] include/qemu/compiler.h: replace QEMU_FALLTHROUGH with fallthrough
2023-10-13 8:45 [RFC PATCH v3 00/78] Strict disable implicit fallthrough Emmanouil Pitsidianakis
@ 2023-10-13 8:45 ` Emmanouil Pitsidianakis
2023-10-13 9:13 ` gaosong
2023-10-13 8:45 ` [RFC PATCH v3 02/78] block: add fallthrough pseudo-keyword Emmanouil Pitsidianakis
` (78 subsequent siblings)
79 siblings, 1 reply; 106+ messages in thread
From: Emmanouil Pitsidianakis @ 2023-10-13 8:45 UTC (permalink / raw)
To: qemu-devel
Cc: Emmanouil Pitsidianakis, Gerd Hoffmann, Marc-André Lureau,
Eric Auger, Peter Maydell, Song Gao, Xiaojuan Yang,
Richard Henderson, open list:ARM SMMU
Signed-off-by: Emmanouil Pitsidianakis <manos.pitsidianakis@linaro.org>
---
audio/pwaudio.c | 8 ++++----
hw/arm/smmuv3.c | 2 +-
include/qemu/compiler.h | 30 +++++++++++++++++++++++-------
include/qemu/osdep.h | 4 ++--
target/loongarch/cpu.c | 4 ++--
target/loongarch/translate.c | 2 +-
tcg/optimize.c | 8 ++++----
7 files changed, 37 insertions(+), 21 deletions(-)
diff --git a/audio/pwaudio.c b/audio/pwaudio.c
index 3ce5f6507b..bf26fadb06 100644
--- a/audio/pwaudio.c
+++ b/audio/pwaudio.c
@@ -8,16 +8,16 @@
* SPDX-License-Identifier: GPL-2.0-or-later
*/
+#include <spa/param/audio/format-utils.h>
+#include <spa/utils/ringbuffer.h>
+#include <spa/utils/result.h>
+#include <spa/param/props.h>
#include "qemu/osdep.h"
#include "qemu/module.h"
#include "audio.h"
#include <errno.h>
#include "qemu/error-report.h"
#include "qapi/error.h"
-#include <spa/param/audio/format-utils.h>
-#include <spa/utils/ringbuffer.h>
-#include <spa/utils/result.h>
-#include <spa/param/props.h>
#include <pipewire/pipewire.h>
#include "trace.h"
diff --git a/hw/arm/smmuv3.c b/hw/arm/smmuv3.c
index 6f2b2bd45f..545d82ff04 100644
--- a/hw/arm/smmuv3.c
+++ b/hw/arm/smmuv3.c
@@ -1291,7 +1291,7 @@ static int smmuv3_cmdq_consume(SMMUv3State *s)
cmd_error = SMMU_CERROR_ILL;
break;
}
- QEMU_FALLTHROUGH;
+ fallthrough;
case SMMU_CMD_TLBI_NSNH_ALL:
trace_smmuv3_cmdq_tlbi_nh();
smmu_inv_notifiers_all(&s->smmu_state);
diff --git a/include/qemu/compiler.h b/include/qemu/compiler.h
index 1109482a00..959982805d 100644
--- a/include/qemu/compiler.h
+++ b/include/qemu/compiler.h
@@ -165,15 +165,31 @@
#define QEMU_ALWAYS_INLINE
#endif
-/**
- * In most cases, normal "fallthrough" comments are good enough for
- * switch-case statements, but sometimes the compiler has problems
- * with those. In that case you can use QEMU_FALLTHROUGH instead.
+/*
+ * Add the pseudo keyword 'fallthrough' so case statement blocks
+ * must end with any of these keywords:
+ * break;
+ * fallthrough;
+ * continue;
+ * goto <label>;
+ * return [expression];
+ *
+ * gcc: https://gcc.gnu.org/onlinedocs/gcc/Statement-Attributes.html#Statement-Attributes
*/
-#if __has_attribute(fallthrough)
-# define QEMU_FALLTHROUGH __attribute__((fallthrough))
+
+/*
+ * glib_macros.h contains its own definition of fallthrough, so if we define
+ * the pseudokeyword here it will expand when the glib header checks for the
+ * attribute. glib headers must be #included after this header.
+ */
+#ifdef fallthrough
+#undef fallthrough
+#endif
+
+#if __has_attribute(__fallthrough__)
+# define fallthrough __attribute__((__fallthrough__))
#else
-# define QEMU_FALLTHROUGH do {} while (0) /* fallthrough */
+# define fallthrough do {} while (0) /* fallthrough */
#endif
#ifdef CONFIG_CFI
diff --git a/include/qemu/osdep.h b/include/qemu/osdep.h
index 475a1c62ff..8f790f0deb 100644
--- a/include/qemu/osdep.h
+++ b/include/qemu/osdep.h
@@ -50,8 +50,6 @@
*/
#pragma GCC poison TARGET_WORDS_BIGENDIAN
-#include "qemu/compiler.h"
-
/* Older versions of C++ don't get definitions of various macros from
* stdlib.h unless we define these macros before first inclusion of
* that system header.
@@ -160,6 +158,8 @@ QEMU_EXTERN_C int daemon(int, int);
*/
#include "glib-compat.h"
+#include "qemu/compiler.h"
+
#ifdef _WIN32
#include "sysemu/os-win32.h"
#endif
diff --git a/target/loongarch/cpu.c b/target/loongarch/cpu.c
index 2bea7ca5d5..e01d626b15 100644
--- a/target/loongarch/cpu.c
+++ b/target/loongarch/cpu.c
@@ -178,7 +178,7 @@ static void loongarch_cpu_do_interrupt(CPUState *cs)
env->CSR_DBG = FIELD_DP64(env->CSR_DBG, CSR_DBG, DEI, 1);
goto set_DERA;
}
- QEMU_FALLTHROUGH;
+ fallthrough;
case EXCCODE_PIF:
case EXCCODE_ADEF:
cause = cs->exception_index;
@@ -193,7 +193,7 @@ static void loongarch_cpu_do_interrupt(CPUState *cs)
case EXCCODE_SXD:
case EXCCODE_ASXD:
env->CSR_BADV = env->pc;
- QEMU_FALLTHROUGH;
+ fallthrough;
case EXCCODE_BCE:
case EXCCODE_ADEM:
case EXCCODE_PIL:
diff --git a/target/loongarch/translate.c b/target/loongarch/translate.c
index 21f4db6fbd..36fceb1beb 100644
--- a/target/loongarch/translate.c
+++ b/target/loongarch/translate.c
@@ -317,7 +317,7 @@ static void loongarch_tr_tb_stop(DisasContextBase *dcbase, CPUState *cs)
break;
case DISAS_EXIT_UPDATE:
tcg_gen_movi_tl(cpu_pc, ctx->base.pc_next);
- QEMU_FALLTHROUGH;
+ fallthrough;
case DISAS_EXIT:
tcg_gen_exit_tb(NULL, 0);
break;
diff --git a/tcg/optimize.c b/tcg/optimize.c
index 3013eb04e6..3da135a353 100644
--- a/tcg/optimize.c
+++ b/tcg/optimize.c
@@ -1089,7 +1089,7 @@ static bool fold_brcond2(OptContext *ctx, TCGOp *op)
case TCG_COND_NE:
inv = 1;
- QEMU_FALLTHROUGH;
+ fallthrough;
case TCG_COND_EQ:
/*
* Simplify EQ/NE comparisons where one of the pairs
@@ -1445,7 +1445,7 @@ static bool fold_exts(OptContext *ctx, TCGOp *op)
break;
case INDEX_op_ext_i32_i64:
type_change = true;
- QEMU_FALLTHROUGH;
+ fallthrough;
case INDEX_op_ext32s_i64:
sign = INT32_MIN;
z_mask = (uint32_t)z_mask;
@@ -1489,7 +1489,7 @@ static bool fold_extu(OptContext *ctx, TCGOp *op)
case INDEX_op_extrl_i64_i32:
case INDEX_op_extu_i32_i64:
type_change = true;
- QEMU_FALLTHROUGH;
+ fallthrough;
case INDEX_op_ext32u_i64:
z_mask = (uint32_t)z_mask;
break;
@@ -1861,7 +1861,7 @@ static bool fold_setcond2(OptContext *ctx, TCGOp *op)
case TCG_COND_NE:
inv = 1;
- QEMU_FALLTHROUGH;
+ fallthrough;
case TCG_COND_EQ:
/*
* Simplify EQ/NE comparisons where one of the pairs
--
2.39.2
^ permalink raw reply related [flat|nested] 106+ messages in thread
* Re: [RFC PATCH v3 01/78] include/qemu/compiler.h: replace QEMU_FALLTHROUGH with fallthrough
2023-10-13 8:45 ` [RFC PATCH v3 01/78] include/qemu/compiler.h: replace QEMU_FALLTHROUGH with fallthrough Emmanouil Pitsidianakis
@ 2023-10-13 9:13 ` gaosong
0 siblings, 0 replies; 106+ messages in thread
From: gaosong @ 2023-10-13 9:13 UTC (permalink / raw)
To: Emmanouil Pitsidianakis, qemu-devel
Cc: Gerd Hoffmann, Marc-André Lureau, Eric Auger, Peter Maydell,
Xiaojuan Yang, Richard Henderson, open list:ARM SMMU
在 2023/10/13 下午4:45, Emmanouil Pitsidianakis 写道:
> Signed-off-by: Emmanouil Pitsidianakis <manos.pitsidianakis@linaro.org>
> ---
> audio/pwaudio.c | 8 ++++----
> hw/arm/smmuv3.c | 2 +-
> include/qemu/compiler.h | 30 +++++++++++++++++++++++-------
> include/qemu/osdep.h | 4 ++--
> target/loongarch/cpu.c | 4 ++--
> target/loongarch/translate.c | 2 +-
> tcg/optimize.c | 8 ++++----
> 7 files changed, 37 insertions(+), 21 deletions(-)
For LoongArch:
Reviewed-by: Song Gao <gaosong@loongson.cn>
Thanks.
Song Gao.
> diff --git a/audio/pwaudio.c b/audio/pwaudio.c
> index 3ce5f6507b..bf26fadb06 100644
> --- a/audio/pwaudio.c
> +++ b/audio/pwaudio.c
> @@ -8,16 +8,16 @@
> * SPDX-License-Identifier: GPL-2.0-or-later
> */
>
> +#include <spa/param/audio/format-utils.h>
> +#include <spa/utils/ringbuffer.h>
> +#include <spa/utils/result.h>
> +#include <spa/param/props.h>
> #include "qemu/osdep.h"
> #include "qemu/module.h"
> #include "audio.h"
> #include <errno.h>
> #include "qemu/error-report.h"
> #include "qapi/error.h"
> -#include <spa/param/audio/format-utils.h>
> -#include <spa/utils/ringbuffer.h>
> -#include <spa/utils/result.h>
> -#include <spa/param/props.h>
>
> #include <pipewire/pipewire.h>
> #include "trace.h"
> diff --git a/hw/arm/smmuv3.c b/hw/arm/smmuv3.c
> index 6f2b2bd45f..545d82ff04 100644
> --- a/hw/arm/smmuv3.c
> +++ b/hw/arm/smmuv3.c
> @@ -1291,7 +1291,7 @@ static int smmuv3_cmdq_consume(SMMUv3State *s)
> cmd_error = SMMU_CERROR_ILL;
> break;
> }
> - QEMU_FALLTHROUGH;
> + fallthrough;
> case SMMU_CMD_TLBI_NSNH_ALL:
> trace_smmuv3_cmdq_tlbi_nh();
> smmu_inv_notifiers_all(&s->smmu_state);
> diff --git a/include/qemu/compiler.h b/include/qemu/compiler.h
> index 1109482a00..959982805d 100644
> --- a/include/qemu/compiler.h
> +++ b/include/qemu/compiler.h
> @@ -165,15 +165,31 @@
> #define QEMU_ALWAYS_INLINE
> #endif
>
> -/**
> - * In most cases, normal "fallthrough" comments are good enough for
> - * switch-case statements, but sometimes the compiler has problems
> - * with those. In that case you can use QEMU_FALLTHROUGH instead.
> +/*
> + * Add the pseudo keyword 'fallthrough' so case statement blocks
> + * must end with any of these keywords:
> + * break;
> + * fallthrough;
> + * continue;
> + * goto <label>;
> + * return [expression];
> + *
> + * gcc: https://gcc.gnu.org/onlinedocs/gcc/Statement-Attributes.html#Statement-Attributes
> */
> -#if __has_attribute(fallthrough)
> -# define QEMU_FALLTHROUGH __attribute__((fallthrough))
> +
> +/*
> + * glib_macros.h contains its own definition of fallthrough, so if we define
> + * the pseudokeyword here it will expand when the glib header checks for the
> + * attribute. glib headers must be #included after this header.
> + */
> +#ifdef fallthrough
> +#undef fallthrough
> +#endif
> +
> +#if __has_attribute(__fallthrough__)
> +# define fallthrough __attribute__((__fallthrough__))
> #else
> -# define QEMU_FALLTHROUGH do {} while (0) /* fallthrough */
> +# define fallthrough do {} while (0) /* fallthrough */
> #endif
>
> #ifdef CONFIG_CFI
> diff --git a/include/qemu/osdep.h b/include/qemu/osdep.h
> index 475a1c62ff..8f790f0deb 100644
> --- a/include/qemu/osdep.h
> +++ b/include/qemu/osdep.h
> @@ -50,8 +50,6 @@
> */
> #pragma GCC poison TARGET_WORDS_BIGENDIAN
>
> -#include "qemu/compiler.h"
> -
> /* Older versions of C++ don't get definitions of various macros from
> * stdlib.h unless we define these macros before first inclusion of
> * that system header.
> @@ -160,6 +158,8 @@ QEMU_EXTERN_C int daemon(int, int);
> */
> #include "glib-compat.h"
>
> +#include "qemu/compiler.h"
> +
> #ifdef _WIN32
> #include "sysemu/os-win32.h"
> #endif
> diff --git a/target/loongarch/cpu.c b/target/loongarch/cpu.c
> index 2bea7ca5d5..e01d626b15 100644
> --- a/target/loongarch/cpu.c
> +++ b/target/loongarch/cpu.c
> @@ -178,7 +178,7 @@ static void loongarch_cpu_do_interrupt(CPUState *cs)
> env->CSR_DBG = FIELD_DP64(env->CSR_DBG, CSR_DBG, DEI, 1);
> goto set_DERA;
> }
> - QEMU_FALLTHROUGH;
> + fallthrough;
> case EXCCODE_PIF:
> case EXCCODE_ADEF:
> cause = cs->exception_index;
> @@ -193,7 +193,7 @@ static void loongarch_cpu_do_interrupt(CPUState *cs)
> case EXCCODE_SXD:
> case EXCCODE_ASXD:
> env->CSR_BADV = env->pc;
> - QEMU_FALLTHROUGH;
> + fallthrough;
> case EXCCODE_BCE:
> case EXCCODE_ADEM:
> case EXCCODE_PIL:
> diff --git a/target/loongarch/translate.c b/target/loongarch/translate.c
> index 21f4db6fbd..36fceb1beb 100644
> --- a/target/loongarch/translate.c
> +++ b/target/loongarch/translate.c
> @@ -317,7 +317,7 @@ static void loongarch_tr_tb_stop(DisasContextBase *dcbase, CPUState *cs)
> break;
> case DISAS_EXIT_UPDATE:
> tcg_gen_movi_tl(cpu_pc, ctx->base.pc_next);
> - QEMU_FALLTHROUGH;
> + fallthrough;
> case DISAS_EXIT:
> tcg_gen_exit_tb(NULL, 0);
> break;
> diff --git a/tcg/optimize.c b/tcg/optimize.c
> index 3013eb04e6..3da135a353 100644
> --- a/tcg/optimize.c
> +++ b/tcg/optimize.c
> @@ -1089,7 +1089,7 @@ static bool fold_brcond2(OptContext *ctx, TCGOp *op)
>
> case TCG_COND_NE:
> inv = 1;
> - QEMU_FALLTHROUGH;
> + fallthrough;
> case TCG_COND_EQ:
> /*
> * Simplify EQ/NE comparisons where one of the pairs
> @@ -1445,7 +1445,7 @@ static bool fold_exts(OptContext *ctx, TCGOp *op)
> break;
> case INDEX_op_ext_i32_i64:
> type_change = true;
> - QEMU_FALLTHROUGH;
> + fallthrough;
> case INDEX_op_ext32s_i64:
> sign = INT32_MIN;
> z_mask = (uint32_t)z_mask;
> @@ -1489,7 +1489,7 @@ static bool fold_extu(OptContext *ctx, TCGOp *op)
> case INDEX_op_extrl_i64_i32:
> case INDEX_op_extu_i32_i64:
> type_change = true;
> - QEMU_FALLTHROUGH;
> + fallthrough;
> case INDEX_op_ext32u_i64:
> z_mask = (uint32_t)z_mask;
> break;
> @@ -1861,7 +1861,7 @@ static bool fold_setcond2(OptContext *ctx, TCGOp *op)
>
> case TCG_COND_NE:
> inv = 1;
> - QEMU_FALLTHROUGH;
> + fallthrough;
> case TCG_COND_EQ:
> /*
> * Simplify EQ/NE comparisons where one of the pairs
^ permalink raw reply [flat|nested] 106+ messages in thread
* [RFC PATCH v3 02/78] block: add fallthrough pseudo-keyword
2023-10-13 8:45 [RFC PATCH v3 00/78] Strict disable implicit fallthrough Emmanouil Pitsidianakis
2023-10-13 8:45 ` [RFC PATCH v3 01/78] include/qemu/compiler.h: replace QEMU_FALLTHROUGH with fallthrough Emmanouil Pitsidianakis
@ 2023-10-13 8:45 ` Emmanouil Pitsidianakis
2023-10-16 15:03 ` Stefan Hajnoczi
2023-10-13 8:45 ` [RFC PATCH v3 03/78] fpu/softfloat: " Emmanouil Pitsidianakis
` (77 subsequent siblings)
79 siblings, 1 reply; 106+ messages in thread
From: Emmanouil Pitsidianakis @ 2023-10-13 8:45 UTC (permalink / raw)
To: qemu-devel
Cc: Emmanouil Pitsidianakis, John Snow, Vladimir Sementsov-Ogievskiy,
Kevin Wolf, Hanna Reitz, Stefan Hajnoczi, Fam Zheng,
Ronnie Sahlberg, Paolo Bonzini, Peter Lieven, Jeff Cody,
open list:Block Jobs
In preparation of raising -Wimplicit-fallthrough to 5, replace all
fall-through comments with the fallthrough attribute pseudo-keyword.
Signed-off-by: Emmanouil Pitsidianakis <manos.pitsidianakis@linaro.org>
---
block/block-copy.c | 1 +
block/file-posix.c | 1 +
block/io.c | 1 +
block/iscsi.c | 1 +
block/qcow2-cluster.c | 5 ++++-
block/vhdx.c | 17 +++++++++++++----
6 files changed, 21 insertions(+), 5 deletions(-)
diff --git a/block/block-copy.c b/block/block-copy.c
index 1c60368d72..b4ceb6a079 100644
--- a/block/block-copy.c
+++ b/block/block-copy.c
@@ -508,6 +508,7 @@ block_copy_do_copy(BlockCopyState *s, int64_t offset, int64_t bytes,
trace_block_copy_copy_range_fail(s, offset, ret);
*method = COPY_READ_WRITE;
/* Fall through to read+write with allocated buffer */
+ fallthrough;
case COPY_READ_WRITE_CLUSTER:
case COPY_READ_WRITE:
diff --git a/block/file-posix.c b/block/file-posix.c
index 50e2b20d5c..31c7719da5 100644
--- a/block/file-posix.c
+++ b/block/file-posix.c
@@ -1013,6 +1013,7 @@ static int raw_handle_perm_lock(BlockDriverState *bs,
bs->filename);
}
/* fall through to unlock bytes. */
+ fallthrough;
case RAW_PL_ABORT:
raw_apply_lock_bytes(s, s->fd, s->perm, ~s->shared_perm,
true, &local_err);
diff --git a/block/io.c b/block/io.c
index e7f9448d5a..cc05457d02 100644
--- a/block/io.c
+++ b/block/io.c
@@ -2034,6 +2034,7 @@ bdrv_co_write_req_finish(BdrvChild *child, int64_t offset, int64_t bytes,
case BDRV_TRACKED_WRITE:
stat64_max(&bs->wr_highest_offset, offset + bytes);
/* fall through, to set dirty bits */
+ fallthrough;
case BDRV_TRACKED_DISCARD:
bdrv_set_dirty(bs, offset, bytes);
break;
diff --git a/block/iscsi.c b/block/iscsi.c
index 5640c8b565..2fb7037748 100644
--- a/block/iscsi.c
+++ b/block/iscsi.c
@@ -1461,6 +1461,7 @@ static void iscsi_readcapacity_sync(IscsiLun *iscsilun, Error **errp)
break;
}
/* Fall through and try READ CAPACITY(10) instead. */
+ fallthrough;
case TYPE_ROM:
task = iscsi_readcapacity10_sync(iscsilun->iscsi, iscsilun->lun, 0, 0);
if (task != NULL && task->status == SCSI_STATUS_GOOD) {
diff --git a/block/qcow2-cluster.c b/block/qcow2-cluster.c
index f4f6cd6ad0..c50143d493 100644
--- a/block/qcow2-cluster.c
+++ b/block/qcow2-cluster.c
@@ -1333,13 +1333,16 @@ static bool cluster_needs_new_alloc(BlockDriverState *bs, uint64_t l2_entry)
{
switch (qcow2_get_cluster_type(bs, l2_entry)) {
case QCOW2_CLUSTER_NORMAL:
+ fallthrough;
case QCOW2_CLUSTER_ZERO_ALLOC:
if (l2_entry & QCOW_OFLAG_COPIED) {
return false;
}
- /* fallthrough */
+ fallthrough;
case QCOW2_CLUSTER_UNALLOCATED:
+ fallthrough;
case QCOW2_CLUSTER_COMPRESSED:
+ fallthrough;
case QCOW2_CLUSTER_ZERO_PLAIN:
return true;
default:
diff --git a/block/vhdx.c b/block/vhdx.c
index a67edcc03e..9000b3fcea 100644
--- a/block/vhdx.c
+++ b/block/vhdx.c
@@ -1201,10 +1201,14 @@ vhdx_co_readv(BlockDriverState *bs, int64_t sector_num, int nb_sectors,
/* check the payload block state */
switch (s->bat[sinfo.bat_idx] & VHDX_BAT_STATE_BIT_MASK) {
- case PAYLOAD_BLOCK_NOT_PRESENT: /* fall through */
+ case PAYLOAD_BLOCK_NOT_PRESENT:
+ fallthrough;
case PAYLOAD_BLOCK_UNDEFINED:
+ fallthrough;
case PAYLOAD_BLOCK_UNMAPPED:
+ fallthrough;
case PAYLOAD_BLOCK_UNMAPPED_v095:
+ fallthrough;
case PAYLOAD_BLOCK_ZERO:
/* return zero */
qemu_iovec_memset(&hd_qiov, 0, 0, sinfo.bytes_avail);
@@ -1222,6 +1226,7 @@ vhdx_co_readv(BlockDriverState *bs, int64_t sector_num, int nb_sectors,
case PAYLOAD_BLOCK_PARTIALLY_PRESENT:
/* we don't yet support difference files, fall through
* to error */
+ fallthrough;
default:
ret = -EIO;
goto exit;
@@ -1373,10 +1378,13 @@ vhdx_co_writev(BlockDriverState *bs, int64_t sector_num, int nb_sectors,
* data that is not part of this write, so we must pad
* the rest of the buffer to zeroes */
use_zero_buffers = true;
- /* fall through */
- case PAYLOAD_BLOCK_NOT_PRESENT: /* fall through */
+ fallthrough;
+ case PAYLOAD_BLOCK_NOT_PRESENT:
+ fallthrough;
case PAYLOAD_BLOCK_UNMAPPED:
+ fallthrough;
case PAYLOAD_BLOCK_UNMAPPED_v095:
+ fallthrough;
case PAYLOAD_BLOCK_UNDEFINED:
bat_prior_offset = sinfo.file_offset;
ret = vhdx_allocate_block(bs, s, &sinfo.file_offset,
@@ -1431,7 +1439,7 @@ vhdx_co_writev(BlockDriverState *bs, int64_t sector_num, int nb_sectors,
}
}
- /* fall through */
+ fallthrough;
case PAYLOAD_BLOCK_FULLY_PRESENT:
/* if the file offset address is in the header zone,
* there is a problem */
@@ -1457,6 +1465,7 @@ vhdx_co_writev(BlockDriverState *bs, int64_t sector_num, int nb_sectors,
case PAYLOAD_BLOCK_PARTIALLY_PRESENT:
/* we don't yet support difference files, fall through
* to error */
+ fallthrough;
default:
ret = -EIO;
goto exit;
--
2.39.2
^ permalink raw reply related [flat|nested] 106+ messages in thread
* Re: [RFC PATCH v3 02/78] block: add fallthrough pseudo-keyword
2023-10-13 8:45 ` [RFC PATCH v3 02/78] block: add fallthrough pseudo-keyword Emmanouil Pitsidianakis
@ 2023-10-16 15:03 ` Stefan Hajnoczi
0 siblings, 0 replies; 106+ messages in thread
From: Stefan Hajnoczi @ 2023-10-16 15:03 UTC (permalink / raw)
To: Emmanouil Pitsidianakis
Cc: qemu-devel, John Snow, Vladimir Sementsov-Ogievskiy, Kevin Wolf,
Hanna Reitz, Fam Zheng, Ronnie Sahlberg, Paolo Bonzini,
Peter Lieven, Jeff Cody, open list:Block Jobs
[-- Attachment #1: Type: text/plain, Size: 628 bytes --]
On Fri, Oct 13, 2023 at 11:45:30AM +0300, Emmanouil Pitsidianakis wrote:
> In preparation of raising -Wimplicit-fallthrough to 5, replace all
> fall-through comments with the fallthrough attribute pseudo-keyword.
>
> Signed-off-by: Emmanouil Pitsidianakis <manos.pitsidianakis@linaro.org>
> ---
> block/block-copy.c | 1 +
> block/file-posix.c | 1 +
> block/io.c | 1 +
> block/iscsi.c | 1 +
> block/qcow2-cluster.c | 5 ++++-
> block/vhdx.c | 17 +++++++++++++----
> 6 files changed, 21 insertions(+), 5 deletions(-)
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]
^ permalink raw reply [flat|nested] 106+ messages in thread
* [RFC PATCH v3 03/78] fpu/softfloat: add fallthrough pseudo-keyword
2023-10-13 8:45 [RFC PATCH v3 00/78] Strict disable implicit fallthrough Emmanouil Pitsidianakis
2023-10-13 8:45 ` [RFC PATCH v3 01/78] include/qemu/compiler.h: replace QEMU_FALLTHROUGH with fallthrough Emmanouil Pitsidianakis
2023-10-13 8:45 ` [RFC PATCH v3 02/78] block: add fallthrough pseudo-keyword Emmanouil Pitsidianakis
@ 2023-10-13 8:45 ` Emmanouil Pitsidianakis
2023-10-16 18:56 ` Alex Bennée
2023-10-13 8:45 ` [RFC PATCH v3 04/78] qapi/opts-visitor: " Emmanouil Pitsidianakis
` (76 subsequent siblings)
79 siblings, 1 reply; 106+ messages in thread
From: Emmanouil Pitsidianakis @ 2023-10-13 8:45 UTC (permalink / raw)
To: qemu-devel
Cc: Emmanouil Pitsidianakis, Aurelien Jarno, Peter Maydell,
Alex Bennée
In preparation of raising -Wimplicit-fallthrough to 5, replace all
fall-through comments with the fallthrough attribute pseudo-keyword.
Signed-off-by: Emmanouil Pitsidianakis <manos.pitsidianakis@linaro.org>
---
fpu/softfloat-parts.c.inc | 8 ++++----
fpu/softfloat.c | 7 ++++---
2 files changed, 8 insertions(+), 7 deletions(-)
diff --git a/fpu/softfloat-parts.c.inc b/fpu/softfloat-parts.c.inc
index a44649f4f4..df64cc7a29 100644
--- a/fpu/softfloat-parts.c.inc
+++ b/fpu/softfloat-parts.c.inc
@@ -181,7 +181,7 @@ static void partsN(uncanon_normal)(FloatPartsN *p, float_status *s,
break;
case float_round_to_odd:
overflow_norm = true;
- /* fall through */
+ fallthrough;
case float_round_to_odd_inf:
if (N > 64 && frac_lsb == 0) {
inc = p->frac_hi & 1 ? 0 : round_mask;
@@ -1068,7 +1068,7 @@ static int64_t partsN(float_to_sint)(FloatPartsN *p, FloatRoundMode rmode,
switch (p->cls) {
case float_class_snan:
flags |= float_flag_invalid_snan;
- /* fall through */
+ fallthrough;
case float_class_qnan:
flags |= float_flag_invalid;
r = max;
@@ -1135,7 +1135,7 @@ static uint64_t partsN(float_to_uint)(FloatPartsN *p, FloatRoundMode rmode,
switch (p->cls) {
case float_class_snan:
flags |= float_flag_invalid_snan;
- /* fall through */
+ fallthrough;
case float_class_qnan:
flags |= float_flag_invalid;
r = max;
@@ -1198,7 +1198,7 @@ static int64_t partsN(float_to_sint_modulo)(FloatPartsN *p,
switch (p->cls) {
case float_class_snan:
flags |= float_flag_invalid_snan;
- /* fall through */
+ fallthrough;
case float_class_qnan:
flags |= float_flag_invalid;
r = 0;
diff --git a/fpu/softfloat.c b/fpu/softfloat.c
index 027a8e576d..e16e1896ee 100644
--- a/fpu/softfloat.c
+++ b/fpu/softfloat.c
@@ -1835,6 +1835,7 @@ static floatx80 floatx80_round_pack_canonical(FloatParts128 *p,
break;
}
/* rounded to inf -- fall through to set frac correctly */
+ fallthrough;
case float_class_inf:
/* x86 and m68k differ in the setting of the integer bit. */
@@ -2670,7 +2671,7 @@ static void parts_float_to_ahp(FloatParts64 *a, float_status *s)
switch (a->cls) {
case float_class_snan:
float_raise(float_flag_invalid_snan, s);
- /* fall through */
+ fallthrough;
case float_class_qnan:
/*
* There is no NaN in the destination format. Raise Invalid
@@ -3199,7 +3200,7 @@ static Int128 float128_to_int128_scalbn(float128 a, FloatRoundMode rmode,
switch (p.cls) {
case float_class_snan:
flags |= float_flag_invalid_snan;
- /* fall through */
+ fallthrough;
case float_class_qnan:
flags |= float_flag_invalid;
r = UINT128_MAX;
@@ -3626,7 +3627,7 @@ static Int128 float128_to_uint128_scalbn(float128 a, FloatRoundMode rmode,
switch (p.cls) {
case float_class_snan:
flags |= float_flag_invalid_snan;
- /* fall through */
+ fallthrough;
case float_class_qnan:
flags |= float_flag_invalid;
r = UINT128_MAX;
--
2.39.2
^ permalink raw reply related [flat|nested] 106+ messages in thread
* Re: [RFC PATCH v3 03/78] fpu/softfloat: add fallthrough pseudo-keyword
2023-10-13 8:45 ` [RFC PATCH v3 03/78] fpu/softfloat: " Emmanouil Pitsidianakis
@ 2023-10-16 18:56 ` Alex Bennée
0 siblings, 0 replies; 106+ messages in thread
From: Alex Bennée @ 2023-10-16 18:56 UTC (permalink / raw)
To: Emmanouil Pitsidianakis; +Cc: qemu-devel, Aurelien Jarno, Peter Maydell
Emmanouil Pitsidianakis <manos.pitsidianakis@linaro.org> writes:
> In preparation of raising -Wimplicit-fallthrough to 5, replace all
> fall-through comments with the fallthrough attribute pseudo-keyword.
>
> Signed-off-by: Emmanouil Pitsidianakis
> <manos.pitsidianakis@linaro.org>
Acked-by: Alex Bennée <alex.bennee@linaro.org>
--
Alex Bennée
Virtualisation Tech Lead @ Linaro
^ permalink raw reply [flat|nested] 106+ messages in thread
* [RFC PATCH v3 04/78] qapi/opts-visitor: add fallthrough pseudo-keyword
2023-10-13 8:45 [RFC PATCH v3 00/78] Strict disable implicit fallthrough Emmanouil Pitsidianakis
` (2 preceding siblings ...)
2023-10-13 8:45 ` [RFC PATCH v3 03/78] fpu/softfloat: " Emmanouil Pitsidianakis
@ 2023-10-13 8:45 ` Emmanouil Pitsidianakis
2023-10-13 8:45 ` [RFC PATCH v3 05/78] qobject/json: " Emmanouil Pitsidianakis
` (75 subsequent siblings)
79 siblings, 0 replies; 106+ messages in thread
From: Emmanouil Pitsidianakis @ 2023-10-13 8:45 UTC (permalink / raw)
To: qemu-devel; +Cc: Emmanouil Pitsidianakis, Markus Armbruster, Michael Roth
In preparation of raising -Wimplicit-fallthrough to 5, replace all
fall-through comments with the fallthrough attribute pseudo-keyword.
Signed-off-by: Emmanouil Pitsidianakis <manos.pitsidianakis@linaro.org>
---
qapi/opts-visitor.c | 1 +
qapi/string-input-visitor.c | 4 ++--
2 files changed, 3 insertions(+), 2 deletions(-)
diff --git a/qapi/opts-visitor.c b/qapi/opts-visitor.c
index 8f1efab8b9..d7376bf239 100644
--- a/qapi/opts-visitor.c
+++ b/qapi/opts-visitor.c
@@ -266,6 +266,7 @@ opts_next_list(Visitor *v, GenericList *tail, size_t size)
}
ov->list_mode = LM_IN_PROGRESS;
/* range has been completed, fall through in order to pop option */
+ fallthrough;
case LM_IN_PROGRESS: {
const QemuOpt *opt;
diff --git a/qapi/string-input-visitor.c b/qapi/string-input-visitor.c
index 197139c1c0..1ce43da20b 100644
--- a/qapi/string-input-visitor.c
+++ b/qapi/string-input-visitor.c
@@ -202,7 +202,7 @@ static bool parse_type_int64(Visitor *v, const char *name, int64_t *obj,
return false;
}
assert(siv->lm == LM_INT64_RANGE);
- /* fall through */
+ fallthrough;
case LM_INT64_RANGE:
/* return the next element in the range */
assert(siv->rangeNext.i64 <= siv->rangeEnd.i64);
@@ -292,7 +292,7 @@ static bool parse_type_uint64(Visitor *v, const char *name, uint64_t *obj,
return false;
}
assert(siv->lm == LM_UINT64_RANGE);
- /* fall through */
+ fallthrough;
case LM_UINT64_RANGE:
/* return the next element in the range */
assert(siv->rangeNext.u64 <= siv->rangeEnd.u64);
--
2.39.2
^ permalink raw reply related [flat|nested] 106+ messages in thread
* [RFC PATCH v3 05/78] qobject/json: add fallthrough pseudo-keyword
2023-10-13 8:45 [RFC PATCH v3 00/78] Strict disable implicit fallthrough Emmanouil Pitsidianakis
` (3 preceding siblings ...)
2023-10-13 8:45 ` [RFC PATCH v3 04/78] qapi/opts-visitor: " Emmanouil Pitsidianakis
@ 2023-10-13 8:45 ` Emmanouil Pitsidianakis
2023-10-13 8:45 ` [RFC PATCH v3 06/78] tcg: " Emmanouil Pitsidianakis
` (74 subsequent siblings)
79 siblings, 0 replies; 106+ messages in thread
From: Emmanouil Pitsidianakis @ 2023-10-13 8:45 UTC (permalink / raw)
To: qemu-devel; +Cc: Emmanouil Pitsidianakis, Markus Armbruster
In preparation of raising -Wimplicit-fallthrough to 5, replace all
fall-through comments with the fallthrough attribute pseudo-keyword.
Signed-off-by: Emmanouil Pitsidianakis <manos.pitsidianakis@linaro.org>
---
qobject/json-lexer.c | 4 ++--
qobject/json-parser.c | 5 +++--
2 files changed, 5 insertions(+), 4 deletions(-)
diff --git a/qobject/json-lexer.c b/qobject/json-lexer.c
index 51341d96e4..ab74470ac6 100644
--- a/qobject/json-lexer.c
+++ b/qobject/json-lexer.c
@@ -312,7 +312,7 @@ static void json_lexer_feed_char(JSONLexer *lexer, char ch, bool flush)
case JSON_STRING:
json_message_process_token(lexer, lexer->token, new_state,
lexer->x, lexer->y);
- /* fall through */
+ fallthrough;
case IN_START:
g_string_truncate(lexer->token, 0);
new_state = lexer->start_state;
@@ -321,7 +321,7 @@ static void json_lexer_feed_char(JSONLexer *lexer, char ch, bool flush)
json_message_process_token(lexer, lexer->token, JSON_ERROR,
lexer->x, lexer->y);
new_state = IN_RECOVERY;
- /* fall through */
+ fallthrough;
case IN_RECOVERY:
g_string_truncate(lexer->token, 0);
break;
diff --git a/qobject/json-parser.c b/qobject/json-parser.c
index d498db6e70..4dc622dcc9 100644
--- a/qobject/json-parser.c
+++ b/qobject/json-parser.c
@@ -214,7 +214,7 @@ static QString *parse_string(JSONParserContext *ctxt, JSONToken *token)
}
ptr++;
}
- /* fall through */
+ fallthrough;
default:
cp = mod_utf8_codepoint(ptr, 6, &end);
if (cp < 0) {
@@ -518,8 +518,9 @@ static QObject *parse_literal(JSONParserContext *ctxt)
}
assert(ret == -ERANGE);
}
+ /* fall through to JSON_FLOAT */
+ fallthrough;
}
- /* fall through to JSON_FLOAT */
case JSON_FLOAT:
/* FIXME dependent on locale; a pervasive issue in QEMU */
/* FIXME our lexer matches RFC 8259 in forbidding Inf or NaN,
--
2.39.2
^ permalink raw reply related [flat|nested] 106+ messages in thread
* [RFC PATCH v3 06/78] tcg: add fallthrough pseudo-keyword
2023-10-13 8:45 [RFC PATCH v3 00/78] Strict disable implicit fallthrough Emmanouil Pitsidianakis
` (4 preceding siblings ...)
2023-10-13 8:45 ` [RFC PATCH v3 05/78] qobject/json: " Emmanouil Pitsidianakis
@ 2023-10-13 8:45 ` Emmanouil Pitsidianakis
2023-10-13 8:45 ` [RFC PATCH v3 07/78] hw/virtio/virtio-balloon.c: " Emmanouil Pitsidianakis
` (73 subsequent siblings)
79 siblings, 0 replies; 106+ messages in thread
From: Emmanouil Pitsidianakis @ 2023-10-13 8:45 UTC (permalink / raw)
To: qemu-devel
Cc: Emmanouil Pitsidianakis, Paolo Bonzini, Richard Henderson,
Eduardo Habkost, WANG Xuerui, Philippe Mathieu-Daudé,
Aurelien Jarno, Huacai Chen, Jiaxun Yang, Aleksandar Rikalo,
Palmer Dabbelt, Alistair Francis, Stefan Weil,
open list:AArch64 TCG target, open list:RISC-V TCG target
In preparation of raising -Wimplicit-fallthrough to 5, replace all
fall-through comments with the fallthrough attribute pseudo-keyword.
Signed-off-by: Emmanouil Pitsidianakis <manos.pitsidianakis@linaro.org>
---
target/i386/tcg/translate.c | 3 +++
tcg/aarch64/tcg-target.c.inc | 15 ++++++++++++++-
tcg/arm/tcg-target.c.inc | 5 +++--
tcg/i386/tcg-target.c.inc | 20 ++++++++++++++------
tcg/loongarch64/tcg-target.c.inc | 4 ++--
tcg/mips/tcg-target.c.inc | 8 ++++++--
tcg/ppc/tcg-target.c.inc | 19 ++++++++++++++-----
tcg/riscv/tcg-target.c.inc | 5 +++--
tcg/s390x/tcg-target.c.inc | 8 ++++++--
tcg/tcg-op-gvec.c | 24 ++++++++++++------------
tcg/tcg-op-ldst.c | 2 +-
tcg/tcg.c | 24 +++++++++++++-----------
tcg/tci.c | 2 +-
tcg/tci/tcg-target.c.inc | 2 +-
14 files changed, 93 insertions(+), 48 deletions(-)
diff --git a/target/i386/tcg/translate.c b/target/i386/tcg/translate.c
index d2061ec44a..e42e3dd653 100644
--- a/target/i386/tcg/translate.c
+++ b/target/i386/tcg/translate.c
@@ -1996,6 +1996,7 @@ static void gen_shiftd_rm_T1(DisasContext *s, MemOp ot, int op1,
* If TARGET_X86_64 defined then fall through into MO_32 case,
* otherwise fall through default case.
*/
+ fallthrough;
case MO_32:
#ifdef TARGET_X86_64
/* Concatenate the two 32-bit values and use a 64-bit shift. */
@@ -3298,6 +3299,7 @@ static bool disas_insn(DisasContext *s, CPUState *cpu)
if (CODE64(s))
goto illegal_op;
/* fall through */
+ fallthrough;
case 0x80: /* GRP1 */
case 0x81:
case 0x83:
@@ -7046,6 +7048,7 @@ static void i386_tr_tb_stop(DisasContextBase *dcbase, CPUState *cpu)
gen_update_cc_op(dc);
gen_update_eip_cur(dc);
/* fall through */
+ fallthrough;
case DISAS_EOB_ONLY:
gen_eob(dc);
break;
diff --git a/tcg/aarch64/tcg-target.c.inc b/tcg/aarch64/tcg-target.c.inc
index 3afb896a3a..1af7640aab 100644
--- a/tcg/aarch64/tcg-target.c.inc
+++ b/tcg/aarch64/tcg-target.c.inc
@@ -298,7 +298,7 @@ static bool tcg_target_const_match(int64_t val, TCGType type, int ct, int vece)
break;
case TCG_CT_CONST_ANDI:
val = ~val;
- /* fallthru */
+ fallthrough;
case TCG_CT_CONST_ORRI:
if (val == deposit64(val, 32, 32, val)) {
int cmode, imm8;
@@ -1190,6 +1190,7 @@ static bool tcg_out_mov(TCGContext *s, TCGType type, TCGReg ret, TCGReg arg)
break;
}
/* FALLTHRU */
+ fallthrough;
case TCG_TYPE_V64:
tcg_debug_assert(ret >= 32 && arg >= 32);
@@ -2090,6 +2091,7 @@ static void tcg_out_op(TCGContext *s, TCGOpcode opc,
case INDEX_op_add_i32:
a2 = (int32_t)a2;
/* FALLTHRU */
+ fallthrough;
case INDEX_op_add_i64:
if (c2) {
tcg_out_addsubi(s, ext, a0, a1, a2);
@@ -2101,6 +2103,7 @@ static void tcg_out_op(TCGContext *s, TCGOpcode opc,
case INDEX_op_sub_i32:
a2 = (int32_t)a2;
/* FALLTHRU */
+ fallthrough;
case INDEX_op_sub_i64:
if (c2) {
tcg_out_addsubi(s, ext, a0, a1, -a2);
@@ -2117,6 +2120,7 @@ static void tcg_out_op(TCGContext *s, TCGOpcode opc,
case INDEX_op_and_i32:
a2 = (int32_t)a2;
/* FALLTHRU */
+ fallthrough;
case INDEX_op_and_i64:
if (c2) {
tcg_out_logicali(s, I3404_ANDI, ext, a0, a1, a2);
@@ -2128,6 +2132,7 @@ static void tcg_out_op(TCGContext *s, TCGOpcode opc,
case INDEX_op_andc_i32:
a2 = (int32_t)a2;
/* FALLTHRU */
+ fallthrough;
case INDEX_op_andc_i64:
if (c2) {
tcg_out_logicali(s, I3404_ANDI, ext, a0, a1, ~a2);
@@ -2139,6 +2144,7 @@ static void tcg_out_op(TCGContext *s, TCGOpcode opc,
case INDEX_op_or_i32:
a2 = (int32_t)a2;
/* FALLTHRU */
+ fallthrough;
case INDEX_op_or_i64:
if (c2) {
tcg_out_logicali(s, I3404_ORRI, ext, a0, a1, a2);
@@ -2150,6 +2156,7 @@ static void tcg_out_op(TCGContext *s, TCGOpcode opc,
case INDEX_op_orc_i32:
a2 = (int32_t)a2;
/* FALLTHRU */
+ fallthrough;
case INDEX_op_orc_i64:
if (c2) {
tcg_out_logicali(s, I3404_ORRI, ext, a0, a1, ~a2);
@@ -2161,6 +2168,7 @@ static void tcg_out_op(TCGContext *s, TCGOpcode opc,
case INDEX_op_xor_i32:
a2 = (int32_t)a2;
/* FALLTHRU */
+ fallthrough;
case INDEX_op_xor_i64:
if (c2) {
tcg_out_logicali(s, I3404_EORI, ext, a0, a1, a2);
@@ -2172,6 +2180,7 @@ static void tcg_out_op(TCGContext *s, TCGOpcode opc,
case INDEX_op_eqv_i32:
a2 = (int32_t)a2;
/* FALLTHRU */
+ fallthrough;
case INDEX_op_eqv_i64:
if (c2) {
tcg_out_logicali(s, I3404_EORI, ext, a0, a1, ~a2);
@@ -2268,6 +2277,7 @@ static void tcg_out_op(TCGContext *s, TCGOpcode opc,
case INDEX_op_brcond_i32:
a1 = (int32_t)a1;
/* FALLTHRU */
+ fallthrough;
case INDEX_op_brcond_i64:
tcg_out_brcond(s, ext, a2, a0, a1, const_args[1], arg_label(args[3]));
break;
@@ -2275,6 +2285,7 @@ static void tcg_out_op(TCGContext *s, TCGOpcode opc,
case INDEX_op_setcond_i32:
a2 = (int32_t)a2;
/* FALLTHRU */
+ fallthrough;
case INDEX_op_setcond_i64:
tcg_out_cmp(s, ext, a1, a2, c2);
/* Use CSET alias of CSINC Wd, WZR, WZR, invert(cond). */
@@ -2285,6 +2296,7 @@ static void tcg_out_op(TCGContext *s, TCGOpcode opc,
case INDEX_op_negsetcond_i32:
a2 = (int32_t)a2;
/* FALLTHRU */
+ fallthrough;
case INDEX_op_negsetcond_i64:
tcg_out_cmp(s, ext, a1, a2, c2);
/* Use CSETM alias of CSINV Wd, WZR, WZR, invert(cond). */
@@ -2295,6 +2307,7 @@ static void tcg_out_op(TCGContext *s, TCGOpcode opc,
case INDEX_op_movcond_i32:
a2 = (int32_t)a2;
/* FALLTHRU */
+ fallthrough;
case INDEX_op_movcond_i64:
tcg_out_cmp(s, ext, a1, a2, c2);
tcg_out_insn(s, 3506, CSEL, ext, a0, REG0(3), REG0(4), args[5]);
diff --git a/tcg/arm/tcg-target.c.inc b/tcg/arm/tcg-target.c.inc
index 0d9c2d157b..ceb747183d 100644
--- a/tcg/arm/tcg-target.c.inc
+++ b/tcg/arm/tcg-target.c.inc
@@ -529,6 +529,7 @@ static bool tcg_target_const_match(int64_t val, TCGType type, int ct, int vece)
case TCG_CT_CONST_ANDI:
val = ~val;
/* fallthru */
+ fallthrough;
case TCG_CT_CONST_ORRI:
if (val == deposit64(val, 32, 32, val)) {
int cmode, imm8;
@@ -2677,7 +2678,7 @@ static void tcg_out_vec_op(TCGContext *s, TCGOpcode opc,
return;
}
a2 = ~a2;
- /* fall through */
+ fallthrough;
case INDEX_op_and_vec:
if (const_args[2]) {
is_shimm1632(~a2, &cmode, &imm8);
@@ -2697,7 +2698,7 @@ static void tcg_out_vec_op(TCGContext *s, TCGOpcode opc,
return;
}
a2 = ~a2;
- /* fall through */
+ fallthrough;
case INDEX_op_or_vec:
if (const_args[2]) {
is_shimm1632(a2, &cmode, &imm8);
diff --git a/tcg/i386/tcg-target.c.inc b/tcg/i386/tcg-target.c.inc
index 788d608150..8f0764156e 100644
--- a/tcg/i386/tcg-target.c.inc
+++ b/tcg/i386/tcg-target.c.inc
@@ -181,6 +181,7 @@ static bool patch_reloc(tcg_insn_unit *code_ptr, int type,
return false;
}
/* FALLTHRU */
+ fallthrough;
case R_386_32:
tcg_patch32(code_ptr, value);
break;
@@ -845,6 +846,7 @@ static bool tcg_out_mov(TCGContext *s, TCGType type, TCGReg ret, TCGReg arg)
case TCG_TYPE_I64:
rexw = P_REXW;
/* fallthru */
+ fallthrough;
case TCG_TYPE_I32:
if (ret < 16) {
if (arg < 16) {
@@ -898,10 +900,12 @@ static bool tcg_out_dup_vec(TCGContext *s, TCGType type, unsigned vece,
tcg_out_vex_modrm(s, OPC_PUNPCKLBW, r, a, a);
a = r;
/* FALLTHRU */
+ fallthrough;
case MO_16:
tcg_out_vex_modrm(s, OPC_PUNPCKLWD, r, a, a);
a = r;
/* FALLTHRU */
+ fallthrough;
case MO_32:
tcg_out_vex_modrm(s, OPC_PSHUFD, r, 0, a);
/* imm8 operand: all output lanes selected from input lane 0. */
@@ -1126,6 +1130,7 @@ static void tcg_out_ld(TCGContext *s, TCGType type, TCGReg ret,
break;
}
/* FALLTHRU */
+ fallthrough;
case TCG_TYPE_V64:
/* There is no instruction that can validate 8-byte alignment. */
tcg_debug_assert(ret >= 16);
@@ -1171,6 +1176,7 @@ static void tcg_out_st(TCGContext *s, TCGType type, TCGReg arg,
break;
}
/* FALLTHRU */
+ fallthrough;
case TCG_TYPE_V64:
/* There is no instruction that can validate 8-byte alignment. */
tcg_debug_assert(arg >= 16);
@@ -1537,7 +1543,7 @@ static void tcg_out_setcond(TCGContext *s, int rexw, TCGCond cond,
switch (cond) {
case TCG_COND_NE:
inv = true;
- /* fall through */
+ fallthrough;
case TCG_COND_EQ:
/* If arg2 is 0, convert to LTU/GEU vs 1. */
if (const_arg2 && arg2 == 0) {
@@ -1548,7 +1554,7 @@ static void tcg_out_setcond(TCGContext *s, int rexw, TCGCond cond,
case TCG_COND_LEU:
inv = true;
- /* fall through */
+ fallthrough;
case TCG_COND_GTU:
/* If arg2 is a register, swap for LTU/GEU. */
if (!const_arg2) {
@@ -1561,7 +1567,7 @@ static void tcg_out_setcond(TCGContext *s, int rexw, TCGCond cond,
case TCG_COND_GEU:
inv = true;
- /* fall through */
+ fallthrough;
case TCG_COND_LTU:
do_ltu:
/*
@@ -1587,7 +1593,7 @@ static void tcg_out_setcond(TCGContext *s, int rexw, TCGCond cond,
case TCG_COND_GE:
inv = true;
- /* fall through */
+ fallthrough;
case TCG_COND_LT:
/* If arg2 is 0, extract the sign bit. */
if (const_arg2 && arg2 == 0) {
@@ -2443,6 +2449,7 @@ static inline void tcg_out_op(TCGContext *s, TCGOpcode opc,
# define OP_32_64(x) \
case glue(glue(INDEX_op_, x), _i64): \
rexw = P_REXW; /* FALLTHRU */ \
+ fallthrough; \
case glue(glue(INDEX_op_, x), _i32)
#else
# define OP_32_64(x) \
@@ -2689,7 +2696,7 @@ static inline void tcg_out_op(TCGContext *s, TCGOpcode opc,
tcg_out_qemu_ld(s, a0, -1, a1, a2, args[3], TCG_TYPE_I32);
break;
}
- /* fall through */
+ fallthrough;
case INDEX_op_qemu_ld_a32_i32:
tcg_out_qemu_ld(s, a0, -1, a1, -1, a2, TCG_TYPE_I32);
break;
@@ -2719,7 +2726,7 @@ static inline void tcg_out_op(TCGContext *s, TCGOpcode opc,
tcg_out_qemu_st(s, a0, -1, a1, a2, args[3], TCG_TYPE_I32);
break;
}
- /* fall through */
+ fallthrough;
case INDEX_op_qemu_st_a32_i32:
case INDEX_op_qemu_st8_a32_i32:
tcg_out_qemu_st(s, a0, -1, a1, -1, a2, TCG_TYPE_I32);
@@ -2846,6 +2853,7 @@ static inline void tcg_out_op(TCGContext *s, TCGOpcode opc,
break;
}
/* FALLTHRU */
+ fallthrough;
case INDEX_op_extract_i32:
/* On the off-chance that we can use the high-byte registers.
Otherwise we emit the same ext16 + shift pattern that we
diff --git a/tcg/loongarch64/tcg-target.c.inc b/tcg/loongarch64/tcg-target.c.inc
index 801302d85d..728384ce51 100644
--- a/tcg/loongarch64/tcg-target.c.inc
+++ b/tcg/loongarch64/tcg-target.c.inc
@@ -1013,7 +1013,7 @@ static void tcg_out_qemu_ld_indexed(TCGContext *s, MemOp opc, TCGType type,
tcg_out_opc_ldx_wu(s, rd, h.base, h.index);
break;
}
- /* fallthrough */
+ fallthrough;
case MO_SL:
tcg_out_opc_ldx_w(s, rd, h.base, h.index);
break;
@@ -1303,7 +1303,7 @@ static void tcg_out_op(TCGContext *s, TCGOpcode opc,
case INDEX_op_bswap32_i32:
/* All 32-bit values are computed sign-extended in the register. */
a2 = TCG_BSWAP_OS;
- /* fallthrough */
+ fallthrough;
case INDEX_op_bswap32_i64:
tcg_out_opc_revb_2w(s, a0, a1);
if (a2 & TCG_BSWAP_OS) {
diff --git a/tcg/mips/tcg-target.c.inc b/tcg/mips/tcg-target.c.inc
index e2892edc6a..0effa5320a 100644
--- a/tcg/mips/tcg-target.c.inc
+++ b/tcg/mips/tcg-target.c.inc
@@ -917,6 +917,7 @@ static void tcg_out_setcond(TCGContext *s, TCGCond cond, TCGReg ret,
case TCG_COND_GT:
s_opc = OPC_SLT;
/* FALLTHRU */
+ fallthrough;
case TCG_COND_LTU:
case TCG_COND_GEU:
@@ -974,6 +975,7 @@ static void tcg_out_brcond(TCGContext *s, TCGCond cond, TCGReg arg1,
}
s_opc = OPC_SLT;
/* FALLTHRU */
+ fallthrough;
case TCG_COND_LTU:
case TCG_COND_GTU:
@@ -1109,6 +1111,7 @@ static void tcg_out_movcond(TCGContext *s, TCGCond cond, TCGReg ret,
case TCG_COND_EQ:
eqz = true;
/* FALLTHRU */
+ fallthrough;
case TCG_COND_NE:
if (c2 != 0) {
tcg_out_opc_reg(s, OPC_XOR, TCG_TMP0, c1, c2);
@@ -1430,6 +1433,7 @@ static void tcg_out_qemu_ld_direct(TCGContext *s, TCGReg lo, TCGReg hi,
break;
}
/* FALLTHRU */
+ fallthrough;
case MO_SL:
tcg_out_opc_imm(s, OPC_LW, lo, base, 0);
break;
@@ -2117,7 +2121,7 @@ static void tcg_out_op(TCGContext *s, TCGOpcode opc,
tcg_out_qemu_ld(s, a0, 0, a1, a2, args[3], TCG_TYPE_I32);
break;
}
- /* fall through */
+ fallthrough;
case INDEX_op_qemu_ld_a32_i32:
tcg_out_qemu_ld(s, a0, 0, a1, 0, a2, TCG_TYPE_I32);
break;
@@ -2141,7 +2145,7 @@ static void tcg_out_op(TCGContext *s, TCGOpcode opc,
tcg_out_qemu_st(s, a0, 0, a1, a2, args[3], TCG_TYPE_I32);
break;
}
- /* fall through */
+ fallthrough;
case INDEX_op_qemu_st_a32_i32:
tcg_out_qemu_st(s, a0, 0, a1, 0, a2, TCG_TYPE_I32);
break;
diff --git a/tcg/ppc/tcg-target.c.inc b/tcg/ppc/tcg-target.c.inc
index 5c873b2161..a438a02045 100644
--- a/tcg/ppc/tcg-target.c.inc
+++ b/tcg/ppc/tcg-target.c.inc
@@ -724,6 +724,7 @@ static bool tcg_out_mov(TCGContext *s, TCGType type, TCGReg ret, TCGReg arg)
case TCG_TYPE_I64:
tcg_debug_assert(TCG_TARGET_REG_BITS == 64);
/* fallthru */
+ fallthrough;
case TCG_TYPE_I32:
if (ret < TCG_REG_V0) {
if (arg < TCG_REG_V0) {
@@ -748,6 +749,7 @@ static bool tcg_out_mov(TCGContext *s, TCGType type, TCGReg ret, TCGReg arg)
}
}
/* fallthru */
+ fallthrough;
case TCG_TYPE_V64:
case TCG_TYPE_V128:
tcg_debug_assert(ret >= TCG_REG_V0 && arg >= TCG_REG_V0);
@@ -1300,6 +1302,7 @@ static void tcg_out_mem_long(TCGContext *s, int opi, int opx, TCGReg rt,
case LD: case LWA:
align = 3;
/* FALLTHRU */
+ fallthrough;
default:
if (rt > TCG_REG_R0 && rt < TCG_REG_V0) {
rs = rt;
@@ -1317,6 +1320,7 @@ static void tcg_out_mem_long(TCGContext *s, int opi, int opx, TCGReg rt,
case STD:
align = 3;
/* FALLTHRU */
+ fallthrough;
case STB: case STH: case STW:
is_int_store = true;
break;
@@ -1389,6 +1393,7 @@ static void tcg_out_ld(TCGContext *s, TCGType type, TCGReg ret,
break;
}
/* fallthru */
+ fallthrough;
case TCG_TYPE_V64:
tcg_debug_assert(ret >= TCG_REG_V0);
if (have_vsx) {
@@ -1444,6 +1449,7 @@ static void tcg_out_st(TCGContext *s, TCGType type, TCGReg arg,
break;
}
/* fallthru */
+ fallthrough;
case TCG_TYPE_V64:
tcg_debug_assert(arg >= TCG_REG_V0);
if (have_vsx) {
@@ -1659,6 +1665,7 @@ static void tcg_out_setcond(TCGContext *s, TCGType type, TCGCond cond,
tcg_out32(s, NOR | SAB(arg1, arg0, arg1));
arg1 = arg0;
/* FALLTHRU */
+ fallthrough;
case TCG_COND_LT:
/* Extract the sign bit. */
if (type == TCG_TYPE_I32) {
@@ -1719,7 +1726,7 @@ static void tcg_out_setcond(TCGContext *s, TCGType type, TCGCond cond,
case TCG_COND_LE:
case TCG_COND_LEU:
inv = true;
- /* fall through */
+ fallthrough;
case TCG_COND_GT:
case TCG_COND_GTU:
sh = 30; /* CR7 CR_GT */
@@ -1728,7 +1735,7 @@ static void tcg_out_setcond(TCGContext *s, TCGType type, TCGCond cond,
case TCG_COND_GE:
case TCG_COND_GEU:
inv = true;
- /* fall through */
+ fallthrough;
case TCG_COND_LT:
case TCG_COND_LTU:
sh = 29; /* CR7 CR_LT */
@@ -2744,6 +2751,7 @@ static void tcg_out_op(TCGContext *s, TCGOpcode opc,
break;
}
/* FALLTHRU */
+ fallthrough;
case INDEX_op_orc_i64:
tcg_out32(s, ORC | SAB(args[1], args[0], args[2]));
break;
@@ -2753,6 +2761,7 @@ static void tcg_out_op(TCGContext *s, TCGOpcode opc,
break;
}
/* FALLTHRU */
+ fallthrough;
case INDEX_op_eqv_i64:
tcg_out32(s, EQV | SAB(args[1], args[0], args[2]));
break;
@@ -2968,7 +2977,7 @@ static void tcg_out_op(TCGContext *s, TCGOpcode opc,
args[3], TCG_TYPE_I32);
break;
}
- /* fall through */
+ fallthrough;
case INDEX_op_qemu_ld_a32_i32:
tcg_out_qemu_ld(s, args[0], -1, args[1], -1, args[2], TCG_TYPE_I32);
break;
@@ -3002,7 +3011,7 @@ static void tcg_out_op(TCGContext *s, TCGOpcode opc,
args[3], TCG_TYPE_I32);
break;
}
- /* fall through */
+ fallthrough;
case INDEX_op_qemu_st_a32_i32:
tcg_out_qemu_st(s, args[0], -1, args[1], -1, args[2], TCG_TYPE_I32);
break;
@@ -3591,7 +3600,7 @@ static void expand_vec_cmp(TCGType type, unsigned vece, TCGv_vec v0,
if (have_isa_3_00 && vece <= MO_32) {
break;
}
- /* fall through */
+ fallthrough;
case TCG_COND_LE:
case TCG_COND_LEU:
need_inv = true;
diff --git a/tcg/riscv/tcg-target.c.inc b/tcg/riscv/tcg-target.c.inc
index d6dbcaf3cb..8b0e7b000c 100644
--- a/tcg/riscv/tcg-target.c.inc
+++ b/tcg/riscv/tcg-target.c.inc
@@ -948,7 +948,7 @@ static void tcg_out_negsetcond(TCGContext *s, TCGCond cond, TCGReg ret,
case TCG_COND_GE:
tcg_out_opc_imm(s, OPC_XORI, ret, arg1, -1);
arg1 = ret;
- /* fall through */
+ fallthrough;
case TCG_COND_LT:
tcg_out_opc_imm(s, OPC_SRAI, ret, arg1, TCG_TARGET_REG_BITS - 1);
return;
@@ -1373,6 +1373,7 @@ static void tcg_out_qemu_ld_direct(TCGContext *s, TCGReg val,
break;
}
/* FALLTHRU */
+ fallthrough;
case MO_SL:
tcg_out_opc_imm(s, OPC_LW, val, base, 0);
break;
@@ -1754,7 +1755,7 @@ static void tcg_out_op(TCGContext *s, TCGOpcode opc,
break;
case INDEX_op_bswap32_i32:
a2 = 0;
- /* fall through */
+ fallthrough;
case INDEX_op_bswap32_i64:
tcg_out_opc_imm(s, OPC_REV8, a0, a1, 0);
if (a2 & TCG_BSWAP_OZ) {
diff --git a/tcg/s390x/tcg-target.c.inc b/tcg/s390x/tcg-target.c.inc
index 4ef9ac3d5b..3656b8ddf0 100644
--- a/tcg/s390x/tcg-target.c.inc
+++ b/tcg/s390x/tcg-target.c.inc
@@ -809,7 +809,7 @@ static bool tcg_out_mov(TCGContext *s, TCGType type, TCGReg dst, TCGReg src)
tcg_out_insn(s, RR, LR, dst, src);
break;
}
- /* fallthru */
+ fallthrough;
case TCG_TYPE_I64:
if (likely(is_general_reg(dst))) {
@@ -823,7 +823,7 @@ static bool tcg_out_mov(TCGContext *s, TCGType type, TCGReg dst, TCGReg src)
tcg_out_insn(s, VRSb, VLVG, dst, 0, 0, src, 3);
break;
}
- /* fallthru */
+ fallthrough;
case TCG_TYPE_V64:
case TCG_TYPE_V128:
@@ -981,6 +981,7 @@ static void tcg_out_ld(TCGContext *s, TCGType type, TCGReg data,
break;
}
/* fallthru */
+ fallthrough;
case TCG_TYPE_V64:
tcg_out_vrx_mem(s, VRX_VLLEZ, data, base, TCG_REG_NONE, ofs, MO_64);
@@ -1014,6 +1015,7 @@ static void tcg_out_st(TCGContext *s, TCGType type, TCGReg data,
break;
}
/* fallthru */
+ fallthrough;
case TCG_TYPE_V64:
tcg_out_vrx_mem(s, VRX_VSTEG, data, base, TCG_REG_NONE, ofs, 0);
@@ -1306,6 +1308,7 @@ static void tgen_setcond(TCGContext *s, TCGType type, TCGCond cond,
break;
}
/* fallthru */
+ fallthrough;
case TCG_COND_GTU:
case TCG_COND_GT:
@@ -1333,6 +1336,7 @@ static void tgen_setcond(TCGContext *s, TCGType type, TCGCond cond,
break;
}
/* fallthru */
+ fallthrough;
case TCG_COND_LEU:
case TCG_COND_LE:
diff --git a/tcg/tcg-op-gvec.c b/tcg/tcg-op-gvec.c
index feb2d3686b..35e47902f1 100644
--- a/tcg/tcg-op-gvec.c
+++ b/tcg/tcg-op-gvec.c
@@ -496,7 +496,7 @@ static void do_dup_store(TCGType type, uint32_t dofs, uint32_t oprsz,
for (; i + 32 <= oprsz; i += 32) {
tcg_gen_stl_vec(t_vec, tcg_env, dofs + i, TCG_TYPE_V256);
}
- /* fallthru */
+ fallthrough;
case TCG_TYPE_V128:
for (; i + 16 <= oprsz; i += 16) {
tcg_gen_stl_vec(t_vec, tcg_env, dofs + i, TCG_TYPE_V128);
@@ -1229,7 +1229,7 @@ void tcg_gen_gvec_2(uint32_t dofs, uint32_t aofs,
aofs += some;
oprsz -= some;
maxsz -= some;
- /* fallthru */
+ fallthrough;
case TCG_TYPE_V128:
expand_2_vec(g->vece, dofs, aofs, oprsz, 16, TCG_TYPE_V128,
g->load_dest, g->fniv);
@@ -1293,7 +1293,7 @@ void tcg_gen_gvec_2i(uint32_t dofs, uint32_t aofs, uint32_t oprsz,
aofs += some;
oprsz -= some;
maxsz -= some;
- /* fallthru */
+ fallthrough;
case TCG_TYPE_V128:
expand_2i_vec(g->vece, dofs, aofs, oprsz, 16, TCG_TYPE_V128,
c, g->load_dest, g->fniv);
@@ -1367,7 +1367,7 @@ void tcg_gen_gvec_2s(uint32_t dofs, uint32_t aofs, uint32_t oprsz,
aofs += some;
oprsz -= some;
maxsz -= some;
- /* fallthru */
+ fallthrough;
case TCG_TYPE_V128:
expand_2s_vec(g->vece, dofs, aofs, oprsz, 16, TCG_TYPE_V128,
@@ -1440,7 +1440,7 @@ void tcg_gen_gvec_3(uint32_t dofs, uint32_t aofs, uint32_t bofs,
bofs += some;
oprsz -= some;
maxsz -= some;
- /* fallthru */
+ fallthrough;
case TCG_TYPE_V128:
expand_3_vec(g->vece, dofs, aofs, bofs, oprsz, 16, TCG_TYPE_V128,
g->load_dest, g->fniv);
@@ -1508,7 +1508,7 @@ void tcg_gen_gvec_3i(uint32_t dofs, uint32_t aofs, uint32_t bofs,
bofs += some;
oprsz -= some;
maxsz -= some;
- /* fallthru */
+ fallthrough;
case TCG_TYPE_V128:
expand_3i_vec(g->vece, dofs, aofs, bofs, oprsz, 16, TCG_TYPE_V128,
c, g->load_dest, g->fniv);
@@ -1574,7 +1574,7 @@ void tcg_gen_gvec_4(uint32_t dofs, uint32_t aofs, uint32_t bofs, uint32_t cofs,
cofs += some;
oprsz -= some;
maxsz -= some;
- /* fallthru */
+ fallthrough;
case TCG_TYPE_V128:
expand_4_vec(g->vece, dofs, aofs, bofs, cofs, oprsz,
16, TCG_TYPE_V128, g->write_aofs, g->fniv);
@@ -1645,7 +1645,7 @@ void tcg_gen_gvec_4i(uint32_t dofs, uint32_t aofs, uint32_t bofs, uint32_t cofs,
cofs += some;
oprsz -= some;
maxsz -= some;
- /* fallthru */
+ fallthrough;
case TCG_TYPE_V128:
expand_4i_vec(g->vece, dofs, aofs, bofs, cofs, oprsz,
16, TCG_TYPE_V128, c, g->fniv);
@@ -3173,7 +3173,7 @@ do_gvec_shifts(unsigned vece, uint32_t dofs, uint32_t aofs, TCGv_i32 shift,
aofs += some;
oprsz -= some;
maxsz -= some;
- /* fallthru */
+ fallthrough;
case TCG_TYPE_V128:
expand_2sh_vec(vece, dofs, aofs, oprsz, 16,
TCG_TYPE_V128, shift, g->fniv_s);
@@ -3216,7 +3216,7 @@ do_gvec_shifts(unsigned vece, uint32_t dofs, uint32_t aofs, TCGv_i32 shift,
aofs += some;
oprsz -= some;
maxsz -= some;
- /* fallthru */
+ fallthrough;
case TCG_TYPE_V128:
expand_2s_vec(vece, dofs, aofs, oprsz, 16, TCG_TYPE_V128,
v_shift, false, g->fniv_v);
@@ -3808,7 +3808,7 @@ void tcg_gen_gvec_cmp(TCGCond cond, unsigned vece, uint32_t dofs,
bofs += some;
oprsz -= some;
maxsz -= some;
- /* fallthru */
+ fallthrough;
case TCG_TYPE_V128:
expand_cmp_vec(vece, dofs, aofs, bofs, oprsz, 16, TCG_TYPE_V128, cond);
break;
@@ -3926,7 +3926,7 @@ void tcg_gen_gvec_cmps(TCGCond cond, unsigned vece, uint32_t dofs,
dofs += some;
oprsz -= some;
maxsz -= some;
- /* fallthru */
+ fallthrough;
case TCG_TYPE_V128:
some = QEMU_ALIGN_DOWN(oprsz, 16);
diff --git a/tcg/tcg-op-ldst.c b/tcg/tcg-op-ldst.c
index df4f22c427..5ad51c8cb8 100644
--- a/tcg/tcg-op-ldst.c
+++ b/tcg/tcg-op-ldst.c
@@ -70,7 +70,7 @@ static MemOp tcg_canonicalize_memop(MemOp op, bool is64, bool st)
op &= ~MO_SIGN;
break;
}
- /* fall through */
+ fallthrough;
default:
g_assert_not_reached();
}
diff --git a/tcg/tcg.c b/tcg/tcg.c
index 637b9e6870..84e74badcf 100644
--- a/tcg/tcg.c
+++ b/tcg/tcg.c
@@ -23,6 +23,7 @@
*/
#include "qemu/osdep.h"
+#include "qemu/compiler.h"
/* Define to jump the ELF file used to communicate with GDB. */
#undef DEBUG_JIT
@@ -1192,7 +1193,7 @@ static void init_call_layout(TCGHelperInfo *info)
switch (TCG_TARGET_CALL_ARG_I32) {
case TCG_CALL_ARG_EVEN:
layout_arg_even(&cum);
- /* fall through */
+ fallthrough;
case TCG_CALL_ARG_NORMAL:
layout_arg_1(&cum, info, TCG_CALL_ARG_NORMAL);
break;
@@ -1209,7 +1210,7 @@ static void init_call_layout(TCGHelperInfo *info)
switch (TCG_TARGET_CALL_ARG_I64) {
case TCG_CALL_ARG_EVEN:
layout_arg_even(&cum);
- /* fall through */
+ fallthrough;
case TCG_CALL_ARG_NORMAL:
if (TCG_TARGET_REG_BITS == 32) {
layout_arg_normal_n(&cum, info, 2);
@@ -1226,7 +1227,7 @@ static void init_call_layout(TCGHelperInfo *info)
switch (TCG_TARGET_CALL_ARG_I128) {
case TCG_CALL_ARG_EVEN:
layout_arg_even(&cum);
- /* fall through */
+ fallthrough;
case TCG_CALL_ARG_NORMAL:
layout_arg_normal_n(&cum, info, 128 / TCG_TARGET_REG_BITS);
break;
@@ -2299,7 +2300,7 @@ static void tcg_reg_alloc_start(TCGContext *s)
break;
case TEMP_EBB:
val = TEMP_VAL_DEAD;
- /* fall through */
+ fallthrough;
case TEMP_TB:
ts->mem_allocated = 0;
break;
@@ -3556,7 +3557,7 @@ liveness_pass_1(TCGContext *s)
*la_temp_pref(ts) = 0;
break;
}
- /* fall through */
+ fallthrough;
default:
*la_temp_pref(ts) =
tcg_target_available_regs[ts->type];
@@ -4135,7 +4136,7 @@ static void temp_sync(TCGContext *s, TCGTemp *ts, TCGRegSet allocated_regs,
}
temp_load(s, ts, tcg_target_available_regs[ts->type],
allocated_regs, preferred_regs);
- /* fallthrough */
+ fallthrough;
case TEMP_VAL_REG:
tcg_out_st(s, ts->type, ts->reg,
@@ -4622,7 +4623,7 @@ static void tcg_reg_alloc_dup(TCGContext *s, const TCGOp *op)
/* Sync the temp back to its slot and load from there. */
temp_sync(s, its, s->reserved_regs, 0, 0);
}
- /* fall through */
+ fallthrough;
case TEMP_VAL_MEM:
lowpart_ofs = 0;
@@ -5289,6 +5290,7 @@ static void tcg_reg_alloc_call(TCGContext *s, TCGOp *op)
ts->mem_base->reg, ts->mem_offset);
}
/* fall through to mark all parts in memory */
+ fallthrough;
case TCG_CALL_RET_BY_REF:
/* The callee has performed a write through the reference. */
@@ -5489,7 +5491,7 @@ static void tcg_out_helper_load_slots(TCGContext *s,
/* No conflicts: perform this move and continue. */
tcg_out_movext1(s, &mov[3]);
- /* fall through */
+ fallthrough;
case 3:
tcg_out_movext3(s, mov, mov + 1, mov + 2,
@@ -5741,7 +5743,7 @@ static void tcg_out_ld_helper_ret(TCGContext *s, const TCGLabelQemuLdst *ldst,
if (TCG_TARGET_REG_BITS == 32) {
break;
}
- /* fall through */
+ fallthrough;
case TCG_TYPE_I32:
mov[0].dst = ldst->datalo_reg;
@@ -5781,7 +5783,7 @@ static void tcg_out_ld_helper_ret(TCGContext *s, const TCGLabelQemuLdst *ldst,
tcg_out_st(s, TCG_TYPE_V128,
tcg_target_call_oarg_reg(TCG_CALL_RET_BY_VEC, 0),
TCG_REG_CALL_STACK, ofs_slot0);
- /* fall through */
+ fallthrough;
case TCG_CALL_RET_BY_REF:
tcg_out_ld(s, TCG_TYPE_I64, ldst->datalo_reg,
TCG_REG_CALL_STACK, ofs_slot0 + 8 * HOST_BIG_ENDIAN);
@@ -6069,7 +6071,7 @@ int tcg_gen_code(TCGContext *s, TranslationBlock *tb, uint64_t pc_start)
if (tcg_reg_alloc_dup2(s, op)) {
break;
}
- /* fall through */
+ fallthrough;
default:
/* Sanity check that we've not introduced any unhandled opcodes. */
tcg_debug_assert(tcg_op_supported(opc));
diff --git a/tcg/tci.c b/tcg/tci.c
index 4640902c88..3368941953 100644
--- a/tcg/tci.c
+++ b/tcg/tci.c
@@ -1310,7 +1310,7 @@ int print_insn_tci(bfd_vma addr, disassemble_info *info)
info->fprintf_func(info->stream, "align");
break;
}
- /* fall through */
+ fallthrough;
default:
info->fprintf_func(info->stream, "illegal opcode %d", op);
diff --git a/tcg/tci/tcg-target.c.inc b/tcg/tci/tcg-target.c.inc
index 461f4b47ff..f60d0ba037 100644
--- a/tcg/tci/tcg-target.c.inc
+++ b/tcg/tci/tcg-target.c.inc
@@ -524,7 +524,7 @@ static void tcg_out_movi(TCGContext *s, TCGType type,
case TCG_TYPE_I32:
#if TCG_TARGET_REG_BITS == 64
arg = (int32_t)arg;
- /* fall through */
+ fallthrough;
case TCG_TYPE_I64:
#endif
break;
--
2.39.2
^ permalink raw reply related [flat|nested] 106+ messages in thread
* [RFC PATCH v3 07/78] hw/virtio/virtio-balloon.c: add fallthrough pseudo-keyword
2023-10-13 8:45 [RFC PATCH v3 00/78] Strict disable implicit fallthrough Emmanouil Pitsidianakis
` (5 preceding siblings ...)
2023-10-13 8:45 ` [RFC PATCH v3 06/78] tcg: " Emmanouil Pitsidianakis
@ 2023-10-13 8:45 ` Emmanouil Pitsidianakis
2023-10-13 8:45 ` [RFC PATCH v3 08/78] hw/block: " Emmanouil Pitsidianakis
` (72 subsequent siblings)
79 siblings, 0 replies; 106+ messages in thread
From: Emmanouil Pitsidianakis @ 2023-10-13 8:45 UTC (permalink / raw)
To: qemu-devel; +Cc: Emmanouil Pitsidianakis, David Hildenbrand, Michael S. Tsirkin
In preparation of raising -Wimplicit-fallthrough to 5, replace all
fall-through comments with the fallthrough attribute pseudo-keyword.
Reviewed-by: David Hildenbrand <david@redhat.com>
Signed-off-by: Emmanouil Pitsidianakis <manos.pitsidianakis@linaro.org>
---
hw/virtio/virtio-balloon.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/hw/virtio/virtio-balloon.c b/hw/virtio/virtio-balloon.c
index d004cf29d2..0f0d94bd94 100644
--- a/hw/virtio/virtio-balloon.c
+++ b/hw/virtio/virtio-balloon.c
@@ -673,6 +673,7 @@ virtio_balloon_free_page_hint_notify(NotifierWithReturn *n, void *data)
* Set S_DONE before migrating the vmstate, so the guest will reuse
* all hinted pages once running on the destination. Fall through.
*/
+ fallthrough;
case PRECOPY_NOTIFY_CLEANUP:
/*
* Especially, if something goes wrong during precopy or if migration
--
2.39.2
^ permalink raw reply related [flat|nested] 106+ messages in thread
* [RFC PATCH v3 08/78] hw/block: add fallthrough pseudo-keyword
2023-10-13 8:45 [RFC PATCH v3 00/78] Strict disable implicit fallthrough Emmanouil Pitsidianakis
` (6 preceding siblings ...)
2023-10-13 8:45 ` [RFC PATCH v3 07/78] hw/virtio/virtio-balloon.c: " Emmanouil Pitsidianakis
@ 2023-10-13 8:45 ` Emmanouil Pitsidianakis
2023-10-16 15:03 ` Stefan Hajnoczi
2023-10-13 8:45 ` [RFC PATCH v3 09/78] hw/acpi/aml-build.c: " Emmanouil Pitsidianakis
` (71 subsequent siblings)
79 siblings, 1 reply; 106+ messages in thread
From: Emmanouil Pitsidianakis @ 2023-10-13 8:45 UTC (permalink / raw)
To: qemu-devel
Cc: Emmanouil Pitsidianakis, Stefan Hajnoczi, Stefano Stabellini,
Anthony Perard, Paul Durrant, Kevin Wolf, Hanna Reitz,
Alistair Francis, Philippe Mathieu-Daudé,
open list:virtio-blk, open list:X86 Xen CPUs
In preparation of raising -Wimplicit-fallthrough to 5, replace all
fall-through comments with the fallthrough attribute pseudo-keyword.
Signed-off-by: Emmanouil Pitsidianakis <manos.pitsidianakis@linaro.org>
---
hw/block/dataplane/xen-block.c | 4 ++--
hw/block/m25p80.c | 2 +-
hw/block/onenand.c | 2 +-
hw/block/pflash_cfi01.c | 1 +
hw/block/pflash_cfi02.c | 6 ++++--
5 files changed, 9 insertions(+), 6 deletions(-)
diff --git a/hw/block/dataplane/xen-block.c b/hw/block/dataplane/xen-block.c
index 3b6f2b0aa2..1ae25a73b2 100644
--- a/hw/block/dataplane/xen-block.c
+++ b/hw/block/dataplane/xen-block.c
@@ -159,7 +159,7 @@ static int xen_block_parse_request(XenBlockRequest *request)
if (!request->req.nr_segments) {
return 0;
}
- /* fall through */
+ fallthrough;
case BLKIF_OP_WRITE:
break;
case BLKIF_OP_DISCARD:
@@ -299,7 +299,7 @@ static void xen_block_complete_aio(void *opaque, int ret)
if (!request->req.nr_segments) {
break;
}
- /* fall through */
+ fallthrough;
case BLKIF_OP_READ:
if (request->status == BLKIF_RSP_OKAY) {
block_acct_done(blk_get_stats(dataplane->blk), &request->acct);
diff --git a/hw/block/m25p80.c b/hw/block/m25p80.c
index afc3fdf4d6..523c34da71 100644
--- a/hw/block/m25p80.c
+++ b/hw/block/m25p80.c
@@ -1462,7 +1462,7 @@ static void decode_new_cmd(Flash *s, uint32_t value)
s->state = STATE_COLLECTING_DATA;
break;
}
- /* Fallthrough */
+ fallthrough;
default:
s->pos = 0;
diff --git a/hw/block/onenand.c b/hw/block/onenand.c
index 50d3d1c985..87583c48a0 100644
--- a/hw/block/onenand.c
+++ b/hw/block/onenand.c
@@ -564,7 +564,7 @@ static void onenand_command(OneNANDState *s)
break;
case 0x95: /* Multi-block erase */
qemu_irq_pulse(s->intr);
- /* Fall through. */
+ fallthrough;
case 0x94: /* Block erase */
sec = ((s->addr[ONEN_BUF_BLOCK] & 0xfff) |
(s->addr[ONEN_BUF_BLOCK] >> 15 ? s->density_mask : 0))
diff --git a/hw/block/pflash_cfi01.c b/hw/block/pflash_cfi01.c
index 62056b1d74..cb58f08f53 100644
--- a/hw/block/pflash_cfi01.c
+++ b/hw/block/pflash_cfi01.c
@@ -276,6 +276,7 @@ static uint32_t pflash_read(PFlashCFI01 *pfl, hwaddr offset,
*/
pfl->cmd = 0x00;
/* fall through to read code */
+ fallthrough;
case 0x00: /* This model reset value for READ_ARRAY (not CFI compliant) */
/* Flash area read */
ret = pflash_data_read(pfl, offset, width, be);
diff --git a/hw/block/pflash_cfi02.c b/hw/block/pflash_cfi02.c
index 2a99b286b0..711f978d7c 100644
--- a/hw/block/pflash_cfi02.c
+++ b/hw/block/pflash_cfi02.c
@@ -328,6 +328,7 @@ static uint64_t pflash_read(void *opaque, hwaddr offset, unsigned int width)
trace_pflash_read_unknown_state(pfl->name, pfl->cmd);
pflash_reset_state_machine(pfl);
/* fall through to the read code */
+ fallthrough;
case 0x80: /* Erase (unlock) */
/* We accept reads during second unlock sequence... */
case 0x00:
@@ -359,6 +360,7 @@ static uint64_t pflash_read(void *opaque, hwaddr offset, unsigned int width)
break;
}
/* Fall through to data read. */
+ fallthrough;
default:
ret = pflash_data_read(pfl, offset, width);
}
@@ -368,7 +370,7 @@ static uint64_t pflash_read(void *opaque, hwaddr offset, unsigned int width)
case 0x30: /* Sector Erase */
/* Toggle bit 2 during erase, but not program. */
toggle_dq2(pfl);
- /* fall through */
+ fallthrough;
case 0xA0: /* Program */
/* Toggle bit 6 */
toggle_dq6(pfl);
@@ -582,7 +584,7 @@ static void pflash_write(void *opaque, hwaddr offset, uint64_t value,
pfl->cmd = 0x98;
return;
}
- /* fall through */
+ fallthrough;
default:
trace_pflash_write_invalid(pfl->name, pfl->cmd);
goto reset_flash;
--
2.39.2
^ permalink raw reply related [flat|nested] 106+ messages in thread
* Re: [RFC PATCH v3 08/78] hw/block: add fallthrough pseudo-keyword
2023-10-13 8:45 ` [RFC PATCH v3 08/78] hw/block: " Emmanouil Pitsidianakis
@ 2023-10-16 15:03 ` Stefan Hajnoczi
0 siblings, 0 replies; 106+ messages in thread
From: Stefan Hajnoczi @ 2023-10-16 15:03 UTC (permalink / raw)
To: Emmanouil Pitsidianakis
Cc: qemu-devel, Stefano Stabellini, Anthony Perard, Paul Durrant,
Kevin Wolf, Hanna Reitz, Alistair Francis,
Philippe Mathieu-Daudé, open list:virtio-blk,
open list:X86 Xen CPUs
[-- Attachment #1: Type: text/plain, Size: 624 bytes --]
On Fri, Oct 13, 2023 at 11:45:36AM +0300, Emmanouil Pitsidianakis wrote:
> In preparation of raising -Wimplicit-fallthrough to 5, replace all
> fall-through comments with the fallthrough attribute pseudo-keyword.
>
> Signed-off-by: Emmanouil Pitsidianakis <manos.pitsidianakis@linaro.org>
> ---
> hw/block/dataplane/xen-block.c | 4 ++--
> hw/block/m25p80.c | 2 +-
> hw/block/onenand.c | 2 +-
> hw/block/pflash_cfi01.c | 1 +
> hw/block/pflash_cfi02.c | 6 ++++--
> 5 files changed, 9 insertions(+), 6 deletions(-)
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]
^ permalink raw reply [flat|nested] 106+ messages in thread
* [RFC PATCH v3 09/78] hw/acpi/aml-build.c: add fallthrough pseudo-keyword
2023-10-13 8:45 [RFC PATCH v3 00/78] Strict disable implicit fallthrough Emmanouil Pitsidianakis
` (7 preceding siblings ...)
2023-10-13 8:45 ` [RFC PATCH v3 08/78] hw/block: " Emmanouil Pitsidianakis
@ 2023-10-13 8:45 ` Emmanouil Pitsidianakis
2023-10-17 8:40 ` Ani Sinha
2023-10-13 8:45 ` [RFC PATCH v3 10/78] hw/ide/atapi.c: " Emmanouil Pitsidianakis
` (70 subsequent siblings)
79 siblings, 1 reply; 106+ messages in thread
From: Emmanouil Pitsidianakis @ 2023-10-13 8:45 UTC (permalink / raw)
To: qemu-devel
Cc: Emmanouil Pitsidianakis, Michael S. Tsirkin, Igor Mammedov,
Ani Sinha
In preparation of raising -Wimplicit-fallthrough to 5, replace all
fall-through comments with the fallthrough attribute pseudo-keyword.
Signed-off-by: Emmanouil Pitsidianakis <manos.pitsidianakis@linaro.org>
---
hw/acpi/aml-build.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/hw/acpi/aml-build.c b/hw/acpi/aml-build.c
index af66bde0f5..b0cf0c6073 100644
--- a/hw/acpi/aml-build.c
+++ b/hw/acpi/aml-build.c
@@ -326,17 +326,16 @@ build_prepend_package_length(GArray *package, unsigned length, bool incl_self)
byte = length >> PACKAGE_LENGTH_4BYTE_SHIFT;
build_prepend_byte(package, byte);
length &= (1 << PACKAGE_LENGTH_4BYTE_SHIFT) - 1;
- /* fall through */
+ fallthrough;
case 3:
byte = length >> PACKAGE_LENGTH_3BYTE_SHIFT;
build_prepend_byte(package, byte);
length &= (1 << PACKAGE_LENGTH_3BYTE_SHIFT) - 1;
- /* fall through */
+ fallthrough;
case 2:
byte = length >> PACKAGE_LENGTH_2BYTE_SHIFT;
build_prepend_byte(package, byte);
length &= (1 << PACKAGE_LENGTH_2BYTE_SHIFT) - 1;
- /* fall through */
}
/*
* Most significant two bits of byte zero indicate how many following bytes
@@ -528,6 +527,7 @@ void aml_append(Aml *parent_ctx, Aml *child)
*/
build_append_byte(buf, 0);
/* fall through, to pack resources in buffer */
+ fallthrough;
case AML_BUFFER:
build_buffer(buf, child->op);
break;
--
2.39.2
^ permalink raw reply related [flat|nested] 106+ messages in thread
* Re: [RFC PATCH v3 09/78] hw/acpi/aml-build.c: add fallthrough pseudo-keyword
2023-10-13 8:45 ` [RFC PATCH v3 09/78] hw/acpi/aml-build.c: " Emmanouil Pitsidianakis
@ 2023-10-17 8:40 ` Ani Sinha
0 siblings, 0 replies; 106+ messages in thread
From: Ani Sinha @ 2023-10-17 8:40 UTC (permalink / raw)
To: Emmanouil Pitsidianakis; +Cc: qemu-devel, Michael S. Tsirkin, Igor Mammedov
> On 13-Oct-2023, at 2:15 PM, Emmanouil Pitsidianakis <manos.pitsidianakis@linaro.org> wrote:
>
> In preparation of raising -Wimplicit-fallthrough to 5, replace all
> fall-through comments with the fallthrough attribute pseudo-keyword.
>
> Signed-off-by: Emmanouil Pitsidianakis <manos.pitsidianakis@linaro.org>
What was wrong with QEMU_FALLTHROUGH?
https://www.mail-archive.com/qemu-devel@nongnu.org/msg996916.html does not explain and there is no commit message that justifies the change.
Other than that,
Reviewed-by: Ani Sinha <anisinha@redhat.com>
> ---
> hw/acpi/aml-build.c | 6 +++---
> 1 file changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/hw/acpi/aml-build.c b/hw/acpi/aml-build.c
> index af66bde0f5..b0cf0c6073 100644
> --- a/hw/acpi/aml-build.c
> +++ b/hw/acpi/aml-build.c
> @@ -326,17 +326,16 @@ build_prepend_package_length(GArray *package, unsigned length, bool incl_self)
> byte = length >> PACKAGE_LENGTH_4BYTE_SHIFT;
> build_prepend_byte(package, byte);
> length &= (1 << PACKAGE_LENGTH_4BYTE_SHIFT) - 1;
> - /* fall through */
> + fallthrough;
> case 3:
> byte = length >> PACKAGE_LENGTH_3BYTE_SHIFT;
> build_prepend_byte(package, byte);
> length &= (1 << PACKAGE_LENGTH_3BYTE_SHIFT) - 1;
> - /* fall through */
> + fallthrough;
> case 2:
> byte = length >> PACKAGE_LENGTH_2BYTE_SHIFT;
> build_prepend_byte(package, byte);
> length &= (1 << PACKAGE_LENGTH_2BYTE_SHIFT) - 1;
> - /* fall through */
> }
> /*
> * Most significant two bits of byte zero indicate how many following bytes
> @@ -528,6 +527,7 @@ void aml_append(Aml *parent_ctx, Aml *child)
> */
> build_append_byte(buf, 0);
> /* fall through, to pack resources in buffer */
> + fallthrough;
> case AML_BUFFER:
> build_buffer(buf, child->op);
> break;
> --
> 2.39.2
>
^ permalink raw reply [flat|nested] 106+ messages in thread
* [RFC PATCH v3 10/78] hw/ide/atapi.c: add fallthrough pseudo-keyword
2023-10-13 8:45 [RFC PATCH v3 00/78] Strict disable implicit fallthrough Emmanouil Pitsidianakis
` (8 preceding siblings ...)
2023-10-13 8:45 ` [RFC PATCH v3 09/78] hw/acpi/aml-build.c: " Emmanouil Pitsidianakis
@ 2023-10-13 8:45 ` Emmanouil Pitsidianakis
2023-10-13 8:45 ` [RFC PATCH v3 11/78] hw/timer: " Emmanouil Pitsidianakis
` (69 subsequent siblings)
79 siblings, 0 replies; 106+ messages in thread
From: Emmanouil Pitsidianakis @ 2023-10-13 8:45 UTC (permalink / raw)
To: qemu-devel; +Cc: Emmanouil Pitsidianakis, John Snow, open list:IDE
In preparation of raising -Wimplicit-fallthrough to 5, replace all
fall-through comments with the fallthrough attribute pseudo-keyword.
Signed-off-by: Emmanouil Pitsidianakis <manos.pitsidianakis@linaro.org>
---
hw/ide/atapi.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/hw/ide/atapi.c b/hw/ide/atapi.c
index dcc39df9a4..85c74a5ffe 100644
--- a/hw/ide/atapi.c
+++ b/hw/ide/atapi.c
@@ -1225,6 +1225,7 @@ static void cmd_read_dvd_structure(IDEState *s, uint8_t* buf)
break;
}
/* TODO: BD support, fall through for now */
+ fallthrough;
/* Generic disk structures */
case 0x80: /* TODO: AACS volume identifier */
--
2.39.2
^ permalink raw reply related [flat|nested] 106+ messages in thread
* [RFC PATCH v3 11/78] hw/timer: add fallthrough pseudo-keyword
2023-10-13 8:45 [RFC PATCH v3 00/78] Strict disable implicit fallthrough Emmanouil Pitsidianakis
` (9 preceding siblings ...)
2023-10-13 8:45 ` [RFC PATCH v3 10/78] hw/ide/atapi.c: " Emmanouil Pitsidianakis
@ 2023-10-13 8:45 ` Emmanouil Pitsidianakis
2023-10-13 8:45 ` [RFC PATCH v3 12/78] hw/usb: " Emmanouil Pitsidianakis
` (68 subsequent siblings)
79 siblings, 0 replies; 106+ messages in thread
From: Emmanouil Pitsidianakis @ 2023-10-13 8:45 UTC (permalink / raw)
To: qemu-devel
Cc: Emmanouil Pitsidianakis, Peter Maydell, Cédric Le Goater,
Andrew Jeffery, Joel Stanley, Yoshinori Sato, Magnus Damm,
open list:ARM cores
In preparation of raising -Wimplicit-fallthrough to 5, replace all
fall-through comments with the fallthrough attribute pseudo-keyword.
Signed-off-by: Emmanouil Pitsidianakis <manos.pitsidianakis@linaro.org>
---
hw/timer/a9gtimer.c | 8 ++--
hw/timer/aspeed_timer.c | 1 +
hw/timer/pxa2xx_timer.c | 94 ++++++++++++++++++++---------------------
hw/timer/renesas_tmr.c | 2 +-
hw/timer/sh_timer.c | 8 ++--
5 files changed, 57 insertions(+), 56 deletions(-)
diff --git a/hw/timer/a9gtimer.c b/hw/timer/a9gtimer.c
index 5e959b6d09..b83d51da96 100644
--- a/hw/timer/a9gtimer.c
+++ b/hw/timer/a9gtimer.c
@@ -143,7 +143,7 @@ static uint64_t a9_gtimer_read(void *opaque, hwaddr addr, unsigned size)
switch (addr) {
case R_COUNTER_HI:
shift = 32;
- /* fallthrough */
+ fallthrough;
case R_COUNTER_LO:
update = a9_gtimer_get_update(s);
ret = extract64(update.new, shift, 32);
@@ -156,7 +156,7 @@ static uint64_t a9_gtimer_read(void *opaque, hwaddr addr, unsigned size)
break;
case R_COMPARATOR_HI:
shift = 32;
- /* fallthrough */
+ fallthrough;
case R_COMPARATOR_LO:
ret = extract64(gtb->compare, shift, 32);
break;
@@ -185,7 +185,7 @@ static void a9_gtimer_write(void *opaque, hwaddr addr, uint64_t value,
switch (addr) {
case R_COUNTER_HI:
shift = 32;
- /* fallthrough */
+ fallthrough;
case R_COUNTER_LO:
/*
* Keep it simple - ARM docco explicitly says to disable timer before
@@ -209,7 +209,7 @@ static void a9_gtimer_write(void *opaque, hwaddr addr, uint64_t value,
break;
case R_COMPARATOR_HI:
shift = 32;
- /* fallthrough */
+ fallthrough;
case R_COMPARATOR_LO:
a9_gtimer_update(s, false);
gtb->compare = deposit64(gtb->compare, shift, 32, value);
diff --git a/hw/timer/aspeed_timer.c b/hw/timer/aspeed_timer.c
index 72161f07bb..b343b7ab2c 100644
--- a/hw/timer/aspeed_timer.c
+++ b/hw/timer/aspeed_timer.c
@@ -284,6 +284,7 @@ static void aspeed_timer_set_value(AspeedTimerCtrlState *s, int timer, int reg,
break;
}
/* fall through to re-enable */
+ fallthrough;
case TIMER_REG_STATUS:
if (timer_enabled(t)) {
uint64_t now = qemu_clock_get_ns(QEMU_CLOCK_VIRTUAL);
diff --git a/hw/timer/pxa2xx_timer.c b/hw/timer/pxa2xx_timer.c
index 2ae5ae3212..11863e1a42 100644
--- a/hw/timer/pxa2xx_timer.c
+++ b/hw/timer/pxa2xx_timer.c
@@ -167,27 +167,27 @@ static uint64_t pxa2xx_timer_read(void *opaque, hwaddr offset,
switch (offset) {
case OSMR3: tm ++;
- /* fall through */
+ fallthrough;
case OSMR2: tm ++;
- /* fall through */
+ fallthrough;
case OSMR1: tm ++;
- /* fall through */
+ fallthrough;
case OSMR0:
return s->timer[tm].value;
case OSMR11: tm ++;
- /* fall through */
+ fallthrough;
case OSMR10: tm ++;
- /* fall through */
+ fallthrough;
case OSMR9: tm ++;
- /* fall through */
+ fallthrough;
case OSMR8: tm ++;
- /* fall through */
+ fallthrough;
case OSMR7: tm ++;
- /* fall through */
+ fallthrough;
case OSMR6: tm ++;
- /* fall through */
+ fallthrough;
case OSMR5: tm ++;
- /* fall through */
+ fallthrough;
case OSMR4:
if (!pxa2xx_timer_has_tm4(s))
goto badreg;
@@ -196,19 +196,19 @@ static uint64_t pxa2xx_timer_read(void *opaque, hwaddr offset,
return s->clock + muldiv64(qemu_clock_get_ns(QEMU_CLOCK_VIRTUAL) -
s->lastload, s->freq, NANOSECONDS_PER_SECOND);
case OSCR11: tm ++;
- /* fall through */
+ fallthrough;
case OSCR10: tm ++;
- /* fall through */
+ fallthrough;
case OSCR9: tm ++;
- /* fall through */
+ fallthrough;
case OSCR8: tm ++;
- /* fall through */
+ fallthrough;
case OSCR7: tm ++;
- /* fall through */
+ fallthrough;
case OSCR6: tm ++;
- /* fall through */
+ fallthrough;
case OSCR5: tm ++;
- /* fall through */
+ fallthrough;
case OSCR4:
if (!pxa2xx_timer_has_tm4(s))
goto badreg;
@@ -236,19 +236,19 @@ static uint64_t pxa2xx_timer_read(void *opaque, hwaddr offset,
case OWER:
return s->reset3;
case OMCR11: tm ++;
- /* fall through */
+ fallthrough;
case OMCR10: tm ++;
- /* fall through */
+ fallthrough;
case OMCR9: tm ++;
- /* fall through */
+ fallthrough;
case OMCR8: tm ++;
- /* fall through */
+ fallthrough;
case OMCR7: tm ++;
- /* fall through */
+ fallthrough;
case OMCR6: tm ++;
- /* fall through */
+ fallthrough;
case OMCR5: tm ++;
- /* fall through */
+ fallthrough;
case OMCR4:
if (!pxa2xx_timer_has_tm4(s))
goto badreg;
@@ -277,29 +277,29 @@ static void pxa2xx_timer_write(void *opaque, hwaddr offset,
switch (offset) {
case OSMR3: tm ++;
- /* fall through */
+ fallthrough;
case OSMR2: tm ++;
- /* fall through */
+ fallthrough;
case OSMR1: tm ++;
- /* fall through */
+ fallthrough;
case OSMR0:
s->timer[tm].value = value;
pxa2xx_timer_update(s, qemu_clock_get_ns(QEMU_CLOCK_VIRTUAL));
break;
case OSMR11: tm ++;
- /* fall through */
+ fallthrough;
case OSMR10: tm ++;
- /* fall through */
+ fallthrough;
case OSMR9: tm ++;
- /* fall through */
+ fallthrough;
case OSMR8: tm ++;
- /* fall through */
+ fallthrough;
case OSMR7: tm ++;
- /* fall through */
+ fallthrough;
case OSMR6: tm ++;
- /* fall through */
+ fallthrough;
case OSMR5: tm ++;
- /* fall through */
+ fallthrough;
case OSMR4:
if (!pxa2xx_timer_has_tm4(s))
goto badreg;
@@ -313,19 +313,19 @@ static void pxa2xx_timer_write(void *opaque, hwaddr offset,
pxa2xx_timer_update(s, s->lastload);
break;
case OSCR11: tm ++;
- /* fall through */
+ fallthrough;
case OSCR10: tm ++;
- /* fall through */
+ fallthrough;
case OSCR9: tm ++;
- /* fall through */
+ fallthrough;
case OSCR8: tm ++;
- /* fall through */
+ fallthrough;
case OSCR7: tm ++;
- /* fall through */
+ fallthrough;
case OSCR6: tm ++;
- /* fall through */
+ fallthrough;
case OSCR5: tm ++;
- /* fall through */
+ fallthrough;
case OSCR4:
if (!pxa2xx_timer_has_tm4(s))
goto badreg;
@@ -350,11 +350,11 @@ static void pxa2xx_timer_write(void *opaque, hwaddr offset,
s->reset3 = value;
break;
case OMCR7: tm ++;
- /* fall through */
+ fallthrough;
case OMCR6: tm ++;
- /* fall through */
+ fallthrough;
case OMCR5: tm ++;
- /* fall through */
+ fallthrough;
case OMCR4:
if (!pxa2xx_timer_has_tm4(s))
goto badreg;
@@ -368,11 +368,11 @@ static void pxa2xx_timer_write(void *opaque, hwaddr offset,
}
break;
case OMCR11: tm ++;
- /* fall through */
+ fallthrough;
case OMCR10: tm ++;
- /* fall through */
+ fallthrough;
case OMCR9: tm ++;
- /* fall through */
+ fallthrough;
case OMCR8: tm += 4;
if (!pxa2xx_timer_has_tm4(s))
goto badreg;
diff --git a/hw/timer/renesas_tmr.c b/hw/timer/renesas_tmr.c
index 43b31213bc..a32521e3c3 100644
--- a/hw/timer/renesas_tmr.c
+++ b/hw/timer/renesas_tmr.c
@@ -236,7 +236,7 @@ static uint64_t tmr_read(void *opaque, hwaddr addr, unsigned size)
} else if (ch == 0) {
return concat_reg(tmr->tcora);
}
- /* fall through */
+ fallthrough;
case A_TCORB:
if (size == 1) {
return tmr->tcorb[ch];
diff --git a/hw/timer/sh_timer.c b/hw/timer/sh_timer.c
index 7788939766..6dbfc2595b 100644
--- a/hw/timer/sh_timer.c
+++ b/hw/timer/sh_timer.c
@@ -131,7 +131,7 @@ static void sh_timer_write(void *opaque, hwaddr offset, uint32_t value)
if (s->feat & TIMER_FEAT_EXTCLK) {
break;
}
- /* fallthrough */
+ fallthrough;
default:
qemu_log_mask(LOG_GUEST_ERROR,
"%s: Reserved TPSC value\n", __func__);
@@ -145,7 +145,7 @@ static void sh_timer_write(void *opaque, hwaddr offset, uint32_t value)
if (s->feat & TIMER_FEAT_EXTCLK) {
break;
}
- /* fallthrough */
+ fallthrough;
default:
qemu_log_mask(LOG_GUEST_ERROR,
"%s: Reserved CKEG value\n", __func__);
@@ -158,7 +158,7 @@ static void sh_timer_write(void *opaque, hwaddr offset, uint32_t value)
if (s->feat & TIMER_FEAT_CAPT) {
break;
}
- /* fallthrough */
+ fallthrough;
default:
qemu_log_mask(LOG_GUEST_ERROR,
"%s: Reserved ICPE value\n", __func__);
@@ -194,7 +194,7 @@ static void sh_timer_write(void *opaque, hwaddr offset, uint32_t value)
s->tcpr = value;
break;
}
- /* fallthrough */
+ fallthrough;
default:
qemu_log_mask(LOG_GUEST_ERROR,
"%s: Bad offset 0x%" HWADDR_PRIx "\n", __func__, offset);
--
2.39.2
^ permalink raw reply related [flat|nested] 106+ messages in thread
* [RFC PATCH v3 12/78] hw/usb: add fallthrough pseudo-keyword
2023-10-13 8:45 [RFC PATCH v3 00/78] Strict disable implicit fallthrough Emmanouil Pitsidianakis
` (10 preceding siblings ...)
2023-10-13 8:45 ` [RFC PATCH v3 11/78] hw/timer: " Emmanouil Pitsidianakis
@ 2023-10-13 8:45 ` Emmanouil Pitsidianakis
2023-10-13 8:45 ` [RFC PATCH v3 13/78] hw/adc: " Emmanouil Pitsidianakis
` (67 subsequent siblings)
79 siblings, 0 replies; 106+ messages in thread
From: Emmanouil Pitsidianakis @ 2023-10-13 8:45 UTC (permalink / raw)
To: qemu-devel; +Cc: Emmanouil Pitsidianakis, Gerd Hoffmann
In preparation of raising -Wimplicit-fallthrough to 5, replace all
fall-through comments with the fallthrough attribute pseudo-keyword.
Signed-off-by: Emmanouil Pitsidianakis <manos.pitsidianakis@linaro.org>
---
hw/usb/dev-mtp.c | 2 +-
hw/usb/dev-wacom.c | 2 +-
hw/usb/hcd-ehci.c | 4 +++-
hw/usb/hcd-xhci.c | 4 ++--
hw/usb/redirect.c | 4 ++--
hw/usb/tusb6010.c | 2 +-
6 files changed, 10 insertions(+), 8 deletions(-)
diff --git a/hw/usb/dev-mtp.c b/hw/usb/dev-mtp.c
index 1cac1cd435..5cbaabd2b2 100644
--- a/hw/usb/dev-mtp.c
+++ b/hw/usb/dev-mtp.c
@@ -1648,7 +1648,7 @@ static void usb_mtp_write_data(MTPState *s, uint32_t handle)
d->write_status = WRITE_END;
}
}
- /* fall through */
+ fallthrough;
case WRITE_CONTINUE:
case WRITE_END:
rc = write_retry(d->fd, d->data, d->data_offset,
diff --git a/hw/usb/dev-wacom.c b/hw/usb/dev-wacom.c
index 7177c17f03..bd2a1bae50 100644
--- a/hw/usb/dev-wacom.c
+++ b/hw/usb/dev-wacom.c
@@ -389,7 +389,7 @@ static void usb_wacom_handle_data(USBDevice *dev, USBPacket *p)
usb_packet_copy(p, buf, len);
break;
}
- /* Fall through. */
+ fallthrough;
case USB_TOKEN_OUT:
default:
p->status = USB_RET_STALL;
diff --git a/hw/usb/hcd-ehci.c b/hw/usb/hcd-ehci.c
index 19b4534c20..e29cc21957 100644
--- a/hw/usb/hcd-ehci.c
+++ b/hw/usb/hcd-ehci.c
@@ -1477,7 +1477,7 @@ static int ehci_process_itd(EHCIState *ehci,
default:
fprintf(stderr, "Unexpected iso usb result: %d\n",
ehci->ipacket.status);
- /* Fall through */
+ fallthrough;
case USB_RET_IOERROR:
case USB_RET_NODEV:
/* 3.3.2: XACTERR is only allowed on IN transactions */
@@ -2140,6 +2140,7 @@ static void ehci_advance_async_state(EHCIState *ehci)
}
ehci_set_state(ehci, async, EST_ACTIVE);
// No break, fall through to ACTIVE
+ fallthrough;
case EST_ACTIVE:
if (!ehci_async_enabled(ehci)) {
@@ -2197,6 +2198,7 @@ static void ehci_advance_periodic_state(EHCIState *ehci)
if (!(ehci->frindex & 7) && ehci_periodic_enabled(ehci)) {
ehci_set_state(ehci, async, EST_ACTIVE);
// No break, fall through to ACTIVE
+ fallthrough;
} else
break;
diff --git a/hw/usb/hcd-xhci.c b/hw/usb/hcd-xhci.c
index 4b60114207..3e9b9c62bd 100644
--- a/hw/usb/hcd-xhci.c
+++ b/hw/usb/hcd-xhci.c
@@ -1457,7 +1457,7 @@ static int xhci_xfer_create_sgl(XHCITransfer *xfer, int in_xfer)
DPRINTF("xhci: data direction mismatch for TR_DATA\n");
goto err;
}
- /* fallthrough */
+ fallthrough;
case TR_NORMAL:
case TR_ISOCH:
addr = xhci_mask64(trb->parameter);
@@ -2678,7 +2678,7 @@ static void xhci_port_reset(XHCIPort *port, bool warm_reset)
if (warm_reset) {
port->portsc |= PORTSC_WRC;
}
- /* fall through */
+ fallthrough;
case USB_SPEED_LOW:
case USB_SPEED_FULL:
case USB_SPEED_HIGH:
diff --git a/hw/usb/redirect.c b/hw/usb/redirect.c
index c9893df867..2531d583ad 100644
--- a/hw/usb/redirect.c
+++ b/hw/usb/redirect.c
@@ -1814,7 +1814,7 @@ static void usbredir_ep_info(void *priv,
case usb_redir_type_iso:
usbredir_mark_speed_incompatible(dev, USB_SPEED_FULL);
usbredir_mark_speed_incompatible(dev, USB_SPEED_HIGH);
- /* Fall through */
+ fallthrough;
case usb_redir_type_interrupt:
if (!usbredirparser_peer_has_cap(dev->parser,
usb_redir_cap_ep_info_max_packet_size) ||
@@ -1831,7 +1831,7 @@ static void usbredir_ep_info(void *priv,
usbredir_reject_device(dev);
return;
}
- /* Fall through */
+ fallthrough;
case usb_redir_type_control:
case usb_redir_type_bulk:
DPRINTF("ep: %02X type: %d interface: %d\n", I2EP(i),
diff --git a/hw/usb/tusb6010.c b/hw/usb/tusb6010.c
index 1dd4071e68..88c736fad2 100644
--- a/hw/usb/tusb6010.c
+++ b/hw/usb/tusb6010.c
@@ -741,7 +741,7 @@ static void tusb_musb_core_intr(void *opaque, int source, int level)
case musb_irq_tx:
case musb_irq_rx:
s->usbip_intr = musb_core_intr_get(s->musb);
- /* Fall through. */
+ fallthrough;
default:
if (level)
s->intr |= 1 << source;
--
2.39.2
^ permalink raw reply related [flat|nested] 106+ messages in thread
* [RFC PATCH v3 13/78] hw/adc: add fallthrough pseudo-keyword
2023-10-13 8:45 [RFC PATCH v3 00/78] Strict disable implicit fallthrough Emmanouil Pitsidianakis
` (11 preceding siblings ...)
2023-10-13 8:45 ` [RFC PATCH v3 12/78] hw/usb: " Emmanouil Pitsidianakis
@ 2023-10-13 8:45 ` Emmanouil Pitsidianakis
2023-10-13 8:45 ` [RFC PATCH v3 14/78] util/error-report.c: " Emmanouil Pitsidianakis
` (66 subsequent siblings)
79 siblings, 0 replies; 106+ messages in thread
From: Emmanouil Pitsidianakis @ 2023-10-13 8:45 UTC (permalink / raw)
To: qemu-devel
Cc: Emmanouil Pitsidianakis, Cédric Le Goater, Peter Maydell,
Andrew Jeffery, Joel Stanley, Alistair Francis, Edgar E. Iglesias,
open list:ASPEED BMCs
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 <clg@kaod.org>
Signed-off-by: Emmanouil Pitsidianakis <manos.pitsidianakis@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
^ permalink raw reply related [flat|nested] 106+ messages in thread
* [RFC PATCH v3 14/78] util/error-report.c: add fallthrough pseudo-keyword
2023-10-13 8:45 [RFC PATCH v3 00/78] Strict disable implicit fallthrough Emmanouil Pitsidianakis
` (12 preceding siblings ...)
2023-10-13 8:45 ` [RFC PATCH v3 13/78] hw/adc: " Emmanouil Pitsidianakis
@ 2023-10-13 8:45 ` Emmanouil Pitsidianakis
2023-10-13 8:45 ` [RFC PATCH v3 15/78] accel/tcg: " Emmanouil Pitsidianakis
` (65 subsequent siblings)
79 siblings, 0 replies; 106+ messages in thread
From: Emmanouil Pitsidianakis @ 2023-10-13 8:45 UTC (permalink / raw)
To: qemu-devel; +Cc: Emmanouil Pitsidianakis
In preparation of raising -Wimplicit-fallthrough to 5, replace all
fall-through comments with the fallthrough attribute pseudo-keyword.
Signed-off-by: Emmanouil Pitsidianakis <manos.pitsidianakis@linaro.org>
---
util/error-report.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/util/error-report.c b/util/error-report.c
index 6e44a55732..acb66420de 100644
--- a/util/error-report.c
+++ b/util/error-report.c
@@ -369,7 +369,7 @@ static void qemu_log_func(const gchar *log_domain,
(log_domain == NULL || !strstr(qemu_glog_domains, log_domain))) {
break;
}
- /* Fall through */
+ fallthrough;
case G_LOG_LEVEL_MESSAGE:
info_report("%s%s%s",
log_domain ?: "", log_domain ? ": " : "", message);
--
2.39.2
^ permalink raw reply related [flat|nested] 106+ messages in thread
* [RFC PATCH v3 15/78] accel/tcg: add fallthrough pseudo-keyword
2023-10-13 8:45 [RFC PATCH v3 00/78] Strict disable implicit fallthrough Emmanouil Pitsidianakis
` (13 preceding siblings ...)
2023-10-13 8:45 ` [RFC PATCH v3 14/78] util/error-report.c: " Emmanouil Pitsidianakis
@ 2023-10-13 8:45 ` Emmanouil Pitsidianakis
2023-10-13 8:45 ` [RFC PATCH v3 16/78] audio: " Emmanouil Pitsidianakis
` (64 subsequent siblings)
79 siblings, 0 replies; 106+ messages in thread
From: Emmanouil Pitsidianakis @ 2023-10-13 8:45 UTC (permalink / raw)
To: qemu-devel; +Cc: Emmanouil Pitsidianakis, Richard Henderson, Paolo Bonzini
In preparation of raising -Wimplicit-fallthrough to 5, replace all
fall-through comments with the fallthrough attribute pseudo-keyword.
Signed-off-by: Emmanouil Pitsidianakis <manos.pitsidianakis@linaro.org>
---
accel/tcg/cputlb.c | 4 ++--
accel/tcg/ldst_atomicity.c.inc | 2 +-
accel/tcg/plugin-gen.c | 2 +-
3 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/accel/tcg/cputlb.c b/accel/tcg/cputlb.c
index b8c5e345b8..92b7ab529a 100644
--- a/accel/tcg/cputlb.c
+++ b/accel/tcg/cputlb.c
@@ -2244,7 +2244,7 @@ static uint64_t do_ld_beN(CPUState *cpu, MMULookupPageData *p,
return do_ld_whole_be8(cpu, ra, p, ret_be);
}
}
- /* fall through */
+ fallthrough;
case MO_ATOM_IFALIGN:
case MO_ATOM_WITHIN16:
@@ -2664,7 +2664,7 @@ static uint64_t do_st_leN(CPUState *cpu, MMULookupPageData *p,
cpu_loop_exit_atomic(cpu, ra);
}
}
- /* fall through */
+ fallthrough;
case MO_ATOM_IFALIGN:
case MO_ATOM_WITHIN16:
diff --git a/accel/tcg/ldst_atomicity.c.inc b/accel/tcg/ldst_atomicity.c.inc
index 1cf5b92166..3752f74214 100644
--- a/accel/tcg/ldst_atomicity.c.inc
+++ b/accel/tcg/ldst_atomicity.c.inc
@@ -41,7 +41,7 @@ static int required_atomicity(CPUState *cpu, uintptr_t p, MemOp memop)
case MO_ATOM_IFALIGN_PAIR:
size = half;
- /* fall through */
+ fallthrough;
case MO_ATOM_IFALIGN:
tmp = (1 << size) - 1;
diff --git a/accel/tcg/plugin-gen.c b/accel/tcg/plugin-gen.c
index d31c9993ea..ba9a8c8789 100644
--- a/accel/tcg/plugin-gen.c
+++ b/accel/tcg/plugin-gen.c
@@ -190,7 +190,7 @@ static void plugin_gen_empty_callback(enum plugin_gen_from from)
*/
gen_wrapped(from, PLUGIN_GEN_ENABLE_MEM_HELPER,
gen_empty_mem_helper);
- /* fall through */
+ fallthrough;
case PLUGIN_GEN_FROM_TB:
gen_wrapped(from, PLUGIN_GEN_CB_UDATA, gen_empty_udata_cb);
gen_wrapped(from, PLUGIN_GEN_CB_INLINE, gen_empty_inline_cb);
--
2.39.2
^ permalink raw reply related [flat|nested] 106+ messages in thread
* [RFC PATCH v3 16/78] audio: add fallthrough pseudo-keyword
2023-10-13 8:45 [RFC PATCH v3 00/78] Strict disable implicit fallthrough Emmanouil Pitsidianakis
` (14 preceding siblings ...)
2023-10-13 8:45 ` [RFC PATCH v3 15/78] accel/tcg: " Emmanouil Pitsidianakis
@ 2023-10-13 8:45 ` Emmanouil Pitsidianakis
2023-10-13 8:45 ` [RFC PATCH v3 17/78] ui/sdl2.c: " Emmanouil Pitsidianakis
` (63 subsequent siblings)
79 siblings, 0 replies; 106+ messages in thread
From: Emmanouil Pitsidianakis @ 2023-10-13 8:45 UTC (permalink / raw)
To: qemu-devel
Cc: Emmanouil Pitsidianakis, Gerd Hoffmann, Marc-André Lureau,
Christian Schoenebeck
In preparation of raising -Wimplicit-fallthrough to 5, replace all
fall-through comments with the fallthrough attribute pseudo-keyword.
Signed-off-by: Emmanouil Pitsidianakis <manos.pitsidianakis@linaro.org>
---
audio/audio.c | 16 ++++++++--------
audio/jackaudio.c | 4 ++--
audio/pwaudio.c | 4 ++--
3 files changed, 12 insertions(+), 12 deletions(-)
diff --git a/audio/audio.c b/audio/audio.c
index e9815d6812..ed7c795af7 100644
--- a/audio/audio.c
+++ b/audio/audio.c
@@ -250,23 +250,23 @@ static int audio_pcm_info_eq (struct audio_pcm_info *info, struct audsettings *a
switch (as->fmt) {
case AUDIO_FORMAT_S8:
is_signed = true;
- /* fall through */
+ fallthrough;
case AUDIO_FORMAT_U8:
break;
case AUDIO_FORMAT_S16:
is_signed = true;
- /* fall through */
+ fallthrough;
case AUDIO_FORMAT_U16:
bits = 16;
break;
case AUDIO_FORMAT_F32:
is_float = true;
- /* fall through */
+ fallthrough;
case AUDIO_FORMAT_S32:
is_signed = true;
- /* fall through */
+ fallthrough;
case AUDIO_FORMAT_U32:
bits = 32;
break;
@@ -290,14 +290,14 @@ void audio_pcm_init_info (struct audio_pcm_info *info, struct audsettings *as)
switch (as->fmt) {
case AUDIO_FORMAT_S8:
is_signed = true;
- /* fall through */
+ fallthrough;
case AUDIO_FORMAT_U8:
mul = 1;
break;
case AUDIO_FORMAT_S16:
is_signed = true;
- /* fall through */
+ fallthrough;
case AUDIO_FORMAT_U16:
bits = 16;
mul = 2;
@@ -305,10 +305,10 @@ void audio_pcm_init_info (struct audio_pcm_info *info, struct audsettings *as)
case AUDIO_FORMAT_F32:
is_float = true;
- /* fall through */
+ fallthrough;
case AUDIO_FORMAT_S32:
is_signed = true;
- /* fall through */
+ fallthrough;
case AUDIO_FORMAT_U32:
bits = 32;
mul = 4;
diff --git a/audio/jackaudio.c b/audio/jackaudio.c
index 974a3caad3..fc602411cd 100644
--- a/audio/jackaudio.c
+++ b/audio/jackaudio.c
@@ -576,7 +576,7 @@ static void qjack_client_fini_locked(QJackClient *c)
switch (c->state) {
case QJACK_STATE_RUNNING:
jack_deactivate(c->client);
- /* fallthrough */
+ fallthrough;
case QJACK_STATE_SHUTDOWN:
jack_client_close(c->client);
@@ -587,7 +587,7 @@ static void qjack_client_fini_locked(QJackClient *c)
g_free(c->process_buffers);
c->state = QJACK_STATE_DISCONNECTED;
- /* fallthrough */
+ fallthrough;
case QJACK_STATE_DISCONNECTED:
break;
diff --git a/audio/pwaudio.c b/audio/pwaudio.c
index bf26fadb06..89b31617a6 100644
--- a/audio/pwaudio.c
+++ b/audio/pwaudio.c
@@ -497,13 +497,13 @@ qpw_set_position(uint32_t channels, uint32_t position[SPA_AUDIO_MAX_CHANNELS])
case 8:
position[6] = SPA_AUDIO_CHANNEL_SL;
position[7] = SPA_AUDIO_CHANNEL_SR;
- /* fallthrough */
+ fallthrough;
case 6:
position[2] = SPA_AUDIO_CHANNEL_FC;
position[3] = SPA_AUDIO_CHANNEL_LFE;
position[4] = SPA_AUDIO_CHANNEL_RL;
position[5] = SPA_AUDIO_CHANNEL_RR;
- /* fallthrough */
+ fallthrough;
case 2:
position[0] = SPA_AUDIO_CHANNEL_FL;
position[1] = SPA_AUDIO_CHANNEL_FR;
--
2.39.2
^ permalink raw reply related [flat|nested] 106+ messages in thread
* [RFC PATCH v3 17/78] ui/sdl2.c: add fallthrough pseudo-keyword
2023-10-13 8:45 [RFC PATCH v3 00/78] Strict disable implicit fallthrough Emmanouil Pitsidianakis
` (15 preceding siblings ...)
2023-10-13 8:45 ` [RFC PATCH v3 16/78] audio: " Emmanouil Pitsidianakis
@ 2023-10-13 8:45 ` Emmanouil Pitsidianakis
2023-10-13 8:45 ` [RFC PATCH v3 18/78] ui/win32-kbd-hook.c: " Emmanouil Pitsidianakis
` (62 subsequent siblings)
79 siblings, 0 replies; 106+ messages in thread
From: Emmanouil Pitsidianakis @ 2023-10-13 8:45 UTC (permalink / raw)
To: qemu-devel; +Cc: Emmanouil Pitsidianakis, Gerd Hoffmann, Marc-André Lureau
In preparation of raising -Wimplicit-fallthrough to 5, replace all
fall-through comments with the fallthrough attribute pseudo-keyword.
Signed-off-by: Emmanouil Pitsidianakis <manos.pitsidianakis@linaro.org>
---
ui/sdl2.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/ui/sdl2.c b/ui/sdl2.c
index fbfdb64e90..3d157a14aa 100644
--- a/ui/sdl2.c
+++ b/ui/sdl2.c
@@ -601,7 +601,7 @@ static void handle_windowevent(SDL_Event *ev)
if (qemu_console_is_graphic(scon->dcl.con)) {
win32_kbd_set_window(sdl2_win32_get_hwnd(scon));
}
- /* fall through */
+ fallthrough;
case SDL_WINDOWEVENT_ENTER:
if (!gui_grab && (qemu_input_is_absolute(scon->dcl.con) || absolute_enabled)) {
absolute_mouse_grab(scon);
--
2.39.2
^ permalink raw reply related [flat|nested] 106+ messages in thread
* [RFC PATCH v3 18/78] ui/win32-kbd-hook.c: add fallthrough pseudo-keyword
2023-10-13 8:45 [RFC PATCH v3 00/78] Strict disable implicit fallthrough Emmanouil Pitsidianakis
` (16 preceding siblings ...)
2023-10-13 8:45 ` [RFC PATCH v3 17/78] ui/sdl2.c: " Emmanouil Pitsidianakis
@ 2023-10-13 8:45 ` Emmanouil Pitsidianakis
2023-10-13 8:45 ` [RFC PATCH v3 19/78] target/hppa: " Emmanouil Pitsidianakis
` (61 subsequent siblings)
79 siblings, 0 replies; 106+ messages in thread
From: Emmanouil Pitsidianakis @ 2023-10-13 8:45 UTC (permalink / raw)
To: qemu-devel
Cc: Emmanouil Pitsidianakis, Gerd Hoffmann, Marc-André Lureau,
Stefan Weil
In preparation of raising -Wimplicit-fallthrough to 5, replace all
fall-through comments with the fallthrough attribute pseudo-keyword.
Signed-off-by: Emmanouil Pitsidianakis <manos.pitsidianakis@linaro.org>
---
ui/win32-kbd-hook.c | 7 -------
1 file changed, 7 deletions(-)
diff --git a/ui/win32-kbd-hook.c b/ui/win32-kbd-hook.c
index 1ac237db9e..3c5c3fc597 100644
--- a/ui/win32-kbd-hook.c
+++ b/ui/win32-kbd-hook.c
@@ -26,19 +26,12 @@ static LRESULT CALLBACK keyboard_hook_cb(int code, WPARAM wparam, LPARAM lparam)
switch (hooked->vkCode) {
case VK_CAPITAL:
- /* fall through */
case VK_SCROLL:
- /* fall through */
case VK_NUMLOCK:
- /* fall through */
case VK_LSHIFT:
- /* fall through */
case VK_RSHIFT:
- /* fall through */
case VK_RCONTROL:
- /* fall through */
case VK_LMENU:
- /* fall through */
case VK_RMENU:
break;
--
2.39.2
^ permalink raw reply related [flat|nested] 106+ messages in thread
* [RFC PATCH v3 19/78] target/hppa: add fallthrough pseudo-keyword
2023-10-13 8:45 [RFC PATCH v3 00/78] Strict disable implicit fallthrough Emmanouil Pitsidianakis
` (17 preceding siblings ...)
2023-10-13 8:45 ` [RFC PATCH v3 18/78] ui/win32-kbd-hook.c: " Emmanouil Pitsidianakis
@ 2023-10-13 8:45 ` Emmanouil Pitsidianakis
2023-10-13 8:45 ` [RFC PATCH v3 20/78] target/mips: " Emmanouil Pitsidianakis
` (60 subsequent siblings)
79 siblings, 0 replies; 106+ messages in thread
From: Emmanouil Pitsidianakis @ 2023-10-13 8:45 UTC (permalink / raw)
To: qemu-devel; +Cc: Emmanouil Pitsidianakis, Richard Henderson
In preparation of raising -Wimplicit-fallthrough to 5, replace all
fall-through comments with the fallthrough attribute pseudo-keyword.
Signed-off-by: Emmanouil Pitsidianakis <manos.pitsidianakis@linaro.org>
---
target/hppa/translate.c | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/target/hppa/translate.c b/target/hppa/translate.c
index 9f3ba9f42f..1df81b0fa2 100644
--- a/target/hppa/translate.c
+++ b/target/hppa/translate.c
@@ -483,7 +483,7 @@ static void cond_free(DisasCond *cond)
default:
cond->a0 = NULL;
cond->a1 = NULL;
- /* fallthru */
+ fallthrough;
case TCG_COND_ALWAYS:
cond->c = TCG_COND_NEVER;
break;
@@ -3848,13 +3848,13 @@ static bool trans_ftest(DisasContext *ctx, arg_ftest *a)
goto done;
case 2: /* rej */
inv = true;
- /* fallthru */
+ fallthrough;
case 1: /* acc */
mask = 0x43ff800;
break;
case 6: /* rej8 */
inv = true;
- /* fallthru */
+ fallthrough;
case 5: /* acc8 */
mask = 0x43f8000;
break;
@@ -4230,13 +4230,13 @@ static void hppa_tr_tb_stop(DisasContextBase *dcbase, CPUState *cs)
copy_iaoq_entry(cpu_iaoq_f, ctx->iaoq_f, cpu_iaoq_f);
copy_iaoq_entry(cpu_iaoq_b, ctx->iaoq_b, cpu_iaoq_b);
nullify_save(ctx);
- /* FALLTHRU */
+ fallthrough;
case DISAS_IAQ_N_UPDATED:
if (is_jmp != DISAS_IAQ_N_STALE_EXIT) {
tcg_gen_lookup_and_goto_ptr();
break;
}
- /* FALLTHRU */
+ fallthrough;
case DISAS_EXIT:
tcg_gen_exit_tb(NULL, 0);
break;
--
2.39.2
^ permalink raw reply related [flat|nested] 106+ messages in thread
* [RFC PATCH v3 20/78] target/mips: add fallthrough pseudo-keyword
2023-10-13 8:45 [RFC PATCH v3 00/78] Strict disable implicit fallthrough Emmanouil Pitsidianakis
` (18 preceding siblings ...)
2023-10-13 8:45 ` [RFC PATCH v3 19/78] target/hppa: " Emmanouil Pitsidianakis
@ 2023-10-13 8:45 ` Emmanouil Pitsidianakis
2023-10-16 16:51 ` Philippe Mathieu-Daudé
2023-10-13 8:45 ` [RFC PATCH v3 21/78] target/sparc: " Emmanouil Pitsidianakis
` (59 subsequent siblings)
79 siblings, 1 reply; 106+ messages in thread
From: Emmanouil Pitsidianakis @ 2023-10-13 8:45 UTC (permalink / raw)
To: qemu-devel
Cc: Emmanouil Pitsidianakis, Huacai Chen, Philippe Mathieu-Daudé,
Aurelien Jarno, Jiaxun Yang, Aleksandar Rikalo
In preparation of raising -Wimplicit-fallthrough to 5, replace all
fall-through comments with the fallthrough attribute pseudo-keyword.
Signed-off-by: Emmanouil Pitsidianakis <manos.pitsidianakis@linaro.org>
---
target/mips/sysemu/physaddr.c | 2 +-
target/mips/tcg/micromips_translate.c.inc | 4 +-
target/mips/tcg/mips16e_translate.c.inc | 30 ++++-----
target/mips/tcg/mxu_translate.c | 8 +--
target/mips/tcg/nanomips_translate.c.inc | 4 +-
target/mips/tcg/op_helper.c | 2 +-
target/mips/tcg/translate.c | 79 ++++++++++++-----------
7 files changed, 66 insertions(+), 63 deletions(-)
diff --git a/target/mips/sysemu/physaddr.c b/target/mips/sysemu/physaddr.c
index 05990aa5bb..ebcaeea1bc 100644
--- a/target/mips/sysemu/physaddr.c
+++ b/target/mips/sysemu/physaddr.c
@@ -44,7 +44,7 @@ static int is_seg_am_mapped(unsigned int am, bool eu, int mmu_idx)
if (eu) {
return 0;
}
- /* fall through */
+ fallthrough;
case MIPS_HFLAG_KM:
/* Never AdE, TLB mapped if AM={1,2,3} */
adetlb_mask = 0x70000000;
diff --git a/target/mips/tcg/micromips_translate.c.inc b/target/mips/tcg/micromips_translate.c.inc
index 7510831701..00e96ce27a 100644
--- a/target/mips/tcg/micromips_translate.c.inc
+++ b/target/mips/tcg/micromips_translate.c.inc
@@ -1845,7 +1845,7 @@ static void decode_micromips32_opc(CPUMIPSState *env, DisasContext *ctx)
check_insn(ctx, ISA_MIPS3);
check_mips_64(ctx);
#endif
- /* fall through */
+ fallthrough;
case LWP:
case SWP:
gen_ldst_pair(ctx, minor, rt, rs, SIMM(ctx->opcode, 0, 12));
@@ -1856,7 +1856,7 @@ static void decode_micromips32_opc(CPUMIPSState *env, DisasContext *ctx)
check_insn(ctx, ISA_MIPS3);
check_mips_64(ctx);
#endif
- /* fall through */
+ fallthrough;
case LWM32:
case SWM32:
gen_ldst_multiple(ctx, minor, rt, rs, SIMM(ctx->opcode, 0, 12));
diff --git a/target/mips/tcg/mips16e_translate.c.inc b/target/mips/tcg/mips16e_translate.c.inc
index 5cffe0e412..b8bdd6a7f2 100644
--- a/target/mips/tcg/mips16e_translate.c.inc
+++ b/target/mips/tcg/mips16e_translate.c.inc
@@ -174,19 +174,19 @@ static void gen_mips16_save(DisasContext *ctx,
gen_load_gpr(t1, 7);
tcg_gen_qemu_st_tl(t1, t0, ctx->mem_idx, MO_TEUL |
ctx->default_tcg_memop_mask);
- /* Fall through */
+ fallthrough;
case 3:
gen_base_offset_addr(ctx, t0, 29, 8);
gen_load_gpr(t1, 6);
tcg_gen_qemu_st_tl(t1, t0, ctx->mem_idx, MO_TEUL |
ctx->default_tcg_memop_mask);
- /* Fall through */
+ fallthrough;
case 2:
gen_base_offset_addr(ctx, t0, 29, 4);
gen_load_gpr(t1, 5);
tcg_gen_qemu_st_tl(t1, t0, ctx->mem_idx, MO_TEUL |
ctx->default_tcg_memop_mask);
- /* Fall through */
+ fallthrough;
case 1:
gen_base_offset_addr(ctx, t0, 29, 0);
gen_load_gpr(t1, 4);
@@ -211,22 +211,22 @@ static void gen_mips16_save(DisasContext *ctx,
switch (xsregs) {
case 7:
DECR_AND_STORE(30);
- /* Fall through */
+ fallthrough;
case 6:
DECR_AND_STORE(23);
- /* Fall through */
+ fallthrough;
case 5:
DECR_AND_STORE(22);
- /* Fall through */
+ fallthrough;
case 4:
DECR_AND_STORE(21);
- /* Fall through */
+ fallthrough;
case 3:
DECR_AND_STORE(20);
- /* Fall through */
+ fallthrough;
case 2:
DECR_AND_STORE(19);
- /* Fall through */
+ fallthrough;
case 1:
DECR_AND_STORE(18);
}
@@ -315,22 +315,22 @@ static void gen_mips16_restore(DisasContext *ctx,
switch (xsregs) {
case 7:
DECR_AND_LOAD(30);
- /* Fall through */
+ fallthrough;
case 6:
DECR_AND_LOAD(23);
- /* Fall through */
+ fallthrough;
case 5:
DECR_AND_LOAD(22);
- /* Fall through */
+ fallthrough;
case 4:
DECR_AND_LOAD(21);
- /* Fall through */
+ fallthrough;
case 3:
DECR_AND_LOAD(20);
- /* Fall through */
+ fallthrough;
case 2:
DECR_AND_LOAD(19);
- /* Fall through */
+ fallthrough;
case 1:
DECR_AND_LOAD(18);
}
diff --git a/target/mips/tcg/mxu_translate.c b/target/mips/tcg/mxu_translate.c
index c517258ac5..3811ac0d54 100644
--- a/target/mips/tcg/mxu_translate.c
+++ b/target/mips/tcg/mxu_translate.c
@@ -4573,7 +4573,7 @@ static void decode_opc_mxu__pool06(DisasContext *ctx)
gen_mxu_s32ldxvx(ctx, opcode, false, strd2);
break;
}
- /* fallthrough */
+ fallthrough;
default:
MIPS_INVAL("decode_opc_mxu");
gen_reserved_instruction(ctx);
@@ -4593,7 +4593,7 @@ static void decode_opc_mxu__pool07(DisasContext *ctx)
gen_mxu_s32stxvx(ctx, opcode, false, strd2);
break;
}
- /* fallthrough */
+ fallthrough;
default:
MIPS_INVAL("decode_opc_mxu");
gen_reserved_instruction(ctx);
@@ -4639,7 +4639,7 @@ static void decode_opc_mxu__pool10(DisasContext *ctx)
gen_mxu_s32ldxvx(ctx, opcode, true, strd2);
break;
}
- /* fallthrough */
+ fallthrough;
default:
MIPS_INVAL("decode_opc_mxu");
gen_reserved_instruction(ctx);
@@ -4659,7 +4659,7 @@ static void decode_opc_mxu__pool11(DisasContext *ctx)
gen_mxu_s32stxvx(ctx, opcode, true, strd2);
break;
}
- /* fallthrough */
+ fallthrough;
default:
MIPS_INVAL("decode_opc_mxu");
gen_reserved_instruction(ctx);
diff --git a/target/mips/tcg/nanomips_translate.c.inc b/target/mips/tcg/nanomips_translate.c.inc
index b4b746d418..3e5f4f4e58 100644
--- a/target/mips/tcg/nanomips_translate.c.inc
+++ b/target/mips/tcg/nanomips_translate.c.inc
@@ -2615,14 +2615,14 @@ static void gen_p_lsx(DisasContext *ctx, int rd, int rs, int rt)
switch (extract32(ctx->opcode, 7, 4)) {
case NM_SHXS:
check_nms(ctx);
- /* fall through */
+ fallthrough;
case NM_LHXS:
case NM_LHUXS:
tcg_gen_shli_tl(t0, t0, 1);
break;
case NM_SWXS:
check_nms(ctx);
- /* fall through */
+ fallthrough;
case NM_LWXS:
case NM_LWC1XS:
case NM_SWC1XS:
diff --git a/target/mips/tcg/op_helper.c b/target/mips/tcg/op_helper.c
index 98935b5e64..b53f4fa694 100644
--- a/target/mips/tcg/op_helper.c
+++ b/target/mips/tcg/op_helper.c
@@ -238,7 +238,7 @@ void helper_pmon(CPUMIPSState *env, int function)
if (env->active_tc.gpr[4] == 0) {
env->active_tc.gpr[2] = -1;
}
- /* Fall through */
+ fallthrough;
case 11: /* TODO: char inbyte (void); */
env->active_tc.gpr[2] = -1;
break;
diff --git a/target/mips/tcg/translate.c b/target/mips/tcg/translate.c
index 13e43fa3b6..c6cbc05400 100644
--- a/target/mips/tcg/translate.c
+++ b/target/mips/tcg/translate.c
@@ -2115,7 +2115,7 @@ static void gen_ld(DisasContext *ctx, uint32_t opc,
break;
case OPC_LWE:
mem_idx = MIPS_HFLAG_UM;
- /* fall through */
+ fallthrough;
case OPC_LW:
tcg_gen_qemu_ld_tl(t0, t0, mem_idx, MO_TESL |
ctx->default_tcg_memop_mask);
@@ -2123,7 +2123,7 @@ static void gen_ld(DisasContext *ctx, uint32_t opc,
break;
case OPC_LHE:
mem_idx = MIPS_HFLAG_UM;
- /* fall through */
+ fallthrough;
case OPC_LH:
tcg_gen_qemu_ld_tl(t0, t0, mem_idx, MO_TESW |
ctx->default_tcg_memop_mask);
@@ -2131,7 +2131,7 @@ static void gen_ld(DisasContext *ctx, uint32_t opc,
break;
case OPC_LHUE:
mem_idx = MIPS_HFLAG_UM;
- /* fall through */
+ fallthrough;
case OPC_LHU:
tcg_gen_qemu_ld_tl(t0, t0, mem_idx, MO_TEUW |
ctx->default_tcg_memop_mask);
@@ -2139,21 +2139,21 @@ static void gen_ld(DisasContext *ctx, uint32_t opc,
break;
case OPC_LBE:
mem_idx = MIPS_HFLAG_UM;
- /* fall through */
+ fallthrough;
case OPC_LB:
tcg_gen_qemu_ld_tl(t0, t0, mem_idx, MO_SB);
gen_store_gpr(t0, rt);
break;
case OPC_LBUE:
mem_idx = MIPS_HFLAG_UM;
- /* fall through */
+ fallthrough;
case OPC_LBU:
tcg_gen_qemu_ld_tl(t0, t0, mem_idx, MO_UB);
gen_store_gpr(t0, rt);
break;
case OPC_LWLE:
mem_idx = MIPS_HFLAG_UM;
- /* fall through */
+ fallthrough;
case OPC_LWL:
t1 = tcg_temp_new();
gen_load_gpr(t1, rt);
@@ -2163,7 +2163,7 @@ static void gen_ld(DisasContext *ctx, uint32_t opc,
break;
case OPC_LWRE:
mem_idx = MIPS_HFLAG_UM;
- /* fall through */
+ fallthrough;
case OPC_LWR:
t1 = tcg_temp_new();
gen_load_gpr(t1, rt);
@@ -2173,7 +2173,7 @@ static void gen_ld(DisasContext *ctx, uint32_t opc,
break;
case OPC_LLE:
mem_idx = MIPS_HFLAG_UM;
- /* fall through */
+ fallthrough;
case OPC_LL:
case R6_OPC_LL:
op_ld_ll(t0, t0, mem_idx, ctx);
@@ -2207,33 +2207,33 @@ static void gen_st(DisasContext *ctx, uint32_t opc, int rt,
#endif
case OPC_SWE:
mem_idx = MIPS_HFLAG_UM;
- /* fall through */
+ fallthrough;
case OPC_SW:
tcg_gen_qemu_st_tl(t1, t0, mem_idx, MO_TEUL |
ctx->default_tcg_memop_mask);
break;
case OPC_SHE:
mem_idx = MIPS_HFLAG_UM;
- /* fall through */
+ fallthrough;
case OPC_SH:
tcg_gen_qemu_st_tl(t1, t0, mem_idx, MO_TEUW |
ctx->default_tcg_memop_mask);
break;
case OPC_SBE:
mem_idx = MIPS_HFLAG_UM;
- /* fall through */
+ fallthrough;
case OPC_SB:
tcg_gen_qemu_st_tl(t1, t0, mem_idx, MO_8);
break;
case OPC_SWLE:
mem_idx = MIPS_HFLAG_UM;
- /* fall through */
+ fallthrough;
case OPC_SWL:
gen_helper_0e2i(swl, t1, t0, mem_idx);
break;
case OPC_SWRE:
mem_idx = MIPS_HFLAG_UM;
- /* fall through */
+ fallthrough;
case OPC_SWR:
gen_helper_0e2i(swr, t1, t0, mem_idx);
break;
@@ -2329,7 +2329,7 @@ static void gen_cop1_ldst(DisasContext *ctx, uint32_t op, int rt,
case OPC_LDC1:
case OPC_SDC1:
check_insn(ctx, ISA_MIPS2);
- /* Fallthrough */
+ fallthrough;
default:
gen_base_offset_addr(ctx, t0, rs, imm);
gen_flt_ldst(ctx, op, rt, t0);
@@ -3477,7 +3477,7 @@ static void gen_mul_txx9(DisasContext *ctx, uint32_t opc,
switch (opc) {
case MMI_OPC_MULT1:
acc = 1;
- /* Fall through */
+ fallthrough;
case OPC_MULT:
{
TCGv_i32 t2 = tcg_temp_new_i32();
@@ -3494,7 +3494,7 @@ static void gen_mul_txx9(DisasContext *ctx, uint32_t opc,
break;
case MMI_OPC_MULTU1:
acc = 1;
- /* Fall through */
+ fallthrough;
case OPC_MULTU:
{
TCGv_i32 t2 = tcg_temp_new_i32();
@@ -3511,7 +3511,7 @@ static void gen_mul_txx9(DisasContext *ctx, uint32_t opc,
break;
case MMI_OPC_MADD1:
acc = 1;
- /* Fall through */
+ fallthrough;
case MMI_OPC_MADD:
{
TCGv_i64 t2 = tcg_temp_new_i64();
@@ -3531,7 +3531,7 @@ static void gen_mul_txx9(DisasContext *ctx, uint32_t opc,
break;
case MMI_OPC_MADDU1:
acc = 1;
- /* Fall through */
+ fallthrough;
case MMI_OPC_MADDU:
{
TCGv_i64 t2 = tcg_temp_new_i64();
@@ -4042,6 +4042,7 @@ static void gen_loongson_multimedia(DisasContext *ctx, int rd, int rs, int rt)
/* We want to shift in zeros for SRL; zero-extend first. */
tcg_gen_ext32u_i64(t0, t0);
/* FALLTHRU */
+ fallthrough;
case OPC_DSRL_CP2:
tcg_gen_shr_i64(t0, t0, t1);
break;
@@ -4717,7 +4718,7 @@ static void gen_compute_branch(DisasContext *ctx, uint32_t opc,
break;
case OPC_JALX:
ctx->hflags |= MIPS_HFLAG_BX;
- /* Fallthrough */
+ fallthrough;
case OPC_JAL:
blink = 31;
ctx->hflags |= MIPS_HFLAG_B;
@@ -4883,9 +4884,11 @@ static void gen_bitops(DisasContext *ctx, uint32_t opc, int rt,
case OPC_DINSU:
lsb += 32;
/* FALLTHRU */
+ fallthrough;
case OPC_DINSM:
msb += 32;
/* FALLTHRU */
+ fallthrough;
case OPC_DINS:
if (lsb > msb) {
goto fail;
@@ -8550,7 +8553,7 @@ static void gen_mftr(CPUMIPSState *env, DisasContext *ctx, int rt, int rd,
/* COP2: Not implemented. */
case 4:
case 5:
- /* fall through */
+ fallthrough;
default:
goto die;
}
@@ -8752,7 +8755,7 @@ static void gen_mttr(CPUMIPSState *env, DisasContext *ctx, int rd, int rt,
/* COP2: Not implemented. */
case 4:
case 5:
- /* fall through */
+ fallthrough;
default:
goto die;
}
@@ -11345,13 +11348,13 @@ static void gen_compute_compact_branch(DisasContext *ctx, uint32_t opc,
switch (opc) {
case OPC_JIALC:
tcg_gen_movi_tl(cpu_gpr[31], ctx->base.pc_next + 4 + m16_lowbit);
- /* Fallthrough */
+ fallthrough;
case OPC_JIC:
ctx->hflags |= MIPS_HFLAG_BR;
break;
case OPC_BALC:
tcg_gen_movi_tl(cpu_gpr[31], ctx->base.pc_next + 4 + m16_lowbit);
- /* Fallthrough */
+ fallthrough;
case OPC_BC:
ctx->hflags |= MIPS_HFLAG_B;
break;
@@ -13504,7 +13507,7 @@ static void decode_opc_special(CPUMIPSState *env, DisasContext *ctx)
break;
}
}
- /* Fallthrough */
+ fallthrough;
case OPC_SRA:
gen_shift_imm(ctx, op1, rd, rt, sa);
break;
@@ -13515,7 +13518,7 @@ static void decode_opc_special(CPUMIPSState *env, DisasContext *ctx)
if (ctx->insn_flags & ISA_MIPS_R2) {
op1 = OPC_ROTR;
}
- /* Fallthrough */
+ fallthrough;
case 0:
gen_shift_imm(ctx, op1, rd, rt, sa);
break;
@@ -13541,7 +13544,7 @@ static void decode_opc_special(CPUMIPSState *env, DisasContext *ctx)
if (ctx->insn_flags & ISA_MIPS_R2) {
op1 = OPC_ROTRV;
}
- /* Fallthrough */
+ fallthrough;
case 0:
gen_shift(ctx, op1, rd, rs, rt);
break;
@@ -13609,7 +13612,7 @@ static void decode_opc_special(CPUMIPSState *env, DisasContext *ctx)
if (ctx->insn_flags & ISA_MIPS_R2) {
op1 = OPC_DROTR;
}
- /* Fallthrough */
+ fallthrough;
case 0:
check_insn(ctx, ISA_MIPS3);
check_mips_64(ctx);
@@ -13627,7 +13630,7 @@ static void decode_opc_special(CPUMIPSState *env, DisasContext *ctx)
if (ctx->insn_flags & ISA_MIPS_R2) {
op1 = OPC_DROTR32;
}
- /* Fallthrough */
+ fallthrough;
case 0:
check_insn(ctx, ISA_MIPS3);
check_mips_64(ctx);
@@ -13659,7 +13662,7 @@ static void decode_opc_special(CPUMIPSState *env, DisasContext *ctx)
if (ctx->insn_flags & ISA_MIPS_R2) {
op1 = OPC_DROTRV;
}
- /* Fallthrough */
+ fallthrough;
case 0:
check_insn(ctx, ISA_MIPS3);
check_mips_64(ctx);
@@ -14669,7 +14672,7 @@ static bool decode_opc_legacy(CPUMIPSState *env, DisasContext *ctx)
case OPC_BGEZALL:
check_insn(ctx, ISA_MIPS2);
check_insn_opc_removed(ctx, ISA_MIPS_R6);
- /* Fallthrough */
+ fallthrough;
case OPC_BLTZ:
case OPC_BGEZ:
gen_compute_branch(ctx, op1, 4, rs, -1, imm << 2, 4);
@@ -14942,7 +14945,7 @@ static bool decode_opc_legacy(CPUMIPSState *env, DisasContext *ctx)
case OPC_BNEL:
check_insn(ctx, ISA_MIPS2);
check_insn_opc_removed(ctx, ISA_MIPS_R6);
- /* Fallthrough */
+ fallthrough;
case OPC_BEQ:
case OPC_BNE:
gen_compute_branch(ctx, op, 4, rs, rt, imm << 2, 4);
@@ -14952,7 +14955,7 @@ static bool decode_opc_legacy(CPUMIPSState *env, DisasContext *ctx)
if (ctx->insn_flags & INSN_R5900) {
check_insn_opc_user_only(ctx, INSN_R5900);
}
- /* Fallthrough */
+ fallthrough;
case OPC_LWL:
case OPC_LWR:
case OPC_LB:
@@ -15006,7 +15009,7 @@ static bool decode_opc_legacy(CPUMIPSState *env, DisasContext *ctx)
case OPC_MTHC1:
check_cp1_enabled(ctx);
check_insn(ctx, ISA_MIPS_R2);
- /* fall through */
+ fallthrough;
case OPC_MFC1:
case OPC_CFC1:
case OPC_MTC1:
@@ -15048,7 +15051,7 @@ static bool decode_opc_legacy(CPUMIPSState *env, DisasContext *ctx)
check_insn_opc_removed(ctx, ISA_MIPS_R6);
check_cop1x(ctx);
check_insn(ctx, ASE_MIPS3D);
- /* fall through */
+ fallthrough;
case OPC_BC1:
check_cp1_enabled(ctx);
check_insn_opc_removed(ctx, ISA_MIPS_R6);
@@ -15057,7 +15060,7 @@ static bool decode_opc_legacy(CPUMIPSState *env, DisasContext *ctx)
break;
case OPC_PS_FMT:
check_ps(ctx);
- /* fall through */
+ fallthrough;
case OPC_S_FMT:
case OPC_D_FMT:
check_cp1_enabled(ctx);
@@ -15186,7 +15189,7 @@ static bool decode_opc_legacy(CPUMIPSState *env, DisasContext *ctx)
case OPC_LUXC1:
case OPC_SUXC1:
check_insn(ctx, ISA_MIPS5 | ISA_MIPS_R2);
- /* Fallthrough */
+ fallthrough;
case OPC_LWXC1:
case OPC_LDXC1:
case OPC_SWXC1:
@@ -15200,7 +15203,7 @@ static bool decode_opc_legacy(CPUMIPSState *env, DisasContext *ctx)
break;
case OPC_ALNV_PS:
check_insn(ctx, ISA_MIPS5 | ISA_MIPS_R2);
- /* Fallthrough */
+ fallthrough;
case OPC_MADD_S:
case OPC_MADD_D:
case OPC_MADD_PS:
@@ -15232,7 +15235,7 @@ static bool decode_opc_legacy(CPUMIPSState *env, DisasContext *ctx)
if (ctx->insn_flags & INSN_R5900) {
check_insn_opc_user_only(ctx, INSN_R5900);
}
- /* fall through */
+ fallthrough;
case OPC_LDL:
case OPC_LDR:
case OPC_LWU:
--
2.39.2
^ permalink raw reply related [flat|nested] 106+ messages in thread
* Re: [RFC PATCH v3 20/78] target/mips: add fallthrough pseudo-keyword
2023-10-13 8:45 ` [RFC PATCH v3 20/78] target/mips: " Emmanouil Pitsidianakis
@ 2023-10-16 16:51 ` Philippe Mathieu-Daudé
0 siblings, 0 replies; 106+ messages in thread
From: Philippe Mathieu-Daudé @ 2023-10-16 16:51 UTC (permalink / raw)
To: Emmanouil Pitsidianakis, qemu-devel
Cc: Huacai Chen, Aurelien Jarno, Jiaxun Yang, Aleksandar Rikalo
On 13/10/23 10:45, Emmanouil Pitsidianakis wrote:
> In preparation of raising -Wimplicit-fallthrough to 5, replace all
> fall-through comments with the fallthrough attribute pseudo-keyword.
>
> Signed-off-by: Emmanouil Pitsidianakis <manos.pitsidianakis@linaro.org>
> ---
> target/mips/sysemu/physaddr.c | 2 +-
> target/mips/tcg/micromips_translate.c.inc | 4 +-
> target/mips/tcg/mips16e_translate.c.inc | 30 ++++-----
> target/mips/tcg/mxu_translate.c | 8 +--
> target/mips/tcg/nanomips_translate.c.inc | 4 +-
> target/mips/tcg/op_helper.c | 2 +-
> target/mips/tcg/translate.c | 79 ++++++++++++-----------
> 7 files changed, 66 insertions(+), 63 deletions(-)
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
^ permalink raw reply [flat|nested] 106+ messages in thread
* [RFC PATCH v3 21/78] target/sparc: add fallthrough pseudo-keyword
2023-10-13 8:45 [RFC PATCH v3 00/78] Strict disable implicit fallthrough Emmanouil Pitsidianakis
` (19 preceding siblings ...)
2023-10-13 8:45 ` [RFC PATCH v3 20/78] target/mips: " Emmanouil Pitsidianakis
@ 2023-10-13 8:45 ` Emmanouil Pitsidianakis
2023-10-13 8:45 ` [RFC PATCH v3 22/78] target/ppc: " Emmanouil Pitsidianakis
` (58 subsequent siblings)
79 siblings, 0 replies; 106+ messages in thread
From: Emmanouil Pitsidianakis @ 2023-10-13 8:45 UTC (permalink / raw)
To: qemu-devel; +Cc: Emmanouil Pitsidianakis, Mark Cave-Ayland, Artyom Tarasenko
In preparation of raising -Wimplicit-fallthrough to 5, replace all
fall-through comments with the fallthrough attribute pseudo-keyword.
Signed-off-by: Emmanouil Pitsidianakis <manos.pitsidianakis@linaro.org>
---
target/sparc/ldst_helper.c | 4 ++--
target/sparc/mmu_helper.c | 6 +++---
target/sparc/translate.c | 3 ++-
target/sparc/win_helper.c | 1 +
4 files changed, 8 insertions(+), 6 deletions(-)
diff --git a/target/sparc/ldst_helper.c b/target/sparc/ldst_helper.c
index 78b03308ae..b233e40da5 100644
--- a/target/sparc/ldst_helper.c
+++ b/target/sparc/ldst_helper.c
@@ -1522,7 +1522,7 @@ uint64_t helper_ld_asi(CPUSPARCState *env, target_ulong addr,
/* Hyperprivileged access only */
sparc_raise_mmu_fault(cs, addr, false, false, 1, size, GETPC());
}
- /* fall through */
+ fallthrough;
case ASI_HYP_SCRATCHPAD: /* UA2005 hyperprivileged scratchpad */
{
unsigned int i = (addr >> 3) & 0x7;
@@ -1865,7 +1865,7 @@ void helper_st_asi(CPUSPARCState *env, target_ulong addr, target_ulong val,
/* Hyperprivileged access only */
sparc_raise_mmu_fault(cs, addr, true, false, 1, size, GETPC());
}
- /* fall through */
+ fallthrough;
case ASI_HYP_SCRATCHPAD: /* UA2005 hyperprivileged scratchpad */
{
unsigned int i = (addr >> 3) & 0x7;
diff --git a/target/sparc/mmu_helper.c b/target/sparc/mmu_helper.c
index 453498c670..13f0430c5d 100644
--- a/target/sparc/mmu_helper.c
+++ b/target/sparc/mmu_helper.c
@@ -558,13 +558,13 @@ static int get_physical_address_data(CPUSPARCState *env, CPUTLBEntryFull *full,
g_assert_not_reached();
case MMU_USER_IDX:
is_user = true;
- /* fallthru */
+ fallthrough;
case MMU_KERNEL_IDX:
context = env->dmmu.mmu_primary_context & 0x1fff;
break;
case MMU_USER_SECONDARY_IDX:
is_user = true;
- /* fallthru */
+ fallthrough;
case MMU_KERNEL_SECONDARY_IDX:
context = env->dmmu.mmu_secondary_context & 0x1fff;
break;
@@ -657,7 +657,7 @@ static int get_physical_address_code(CPUSPARCState *env, CPUTLBEntryFull *full,
g_assert_not_reached();
case MMU_USER_IDX:
is_user = true;
- /* fallthru */
+ fallthrough;
case MMU_KERNEL_IDX:
context = env->dmmu.mmu_primary_context & 0x1fff;
break;
diff --git a/target/sparc/translate.c b/target/sparc/translate.c
index f92ff80ac8..4f179473d7 100644
--- a/target/sparc/translate.c
+++ b/target/sparc/translate.c
@@ -1123,6 +1123,7 @@ static void gen_compare(DisasCompare *cmp, bool xcc, unsigned int cond,
gen_helper_compute_psr(tcg_env);
dc->cc_op = CC_OP_FLAGS;
/* FALLTHRU */
+ fallthrough;
case CC_OP_FLAGS:
/* We're going to generate a boolean result. */
@@ -2204,7 +2205,7 @@ static void gen_st_asi(DisasContext *dc, TCGv src, TCGv addr,
/* in OpenSPARC T1+ CPUs TWINX ASIs in store instructions
* are ST_BLKINIT_ ASIs */
#endif
- /* fall through */
+ fallthrough;
case GET_ASI_DIRECT:
gen_address_mask(dc, addr);
tcg_gen_qemu_st_tl(src, addr, da.mem_idx, da.memop | MO_ALIGN);
diff --git a/target/sparc/win_helper.c b/target/sparc/win_helper.c
index 3a7c0ff943..0c54b63938 100644
--- a/target/sparc/win_helper.c
+++ b/target/sparc/win_helper.c
@@ -303,6 +303,7 @@ static inline uint64_t *get_gregset(CPUSPARCState *env, uint32_t pstate)
default:
trace_win_helper_gregset_error(pstate);
/* fall through to normal set of global registers */
+ fallthrough;
case 0:
return env->bgregs;
case PS_AG:
--
2.39.2
^ permalink raw reply related [flat|nested] 106+ messages in thread
* [RFC PATCH v3 22/78] target/ppc: add fallthrough pseudo-keyword
2023-10-13 8:45 [RFC PATCH v3 00/78] Strict disable implicit fallthrough Emmanouil Pitsidianakis
` (20 preceding siblings ...)
2023-10-13 8:45 ` [RFC PATCH v3 21/78] target/sparc: " Emmanouil Pitsidianakis
@ 2023-10-13 8:45 ` Emmanouil Pitsidianakis
2023-10-13 8:45 ` [RFC PATCH v3 23/78] target/arm: " Emmanouil Pitsidianakis
` (57 subsequent siblings)
79 siblings, 0 replies; 106+ messages in thread
From: Emmanouil Pitsidianakis @ 2023-10-13 8:45 UTC (permalink / raw)
To: qemu-devel
Cc: Emmanouil Pitsidianakis, Cédric Le Goater, Nicholas Piggin,
Daniel Henrique Barboza, open list:PowerPC TCG CPUs
In preparation of raising -Wimplicit-fallthrough to 5, replace all
fall-through comments with the fallthrough attribute pseudo-keyword.
Reviewed-by: Cédric Le Goater <clg@kaod.org>
Signed-off-by: Emmanouil Pitsidianakis <manos.pitsidianakis@linaro.org>
---
target/ppc/cpu_init.c | 8 ++++----
target/ppc/excp_helper.c | 6 +++---
target/ppc/mmu-radix64.c | 6 +++---
target/ppc/mmu_common.c | 12 ++++++------
target/ppc/translate.c | 6 +++---
5 files changed, 19 insertions(+), 19 deletions(-)
diff --git a/target/ppc/cpu_init.c b/target/ppc/cpu_init.c
index 40fe14a6c2..7a7bd4d824 100644
--- a/target/ppc/cpu_init.c
+++ b/target/ppc/cpu_init.c
@@ -894,25 +894,25 @@ static void register_BookE206_sprs(CPUPPCState *env, uint32_t mas_mask,
SPR_NOACCESS, SPR_NOACCESS,
&spr_read_generic, SPR_NOACCESS,
tlbncfg[3]);
- /* Fallthru */
+ fallthrough;
case 3:
spr_register(env, SPR_BOOKE_TLB2CFG, "TLB2CFG",
SPR_NOACCESS, SPR_NOACCESS,
&spr_read_generic, SPR_NOACCESS,
tlbncfg[2]);
- /* Fallthru */
+ fallthrough;
case 2:
spr_register(env, SPR_BOOKE_TLB1CFG, "TLB1CFG",
SPR_NOACCESS, SPR_NOACCESS,
&spr_read_generic, SPR_NOACCESS,
tlbncfg[1]);
- /* Fallthru */
+ fallthrough;
case 1:
spr_register(env, SPR_BOOKE_TLB0CFG, "TLB0CFG",
SPR_NOACCESS, SPR_NOACCESS,
&spr_read_generic, SPR_NOACCESS,
tlbncfg[0]);
- /* Fallthru */
+ fallthrough;
case 0:
default:
break;
diff --git a/target/ppc/excp_helper.c b/target/ppc/excp_helper.c
index 7926114d5c..b8be34051c 100644
--- a/target/ppc/excp_helper.c
+++ b/target/ppc/excp_helper.c
@@ -1334,7 +1334,7 @@ static bool is_prefix_insn_excp(PowerPCCPU *cpu, int excp)
*/
break;
}
- /* fall through */
+ fallthrough;
case POWERPC_EXCP_MCHECK:
case POWERPC_EXCP_DSI:
case POWERPC_EXCP_DSEG:
@@ -1576,7 +1576,7 @@ static void powerpc_excp_books(PowerPCCPU *cpu, int excp)
break;
case POWERPC_EXCP_TRACE: /* Trace exception */
msr |= env->error_code;
- /* fall through */
+ fallthrough;
case POWERPC_EXCP_DSEG: /* Data segment exception */
case POWERPC_EXCP_ISEG: /* Instruction segment exception */
case POWERPC_EXCP_SDOOR: /* Doorbell interrupt */
@@ -1584,7 +1584,7 @@ static void powerpc_excp_books(PowerPCCPU *cpu, int excp)
break;
case POWERPC_EXCP_HISI: /* Hypervisor instruction storage exception */
msr |= env->error_code;
- /* fall through */
+ fallthrough;
case POWERPC_EXCP_HDECR: /* Hypervisor decrementer exception */
case POWERPC_EXCP_HDSI: /* Hypervisor data storage exception */
case POWERPC_EXCP_SDOOR_HV: /* Hypervisor Doorbell interrupt */
diff --git a/target/ppc/mmu-radix64.c b/target/ppc/mmu-radix64.c
index 5823e039e6..a85bd614bf 100644
--- a/target/ppc/mmu-radix64.c
+++ b/target/ppc/mmu-radix64.c
@@ -126,7 +126,7 @@ static void ppc_radix64_raise_si(PowerPCCPU *cpu, MMUAccessType access_type,
break;
case MMU_DATA_STORE:
cause |= DSISR_ISSTORE;
- /* fall through */
+ fallthrough;
case MMU_DATA_LOAD:
/* Data Storage Interrupt */
cs->exception_index = POWERPC_EXCP_DSI;
@@ -166,7 +166,7 @@ static void ppc_radix64_raise_hsi(PowerPCCPU *cpu, MMUAccessType access_type,
break;
case MMU_DATA_STORE:
cause |= DSISR_ISSTORE;
- /* fall through */
+ fallthrough;
case MMU_DATA_LOAD:
/* H Data Storage Interrupt */
cs->exception_index = POWERPC_EXCP_HDSI;
@@ -226,7 +226,7 @@ static int ppc_radix64_check_rc(MMUAccessType access_type, uint64_t pte)
if (!(pte & R_PTE_C)) {
break;
}
- /* fall through */
+ fallthrough;
case MMU_INST_FETCH:
case MMU_DATA_LOAD:
if (!(pte & R_PTE_R)) {
diff --git a/target/ppc/mmu_common.c b/target/ppc/mmu_common.c
index 6ca5d12207..dd44befe6f 100644
--- a/target/ppc/mmu_common.c
+++ b/target/ppc/mmu_common.c
@@ -76,7 +76,7 @@ static int pp_check(int key, int pp, int nx)
case 0x1:
case 0x2:
access |= PAGE_WRITE;
- /* fall through */
+ fallthrough;
case 0x3:
access |= PAGE_READ;
break;
@@ -559,7 +559,7 @@ static int mmu40x_get_physical_address(CPUPPCState *env, mmu_ctx_t *ctx,
if (pr != 0) {
goto check_perms;
}
- /* fall through */
+ fallthrough;
case 0x3:
/* All accesses granted */
ctx->prot = PAGE_READ | PAGE_WRITE | PAGE_EXEC;
@@ -573,7 +573,7 @@ static int mmu40x_get_physical_address(CPUPPCState *env, mmu_ctx_t *ctx,
ret = -2;
break;
}
- /* fall through */
+ fallthrough;
case 0x1:
check_perms:
/* Check from TLB entry */
@@ -1349,7 +1349,7 @@ static bool ppc_jumbo_xlate(PowerPCCPU *cpu, vaddr eaddr,
break;
case POWERPC_MMU_BOOKE206:
booke206_update_mas_tlb_miss(env, eaddr, 2, mmu_idx);
- /* fall through */
+ fallthrough;
case POWERPC_MMU_BOOKE:
cs->exception_index = POWERPC_EXCP_ITLB;
env->error_code = 0;
@@ -1435,7 +1435,7 @@ static bool ppc_jumbo_xlate(PowerPCCPU *cpu, vaddr eaddr,
cpu_abort(cs, "MPC8xx MMU model is not implemented\n");
case POWERPC_MMU_BOOKE206:
booke206_update_mas_tlb_miss(env, eaddr, access_type, mmu_idx);
- /* fall through */
+ fallthrough;
case POWERPC_MMU_BOOKE:
cs->exception_index = POWERPC_EXCP_DTLB;
env->error_code = 0;
@@ -1530,7 +1530,7 @@ bool ppc_xlate(PowerPCCPU *cpu, vaddr eaddr, MMUAccessType access_type,
return ppc_radix64_xlate(cpu, eaddr, access_type, raddrp,
psizep, protp, mmu_idx, guest_visible);
}
- /* fall through */
+ fallthrough;
case POWERPC_MMU_64B:
case POWERPC_MMU_2_03:
case POWERPC_MMU_2_06:
diff --git a/target/ppc/translate.c b/target/ppc/translate.c
index 329da4d518..a67b77258d 100644
--- a/target/ppc/translate.c
+++ b/target/ppc/translate.c
@@ -7472,10 +7472,10 @@ static void ppc_tr_tb_stop(DisasContextBase *dcbase, CPUState *cs)
tcg_gen_exit_tb(ctx->base.tb, 0);
break;
}
- /* fall through */
+ fallthrough;
case DISAS_CHAIN_UPDATE:
gen_update_nip(ctx, nip);
- /* fall through */
+ fallthrough;
case DISAS_CHAIN:
/*
* tcg_gen_lookup_and_goto_ptr will exit the TB if
@@ -7490,7 +7490,7 @@ static void ppc_tr_tb_stop(DisasContextBase *dcbase, CPUState *cs)
case DISAS_EXIT_UPDATE:
gen_update_nip(ctx, nip);
- /* fall through */
+ fallthrough;
case DISAS_EXIT:
pmu_count_insns(ctx);
tcg_gen_exit_tb(NULL, 0);
--
2.39.2
^ permalink raw reply related [flat|nested] 106+ messages in thread
* [RFC PATCH v3 23/78] target/arm: add fallthrough pseudo-keyword
2023-10-13 8:45 [RFC PATCH v3 00/78] Strict disable implicit fallthrough Emmanouil Pitsidianakis
` (21 preceding siblings ...)
2023-10-13 8:45 ` [RFC PATCH v3 22/78] target/ppc: " Emmanouil Pitsidianakis
@ 2023-10-13 8:45 ` Emmanouil Pitsidianakis
2023-10-13 8:45 ` [RFC PATCH v3 24/78] target/alpha: " Emmanouil Pitsidianakis
` (56 subsequent siblings)
79 siblings, 0 replies; 106+ messages in thread
From: Emmanouil Pitsidianakis @ 2023-10-13 8:45 UTC (permalink / raw)
To: qemu-devel; +Cc: Emmanouil Pitsidianakis, Peter Maydell, open list:ARM TCG CPUs
In preparation of raising -Wimplicit-fallthrough to 5, replace all
fall-through comments with the fallthrough attribute pseudo-keyword.
Signed-off-by: Emmanouil Pitsidianakis <manos.pitsidianakis@linaro.org>
---
target/arm/helper.c | 34 +++++++-------
target/arm/ptw.c | 10 ++--
target/arm/tcg/psci.c | 2 +-
target/arm/tcg/translate-a64.c | 76 +++++++++++++++----------------
target/arm/tcg/translate-m-nocp.c | 2 +-
target/arm/tcg/translate-vfp.c | 2 +-
target/arm/tcg/translate.c | 8 ++--
7 files changed, 68 insertions(+), 66 deletions(-)
diff --git a/target/arm/helper.c b/target/arm/helper.c
index 74fbb6e1d7..e2d1426cf4 100644
--- a/target/arm/helper.c
+++ b/target/arm/helper.c
@@ -2526,7 +2526,7 @@ static CPAccessResult gt_timer_access(CPUARMState *env, int timeridx,
if (!extract32(env->cp15.c14_cntkctl, 9 - timeridx, 1)) {
return CP_ACCESS_TRAP;
}
- /* fall through */
+ fallthrough;
case 1:
if (has_el2 && timeridx == GTIMER_PHYS) {
@@ -3588,7 +3588,7 @@ static void ats_write(CPUARMState *env, const ARMCPRegInfo *ri, uint64_t value)
break;
case 2:
g_assert(ss != ARMSS_Secure); /* ARMv8.4-SecEL2 is 64-bit only */
- /* fall through */
+ fallthrough;
case 1:
if (ri->crm == 9 && (env->uncached_cpsr & CPSR_PAN)) {
mmu_idx = ARMMMUIdx_Stage1_E1_PAN;
@@ -4657,7 +4657,7 @@ static CPAccessResult aa64_cacheop_poc_access(CPUARMState *env,
if (!(arm_sctlr(env, 0) & SCTLR_UCI)) {
return CP_ACCESS_TRAP;
}
- /* fall through */
+ fallthrough;
case 1:
/* ... EL1 must trap to EL2 if HCR_EL2.TPCP is set. */
if (arm_hcr_el2_eff(env) & HCR_TPCP) {
@@ -4677,7 +4677,7 @@ static CPAccessResult do_cacheop_pou_access(CPUARMState *env, uint64_t hcrflags)
if (!(arm_sctlr(env, 0) & SCTLR_UCI)) {
return CP_ACCESS_TRAP;
}
- /* fall through */
+ fallthrough;
case 1:
/* ... EL1 must trap to EL2 if relevant HCR_EL2 flags are set. */
if (arm_hcr_el2_eff(env) & hcrflags) {
@@ -6757,7 +6757,7 @@ int sve_exception_el(CPUARMState *env, int el)
if (el != 0) {
break;
}
- /* fall through */
+ fallthrough;
case 0:
case 2:
return 1;
@@ -6772,7 +6772,7 @@ int sve_exception_el(CPUARMState *env, int el)
if (el != 0 || !(env->cp15.hcr_el2 & HCR_TGE)) {
break;
}
- /* fall through */
+ fallthrough;
case 0:
case 2:
return 2;
@@ -6806,7 +6806,7 @@ int sme_exception_el(CPUARMState *env, int el)
if (el != 0) {
break;
}
- /* fall through */
+ fallthrough;
case 0:
case 2:
return 1;
@@ -6821,7 +6821,7 @@ int sme_exception_el(CPUARMState *env, int el)
if (el != 0 || !(env->cp15.hcr_el2 & HCR_TGE)) {
break;
}
- /* fall through */
+ fallthrough;
case 0:
case 2:
return 2;
@@ -9731,7 +9731,7 @@ void define_one_arm_cp_reg_with_opaque(ARMCPU *cpu,
if (r->cp == 0) {
break;
}
- /* fall through */
+ fallthrough;
case ARM_CP_STATE_AA32:
if (arm_feature(&cpu->env, ARM_FEATURE_V8) &&
!arm_feature(&cpu->env, ARM_FEATURE_M)) {
@@ -10660,7 +10660,7 @@ static void take_aarch32_exception(CPUARMState *env, int new_mode,
break;
}
/* ... the target is EL3, from secure state ... */
- /* fall through */
+ fallthrough;
case 1:
/* ... the target is EL1 and SCTLR.SPAN is 0. */
if (!(env->cp15.sctlr_el[new_el] & SCTLR_SPAN)) {
@@ -10712,6 +10712,7 @@ static void arm_cpu_do_interrupt_aarch32_hyp(CPUState *cs)
break;
case EXCP_BKPT:
/* Fall through to prefetch abort. */
+ fallthrough;
case EXCP_PREFETCH_ABORT:
env->cp15.ifar_s = env->exception.vaddress;
qemu_log_mask(CPU_LOG_INT, "...with HIFAR 0x%x\n",
@@ -10837,6 +10838,7 @@ static void arm_cpu_do_interrupt_aarch32(CPUState *cs)
break;
case EXCP_BKPT:
/* Fall through to prefetch abort. */
+ fallthrough;
case EXCP_PREFETCH_ABORT:
A32_BANKED_CURRENT_REG_SET(env, ifsr, env->exception.fsr);
A32_BANKED_CURRENT_REG_SET(env, ifar, env->exception.vaddress);
@@ -11091,7 +11093,7 @@ static void arm_cpu_do_interrupt_aarch64(CPUState *cs)
is_aa64 = (hcr & HCR_RW) != 0;
break;
}
- /* fall through */
+ fallthrough;
case 1:
is_aa64 = is_a64(env);
break;
@@ -11112,7 +11114,7 @@ static void arm_cpu_do_interrupt_aarch64(CPUState *cs)
case EXCP_GPC:
qemu_log_mask(CPU_LOG_INT, "...with MFAR 0x%" PRIx64 "\n",
env->cp15.mfar_el3);
- /* fall through */
+ fallthrough;
case EXCP_PREFETCH_ABORT:
case EXCP_DATA_ABORT:
/*
@@ -11126,7 +11128,7 @@ static void arm_cpu_do_interrupt_aarch64(CPUState *cs)
env->cp15.far_el[new_el] = env->exception.vaddress;
qemu_log_mask(CPU_LOG_INT, "...with FAR 0x%" PRIx64 "\n",
env->cp15.far_el[new_el]);
- /* fall through */
+ fallthrough;
case EXCP_BKPT:
case EXCP_UDEF:
case EXCP_SWI:
@@ -11218,7 +11220,7 @@ static void arm_cpu_do_interrupt_aarch64(CPUState *cs)
!= (HCR_E2H | HCR_TGE)) {
break;
}
- /* fall through */
+ fallthrough;
case 1:
/* ... the target is EL1 ... */
/* ... and SCTLR_ELx.SPAN == 0, then set to 1. */
@@ -11956,7 +11958,7 @@ int fp_exception_el(CPUARMState *env, int cur_el)
if (cur_el != 0) {
break;
}
- /* fall through */
+ fallthrough;
case 0:
case 2:
/* Trap from Secure PL0 or PL1 to Secure PL1. */
@@ -11995,7 +11997,7 @@ int fp_exception_el(CPUARMState *env, int cur_el)
if (cur_el != 0 || !(hcr_el2 & HCR_TGE)) {
break;
}
- /* fall through */
+ fallthrough;
case 0:
case 2:
return 2;
diff --git a/target/arm/ptw.c b/target/arm/ptw.c
index 95db9ec4c3..3f6783c100 100644
--- a/target/arm/ptw.c
+++ b/target/arm/ptw.c
@@ -2374,7 +2374,7 @@ static bool get_phys_addr_pmsav7(CPUARMState *env,
break; /* no access */
case 3:
result->f.prot |= PAGE_WRITE;
- /* fall through */
+ fallthrough;
case 2:
case 6:
result->f.prot |= PAGE_READ | PAGE_EXEC;
@@ -2385,7 +2385,7 @@ static bool get_phys_addr_pmsav7(CPUARMState *env,
result->f.prot |= PAGE_READ | PAGE_EXEC;
break;
}
- /* fall through */
+ fallthrough;
default:
qemu_log_mask(LOG_GUEST_ERROR,
"DRACR[%d]: Bad value for AP bits: 0x%"
@@ -2399,7 +2399,7 @@ static bool get_phys_addr_pmsav7(CPUARMState *env,
case 2:
case 3:
result->f.prot |= PAGE_WRITE;
- /* fall through */
+ fallthrough;
case 5:
case 6:
result->f.prot |= PAGE_READ | PAGE_EXEC;
@@ -2410,7 +2410,7 @@ static bool get_phys_addr_pmsav7(CPUARMState *env,
result->f.prot |= PAGE_READ | PAGE_EXEC;
break;
}
- /* fall through */
+ fallthrough;
default:
qemu_log_mask(LOG_GUEST_ERROR,
"DRACR[%d]: Bad value for AP bits: 0x%"
@@ -3333,7 +3333,7 @@ static bool get_phys_addr_nogpc(CPUARMState *env, S1Translate *ptw,
return get_phys_addr_twostage(env, ptw, address, access_type,
result, fi);
}
- /* fall through */
+ fallthrough;
default:
/* Single stage uses physical for ptw. */
diff --git a/target/arm/tcg/psci.c b/target/arm/tcg/psci.c
index 6c1239bb96..dafc39c3d7 100644
--- a/target/arm/tcg/psci.c
+++ b/target/arm/tcg/psci.c
@@ -191,7 +191,7 @@ void arm_handle_psci_call(ARMCPU *cpu)
ret = 0;
break;
}
- /* fallthrough */
+ fallthrough;
case QEMU_PSCI_0_1_FN_MIGRATE:
case QEMU_PSCI_0_2_FN_MIGRATE:
default:
diff --git a/target/arm/tcg/translate-a64.c b/target/arm/tcg/translate-a64.c
index 10e8dcf743..ee97219acb 100644
--- a/target/arm/tcg/translate-a64.c
+++ b/target/arm/tcg/translate-a64.c
@@ -5758,7 +5758,7 @@ static void disas_fp_compare(DisasContext *s, uint32_t insn)
if (dc_isar_feature(aa64_fp16, s)) {
break;
}
- /* fallthru */
+ fallthrough;
default:
unallocated_encoding(s);
return;
@@ -5808,7 +5808,7 @@ static void disas_fp_ccomp(DisasContext *s, uint32_t insn)
if (dc_isar_feature(aa64_fp16, s)) {
break;
}
- /* fallthru */
+ fallthrough;
default:
unallocated_encoding(s);
return;
@@ -5872,7 +5872,7 @@ static void disas_fp_csel(DisasContext *s, uint32_t insn)
if (dc_isar_feature(aa64_fp16, s)) {
break;
}
- /* fallthru */
+ fallthrough;
default:
unallocated_encoding(s);
return;
@@ -6194,7 +6194,7 @@ static void disas_fp_1src(DisasContext *s, uint32_t insn)
if (type > 1 || !dc_isar_feature(aa64_frint, s)) {
goto do_unallocated;
}
- /* fall through */
+ fallthrough;
case 0x0 ... 0x3:
case 0x8 ... 0xc:
case 0xe ... 0xf:
@@ -6623,7 +6623,7 @@ static void disas_fp_imm(DisasContext *s, uint32_t insn)
if (dc_isar_feature(aa64_fp16, s)) {
break;
}
- /* fallthru */
+ fallthrough;
default:
unallocated_encoding(s);
return;
@@ -6831,7 +6831,7 @@ static void disas_fp_fixed_conv(DisasContext *s, uint32_t insn)
if (dc_isar_feature(aa64_fp16, s)) {
break;
}
- /* fallthru */
+ fallthrough;
default:
unallocated_encoding(s);
return;
@@ -6958,13 +6958,13 @@ static void disas_fp_int_conv(DisasContext *s, uint32_t insn)
case 2: /* SCVTF */
case 3: /* UCVTF */
itof = true;
- /* fallthru */
+ fallthrough;
case 4: /* FCVTAS */
case 5: /* FCVTAU */
if (rmode != 0) {
goto do_unallocated;
}
- /* fallthru */
+ fallthrough;
case 0: /* FCVT[NPMZ]S */
case 1: /* FCVT[NPMZ]U */
switch (type) {
@@ -6994,7 +6994,7 @@ static void disas_fp_int_conv(DisasContext *s, uint32_t insn)
if (!dc_isar_feature(aa64_fp16, s)) {
goto do_unallocated;
}
- /* fallthru */
+ fallthrough;
case 0b00000110: /* FMOV 32-bit */
case 0b00000111:
case 0b10100110: /* FMOV 64-bit */
@@ -7386,7 +7386,7 @@ static void disas_simd_across_lanes(DisasContext *s, uint32_t insn)
unallocated_encoding(s);
return;
}
- /* fall through */
+ fallthrough;
case 0x3: /* SADDLV, UADDLV */
case 0xa: /* SMAXV, UMAXV */
case 0x1a: /* SMINV, UMINV */
@@ -8292,7 +8292,7 @@ static void handle_simd_qshl(DisasContext *s, bool scalar, bool is_q,
switch (size) {
case 0:
shift |= shift << 8;
- /* fall through */
+ fallthrough;
case 1:
shift |= shift << 16;
break;
@@ -8639,7 +8639,7 @@ static void disas_simd_scalar_shift_imm(DisasContext *s, uint32_t insn)
unallocated_encoding(s);
return;
}
- /* fall through */
+ fallthrough;
case 0x00: /* SSHR / USHR */
case 0x02: /* SSRA / USRA */
case 0x04: /* SRSHR / URSHR */
@@ -8740,7 +8740,7 @@ static void disas_simd_scalar_three_reg_diff(DisasContext *s, uint32_t insn)
break;
case 0xb: /* SQDMLSL, SQDMLSL2 */
tcg_gen_neg_i64(tcg_res, tcg_res);
- /* fall through */
+ fallthrough;
case 0x9: /* SQDMLAL, SQDMLAL2 */
read_vec_element(s, tcg_op1, rd, 0, MO_64);
gen_helper_neon_addl_saturate_s64(tcg_res, tcg_env,
@@ -8764,7 +8764,7 @@ static void disas_simd_scalar_three_reg_diff(DisasContext *s, uint32_t insn)
break;
case 0xb: /* SQDMLSL, SQDMLSL2 */
gen_helper_neon_negl_u32(tcg_res, tcg_res);
- /* fall through */
+ fallthrough;
case 0x9: /* SQDMLAL, SQDMLAL2 */
{
TCGv_i64 tcg_op3 = tcg_temp_new_i64();
@@ -8887,7 +8887,7 @@ static void handle_3same_float(DisasContext *s, int size, int elements,
case 0x39: /* FMLS */
/* As usual for ARM, separate negation for fused multiply-add */
gen_helper_vfp_negd(tcg_op1, tcg_op1);
- /* fall through */
+ fallthrough;
case 0x19: /* FMLA */
read_vec_element(s, tcg_res, rd, pass, MO_64);
gen_helper_vfp_muladdd(tcg_res, tcg_op1, tcg_op2,
@@ -8963,7 +8963,7 @@ static void handle_3same_float(DisasContext *s, int size, int elements,
case 0x39: /* FMLS */
/* As usual for ARM, separate negation for fused multiply-add */
gen_helper_vfp_negs(tcg_op1, tcg_op1);
- /* fall through */
+ fallthrough;
case 0x19: /* FMLA */
read_vec_element_i32(s, tcg_res, rd, pass, MO_32);
gen_helper_vfp_muladds(tcg_res, tcg_op1, tcg_op2,
@@ -9489,7 +9489,7 @@ static void handle_2misc_fcmp_zero(DisasContext *s, int opcode,
switch (opcode) {
case 0x2e: /* FCMLT (zero) */
swap = true;
- /* fallthrough */
+ fallthrough;
case 0x2c: /* FCMGT (zero) */
genfn = gen_helper_neon_cgt_f64;
break;
@@ -9498,7 +9498,7 @@ static void handle_2misc_fcmp_zero(DisasContext *s, int opcode,
break;
case 0x6d: /* FCMLE (zero) */
swap = true;
- /* fall through */
+ fallthrough;
case 0x6c: /* FCMGE (zero) */
genfn = gen_helper_neon_cge_f64;
break;
@@ -9529,7 +9529,7 @@ static void handle_2misc_fcmp_zero(DisasContext *s, int opcode,
switch (opcode) {
case 0x2e: /* FCMLT (zero) */
swap = true;
- /* fall through */
+ fallthrough;
case 0x2c: /* FCMGT (zero) */
genfn = gen_helper_advsimd_cgt_f16;
break;
@@ -9538,7 +9538,7 @@ static void handle_2misc_fcmp_zero(DisasContext *s, int opcode,
break;
case 0x6d: /* FCMLE (zero) */
swap = true;
- /* fall through */
+ fallthrough;
case 0x6c: /* FCMGE (zero) */
genfn = gen_helper_advsimd_cge_f16;
break;
@@ -9549,7 +9549,7 @@ static void handle_2misc_fcmp_zero(DisasContext *s, int opcode,
switch (opcode) {
case 0x2e: /* FCMLT (zero) */
swap = true;
- /* fall through */
+ fallthrough;
case 0x2c: /* FCMGT (zero) */
genfn = gen_helper_neon_cgt_f32;
break;
@@ -9558,7 +9558,7 @@ static void handle_2misc_fcmp_zero(DisasContext *s, int opcode,
break;
case 0x6d: /* FCMLE (zero) */
swap = true;
- /* fall through */
+ fallthrough;
case 0x6c: /* FCMGE (zero) */
genfn = gen_helper_neon_cge_f32;
break;
@@ -9888,7 +9888,7 @@ static void disas_simd_scalar_two_reg_misc(DisasContext *s, uint32_t insn)
unallocated_encoding(s);
return;
}
- /* fall through */
+ fallthrough;
case 0x8: /* CMGT, CMGE */
case 0x9: /* CMEQ, CMLE */
case 0xb: /* ABS, NEG */
@@ -9902,7 +9902,7 @@ static void disas_simd_scalar_two_reg_misc(DisasContext *s, uint32_t insn)
unallocated_encoding(s);
return;
}
- /* fall through */
+ fallthrough;
case 0x14: /* SQXTN, UQXTN */
if (size == 3) {
unallocated_encoding(s);
@@ -10252,7 +10252,7 @@ static void disas_simd_shift_imm(DisasContext *s, uint32_t insn)
unallocated_encoding(s);
return;
}
- /* fall through */
+ fallthrough;
case 0x00: /* SSHR / USHR */
case 0x02: /* SSRA / USRA (accumulate) */
case 0x04: /* SRSHR / URSHR (rounding) */
@@ -10686,7 +10686,7 @@ static void disas_simd_three_reg_diff(DisasContext *s, uint32_t insn)
unallocated_encoding(s);
return;
}
- /* fall through */
+ fallthrough;
case 0: /* SADDL, SADDL2, UADDL, UADDL2 */
case 2: /* SSUBL, SSUBL2, USUBL, USUBL2 */
case 5: /* SABAL, SABAL2, UABAL, UABAL2 */
@@ -11009,7 +11009,7 @@ static void disas_simd_3same_int(DisasContext *s, uint32_t insn)
unallocated_encoding(s);
return;
}
- /* fall through */
+ fallthrough;
case 0x0: /* SHADD, UHADD */
case 0x2: /* SRHADD, URHADD */
case 0x4: /* SHSUB, UHSUB */
@@ -11972,7 +11972,7 @@ static void disas_simd_two_reg_misc(DisasContext *s, uint32_t insn)
unallocated_encoding(s);
return;
}
- /* fall through */
+ fallthrough;
case 0x8: /* CMGT, CMGE */
case 0x9: /* CMEQ, CMLE */
case 0xb: /* ABS, NEG */
@@ -12075,7 +12075,7 @@ static void disas_simd_two_reg_misc(DisasContext *s, uint32_t insn)
unallocated_encoding(s);
return;
}
- /* fall through */
+ fallthrough;
case 0x3d: /* FRECPE */
case 0x7d: /* FRSQRTE */
if (size == 3 && !is_q) {
@@ -12092,7 +12092,7 @@ static void disas_simd_two_reg_misc(DisasContext *s, uint32_t insn)
unallocated_encoding(s);
return;
}
- /* fall through */
+ fallthrough;
case 0x16: /* FCVTN, FCVTN2 */
/* handle_2misc_narrow does a 2*size -> size operation, but these
* instructions encode the source size rather than dest size.
@@ -12123,7 +12123,7 @@ static void disas_simd_two_reg_misc(DisasContext *s, uint32_t insn)
case 0x38: /* FRINTP */
case 0x39: /* FRINTZ */
rmode = extract32(opcode, 5, 1) | (extract32(opcode, 0, 1) << 1);
- /* fall through */
+ fallthrough;
case 0x59: /* FRINTX */
case 0x79: /* FRINTI */
need_fpstatus = true;
@@ -12149,7 +12149,7 @@ static void disas_simd_two_reg_misc(DisasContext *s, uint32_t insn)
case 0x1e: /* FRINT32Z */
case 0x1f: /* FRINT64Z */
rmode = FPROUNDING_ZERO;
- /* fall through */
+ fallthrough;
case 0x5e: /* FRINT32X */
case 0x5f: /* FRINT64X */
need_fpstatus = true;
@@ -12988,7 +12988,7 @@ static void disas_simd_indexed(DisasContext *s, uint32_t insn)
case 0x05: /* FMLS */
/* As usual for ARM, separate negation for fused multiply-add */
gen_helper_vfp_negd(tcg_op, tcg_op);
- /* fall through */
+ fallthrough;
case 0x01: /* FMLA */
read_vec_element(s, tcg_res, rd, pass, MO_64);
gen_helper_vfp_muladdd(tcg_res, tcg_op, tcg_idx, tcg_res, fpst);
@@ -13244,7 +13244,7 @@ static void disas_simd_indexed(DisasContext *s, uint32_t insn)
break;
case 0x7: /* SQDMLSL, SQDMLSL2 */
tcg_gen_neg_i64(tcg_passres, tcg_passres);
- /* fall through */
+ fallthrough;
case 0x3: /* SQDMLAL, SQDMLAL2 */
gen_helper_neon_addl_saturate_s64(tcg_res[pass], tcg_env,
tcg_res[pass],
@@ -13318,7 +13318,7 @@ static void disas_simd_indexed(DisasContext *s, uint32_t insn)
break;
case 0x7: /* SQDMLSL, SQDMLSL2 */
gen_helper_neon_negl_u32(tcg_passres, tcg_passres);
- /* fall through */
+ fallthrough;
case 0x3: /* SQDMLAL, SQDMLAL2 */
gen_helper_neon_addl_saturate_s32(tcg_res[pass], tcg_env,
tcg_res[pass],
@@ -14212,7 +14212,7 @@ static void aarch64_tr_tb_stop(DisasContextBase *dcbase, CPUState *cpu)
switch (dc->base.is_jmp) {
default:
gen_a64_update_pc(dc, 4);
- /* fall through */
+ fallthrough;
case DISAS_EXIT:
case DISAS_JUMP:
gen_step_complete_exception(dc);
@@ -14229,13 +14229,13 @@ static void aarch64_tr_tb_stop(DisasContextBase *dcbase, CPUState *cpu)
default:
case DISAS_UPDATE_EXIT:
gen_a64_update_pc(dc, 4);
- /* fall through */
+ fallthrough;
case DISAS_EXIT:
tcg_gen_exit_tb(NULL, 0);
break;
case DISAS_UPDATE_NOCHAIN:
gen_a64_update_pc(dc, 4);
- /* fall through */
+ fallthrough;
case DISAS_JUMP:
tcg_gen_lookup_and_goto_ptr();
break;
diff --git a/target/arm/tcg/translate-m-nocp.c b/target/arm/tcg/translate-m-nocp.c
index f564d06ccf..42d6f516ba 100644
--- a/target/arm/tcg/translate-m-nocp.c
+++ b/target/arm/tcg/translate-m-nocp.c
@@ -374,8 +374,8 @@ static bool gen_M_fp_sysreg_write(DisasContext *s, int regno,
s->base.is_jmp = DISAS_NEXT;
break;
}
+ fallthrough;
}
- /* fall through */
case ARM_VFP_FPCXT_S:
{
TCGv_i32 sfpa, control;
diff --git a/target/arm/tcg/translate-vfp.c b/target/arm/tcg/translate-vfp.c
index b9af03b7c3..57d3c41596 100644
--- a/target/arm/tcg/translate-vfp.c
+++ b/target/arm/tcg/translate-vfp.c
@@ -819,7 +819,7 @@ static bool trans_VMSR_VMRS(DisasContext *s, arg_VMSR_VMRS *a)
tcg_constant_i32(a->rt),
tcg_constant_i32(a->reg));
}
- /* fall through */
+ fallthrough;
case ARM_VFP_FPEXC:
case ARM_VFP_FPINST:
case ARM_VFP_FPINST2:
diff --git a/target/arm/tcg/translate.c b/target/arm/tcg/translate.c
index 48927fbb8c..595ef02f0d 100644
--- a/target/arm/tcg/translate.c
+++ b/target/arm/tcg/translate.c
@@ -1596,7 +1596,7 @@ static int disas_iwmmxt_insn(DisasContext *s, uint32_t insn)
break;
case ARM_IWMMXT_wCon:
gen_op_iwmmxt_set_cup();
- /* Fall through. */
+ fallthrough;
case ARM_IWMMXT_wCSSF:
tmp = iwmmxt_load_creg(wrd);
tmp2 = load_reg(s, rd);
@@ -9576,7 +9576,7 @@ static void arm_tr_tb_stop(DisasContextBase *dcbase, CPUState *cpu)
case DISAS_UPDATE_EXIT:
case DISAS_UPDATE_NOCHAIN:
gen_update_pc(dc, curr_insn_len(dc));
- /* fall through */
+ fallthrough;
default:
/* FIXME: Single stepping a WFI insn will not halt the CPU. */
gen_singlestep_exception(dc);
@@ -9600,13 +9600,13 @@ static void arm_tr_tb_stop(DisasContextBase *dcbase, CPUState *cpu)
break;
case DISAS_UPDATE_NOCHAIN:
gen_update_pc(dc, curr_insn_len(dc));
- /* fall through */
+ fallthrough;
case DISAS_JUMP:
gen_goto_ptr();
break;
case DISAS_UPDATE_EXIT:
gen_update_pc(dc, curr_insn_len(dc));
- /* fall through */
+ fallthrough;
default:
/* indicate that the hash table must be used to find the next TB */
tcg_gen_exit_tb(NULL, 0);
--
2.39.2
^ permalink raw reply related [flat|nested] 106+ messages in thread
* [RFC PATCH v3 24/78] target/alpha: add fallthrough pseudo-keyword
2023-10-13 8:45 [RFC PATCH v3 00/78] Strict disable implicit fallthrough Emmanouil Pitsidianakis
` (22 preceding siblings ...)
2023-10-13 8:45 ` [RFC PATCH v3 23/78] target/arm: " Emmanouil Pitsidianakis
@ 2023-10-13 8:45 ` Emmanouil Pitsidianakis
2023-10-13 8:45 ` [RFC PATCH v3 25/78] target/i386: " Emmanouil Pitsidianakis
` (55 subsequent siblings)
79 siblings, 0 replies; 106+ messages in thread
From: Emmanouil Pitsidianakis @ 2023-10-13 8:45 UTC (permalink / raw)
To: qemu-devel; +Cc: Emmanouil Pitsidianakis, Richard Henderson
In preparation of raising -Wimplicit-fallthrough to 5, replace all
fall-through comments with the fallthrough attribute pseudo-keyword.
Signed-off-by: Emmanouil Pitsidianakis <manos.pitsidianakis@linaro.org>
---
target/alpha/helper.c | 6 +++---
target/alpha/translate.c | 4 +++-
2 files changed, 6 insertions(+), 4 deletions(-)
diff --git a/target/alpha/helper.c b/target/alpha/helper.c
index 970c869771..1afdc1beec 100644
--- a/target/alpha/helper.c
+++ b/target/alpha/helper.c
@@ -452,17 +452,17 @@ bool alpha_cpu_exec_interrupt(CPUState *cs, int interrupt_request)
if (interrupt_request & CPU_INTERRUPT_HARD) {
idx = EXCP_DEV_INTERRUPT;
}
- /* FALLTHRU */
+ fallthrough;
case 4:
if (interrupt_request & CPU_INTERRUPT_TIMER) {
idx = EXCP_CLK_INTERRUPT;
}
- /* FALLTHRU */
+ fallthrough;
case 5:
if (interrupt_request & CPU_INTERRUPT_SMP) {
idx = EXCP_SMP_INTERRUPT;
}
- /* FALLTHRU */
+ fallthrough;
case 6:
if (interrupt_request & CPU_INTERRUPT_MCHK) {
idx = EXCP_MCHK;
diff --git a/target/alpha/translate.c b/target/alpha/translate.c
index 32333081d8..19e1d2ed86 100644
--- a/target/alpha/translate.c
+++ b/target/alpha/translate.c
@@ -1436,7 +1436,7 @@ static DisasJumpType translate_one(DisasContext *ctx, uint32_t insn)
case 0x09:
/* LDAH */
disp16 = (uint32_t)disp16 << 16;
- /* fall through */
+ fallthrough;
case 0x08:
/* LDA */
va = dest_gpr(ctx, ra);
@@ -2940,9 +2940,11 @@ static void alpha_tr_tb_stop(DisasContextBase *dcbase, CPUState *cpu)
tcg_gen_exit_tb(ctx->base.tb, 0);
}
/* FALLTHRU */
+ fallthrough;
case DISAS_PC_STALE:
tcg_gen_movi_i64(cpu_pc, ctx->base.pc_next);
/* FALLTHRU */
+ fallthrough;
case DISAS_PC_UPDATED:
tcg_gen_lookup_and_goto_ptr();
break;
--
2.39.2
^ permalink raw reply related [flat|nested] 106+ messages in thread
* [RFC PATCH v3 25/78] target/i386: add fallthrough pseudo-keyword
2023-10-13 8:45 [RFC PATCH v3 00/78] Strict disable implicit fallthrough Emmanouil Pitsidianakis
` (23 preceding siblings ...)
2023-10-13 8:45 ` [RFC PATCH v3 24/78] target/alpha: " Emmanouil Pitsidianakis
@ 2023-10-13 8:45 ` Emmanouil Pitsidianakis
2023-10-19 7:17 ` Zhao Liu
2023-10-13 8:45 ` [RFC PATCH v3 26/78] target/s390x: " Emmanouil Pitsidianakis
` (54 subsequent siblings)
79 siblings, 1 reply; 106+ messages in thread
From: Emmanouil Pitsidianakis @ 2023-10-13 8:45 UTC (permalink / raw)
To: qemu-devel
Cc: Emmanouil Pitsidianakis, Cameron Esfahani, Roman Bolshakov,
Paolo Bonzini, Marcelo Tosatti, Richard Henderson,
Eduardo Habkost, open list:X86 KVM CPUs
In preparation of raising -Wimplicit-fallthrough to 5, replace all
fall-through comments with the fallthrough attribute pseudo-keyword.
Signed-off-by: Emmanouil Pitsidianakis <manos.pitsidianakis@linaro.org>
---
target/i386/cpu.c | 2 +-
target/i386/hvf/x86_decode.c | 1 +
target/i386/kvm/kvm.c | 4 ++--
target/i386/tcg/decode-new.c.inc | 6 +++---
target/i386/tcg/emit.c.inc | 2 +-
target/i386/tcg/translate.c | 8 +++-----
6 files changed, 11 insertions(+), 12 deletions(-)
diff --git a/target/i386/cpu.c b/target/i386/cpu.c
index cec5d2b7b6..f73784edca 100644
--- a/target/i386/cpu.c
+++ b/target/i386/cpu.c
@@ -6133,7 +6133,7 @@ void cpu_x86_cpuid(CPUX86State *env, uint32_t index, uint32_t count,
eax, ebx, ecx, edx);
break;
}
- /* fall through */
+ fallthrough;
default: /* end of info */
*eax = *ebx = *ecx = *edx = 0;
break;
diff --git a/target/i386/hvf/x86_decode.c b/target/i386/hvf/x86_decode.c
index 3728d7705e..7c2e3dab8d 100644
--- a/target/i386/hvf/x86_decode.c
+++ b/target/i386/hvf/x86_decode.c
@@ -1886,6 +1886,7 @@ static void decode_prefix(CPUX86State *env, struct x86_decode *decode)
break;
}
/* fall through when not in long mode */
+ fallthrough;
default:
decode->len--;
return;
diff --git a/target/i386/kvm/kvm.c b/target/i386/kvm/kvm.c
index f6c7f7e268..d283d56aa9 100644
--- a/target/i386/kvm/kvm.c
+++ b/target/i386/kvm/kvm.c
@@ -553,7 +553,7 @@ uint64_t kvm_arch_get_supported_msr_feature(KVMState *s, uint32_t index)
value |= (uint64_t)VMX_SECONDARY_EXEC_RDTSCP << 32;
}
}
- /* fall through */
+ fallthrough;
case MSR_IA32_VMX_TRUE_PINBASED_CTLS:
case MSR_IA32_VMX_TRUE_PROCBASED_CTLS:
case MSR_IA32_VMX_TRUE_ENTRY_CTLS:
@@ -1962,7 +1962,7 @@ int kvm_arch_init_vcpu(CPUState *cs)
if (env->nr_dies < 2) {
break;
}
- /* fallthrough */
+ fallthrough;
case 4:
case 0xb:
case 0xd:
diff --git a/target/i386/tcg/decode-new.c.inc b/target/i386/tcg/decode-new.c.inc
index 7d76f15275..0e663e9124 100644
--- a/target/i386/tcg/decode-new.c.inc
+++ b/target/i386/tcg/decode-new.c.inc
@@ -1108,7 +1108,7 @@ static bool decode_op_size(DisasContext *s, X86OpEntry *e, X86OpSize size, MemOp
*ot = MO_64;
return true;
}
- /* fall through */
+ fallthrough;
case X86_SIZE_ps: /* SSE/AVX packed single precision */
case X86_SIZE_pd: /* SSE/AVX packed double precision */
*ot = s->vex_l ? MO_256 : MO_128;
@@ -1220,7 +1220,7 @@ static bool decode_op(DisasContext *s, CPUX86State *env, X86DecodedInsn *decode,
case X86_TYPE_WM: /* modrm byte selects an XMM/YMM memory operand */
op->unit = X86_OP_SSE;
- /* fall through */
+ fallthrough;
case X86_TYPE_M: /* modrm byte selects a memory operand */
modrm = get_modrm(s, env);
if ((modrm >> 6) == 3) {
@@ -1538,7 +1538,7 @@ static bool validate_vex(DisasContext *s, X86DecodedInsn *decode)
(decode->op[2].n == decode->mem.index || decode->op[2].n == decode->op[1].n)) {
goto illegal;
}
- /* fall through */
+ fallthrough;
case 6:
case 11:
if (!(s->prefix & PREFIX_VEX)) {
diff --git a/target/i386/tcg/emit.c.inc b/target/i386/tcg/emit.c.inc
index 88793ba988..0e0a2efbf9 100644
--- a/target/i386/tcg/emit.c.inc
+++ b/target/i386/tcg/emit.c.inc
@@ -209,7 +209,7 @@ static bool sse_needs_alignment(DisasContext *s, X86DecodedInsn *decode, MemOp o
/* MOST legacy SSE instructions require aligned memory operands, but not all. */
return false;
}
- /* fall through */
+ fallthrough;
case 1:
return ot >= MO_128;
diff --git a/target/i386/tcg/translate.c b/target/i386/tcg/translate.c
index e42e3dd653..77a8fcc5e1 100644
--- a/target/i386/tcg/translate.c
+++ b/target/i386/tcg/translate.c
@@ -1004,7 +1004,7 @@ static CCPrepare gen_prepare_eflags_s(DisasContext *s, TCGv reg)
switch (s->cc_op) {
case CC_OP_DYNAMIC:
gen_compute_eflags(s);
- /* FALLTHRU */
+ fallthrough;
case CC_OP_EFLAGS:
case CC_OP_ADCX:
case CC_OP_ADOX:
@@ -1047,7 +1047,7 @@ static CCPrepare gen_prepare_eflags_z(DisasContext *s, TCGv reg)
switch (s->cc_op) {
case CC_OP_DYNAMIC:
gen_compute_eflags(s);
- /* FALLTHRU */
+ fallthrough;
case CC_OP_EFLAGS:
case CC_OP_ADCX:
case CC_OP_ADOX:
@@ -3298,7 +3298,6 @@ static bool disas_insn(DisasContext *s, CPUState *cpu)
case 0x82:
if (CODE64(s))
goto illegal_op;
- /* fall through */
fallthrough;
case 0x80: /* GRP1 */
case 0x81:
@@ -6733,7 +6732,7 @@ static bool disas_insn(DisasContext *s, CPUState *cpu)
}
break;
}
- /* fallthru */
+ fallthrough;
case 0xf9 ... 0xff: /* sfence */
if (!(s->cpuid_features & CPUID_SSE)
|| (prefixes & PREFIX_LOCK)) {
@@ -7047,7 +7046,6 @@ static void i386_tr_tb_stop(DisasContextBase *dcbase, CPUState *cpu)
case DISAS_EOB_NEXT:
gen_update_cc_op(dc);
gen_update_eip_cur(dc);
- /* fall through */
fallthrough;
case DISAS_EOB_ONLY:
gen_eob(dc);
--
2.39.2
^ permalink raw reply related [flat|nested] 106+ messages in thread
* Re: [RFC PATCH v3 25/78] target/i386: add fallthrough pseudo-keyword
2023-10-13 8:45 ` [RFC PATCH v3 25/78] target/i386: " Emmanouil Pitsidianakis
@ 2023-10-19 7:17 ` Zhao Liu
0 siblings, 0 replies; 106+ messages in thread
From: Zhao Liu @ 2023-10-19 7:17 UTC (permalink / raw)
To: Emmanouil Pitsidianakis
Cc: qemu-devel, Cameron Esfahani, Roman Bolshakov, Paolo Bonzini,
Marcelo Tosatti, Richard Henderson, Eduardo Habkost,
open list:X86 KVM CPUs
On Fri, Oct 13, 2023 at 11:45:53AM +0300, Emmanouil Pitsidianakis wrote:
> Date: Fri, 13 Oct 2023 11:45:53 +0300
> From: Emmanouil Pitsidianakis <manos.pitsidianakis@linaro.org>
> Subject: [RFC PATCH v3 25/78] target/i386: add fallthrough pseudo-keyword
> X-Mailer: git-send-email 2.39.2
>
> In preparation of raising -Wimplicit-fallthrough to 5, replace all
> fall-through comments with the fallthrough attribute pseudo-keyword.
>
> Signed-off-by: Emmanouil Pitsidianakis <manos.pitsidianakis@linaro.org>
Reviewed-by: Zhao Liu <zhao1.liu@intel.com>
> ---
> target/i386/cpu.c | 2 +-
> target/i386/hvf/x86_decode.c | 1 +
> target/i386/kvm/kvm.c | 4 ++--
> target/i386/tcg/decode-new.c.inc | 6 +++---
> target/i386/tcg/emit.c.inc | 2 +-
> target/i386/tcg/translate.c | 8 +++-----
> 6 files changed, 11 insertions(+), 12 deletions(-)
>
> diff --git a/target/i386/cpu.c b/target/i386/cpu.c
> index cec5d2b7b6..f73784edca 100644
> --- a/target/i386/cpu.c
> +++ b/target/i386/cpu.c
> @@ -6133,7 +6133,7 @@ void cpu_x86_cpuid(CPUX86State *env, uint32_t index, uint32_t count,
> eax, ebx, ecx, edx);
> break;
> }
> - /* fall through */
> + fallthrough;
> default: /* end of info */
> *eax = *ebx = *ecx = *edx = 0;
> break;
> diff --git a/target/i386/hvf/x86_decode.c b/target/i386/hvf/x86_decode.c
> index 3728d7705e..7c2e3dab8d 100644
> --- a/target/i386/hvf/x86_decode.c
> +++ b/target/i386/hvf/x86_decode.c
> @@ -1886,6 +1886,7 @@ static void decode_prefix(CPUX86State *env, struct x86_decode *decode)
> break;
> }
> /* fall through when not in long mode */
> + fallthrough;
> default:
> decode->len--;
> return;
> diff --git a/target/i386/kvm/kvm.c b/target/i386/kvm/kvm.c
> index f6c7f7e268..d283d56aa9 100644
> --- a/target/i386/kvm/kvm.c
> +++ b/target/i386/kvm/kvm.c
> @@ -553,7 +553,7 @@ uint64_t kvm_arch_get_supported_msr_feature(KVMState *s, uint32_t index)
> value |= (uint64_t)VMX_SECONDARY_EXEC_RDTSCP << 32;
> }
> }
> - /* fall through */
> + fallthrough;
> case MSR_IA32_VMX_TRUE_PINBASED_CTLS:
> case MSR_IA32_VMX_TRUE_PROCBASED_CTLS:
> case MSR_IA32_VMX_TRUE_ENTRY_CTLS:
> @@ -1962,7 +1962,7 @@ int kvm_arch_init_vcpu(CPUState *cs)
> if (env->nr_dies < 2) {
> break;
> }
> - /* fallthrough */
> + fallthrough;
> case 4:
> case 0xb:
> case 0xd:
> diff --git a/target/i386/tcg/decode-new.c.inc b/target/i386/tcg/decode-new.c.inc
> index 7d76f15275..0e663e9124 100644
> --- a/target/i386/tcg/decode-new.c.inc
> +++ b/target/i386/tcg/decode-new.c.inc
> @@ -1108,7 +1108,7 @@ static bool decode_op_size(DisasContext *s, X86OpEntry *e, X86OpSize size, MemOp
> *ot = MO_64;
> return true;
> }
> - /* fall through */
> + fallthrough;
> case X86_SIZE_ps: /* SSE/AVX packed single precision */
> case X86_SIZE_pd: /* SSE/AVX packed double precision */
> *ot = s->vex_l ? MO_256 : MO_128;
> @@ -1220,7 +1220,7 @@ static bool decode_op(DisasContext *s, CPUX86State *env, X86DecodedInsn *decode,
>
> case X86_TYPE_WM: /* modrm byte selects an XMM/YMM memory operand */
> op->unit = X86_OP_SSE;
> - /* fall through */
> + fallthrough;
> case X86_TYPE_M: /* modrm byte selects a memory operand */
> modrm = get_modrm(s, env);
> if ((modrm >> 6) == 3) {
> @@ -1538,7 +1538,7 @@ static bool validate_vex(DisasContext *s, X86DecodedInsn *decode)
> (decode->op[2].n == decode->mem.index || decode->op[2].n == decode->op[1].n)) {
> goto illegal;
> }
> - /* fall through */
> + fallthrough;
> case 6:
> case 11:
> if (!(s->prefix & PREFIX_VEX)) {
> diff --git a/target/i386/tcg/emit.c.inc b/target/i386/tcg/emit.c.inc
> index 88793ba988..0e0a2efbf9 100644
> --- a/target/i386/tcg/emit.c.inc
> +++ b/target/i386/tcg/emit.c.inc
> @@ -209,7 +209,7 @@ static bool sse_needs_alignment(DisasContext *s, X86DecodedInsn *decode, MemOp o
> /* MOST legacy SSE instructions require aligned memory operands, but not all. */
> return false;
> }
> - /* fall through */
> + fallthrough;
> case 1:
> return ot >= MO_128;
>
> diff --git a/target/i386/tcg/translate.c b/target/i386/tcg/translate.c
> index e42e3dd653..77a8fcc5e1 100644
> --- a/target/i386/tcg/translate.c
> +++ b/target/i386/tcg/translate.c
> @@ -1004,7 +1004,7 @@ static CCPrepare gen_prepare_eflags_s(DisasContext *s, TCGv reg)
> switch (s->cc_op) {
> case CC_OP_DYNAMIC:
> gen_compute_eflags(s);
> - /* FALLTHRU */
> + fallthrough;
> case CC_OP_EFLAGS:
> case CC_OP_ADCX:
> case CC_OP_ADOX:
> @@ -1047,7 +1047,7 @@ static CCPrepare gen_prepare_eflags_z(DisasContext *s, TCGv reg)
> switch (s->cc_op) {
> case CC_OP_DYNAMIC:
> gen_compute_eflags(s);
> - /* FALLTHRU */
> + fallthrough;
> case CC_OP_EFLAGS:
> case CC_OP_ADCX:
> case CC_OP_ADOX:
> @@ -3298,7 +3298,6 @@ static bool disas_insn(DisasContext *s, CPUState *cpu)
> case 0x82:
> if (CODE64(s))
> goto illegal_op;
> - /* fall through */
> fallthrough;
> case 0x80: /* GRP1 */
> case 0x81:
> @@ -6733,7 +6732,7 @@ static bool disas_insn(DisasContext *s, CPUState *cpu)
> }
> break;
> }
> - /* fallthru */
> + fallthrough;
> case 0xf9 ... 0xff: /* sfence */
> if (!(s->cpuid_features & CPUID_SSE)
> || (prefixes & PREFIX_LOCK)) {
> @@ -7047,7 +7046,6 @@ static void i386_tr_tb_stop(DisasContextBase *dcbase, CPUState *cpu)
> case DISAS_EOB_NEXT:
> gen_update_cc_op(dc);
> gen_update_eip_cur(dc);
> - /* fall through */
> fallthrough;
> case DISAS_EOB_ONLY:
> gen_eob(dc);
> --
> 2.39.2
>
^ permalink raw reply [flat|nested] 106+ messages in thread
* [RFC PATCH v3 26/78] target/s390x: add fallthrough pseudo-keyword
2023-10-13 8:45 [RFC PATCH v3 00/78] Strict disable implicit fallthrough Emmanouil Pitsidianakis
` (24 preceding siblings ...)
2023-10-13 8:45 ` [RFC PATCH v3 25/78] target/i386: " Emmanouil Pitsidianakis
@ 2023-10-13 8:45 ` Emmanouil Pitsidianakis
2023-10-13 8:45 ` [RFC PATCH v3 27/78] target/riscv: " Emmanouil Pitsidianakis
` (53 subsequent siblings)
79 siblings, 0 replies; 106+ messages in thread
From: Emmanouil Pitsidianakis @ 2023-10-13 8:45 UTC (permalink / raw)
To: qemu-devel
Cc: Emmanouil Pitsidianakis, David Hildenbrand, Thomas Huth,
Richard Henderson, Ilya Leoshkevich, Halil Pasic,
Christian Borntraeger, open list:S390 general arch...
In preparation of raising -Wimplicit-fallthrough to 5, replace all
fall-through comments with the fallthrough attribute pseudo-keyword.
Reviewed-by: David Hildenbrand <david@redhat.com>
Signed-off-by: Emmanouil Pitsidianakis <manos.pitsidianakis@linaro.org>
---
target/s390x/cpu.c | 4 ++--
target/s390x/kvm/kvm.c | 2 +-
target/s390x/mmu_helper.c | 6 +++---
target/s390x/tcg/translate.c | 18 +++++++++++-------
target/s390x/tcg/translate_vx.c.inc | 2 +-
5 files changed, 18 insertions(+), 14 deletions(-)
diff --git a/target/s390x/cpu.c b/target/s390x/cpu.c
index 4f7599d72c..01df983991 100644
--- a/target/s390x/cpu.c
+++ b/target/s390x/cpu.c
@@ -162,7 +162,7 @@ static void s390_cpu_reset(CPUState *s, cpu_reset_type type)
switch (type) {
case S390_CPU_RESET_CLEAR:
memset(env, 0, offsetof(CPUS390XState, start_initial_reset_fields));
- /* fall through */
+ fallthrough;
case S390_CPU_RESET_INITIAL:
/* initial reset does not clear everything! */
memset(&env->start_initial_reset_fields, 0,
@@ -187,7 +187,7 @@ static void s390_cpu_reset(CPUState *s, cpu_reset_type type)
/* tininess for underflow is detected before rounding */
set_float_detect_tininess(float_tininess_before_rounding,
&env->fpu_status);
- /* fall through */
+ fallthrough;
case S390_CPU_RESET_NORMAL:
env->psw.mask &= ~PSW_MASK_RI;
memset(&env->start_normal_reset_fields, 0,
diff --git a/target/s390x/kvm/kvm.c b/target/s390x/kvm/kvm.c
index bc5c56a305..11b2c05df6 100644
--- a/target/s390x/kvm/kvm.c
+++ b/target/s390x/kvm/kvm.c
@@ -1086,7 +1086,7 @@ static int s390_kvm_irq_to_interrupt(struct kvm_s390_irq *irq,
switch (irq->type) {
case KVM_S390_INT_VIRTIO:
interrupt->parm = irq->u.ext.ext_params;
- /* fall through */
+ fallthrough;
case KVM_S390_INT_PFAULT_INIT:
case KVM_S390_INT_PFAULT_DONE:
interrupt->parm64 = irq->u.ext.ext_params2;
diff --git a/target/s390x/mmu_helper.c b/target/s390x/mmu_helper.c
index fbb2f1b4d4..5833917552 100644
--- a/target/s390x/mmu_helper.c
+++ b/target/s390x/mmu_helper.c
@@ -199,7 +199,7 @@ static int mmu_translate_asce(CPUS390XState *env, target_ulong vaddr,
*flags &= ~PAGE_WRITE;
}
gaddr = (entry & REGION_ENTRY_ORIGIN) + VADDR_REGION2_TX(vaddr) * 8;
- /* fall through */
+ fallthrough;
case ASCE_TYPE_REGION2:
if (!read_table_entry(env, gaddr, &entry)) {
return PGM_ADDRESSING;
@@ -218,7 +218,7 @@ static int mmu_translate_asce(CPUS390XState *env, target_ulong vaddr,
*flags &= ~PAGE_WRITE;
}
gaddr = (entry & REGION_ENTRY_ORIGIN) + VADDR_REGION3_TX(vaddr) * 8;
- /* fall through */
+ fallthrough;
case ASCE_TYPE_REGION3:
if (!read_table_entry(env, gaddr, &entry)) {
return PGM_ADDRESSING;
@@ -248,7 +248,7 @@ static int mmu_translate_asce(CPUS390XState *env, target_ulong vaddr,
return PGM_SEGMENT_TRANS;
}
gaddr = (entry & REGION_ENTRY_ORIGIN) + VADDR_SEGMENT_TX(vaddr) * 8;
- /* fall through */
+ fallthrough;
case ASCE_TYPE_SEGMENT:
if (!read_table_entry(env, gaddr, &entry)) {
return PGM_ADDRESSING;
diff --git a/target/s390x/tcg/translate.c b/target/s390x/tcg/translate.c
index 4bae1509f5..986d6433d2 100644
--- a/target/s390x/tcg/translate.c
+++ b/target/s390x/tcg/translate.c
@@ -576,6 +576,7 @@ static void gen_op_calc_cc(DisasContext *s)
default:
dummy = tcg_constant_i64(0);
/* FALLTHRU */
+ fallthrough;
case CC_OP_ADD_64:
case CC_OP_SUB_64:
case CC_OP_ADD_32:
@@ -820,6 +821,7 @@ static void disas_jcc(DisasContext *s, DisasCompare *c, uint32_t mask)
/* Calculate cc value. */
gen_op_calc_cc(s);
/* FALLTHRU */
+ fallthrough;
case CC_OP_STATIC:
/* Jump based on CC. We'll load up the real cond below;
@@ -1323,7 +1325,7 @@ static void compute_carry(DisasContext *s)
break;
default:
gen_op_calc_cc(s);
- /* fall through */
+ fallthrough;
case CC_OP_STATIC:
/* The carry flag is the msb of CC; compute into cc_src. */
tcg_gen_extu_i32_i64(cc_src, cc_op);
@@ -2612,13 +2614,13 @@ static DisasJumpType op_msa(DisasContext *s, DisasOps *o)
gen_program_exception(s, PGM_SPECIFICATION);
return DISAS_NORETURN;
}
- /* FALL THROUGH */
+ fallthrough;
case S390_FEAT_TYPE_KMCTR:
if (r3 & 1 || !r3) {
gen_program_exception(s, PGM_SPECIFICATION);
return DISAS_NORETURN;
}
- /* FALL THROUGH */
+ fallthrough;
case S390_FEAT_TYPE_PPNO:
case S390_FEAT_TYPE_KMF:
case S390_FEAT_TYPE_KMC:
@@ -2628,7 +2630,7 @@ static DisasJumpType op_msa(DisasContext *s, DisasOps *o)
gen_program_exception(s, PGM_SPECIFICATION);
return DISAS_NORETURN;
}
- /* FALL THROUGH */
+ fallthrough;
case S390_FEAT_TYPE_KMAC:
case S390_FEAT_TYPE_KIMD:
case S390_FEAT_TYPE_KLMD:
@@ -2636,7 +2638,7 @@ static DisasJumpType op_msa(DisasContext *s, DisasOps *o)
gen_program_exception(s, PGM_SPECIFICATION);
return DISAS_NORETURN;
}
- /* FALL THROUGH */
+ fallthrough;
case S390_FEAT_TYPE_PCKMO:
case S390_FEAT_TYPE_PCC:
break;
@@ -4585,12 +4587,12 @@ static void compute_borrow(DisasContext *s)
break;
default:
gen_op_calc_cc(s);
- /* fall through */
+ fallthrough;
case CC_OP_STATIC:
/* The carry flag is the msb of CC; compute into cc_src. */
tcg_gen_extu_i32_i64(cc_src, cc_op);
tcg_gen_shri_i64(cc_src, cc_src, 1);
- /* fall through */
+ fallthrough;
case CC_OP_ADDU:
/* Convert carry (1,0) to borrow (0,-1). */
tcg_gen_subi_i64(cc_src, cc_src, 1);
@@ -6486,11 +6488,13 @@ static void s390x_tr_tb_stop(DisasContextBase *dcbase, CPUState *cs)
case DISAS_TOO_MANY:
update_psw_addr(dc);
/* FALLTHRU */
+ fallthrough;
case DISAS_PC_UPDATED:
/* Next TB starts off with CC_OP_DYNAMIC, so make sure the
cc op type is in env */
update_cc_op(dc);
/* FALLTHRU */
+ fallthrough;
case DISAS_PC_CC_UPDATED:
/* Exit the TB, either by raising a debug exception or by return. */
if (dc->exit_to_mainloop) {
diff --git a/target/s390x/tcg/translate_vx.c.inc b/target/s390x/tcg/translate_vx.c.inc
index e073e5ad3a..75463b4f5c 100644
--- a/target/s390x/tcg/translate_vx.c.inc
+++ b/target/s390x/tcg/translate_vx.c.inc
@@ -686,7 +686,7 @@ static DisasJumpType op_vllez(DisasContext *s, DisasOps *o)
enr = 0;
break;
}
- /* fallthrough */
+ fallthrough;
default:
gen_program_exception(s, PGM_SPECIFICATION);
return DISAS_NORETURN;
--
2.39.2
^ permalink raw reply related [flat|nested] 106+ messages in thread
* [RFC PATCH v3 27/78] target/riscv: add fallthrough pseudo-keyword
2023-10-13 8:45 [RFC PATCH v3 00/78] Strict disable implicit fallthrough Emmanouil Pitsidianakis
` (25 preceding siblings ...)
2023-10-13 8:45 ` [RFC PATCH v3 26/78] target/s390x: " Emmanouil Pitsidianakis
@ 2023-10-13 8:45 ` Emmanouil Pitsidianakis
2023-10-13 18:17 ` Daniel Henrique Barboza
2023-10-16 1:52 ` Alistair Francis
2023-10-13 8:45 ` [RFC PATCH v3 28/78] target/avr: " Emmanouil Pitsidianakis
` (52 subsequent siblings)
79 siblings, 2 replies; 106+ messages in thread
From: Emmanouil Pitsidianakis @ 2023-10-13 8:45 UTC (permalink / raw)
To: qemu-devel
Cc: Emmanouil Pitsidianakis, Palmer Dabbelt, Alistair Francis,
Bin Meng, Weiwei Li, Daniel Henrique Barboza, Liu Zhiwei,
open list:RISC-V TCG CPUs
In preparation of raising -Wimplicit-fallthrough to 5, replace all
fall-through comments with the fallthrough attribute pseudo-keyword.
Signed-off-by: Emmanouil Pitsidianakis <manos.pitsidianakis@linaro.org>
---
target/riscv/insn_trans/trans_rvi.c.inc | 2 +-
target/riscv/insn_trans/trans_rvzce.c.inc | 22 +++++++++++-----------
target/riscv/translate.c | 4 ++--
3 files changed, 14 insertions(+), 14 deletions(-)
diff --git a/target/riscv/insn_trans/trans_rvi.c.inc b/target/riscv/insn_trans/trans_rvi.c.inc
index 25cb60558a..98dd2e3cf6 100644
--- a/target/riscv/insn_trans/trans_rvi.c.inc
+++ b/target/riscv/insn_trans/trans_rvi.c.inc
@@ -122,7 +122,7 @@ static TCGCond gen_compare_i128(bool bz, TCGv rl,
case TCG_COND_LTU:
invert = true;
- /* fallthrough */
+ fallthrough;
case TCG_COND_GEU:
{
TCGv tmp = tcg_temp_new();
diff --git a/target/riscv/insn_trans/trans_rvzce.c.inc b/target/riscv/insn_trans/trans_rvzce.c.inc
index 2d992e14c4..f0bcbb4f72 100644
--- a/target/riscv/insn_trans/trans_rvzce.c.inc
+++ b/target/riscv/insn_trans/trans_rvzce.c.inc
@@ -125,37 +125,37 @@ static uint32_t decode_push_pop_list(DisasContext *ctx, target_ulong rlist)
case 15:
reg_bitmap |= 1 << (X_Sn + 11) ;
reg_bitmap |= 1 << (X_Sn + 10) ;
- /* FALL THROUGH */
+ fallthrough;
case 14:
reg_bitmap |= 1 << (X_Sn + 9) ;
- /* FALL THROUGH */
+ fallthrough;
case 13:
reg_bitmap |= 1 << (X_Sn + 8) ;
- /* FALL THROUGH */
+ fallthrough;
case 12:
reg_bitmap |= 1 << (X_Sn + 7) ;
- /* FALL THROUGH */
+ fallthrough;
case 11:
reg_bitmap |= 1 << (X_Sn + 6) ;
- /* FALL THROUGH */
+ fallthrough;
case 10:
reg_bitmap |= 1 << (X_Sn + 5) ;
- /* FALL THROUGH */
+ fallthrough;
case 9:
reg_bitmap |= 1 << (X_Sn + 4) ;
- /* FALL THROUGH */
+ fallthrough;
case 8:
reg_bitmap |= 1 << (X_Sn + 3) ;
- /* FALL THROUGH */
+ fallthrough;
case 7:
reg_bitmap |= 1 << (X_Sn + 2) ;
- /* FALL THROUGH */
+ fallthrough;
case 6:
reg_bitmap |= 1 << X_S1 ;
- /* FALL THROUGH */
+ fallthrough;
case 5:
reg_bitmap |= 1 << X_S0;
- /* FALL THROUGH */
+ fallthrough;
case 4:
reg_bitmap |= 1 << xRA;
break;
diff --git a/target/riscv/translate.c b/target/riscv/translate.c
index f0be79bb16..c99e513221 100644
--- a/target/riscv/translate.c
+++ b/target/riscv/translate.c
@@ -446,7 +446,7 @@ static TCGv_i64 get_fpr_hs(DisasContext *ctx, int reg_num)
return t;
}
#else
- /* fall through */
+ fallthrough;
case MXL_RV64:
return cpu_gpr[reg_num];
#endif
@@ -516,7 +516,7 @@ static void gen_set_fpr_hs(DisasContext *ctx, int reg_num, TCGv_i64 t)
tcg_gen_extrl_i64_i32(cpu_gpr[reg_num], t);
break;
#else
- /* fall through */
+ fallthrough;
case MXL_RV64:
tcg_gen_mov_i64(cpu_gpr[reg_num], t);
break;
--
2.39.2
^ permalink raw reply related [flat|nested] 106+ messages in thread
* Re: [RFC PATCH v3 27/78] target/riscv: add fallthrough pseudo-keyword
2023-10-13 8:45 ` [RFC PATCH v3 27/78] target/riscv: " Emmanouil Pitsidianakis
@ 2023-10-13 18:17 ` Daniel Henrique Barboza
2023-10-16 1:52 ` Alistair Francis
1 sibling, 0 replies; 106+ messages in thread
From: Daniel Henrique Barboza @ 2023-10-13 18:17 UTC (permalink / raw)
To: Emmanouil Pitsidianakis, qemu-devel
Cc: Palmer Dabbelt, Alistair Francis, Bin Meng, Weiwei Li, Liu Zhiwei,
open list:RISC-V TCG CPUs
On 10/13/23 05:45, Emmanouil Pitsidianakis wrote:
> In preparation of raising -Wimplicit-fallthrough to 5, replace all
> fall-through comments with the fallthrough attribute pseudo-keyword.
>
> Signed-off-by: Emmanouil Pitsidianakis <manos.pitsidianakis@linaro.org>
> ---
Reviewed-by: Daniel Henrique Barboza <dbarboza@ventanamicro.com>
> target/riscv/insn_trans/trans_rvi.c.inc | 2 +-
> target/riscv/insn_trans/trans_rvzce.c.inc | 22 +++++++++++-----------
> target/riscv/translate.c | 4 ++--
> 3 files changed, 14 insertions(+), 14 deletions(-)
>
> diff --git a/target/riscv/insn_trans/trans_rvi.c.inc b/target/riscv/insn_trans/trans_rvi.c.inc
> index 25cb60558a..98dd2e3cf6 100644
> --- a/target/riscv/insn_trans/trans_rvi.c.inc
> +++ b/target/riscv/insn_trans/trans_rvi.c.inc
> @@ -122,7 +122,7 @@ static TCGCond gen_compare_i128(bool bz, TCGv rl,
>
> case TCG_COND_LTU:
> invert = true;
> - /* fallthrough */
> + fallthrough;
> case TCG_COND_GEU:
> {
> TCGv tmp = tcg_temp_new();
> diff --git a/target/riscv/insn_trans/trans_rvzce.c.inc b/target/riscv/insn_trans/trans_rvzce.c.inc
> index 2d992e14c4..f0bcbb4f72 100644
> --- a/target/riscv/insn_trans/trans_rvzce.c.inc
> +++ b/target/riscv/insn_trans/trans_rvzce.c.inc
> @@ -125,37 +125,37 @@ static uint32_t decode_push_pop_list(DisasContext *ctx, target_ulong rlist)
> case 15:
> reg_bitmap |= 1 << (X_Sn + 11) ;
> reg_bitmap |= 1 << (X_Sn + 10) ;
> - /* FALL THROUGH */
> + fallthrough;
> case 14:
> reg_bitmap |= 1 << (X_Sn + 9) ;
> - /* FALL THROUGH */
> + fallthrough;
> case 13:
> reg_bitmap |= 1 << (X_Sn + 8) ;
> - /* FALL THROUGH */
> + fallthrough;
> case 12:
> reg_bitmap |= 1 << (X_Sn + 7) ;
> - /* FALL THROUGH */
> + fallthrough;
> case 11:
> reg_bitmap |= 1 << (X_Sn + 6) ;
> - /* FALL THROUGH */
> + fallthrough;
> case 10:
> reg_bitmap |= 1 << (X_Sn + 5) ;
> - /* FALL THROUGH */
> + fallthrough;
> case 9:
> reg_bitmap |= 1 << (X_Sn + 4) ;
> - /* FALL THROUGH */
> + fallthrough;
> case 8:
> reg_bitmap |= 1 << (X_Sn + 3) ;
> - /* FALL THROUGH */
> + fallthrough;
> case 7:
> reg_bitmap |= 1 << (X_Sn + 2) ;
> - /* FALL THROUGH */
> + fallthrough;
> case 6:
> reg_bitmap |= 1 << X_S1 ;
> - /* FALL THROUGH */
> + fallthrough;
> case 5:
> reg_bitmap |= 1 << X_S0;
> - /* FALL THROUGH */
> + fallthrough;
> case 4:
> reg_bitmap |= 1 << xRA;
> break;
> diff --git a/target/riscv/translate.c b/target/riscv/translate.c
> index f0be79bb16..c99e513221 100644
> --- a/target/riscv/translate.c
> +++ b/target/riscv/translate.c
> @@ -446,7 +446,7 @@ static TCGv_i64 get_fpr_hs(DisasContext *ctx, int reg_num)
> return t;
> }
> #else
> - /* fall through */
> + fallthrough;
> case MXL_RV64:
> return cpu_gpr[reg_num];
> #endif
> @@ -516,7 +516,7 @@ static void gen_set_fpr_hs(DisasContext *ctx, int reg_num, TCGv_i64 t)
> tcg_gen_extrl_i64_i32(cpu_gpr[reg_num], t);
> break;
> #else
> - /* fall through */
> + fallthrough;
> case MXL_RV64:
> tcg_gen_mov_i64(cpu_gpr[reg_num], t);
> break;
^ permalink raw reply [flat|nested] 106+ messages in thread
* Re: [RFC PATCH v3 27/78] target/riscv: add fallthrough pseudo-keyword
2023-10-13 8:45 ` [RFC PATCH v3 27/78] target/riscv: " Emmanouil Pitsidianakis
2023-10-13 18:17 ` Daniel Henrique Barboza
@ 2023-10-16 1:52 ` Alistair Francis
1 sibling, 0 replies; 106+ messages in thread
From: Alistair Francis @ 2023-10-16 1:52 UTC (permalink / raw)
To: Emmanouil Pitsidianakis
Cc: qemu-devel, Palmer Dabbelt, Alistair Francis, Bin Meng, Weiwei Li,
Daniel Henrique Barboza, Liu Zhiwei, open list:RISC-V TCG CPUs
On Fri, Oct 13, 2023 at 6:52 PM Emmanouil Pitsidianakis
<manos.pitsidianakis@linaro.org> wrote:
>
> In preparation of raising -Wimplicit-fallthrough to 5, replace all
> fall-through comments with the fallthrough attribute pseudo-keyword.
>
> Signed-off-by: Emmanouil Pitsidianakis <manos.pitsidianakis@linaro.org>
Acked-by: Alistair Francis <alistair.francis@wdc.com>
Alistair
> ---
> target/riscv/insn_trans/trans_rvi.c.inc | 2 +-
> target/riscv/insn_trans/trans_rvzce.c.inc | 22 +++++++++++-----------
> target/riscv/translate.c | 4 ++--
> 3 files changed, 14 insertions(+), 14 deletions(-)
>
> diff --git a/target/riscv/insn_trans/trans_rvi.c.inc b/target/riscv/insn_trans/trans_rvi.c.inc
> index 25cb60558a..98dd2e3cf6 100644
> --- a/target/riscv/insn_trans/trans_rvi.c.inc
> +++ b/target/riscv/insn_trans/trans_rvi.c.inc
> @@ -122,7 +122,7 @@ static TCGCond gen_compare_i128(bool bz, TCGv rl,
>
> case TCG_COND_LTU:
> invert = true;
> - /* fallthrough */
> + fallthrough;
> case TCG_COND_GEU:
> {
> TCGv tmp = tcg_temp_new();
> diff --git a/target/riscv/insn_trans/trans_rvzce.c.inc b/target/riscv/insn_trans/trans_rvzce.c.inc
> index 2d992e14c4..f0bcbb4f72 100644
> --- a/target/riscv/insn_trans/trans_rvzce.c.inc
> +++ b/target/riscv/insn_trans/trans_rvzce.c.inc
> @@ -125,37 +125,37 @@ static uint32_t decode_push_pop_list(DisasContext *ctx, target_ulong rlist)
> case 15:
> reg_bitmap |= 1 << (X_Sn + 11) ;
> reg_bitmap |= 1 << (X_Sn + 10) ;
> - /* FALL THROUGH */
> + fallthrough;
> case 14:
> reg_bitmap |= 1 << (X_Sn + 9) ;
> - /* FALL THROUGH */
> + fallthrough;
> case 13:
> reg_bitmap |= 1 << (X_Sn + 8) ;
> - /* FALL THROUGH */
> + fallthrough;
> case 12:
> reg_bitmap |= 1 << (X_Sn + 7) ;
> - /* FALL THROUGH */
> + fallthrough;
> case 11:
> reg_bitmap |= 1 << (X_Sn + 6) ;
> - /* FALL THROUGH */
> + fallthrough;
> case 10:
> reg_bitmap |= 1 << (X_Sn + 5) ;
> - /* FALL THROUGH */
> + fallthrough;
> case 9:
> reg_bitmap |= 1 << (X_Sn + 4) ;
> - /* FALL THROUGH */
> + fallthrough;
> case 8:
> reg_bitmap |= 1 << (X_Sn + 3) ;
> - /* FALL THROUGH */
> + fallthrough;
> case 7:
> reg_bitmap |= 1 << (X_Sn + 2) ;
> - /* FALL THROUGH */
> + fallthrough;
> case 6:
> reg_bitmap |= 1 << X_S1 ;
> - /* FALL THROUGH */
> + fallthrough;
> case 5:
> reg_bitmap |= 1 << X_S0;
> - /* FALL THROUGH */
> + fallthrough;
> case 4:
> reg_bitmap |= 1 << xRA;
> break;
> diff --git a/target/riscv/translate.c b/target/riscv/translate.c
> index f0be79bb16..c99e513221 100644
> --- a/target/riscv/translate.c
> +++ b/target/riscv/translate.c
> @@ -446,7 +446,7 @@ static TCGv_i64 get_fpr_hs(DisasContext *ctx, int reg_num)
> return t;
> }
> #else
> - /* fall through */
> + fallthrough;
> case MXL_RV64:
> return cpu_gpr[reg_num];
> #endif
> @@ -516,7 +516,7 @@ static void gen_set_fpr_hs(DisasContext *ctx, int reg_num, TCGv_i64 t)
> tcg_gen_extrl_i64_i32(cpu_gpr[reg_num], t);
> break;
> #else
> - /* fall through */
> + fallthrough;
> case MXL_RV64:
> tcg_gen_mov_i64(cpu_gpr[reg_num], t);
> break;
> --
> 2.39.2
>
>
^ permalink raw reply [flat|nested] 106+ messages in thread
* [RFC PATCH v3 28/78] target/avr: add fallthrough pseudo-keyword
2023-10-13 8:45 [RFC PATCH v3 00/78] Strict disable implicit fallthrough Emmanouil Pitsidianakis
` (26 preceding siblings ...)
2023-10-13 8:45 ` [RFC PATCH v3 27/78] target/riscv: " Emmanouil Pitsidianakis
@ 2023-10-13 8:45 ` Emmanouil Pitsidianakis
2023-10-13 8:45 ` [RFC PATCH v3 29/78] target/cris: " Emmanouil Pitsidianakis
` (51 subsequent siblings)
79 siblings, 0 replies; 106+ messages in thread
From: Emmanouil Pitsidianakis @ 2023-10-13 8:45 UTC (permalink / raw)
To: qemu-devel; +Cc: Emmanouil Pitsidianakis, Michael Rolnik
In preparation of raising -Wimplicit-fallthrough to 5, replace all
fall-through comments with the fallthrough attribute pseudo-keyword.
Signed-off-by: Emmanouil Pitsidianakis <manos.pitsidianakis@linaro.org>
---
target/avr/translate.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/target/avr/translate.c b/target/avr/translate.c
index cdffa04519..2043677745 100644
--- a/target/avr/translate.c
+++ b/target/avr/translate.c
@@ -2773,13 +2773,13 @@ static void avr_tr_tb_stop(DisasContextBase *dcbase, CPUState *cs)
break;
}
tcg_gen_movi_tl(cpu_pc, ctx->npc);
- /* fall through */
+ fallthrough;
case DISAS_LOOKUP:
if (!force_exit) {
tcg_gen_lookup_and_goto_ptr();
break;
}
- /* fall through */
+ fallthrough;
case DISAS_EXIT:
tcg_gen_exit_tb(NULL, 0);
break;
--
2.39.2
^ permalink raw reply related [flat|nested] 106+ messages in thread
* [RFC PATCH v3 29/78] target/cris: add fallthrough pseudo-keyword
2023-10-13 8:45 [RFC PATCH v3 00/78] Strict disable implicit fallthrough Emmanouil Pitsidianakis
` (27 preceding siblings ...)
2023-10-13 8:45 ` [RFC PATCH v3 28/78] target/avr: " Emmanouil Pitsidianakis
@ 2023-10-13 8:45 ` Emmanouil Pitsidianakis
2023-10-13 8:45 ` [RFC PATCH v3 30/78] target/nios2: " Emmanouil Pitsidianakis
` (50 subsequent siblings)
79 siblings, 0 replies; 106+ messages in thread
From: Emmanouil Pitsidianakis @ 2023-10-13 8:45 UTC (permalink / raw)
To: qemu-devel; +Cc: Emmanouil Pitsidianakis, Edgar E. Iglesias
In preparation of raising -Wimplicit-fallthrough to 5, replace all
fall-through comments with the fallthrough attribute pseudo-keyword.
Signed-off-by: Emmanouil Pitsidianakis <manos.pitsidianakis@linaro.org>
---
target/cris/translate.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/target/cris/translate.c b/target/cris/translate.c
index b3974ba0bb..bdd128db23 100644
--- a/target/cris/translate.c
+++ b/target/cris/translate.c
@@ -3113,7 +3113,7 @@ static void cris_tr_tb_stop(DisasContextBase *dcbase, CPUState *cpu)
break;
}
tcg_gen_movi_tl(env_btarget, dc->jmp_pc);
- /* fall through */
+ fallthrough;
case JMP_INDIRECT:
tcg_gen_movcond_tl(TCG_COND_NE, env_pc,
@@ -3140,7 +3140,7 @@ static void cris_tr_tb_stop(DisasContextBase *dcbase, CPUState *cpu)
break;
case DISAS_UPDATE_NEXT:
tcg_gen_movi_tl(env_pc, npc);
- /* fall through */
+ fallthrough;
case DISAS_JUMP:
tcg_gen_lookup_and_goto_ptr();
break;
--
2.39.2
^ permalink raw reply related [flat|nested] 106+ messages in thread
* [RFC PATCH v3 30/78] target/nios2: add fallthrough pseudo-keyword
2023-10-13 8:45 [RFC PATCH v3 00/78] Strict disable implicit fallthrough Emmanouil Pitsidianakis
` (28 preceding siblings ...)
2023-10-13 8:45 ` [RFC PATCH v3 29/78] target/cris: " Emmanouil Pitsidianakis
@ 2023-10-13 8:45 ` Emmanouil Pitsidianakis
2023-10-13 8:45 ` [RFC PATCH v3 31/78] target/xtensa: " Emmanouil Pitsidianakis
` (49 subsequent siblings)
79 siblings, 0 replies; 106+ messages in thread
From: Emmanouil Pitsidianakis @ 2023-10-13 8:45 UTC (permalink / raw)
To: qemu-devel; +Cc: Emmanouil Pitsidianakis, Chris Wulff, Marek Vasut
In preparation of raising -Wimplicit-fallthrough to 5, replace all
fall-through comments with the fallthrough attribute pseudo-keyword.
Signed-off-by: Emmanouil Pitsidianakis <manos.pitsidianakis@linaro.org>
---
target/nios2/helper.c | 6 +++---
target/nios2/translate.c | 2 +-
2 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/target/nios2/helper.c b/target/nios2/helper.c
index bb3b09e5a7..b44e73768e 100644
--- a/target/nios2/helper.c
+++ b/target/nios2/helper.c
@@ -198,7 +198,7 @@ void nios2_cpu_do_interrupt(CPUState *cs)
case EXCP_TLB_D:
tlbmisc_set = CR_TLBMISC_D;
- /* fall through */
+ fallthrough;
case EXCP_TLB_X:
if (env->ctrl[CR_STATUS] & CR_STATUS_EH) {
tlbmisc_set |= CR_TLBMISC_DBL;
@@ -220,7 +220,7 @@ void nios2_cpu_do_interrupt(CPUState *cs)
case EXCP_PERM_R:
case EXCP_PERM_W:
tlbmisc_set = CR_TLBMISC_D;
- /* fall through */
+ fallthrough;
case EXCP_PERM_X:
tlbmisc_set |= CR_TLBMISC_PERM;
if (!(env->ctrl[CR_STATUS] & CR_STATUS_EH)) {
@@ -232,7 +232,7 @@ void nios2_cpu_do_interrupt(CPUState *cs)
case EXCP_SUPERA_D:
case EXCP_UNALIGN:
tlbmisc_set = CR_TLBMISC_D;
- /* fall through */
+ fallthrough;
case EXCP_SUPERA_X:
case EXCP_UNALIGND:
tlbmisc_set |= CR_TLBMISC_BAD;
diff --git a/target/nios2/translate.c b/target/nios2/translate.c
index e806623594..2cfe77c90a 100644
--- a/target/nios2/translate.c
+++ b/target/nios2/translate.c
@@ -649,7 +649,7 @@ static void wrctl(DisasContext *dc, uint32_t code, uint32_t flags)
case CR_IENABLE:
/* If interrupts were enabled using WRCTL, trigger them. */
dc->base.is_jmp = DISAS_UPDATE;
- /* fall through */
+ fallthrough;
default:
if (wr == -1) {
/* The register is entirely writable. */
--
2.39.2
^ permalink raw reply related [flat|nested] 106+ messages in thread
* [RFC PATCH v3 31/78] target/xtensa: add fallthrough pseudo-keyword
2023-10-13 8:45 [RFC PATCH v3 00/78] Strict disable implicit fallthrough Emmanouil Pitsidianakis
` (29 preceding siblings ...)
2023-10-13 8:45 ` [RFC PATCH v3 30/78] target/nios2: " Emmanouil Pitsidianakis
@ 2023-10-13 8:45 ` Emmanouil Pitsidianakis
2023-10-13 8:46 ` [RFC PATCH v3 32/78] target/m68k: " Emmanouil Pitsidianakis
` (48 subsequent siblings)
79 siblings, 0 replies; 106+ messages in thread
From: Emmanouil Pitsidianakis @ 2023-10-13 8:45 UTC (permalink / raw)
To: qemu-devel; +Cc: Emmanouil Pitsidianakis, Max Filippov
In preparation of raising -Wimplicit-fallthrough to 5, replace all
fall-through comments with the fallthrough attribute pseudo-keyword.
Reviewed-by: Max Filippov <jcmvbkbc@gmail.com>
Signed-off-by: Emmanouil Pitsidianakis <manos.pitsidianakis@linaro.org>
---
target/xtensa/op_helper.c | 8 ++++----
target/xtensa/translate.c | 2 +-
2 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/target/xtensa/op_helper.c b/target/xtensa/op_helper.c
index 7bb8cd6726..69b72f474d 100644
--- a/target/xtensa/op_helper.c
+++ b/target/xtensa/op_helper.c
@@ -108,10 +108,10 @@ void HELPER(check_atomctl)(CPUXtensaState *env, uint32_t pc, uint32_t vaddr)
switch (access & PAGE_CACHE_MASK) {
case PAGE_CACHE_WB:
atomctl >>= 2;
- /* fall through */
+ fallthrough;
case PAGE_CACHE_WT:
atomctl >>= 2;
- /* fall through */
+ fallthrough;
case PAGE_CACHE_BYPASS:
if ((atomctl & 0x3) == 0) {
HELPER(exception_cause_vaddr)(env, pc,
@@ -150,10 +150,10 @@ void HELPER(check_exclusive)(CPUXtensaState *env, uint32_t pc, uint32_t vaddr,
switch (access & PAGE_CACHE_MASK) {
case PAGE_CACHE_WB:
atomctl >>= 2;
- /* fall through */
+ fallthrough;
case PAGE_CACHE_WT:
atomctl >>= 2;
- /* fall through */
+ fallthrough;
case PAGE_CACHE_BYPASS:
if ((atomctl & 0x3) == 0) {
HELPER(exception_cause_vaddr)(env, pc,
diff --git a/target/xtensa/translate.c b/target/xtensa/translate.c
index 54bee7ddba..8ef940933c 100644
--- a/target/xtensa/translate.c
+++ b/target/xtensa/translate.c
@@ -803,7 +803,7 @@ static void opcode_add_resource(struct slot_prop *op,
op->in[op->n_in].resource = resource;
op->in[op->n_in].index = index;
++op->n_in;
- /* fall through */
+ fallthrough;
case 'o':
if (direction == 'm' || direction == 'o') {
assert(op->n_out < ARRAY_SIZE(op->out));
--
2.39.2
^ permalink raw reply related [flat|nested] 106+ messages in thread
* [RFC PATCH v3 32/78] target/m68k: add fallthrough pseudo-keyword
2023-10-13 8:45 [RFC PATCH v3 00/78] Strict disable implicit fallthrough Emmanouil Pitsidianakis
` (30 preceding siblings ...)
2023-10-13 8:45 ` [RFC PATCH v3 31/78] target/xtensa: " Emmanouil Pitsidianakis
@ 2023-10-13 8:46 ` Emmanouil Pitsidianakis
2023-10-13 8:46 ` [RFC PATCH v3 33/78] target/rx: " Emmanouil Pitsidianakis
` (47 subsequent siblings)
79 siblings, 0 replies; 106+ messages in thread
From: Emmanouil Pitsidianakis @ 2023-10-13 8:46 UTC (permalink / raw)
To: qemu-devel; +Cc: Emmanouil Pitsidianakis, Laurent Vivier
In preparation of raising -Wimplicit-fallthrough to 5, replace all
fall-through comments with the fallthrough attribute pseudo-keyword.
Signed-off-by: Emmanouil Pitsidianakis <manos.pitsidianakis@linaro.org>
---
target/m68k/op_helper.c | 3 ++-
target/m68k/translate.c | 10 +++++-----
2 files changed, 7 insertions(+), 6 deletions(-)
diff --git a/target/m68k/op_helper.c b/target/m68k/op_helper.c
index 1ce850bbc5..65058b9e2f 100644
--- a/target/m68k/op_helper.c
+++ b/target/m68k/op_helper.c
@@ -418,7 +418,7 @@ static void m68k_interrupt_all(CPUM68KState *env, int is_hw)
do_stack_frame(env, &sp, 1, oldsr, 0, env->pc);
break;
}
- /* fall through */
+ fallthrough;
default:
do_stack_frame(env, &sp, 0, oldsr, 0, env->pc);
@@ -917,6 +917,7 @@ static struct bf_data bf_prep(uint32_t addr, int32_t ofs, uint32_t len)
addr -= 1;
}
/* fallthru */
+ fallthrough;
case 3:
bofs += 32;
break;
diff --git a/target/m68k/translate.c b/target/m68k/translate.c
index 4d0110de95..ce102dc585 100644
--- a/target/m68k/translate.c
+++ b/target/m68k/translate.c
@@ -732,7 +732,7 @@ static TCGv gen_lea_mode(CPUM68KState *env, DisasContext *s,
if (opsize == OS_UNSIZED) {
return NULL_QREG;
}
- /* fallthru */
+ fallthrough;
case 2: /* Indirect register */
return get_areg(s, reg0);
case 4: /* Indirect predecrememnt. */
@@ -1221,7 +1221,7 @@ static void gen_cc_cond(DisasCompare *c, DisasContext *s, int cond)
c->v1 = tmp = tcg_temp_new();
tcg_gen_sub_i32(tmp, QREG_CC_N, QREG_CC_V);
gen_ext(tmp, tmp, op - CC_OP_CMPB, 1);
- /* fallthru */
+ fallthrough;
case 12: /* GE */
case 13: /* LT */
tcond = TCG_COND_LT;
@@ -1260,7 +1260,7 @@ static void gen_cc_cond(DisasCompare *c, DisasContext *s, int cond)
if (op != CC_OP_LOGIC) {
break;
}
- /* fallthru */
+ fallthrough;
case 10: /* PL (!N) */
case 11: /* MI (N) */
/* Several cases represent N normally. */
@@ -1292,7 +1292,7 @@ static void gen_cc_cond(DisasCompare *c, DisasContext *s, int cond)
c->v1 = QREG_CC_X;
goto done;
}
- /* fallthru */
+ fallthrough;
case 8: /* VC (!V) */
case 9: /* VS (V) */
/* Logic operations clear V and C. */
@@ -4234,7 +4234,7 @@ DISAS_INSN(chk)
opsize = OS_LONG;
break;
}
- /* fallthru */
+ fallthrough;
default:
gen_exception(s, s->base.pc_next, EXCP_ILLEGAL);
return;
--
2.39.2
^ permalink raw reply related [flat|nested] 106+ messages in thread
* [RFC PATCH v3 33/78] target/rx: add fallthrough pseudo-keyword
2023-10-13 8:45 [RFC PATCH v3 00/78] Strict disable implicit fallthrough Emmanouil Pitsidianakis
` (31 preceding siblings ...)
2023-10-13 8:46 ` [RFC PATCH v3 32/78] target/m68k: " Emmanouil Pitsidianakis
@ 2023-10-13 8:46 ` Emmanouil Pitsidianakis
2023-10-13 8:46 ` [RFC PATCH v3 34/78] target/tricore: " Emmanouil Pitsidianakis
` (46 subsequent siblings)
79 siblings, 0 replies; 106+ messages in thread
From: Emmanouil Pitsidianakis @ 2023-10-13 8:46 UTC (permalink / raw)
To: qemu-devel; +Cc: Emmanouil Pitsidianakis, Yoshinori Sato
In preparation of raising -Wimplicit-fallthrough to 5, replace all
fall-through comments with the fallthrough attribute pseudo-keyword.
Signed-off-by: Emmanouil Pitsidianakis <manos.pitsidianakis@linaro.org>
---
target/rx/translate.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/target/rx/translate.c b/target/rx/translate.c
index f8860830ae..b00c0a21fb 100644
--- a/target/rx/translate.c
+++ b/target/rx/translate.c
@@ -2243,7 +2243,7 @@ static void rx_tr_tb_stop(DisasContextBase *dcbase, CPUState *cs)
break;
case DISAS_UPDATE:
tcg_gen_movi_i32(cpu_pc, ctx->base.pc_next);
- /* fall through */
+ fallthrough;
case DISAS_EXIT:
tcg_gen_exit_tb(NULL, 0);
break;
--
2.39.2
^ permalink raw reply related [flat|nested] 106+ messages in thread
* [RFC PATCH v3 34/78] target/tricore: add fallthrough pseudo-keyword
2023-10-13 8:45 [RFC PATCH v3 00/78] Strict disable implicit fallthrough Emmanouil Pitsidianakis
` (32 preceding siblings ...)
2023-10-13 8:46 ` [RFC PATCH v3 33/78] target/rx: " Emmanouil Pitsidianakis
@ 2023-10-13 8:46 ` Emmanouil Pitsidianakis
2023-10-13 14:26 ` Bastian Koppelmann
2023-10-13 8:46 ` [RFC PATCH v3 35/78] target/sh4: " Emmanouil Pitsidianakis
` (45 subsequent siblings)
79 siblings, 1 reply; 106+ messages in thread
From: Emmanouil Pitsidianakis @ 2023-10-13 8:46 UTC (permalink / raw)
To: qemu-devel; +Cc: Emmanouil Pitsidianakis, Bastian Koppelmann
In preparation of raising -Wimplicit-fallthrough to 5, replace all
fall-through comments with the fallthrough attribute pseudo-keyword.
Signed-off-by: Emmanouil Pitsidianakis <manos.pitsidianakis@linaro.org>
---
target/tricore/translate.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/target/tricore/translate.c b/target/tricore/translate.c
index dd812ec0f0..4e42f06ec8 100644
--- a/target/tricore/translate.c
+++ b/target/tricore/translate.c
@@ -3014,7 +3014,7 @@ static void gen_compute_branch(DisasContext *ctx, uint32_t opc, int r1,
break;
case OPC1_32_B_JLA:
tcg_gen_movi_tl(cpu_gpr_a[11], ctx->pc_succ_insn);
- /* fall through */
+ fallthrough;
case OPC1_32_B_JA:
gen_goto_tb(ctx, 0, EA_B_ABSOLUT(offset));
break;
@@ -8452,7 +8452,7 @@ static void tricore_tr_tb_stop(DisasContextBase *dcbase, CPUState *cpu)
break;
case DISAS_EXIT_UPDATE:
gen_save_pc(ctx->base.pc_next);
- /* fall through */
+ fallthrough;
case DISAS_EXIT:
tcg_gen_exit_tb(NULL, 0);
break;
--
2.39.2
^ permalink raw reply related [flat|nested] 106+ messages in thread
* Re: [RFC PATCH v3 34/78] target/tricore: add fallthrough pseudo-keyword
2023-10-13 8:46 ` [RFC PATCH v3 34/78] target/tricore: " Emmanouil Pitsidianakis
@ 2023-10-13 14:26 ` Bastian Koppelmann
0 siblings, 0 replies; 106+ messages in thread
From: Bastian Koppelmann @ 2023-10-13 14:26 UTC (permalink / raw)
To: Emmanouil Pitsidianakis; +Cc: qemu-devel
On Fri, Oct 13, 2023 at 11:46:02AM +0300, Emmanouil Pitsidianakis wrote:
> In preparation of raising -Wimplicit-fallthrough to 5, replace all
> fall-through comments with the fallthrough attribute pseudo-keyword.
>
> Signed-off-by: Emmanouil Pitsidianakis <manos.pitsidianakis@linaro.org>
> ---
Reviewed-by: Bastian Koppelmann <kbastian@mail.uni-paderborn.de>
Cheers,
Bastian
^ permalink raw reply [flat|nested] 106+ messages in thread
* [RFC PATCH v3 35/78] target/sh4: add fallthrough pseudo-keyword
2023-10-13 8:45 [RFC PATCH v3 00/78] Strict disable implicit fallthrough Emmanouil Pitsidianakis
` (33 preceding siblings ...)
2023-10-13 8:46 ` [RFC PATCH v3 34/78] target/tricore: " Emmanouil Pitsidianakis
@ 2023-10-13 8:46 ` Emmanouil Pitsidianakis
2023-10-13 8:46 ` [RFC PATCH v3 36/78] target/openrisc: " Emmanouil Pitsidianakis
` (44 subsequent siblings)
79 siblings, 0 replies; 106+ messages in thread
From: Emmanouil Pitsidianakis @ 2023-10-13 8:46 UTC (permalink / raw)
To: qemu-devel; +Cc: Emmanouil Pitsidianakis, Yoshinori Sato
In preparation of raising -Wimplicit-fallthrough to 5, replace all
fall-through comments with the fallthrough attribute pseudo-keyword.
Signed-off-by: Emmanouil Pitsidianakis <manos.pitsidianakis@linaro.org>
---
target/sh4/helper.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/target/sh4/helper.c b/target/sh4/helper.c
index e02e7af607..c1cc5e82f4 100644
--- a/target/sh4/helper.c
+++ b/target/sh4/helper.c
@@ -170,7 +170,7 @@ void superh_cpu_do_interrupt(CPUState *cs)
break;
case 0x160:
env->spc += 2; /* special case for TRAPA */
- /* fall through */
+ fallthrough;
default:
env->pc = env->vbr + 0x100;
break;
--
2.39.2
^ permalink raw reply related [flat|nested] 106+ messages in thread
* [RFC PATCH v3 36/78] target/openrisc: add fallthrough pseudo-keyword
2023-10-13 8:45 [RFC PATCH v3 00/78] Strict disable implicit fallthrough Emmanouil Pitsidianakis
` (34 preceding siblings ...)
2023-10-13 8:46 ` [RFC PATCH v3 35/78] target/sh4: " Emmanouil Pitsidianakis
@ 2023-10-13 8:46 ` Emmanouil Pitsidianakis
2023-10-13 8:46 ` [RFC PATCH v3 37/78] target/hexagon: " Emmanouil Pitsidianakis
` (43 subsequent siblings)
79 siblings, 0 replies; 106+ messages in thread
From: Emmanouil Pitsidianakis @ 2023-10-13 8:46 UTC (permalink / raw)
To: qemu-devel; +Cc: Emmanouil Pitsidianakis, Stafford Horne
In preparation of raising -Wimplicit-fallthrough to 5, replace all
fall-through comments with the fallthrough attribute pseudo-keyword.
Signed-off-by: Emmanouil Pitsidianakis <manos.pitsidianakis@linaro.org>
---
target/openrisc/mmu.c | 2 +-
target/openrisc/translate.c | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/target/openrisc/mmu.c b/target/openrisc/mmu.c
index 603c26715e..7ed744e81b 100644
--- a/target/openrisc/mmu.c
+++ b/target/openrisc/mmu.c
@@ -168,7 +168,7 @@ hwaddr openrisc_cpu_get_phys_page_debug(CPUState *cs, vaddr addr)
if (!excp) {
return phys_addr;
}
- /* fallthru */
+ fallthrough;
case 0:
/* The mmu is definitely disabled; lookups never fail. */
diff --git a/target/openrisc/translate.c b/target/openrisc/translate.c
index ecff4412b7..de77014d60 100644
--- a/target/openrisc/translate.c
+++ b/target/openrisc/translate.c
@@ -1618,7 +1618,7 @@ static void openrisc_tr_tb_stop(DisasContextBase *dcbase, CPUState *cs)
However, we will have stored into jmp_pc as well;
we know now that it wasn't needed. */
tcg_gen_discard_tl(jmp_pc);
- /* fallthru */
+ fallthrough;
case DISAS_TOO_MANY:
if (translator_use_goto_tb(&dc->base, jmp_dest)) {
--
2.39.2
^ permalink raw reply related [flat|nested] 106+ messages in thread
* [RFC PATCH v3 37/78] target/hexagon: add fallthrough pseudo-keyword
2023-10-13 8:45 [RFC PATCH v3 00/78] Strict disable implicit fallthrough Emmanouil Pitsidianakis
` (35 preceding siblings ...)
2023-10-13 8:46 ` [RFC PATCH v3 36/78] target/openrisc: " Emmanouil Pitsidianakis
@ 2023-10-13 8:46 ` Emmanouil Pitsidianakis
2023-10-16 19:30 ` Anton Johansson via
2023-10-13 8:46 ` [RFC PATCH v3 38/78] system/rtc.c: " Emmanouil Pitsidianakis
` (42 subsequent siblings)
79 siblings, 1 reply; 106+ messages in thread
From: Emmanouil Pitsidianakis @ 2023-10-13 8:46 UTC (permalink / raw)
To: qemu-devel
Cc: Emmanouil Pitsidianakis, Alessandro Di Federico, Anton Johansson
In preparation of raising -Wimplicit-fallthrough to 5, replace all
fall-through comments with the fallthrough attribute pseudo-keyword.
Signed-off-by: Emmanouil Pitsidianakis <manos.pitsidianakis@linaro.org>
---
target/hexagon/idef-parser/parser-helpers.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/target/hexagon/idef-parser/parser-helpers.c b/target/hexagon/idef-parser/parser-helpers.c
index 4af020933a..0f1713ae4c 100644
--- a/target/hexagon/idef-parser/parser-helpers.c
+++ b/target/hexagon/idef-parser/parser-helpers.c
@@ -29,6 +29,7 @@
#include "parser-helpers.h"
#include "idef-parser.tab.h"
#include "idef-parser.yy.h"
+#include "qemu/compiler.h"
void yyerror(YYLTYPE *locp,
yyscan_t scanner __attribute__((unused)),
@@ -645,7 +646,7 @@ static void gen_asl_op(Context *c, YYLTYPE *locp, unsigned bit_width,
case IMM_REG:
op1_m.bit_width = bit_width;
op1_m = rvalue_materialize(c, locp, &op1_m);
- /* fallthrough */
+ fallthrough;
case REG_REG: {
OUT(c, locp, "tcg_gen_shl_", bit_suffix,
"(", res, ", ", &op1_m, ", ", op2, ");\n");
@@ -829,7 +830,7 @@ static void gen_minmax_op(Context *c, YYLTYPE *locp, unsigned bit_width,
case REG_IMM:
op2_m.bit_width = bit_width;
op2_m = rvalue_materialize(c, locp, &op2_m);
- /* Fallthrough */
+ fallthrough;
case REG_REG:
OUT(c, locp, mm, "_i", &bit_width, "(");
OUT(c, locp, res, ", ", op1, ", ", &op2_m, ");\n");
--
2.39.2
^ permalink raw reply related [flat|nested] 106+ messages in thread
* Re: [RFC PATCH v3 37/78] target/hexagon: add fallthrough pseudo-keyword
2023-10-13 8:46 ` [RFC PATCH v3 37/78] target/hexagon: " Emmanouil Pitsidianakis
@ 2023-10-16 19:30 ` Anton Johansson via
2023-10-16 19:30 ` Anton Johansson
0 siblings, 1 reply; 106+ messages in thread
From: Anton Johansson via @ 2023-10-16 19:30 UTC (permalink / raw)
To: Emmanouil Pitsidianakis; +Cc: qemu-devel, Alessandro Di Federico
On 13/10/23, Emmanouil Pitsidianakis wrote:
> In preparation of raising -Wimplicit-fallthrough to 5, replace all
> fall-through comments with the fallthrough attribute pseudo-keyword.
>
> Signed-off-by: Emmanouil Pitsidianakis <manos.pitsidianakis@linaro.org>
> ---
> target/hexagon/idef-parser/parser-helpers.c | 5 +++--
> 1 file changed, 3 insertions(+), 2 deletions(-)
Reviewed-by: Anton Johansson <anjo@rev.ng>
^ permalink raw reply [flat|nested] 106+ messages in thread
* Re: [RFC PATCH v3 37/78] target/hexagon: add fallthrough pseudo-keyword
2023-10-16 19:30 ` Anton Johansson via
@ 2023-10-16 19:30 ` Anton Johansson
0 siblings, 0 replies; 106+ messages in thread
From: Anton Johansson @ 2023-10-16 19:30 UTC (permalink / raw)
To: Emmanouil Pitsidianakis; +Cc: qemu-devel, Alessandro Di Federico
On 13/10/23, Emmanouil Pitsidianakis wrote:
> In preparation of raising -Wimplicit-fallthrough to 5, replace all
> fall-through comments with the fallthrough attribute pseudo-keyword.
>
> Signed-off-by: Emmanouil Pitsidianakis <manos.pitsidianakis@linaro.org>
> ---
> target/hexagon/idef-parser/parser-helpers.c | 5 +++--
> 1 file changed, 3 insertions(+), 2 deletions(-)
Reviewed-by: Anton Johansson <anjo@rev.ng>
^ permalink raw reply [flat|nested] 106+ messages in thread
* [RFC PATCH v3 38/78] system/rtc.c: add fallthrough pseudo-keyword
2023-10-13 8:45 [RFC PATCH v3 00/78] Strict disable implicit fallthrough Emmanouil Pitsidianakis
` (36 preceding siblings ...)
2023-10-13 8:46 ` [RFC PATCH v3 37/78] target/hexagon: " Emmanouil Pitsidianakis
@ 2023-10-13 8:46 ` Emmanouil Pitsidianakis
2023-10-13 8:46 ` [RFC PATCH v3 39/78] hw/scsi: " Emmanouil Pitsidianakis
` (41 subsequent siblings)
79 siblings, 0 replies; 106+ messages in thread
From: Emmanouil Pitsidianakis @ 2023-10-13 8:46 UTC (permalink / raw)
To: qemu-devel; +Cc: Emmanouil Pitsidianakis
In preparation of raising -Wimplicit-fallthrough to 5, replace all
fall-through comments with the fallthrough attribute pseudo-keyword.
Signed-off-by: Emmanouil Pitsidianakis <manos.pitsidianakis@linaro.org>
---
system/rtc.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/system/rtc.c b/system/rtc.c
index 4904581abe..bb406542c8 100644
--- a/system/rtc.c
+++ b/system/rtc.c
@@ -53,7 +53,7 @@ static time_t qemu_ref_timedate(QEMUClockType clock)
switch (clock) {
case QEMU_CLOCK_REALTIME:
value -= rtc_realtime_clock_offset;
- /* fall through */
+ fallthrough;
case QEMU_CLOCK_VIRTUAL:
value += rtc_ref_start_datetime;
break;
--
2.39.2
^ permalink raw reply related [flat|nested] 106+ messages in thread
* [RFC PATCH v3 39/78] hw/scsi: add fallthrough pseudo-keyword
2023-10-13 8:45 [RFC PATCH v3 00/78] Strict disable implicit fallthrough Emmanouil Pitsidianakis
` (37 preceding siblings ...)
2023-10-13 8:46 ` [RFC PATCH v3 38/78] system/rtc.c: " Emmanouil Pitsidianakis
@ 2023-10-13 8:46 ` Emmanouil Pitsidianakis
2023-10-13 8:46 ` [RFC PATCH v3 40/78] hw/sd/sdhci.c: " Emmanouil Pitsidianakis
` (40 subsequent siblings)
79 siblings, 0 replies; 106+ messages in thread
From: Emmanouil Pitsidianakis @ 2023-10-13 8:46 UTC (permalink / raw)
To: qemu-devel
Cc: Emmanouil Pitsidianakis, Paolo Bonzini, Fam Zheng,
Hannes Reinecke, open list:megasas
In preparation of raising -Wimplicit-fallthrough to 5, replace all
fall-through comments with the fallthrough attribute pseudo-keyword.
Signed-off-by: Emmanouil Pitsidianakis <manos.pitsidianakis@linaro.org>
---
hw/scsi/esp.c | 2 +-
hw/scsi/megasas.c | 2 +-
hw/scsi/scsi-bus.c | 4 ++--
hw/scsi/scsi-disk.c | 2 +-
4 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/hw/scsi/esp.c b/hw/scsi/esp.c
index 9b11d8c573..d6c8298f51 100644
--- a/hw/scsi/esp.c
+++ b/hw/scsi/esp.c
@@ -1025,7 +1025,7 @@ void esp_reg_write(ESPState *s, uint32_t saddr, uint64_t val)
switch (saddr) {
case ESP_TCHI:
s->tchi_written = true;
- /* fall through */
+ fallthrough;
case ESP_TCLO:
case ESP_TCMID:
s->rregs[ESP_RSTAT] &= ~STAT_TC;
diff --git a/hw/scsi/megasas.c b/hw/scsi/megasas.c
index 32c70c9e99..54e4d7c8b6 100644
--- a/hw/scsi/megasas.c
+++ b/hw/scsi/megasas.c
@@ -2151,7 +2151,7 @@ static void megasas_mmio_write(void *opaque, hwaddr addr,
case MFI_IQPL:
trace_megasas_mmio_writel("MFI_IQPL", val);
/* Received low 32 bits of a 64 bit MFI frame address */
- /* Fallthrough */
+ fallthrough;
case MFI_IQP:
if (addr == MFI_IQP) {
trace_megasas_mmio_writel("MFI_IQP", val);
diff --git a/hw/scsi/scsi-bus.c b/hw/scsi/scsi-bus.c
index fc4b77fdb0..a1c298a92c 100644
--- a/hw/scsi/scsi-bus.c
+++ b/hw/scsi/scsi-bus.c
@@ -1078,7 +1078,7 @@ static int scsi_req_xfer(SCSICommand *cmd, SCSIDevice *dev, uint8_t *buf)
if (cmd->xfer == 0) {
cmd->xfer = 256;
}
- /* fall through */
+ fallthrough;
case WRITE_10:
case WRITE_VERIFY_10:
case WRITE_12:
@@ -1093,7 +1093,7 @@ static int scsi_req_xfer(SCSICommand *cmd, SCSIDevice *dev, uint8_t *buf)
if (cmd->xfer == 0) {
cmd->xfer = 256;
}
- /* fall through */
+ fallthrough;
case READ_10:
case READ_12:
case READ_16:
diff --git a/hw/scsi/scsi-disk.c b/hw/scsi/scsi-disk.c
index 6691f5edb8..6564ca638c 100644
--- a/hw/scsi/scsi-disk.c
+++ b/hw/scsi/scsi-disk.c
@@ -2302,7 +2302,7 @@ static int32_t scsi_disk_dma_command(SCSIRequest *req, uint8_t *buf)
trace_scsi_disk_dma_command_WRITE(
(command & 0xe) == 0xe ? "And Verify " : "",
r->req.cmd.lba, len);
- /* fall through */
+ fallthrough;
case VERIFY_10:
case VERIFY_12:
case VERIFY_16:
--
2.39.2
^ permalink raw reply related [flat|nested] 106+ messages in thread
* [RFC PATCH v3 40/78] hw/sd/sdhci.c: add fallthrough pseudo-keyword
2023-10-13 8:45 [RFC PATCH v3 00/78] Strict disable implicit fallthrough Emmanouil Pitsidianakis
` (38 preceding siblings ...)
2023-10-13 8:46 ` [RFC PATCH v3 39/78] hw/scsi: " Emmanouil Pitsidianakis
@ 2023-10-13 8:46 ` Emmanouil Pitsidianakis
2023-10-17 10:31 ` Philippe Mathieu-Daudé
2023-10-13 8:46 ` [RFC PATCH v3 41/78] linux-user: " Emmanouil Pitsidianakis
` (39 subsequent siblings)
79 siblings, 1 reply; 106+ messages in thread
From: Emmanouil Pitsidianakis @ 2023-10-13 8:46 UTC (permalink / raw)
To: qemu-devel
Cc: Emmanouil Pitsidianakis, Philippe Mathieu-Daudé, Bin Meng,
open list:SD (Secure Card)
In preparation of raising -Wimplicit-fallthrough to 5, replace all
fall-through comments with the fallthrough attribute pseudo-keyword.
Signed-off-by: Emmanouil Pitsidianakis <manos.pitsidianakis@linaro.org>
---
hw/sd/sdhci.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/hw/sd/sdhci.c b/hw/sd/sdhci.c
index 5564765a9b..5c641d24de 100644
--- a/hw/sd/sdhci.c
+++ b/hw/sd/sdhci.c
@@ -92,7 +92,7 @@ static void sdhci_check_capareg(SDHCIState *s, Error **errp)
trace_sdhci_capareg("ADMA3", val);
msk = FIELD_DP64(msk, SDHC_CAPAB, ADMA3, 0);
- /* fallthrough */
+ fallthrough;
case 3:
val = FIELD_EX64(s->capareg, SDHC_CAPAB, ASYNC_INT);
trace_sdhci_capareg("async interrupt", val);
@@ -136,7 +136,7 @@ static void sdhci_check_capareg(SDHCIState *s, Error **errp)
trace_sdhci_capareg("clock multiplier", val);
msk = FIELD_DP64(msk, SDHC_CAPAB, CLOCK_MULT, 0);
- /* fallthrough */
+ fallthrough;
case 2: /* default version */
val = FIELD_EX64(s->capareg, SDHC_CAPAB, ADMA2);
trace_sdhci_capareg("ADMA2", val);
@@ -150,7 +150,7 @@ static void sdhci_check_capareg(SDHCIState *s, Error **errp)
trace_sdhci_capareg("64-bit system bus (v3)", val);
msk = FIELD_DP64(msk, SDHC_CAPAB, BUS64BIT, 0);
- /* fallthrough */
+ fallthrough;
case 1:
y = FIELD_EX64(s->capareg, SDHC_CAPAB, TOUNIT);
msk = FIELD_DP64(msk, SDHC_CAPAB, TOUNIT, 0);
@@ -1839,7 +1839,7 @@ usdhc_write(void *opaque, hwaddr offset, uint64_t val, unsigned size)
* so we artificially set it to that value.
*/
val |= 0x7 << 12;
- /* FALLTHROUGH */
+ fallthrough;
default:
sdhci_write(opaque, offset, val, size);
break;
--
2.39.2
^ permalink raw reply related [flat|nested] 106+ messages in thread
* Re: [RFC PATCH v3 40/78] hw/sd/sdhci.c: add fallthrough pseudo-keyword
2023-10-13 8:46 ` [RFC PATCH v3 40/78] hw/sd/sdhci.c: " Emmanouil Pitsidianakis
@ 2023-10-17 10:31 ` Philippe Mathieu-Daudé
0 siblings, 0 replies; 106+ messages in thread
From: Philippe Mathieu-Daudé @ 2023-10-17 10:31 UTC (permalink / raw)
To: Emmanouil Pitsidianakis, qemu-devel; +Cc: Bin Meng, open list:SD (Secure Card)
On 13/10/23 10:46, Emmanouil Pitsidianakis wrote:
> In preparation of raising -Wimplicit-fallthrough to 5, replace all
> fall-through comments with the fallthrough attribute pseudo-keyword.
>
> Signed-off-by: Emmanouil Pitsidianakis <manos.pitsidianakis@linaro.org>
> ---
> hw/sd/sdhci.c | 8 ++++----
> 1 file changed, 4 insertions(+), 4 deletions(-)
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
^ permalink raw reply [flat|nested] 106+ messages in thread
* [RFC PATCH v3 41/78] linux-user: add fallthrough pseudo-keyword
2023-10-13 8:45 [RFC PATCH v3 00/78] Strict disable implicit fallthrough Emmanouil Pitsidianakis
` (39 preceding siblings ...)
2023-10-13 8:46 ` [RFC PATCH v3 40/78] hw/sd/sdhci.c: " Emmanouil Pitsidianakis
@ 2023-10-13 8:46 ` Emmanouil Pitsidianakis
2023-10-13 8:46 ` [RFC PATCH v3 42/78] hw/i386: " Emmanouil Pitsidianakis
` (38 subsequent siblings)
79 siblings, 0 replies; 106+ messages in thread
From: Emmanouil Pitsidianakis @ 2023-10-13 8:46 UTC (permalink / raw)
To: qemu-devel; +Cc: Emmanouil Pitsidianakis, Laurent Vivier
In preparation of raising -Wimplicit-fallthrough to 5, replace all
fall-through comments with the fallthrough attribute pseudo-keyword.
Signed-off-by: Emmanouil Pitsidianakis <manos.pitsidianakis@linaro.org>
---
linux-user/mips/cpu_loop.c | 8 ++++----
linux-user/mmap.c | 2 +-
linux-user/syscall.c | 2 +-
3 files changed, 6 insertions(+), 6 deletions(-)
diff --git a/linux-user/mips/cpu_loop.c b/linux-user/mips/cpu_loop.c
index 8735e58bad..38ddcadfc6 100644
--- a/linux-user/mips/cpu_loop.c
+++ b/linux-user/mips/cpu_loop.c
@@ -102,22 +102,22 @@ void cpu_loop(CPUMIPSState *env)
if ((ret = get_user_ual(arg8, sp_reg + 28)) != 0) {
goto done_syscall;
}
- /* fall through */
+ fallthrough;
case 7:
if ((ret = get_user_ual(arg7, sp_reg + 24)) != 0) {
goto done_syscall;
}
- /* fall through */
+ fallthrough;
case 6:
if ((ret = get_user_ual(arg6, sp_reg + 20)) != 0) {
goto done_syscall;
}
- /* fall through */
+ fallthrough;
case 5:
if ((ret = get_user_ual(arg5, sp_reg + 16)) != 0) {
goto done_syscall;
}
- /* fall through */
+ fallthrough;
default:
break;
}
diff --git a/linux-user/mmap.c b/linux-user/mmap.c
index 8ccaab7859..ff33b4ccf6 100644
--- a/linux-user/mmap.c
+++ b/linux-user/mmap.c
@@ -1012,7 +1012,7 @@ abi_long target_madvise(abi_ulong start, abi_ulong len_in, int advice)
case MADV_WIPEONFORK:
case MADV_KEEPONFORK:
ret = -EINVAL;
- /* fall through */
+ fallthrough;
case MADV_DONTNEED:
if (page_check_range(start, len, PAGE_PASSTHROUGH)) {
ret = get_errno(madvise(g2h_untagged(start), len, advice));
diff --git a/linux-user/syscall.c b/linux-user/syscall.c
index d49cd314a2..d15817846c 100644
--- a/linux-user/syscall.c
+++ b/linux-user/syscall.c
@@ -7782,7 +7782,7 @@ static int do_futex(CPUState *cpu, bool time64, target_ulong uaddr,
case FUTEX_CMP_REQUEUE:
case FUTEX_CMP_REQUEUE_PI:
val3 = tswap32(val3);
- /* fall through */
+ fallthrough;
case FUTEX_REQUEUE:
case FUTEX_WAKE_OP:
/*
--
2.39.2
^ permalink raw reply related [flat|nested] 106+ messages in thread
* [RFC PATCH v3 42/78] hw/i386: add fallthrough pseudo-keyword
2023-10-13 8:45 [RFC PATCH v3 00/78] Strict disable implicit fallthrough Emmanouil Pitsidianakis
` (40 preceding siblings ...)
2023-10-13 8:46 ` [RFC PATCH v3 41/78] linux-user: " Emmanouil Pitsidianakis
@ 2023-10-13 8:46 ` Emmanouil Pitsidianakis
2023-10-17 12:38 ` Paul Durrant
2023-10-13 8:46 ` [RFC PATCH v3 43/78] hw/misc: " Emmanouil Pitsidianakis
` (37 subsequent siblings)
79 siblings, 1 reply; 106+ messages in thread
From: Emmanouil Pitsidianakis @ 2023-10-13 8:46 UTC (permalink / raw)
To: qemu-devel
Cc: Emmanouil Pitsidianakis, Michael S. Tsirkin, Peter Xu, Jason Wang,
Paolo Bonzini, Richard Henderson, Eduardo Habkost,
Marcel Apfelbaum, David Woodhouse, Paul Durrant
In preparation of raising -Wimplicit-fallthrough to 5, replace all
fall-through comments with the fallthrough attribute pseudo-keyword.
Signed-off-by: Emmanouil Pitsidianakis <manos.pitsidianakis@linaro.org>
---
hw/i386/intel_iommu.c | 4 ++--
hw/i386/kvm/xen_evtchn.c | 2 +-
hw/i386/x86.c | 2 +-
3 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/hw/i386/intel_iommu.c b/hw/i386/intel_iommu.c
index 2c832ab68b..bdb2ea3ac5 100644
--- a/hw/i386/intel_iommu.c
+++ b/hw/i386/intel_iommu.c
@@ -2108,7 +2108,7 @@ static uint64_t vtd_context_cache_invalidate(IntelIOMMUState *s, uint64_t val)
switch (type) {
case VTD_CCMD_DOMAIN_INVL:
- /* Fall through */
+ fallthrough;
case VTD_CCMD_GLOBAL_INVL:
caig = VTD_CCMD_GLOBAL_INVL_A;
vtd_context_global_invalidate(s);
@@ -2525,7 +2525,7 @@ static bool vtd_process_context_cache_desc(IntelIOMMUState *s,
case VTD_INV_DESC_CC_DOMAIN:
trace_vtd_inv_desc_cc_domain(
(uint16_t)VTD_INV_DESC_CC_DID(inv_desc->lo));
- /* Fall through */
+ fallthrough;
case VTD_INV_DESC_CC_GLOBAL:
vtd_context_global_invalidate(s);
break;
diff --git a/hw/i386/kvm/xen_evtchn.c b/hw/i386/kvm/xen_evtchn.c
index a731738411..d15e324f6e 100644
--- a/hw/i386/kvm/xen_evtchn.c
+++ b/hw/i386/kvm/xen_evtchn.c
@@ -2068,7 +2068,7 @@ int xen_be_evtchn_bind_interdomain(struct xenevtchn_handle *xc, uint32_t domid,
}
break;
}
- /* fall through */
+ fallthrough;
case EVTCHNSTAT_unbound:
be_port = find_be_port(s, xc);
diff --git a/hw/i386/x86.c b/hw/i386/x86.c
index b3d054889b..c1fd0a966a 100644
--- a/hw/i386/x86.c
+++ b/hw/i386/x86.c
@@ -605,7 +605,7 @@ void gsi_handler(void *opaque, int n, int level)
/* Under KVM, Kernel will forward to both PIC and IOAPIC */
qemu_set_irq(s->i8259_irq[n], level);
}
- /* fall through */
+ fallthrough;
case ISA_NUM_IRQS ... IOAPIC_NUM_PINS - 1:
#ifdef CONFIG_XEN_EMU
/*
--
2.39.2
^ permalink raw reply related [flat|nested] 106+ messages in thread
* Re: [RFC PATCH v3 42/78] hw/i386: add fallthrough pseudo-keyword
2023-10-13 8:46 ` [RFC PATCH v3 42/78] hw/i386: " Emmanouil Pitsidianakis
@ 2023-10-17 12:38 ` Paul Durrant
0 siblings, 0 replies; 106+ messages in thread
From: Paul Durrant @ 2023-10-17 12:38 UTC (permalink / raw)
To: Emmanouil Pitsidianakis, qemu-devel
Cc: Michael S. Tsirkin, Peter Xu, Jason Wang, Paolo Bonzini,
Richard Henderson, Eduardo Habkost, Marcel Apfelbaum,
David Woodhouse
On 13/10/2023 09:46, Emmanouil Pitsidianakis wrote:
> In preparation of raising -Wimplicit-fallthrough to 5, replace all
> fall-through comments with the fallthrough attribute pseudo-keyword.
>
> Signed-off-by: Emmanouil Pitsidianakis <manos.pitsidianakis@linaro.org>
> ---
> hw/i386/intel_iommu.c | 4 ++--
> hw/i386/kvm/xen_evtchn.c | 2 +-
Reviewed-by: Paul Durrant <paul@xen.org>
> hw/i386/x86.c | 2 +-
> 3 files changed, 4 insertions(+), 4 deletions(-)
>
^ permalink raw reply [flat|nested] 106+ messages in thread
* [RFC PATCH v3 43/78] hw/misc: add fallthrough pseudo-keyword
2023-10-13 8:45 [RFC PATCH v3 00/78] Strict disable implicit fallthrough Emmanouil Pitsidianakis
` (41 preceding siblings ...)
2023-10-13 8:46 ` [RFC PATCH v3 42/78] hw/i386: " Emmanouil Pitsidianakis
@ 2023-10-13 8:46 ` Emmanouil Pitsidianakis
2023-10-13 8:46 ` [RFC PATCH v3 44/78] hw/m68k/mcf_intc.c: " Emmanouil Pitsidianakis
` (36 subsequent siblings)
79 siblings, 0 replies; 106+ messages in thread
From: Emmanouil Pitsidianakis @ 2023-10-13 8:46 UTC (permalink / raw)
To: qemu-devel
Cc: Emmanouil Pitsidianakis, Cédric Le Goater, Peter Maydell,
Andrew Jeffery, Joel Stanley, Philippe Mathieu-Daudé,
Mark Cave-Ayland, open list:ARM cores,
open list:New World (mac99)
In preparation of raising -Wimplicit-fallthrough to 5, replace all
fall-through comments with the fallthrough attribute pseudo-keyword.
(Cédric Le Goater review for aspeed_scu.c)
Reviewed-by: Cédric Le Goater <clg@kaod.org>
Signed-off-by: Emmanouil Pitsidianakis <manos.pitsidianakis@linaro.org>
---
hw/misc/a9scu.c | 2 ++
hw/misc/aspeed_scu.c | 2 +-
hw/misc/bcm2835_property.c | 12 ++++++------
hw/misc/mos6522.c | 4 ++--
4 files changed, 11 insertions(+), 9 deletions(-)
diff --git a/hw/misc/a9scu.c b/hw/misc/a9scu.c
index a375ebc987..b422bec3c4 100644
--- a/hw/misc/a9scu.c
+++ b/hw/misc/a9scu.c
@@ -38,6 +38,7 @@ static uint64_t a9_scu_read(void *opaque, hwaddr offset,
case 0x50: /* SCU Access Control Register */
case 0x54: /* SCU Non-secure Access Control Register */
/* unimplemented, fall through */
+ fallthrough;
default:
qemu_log_mask(LOG_UNIMP, "%s: Unsupported offset 0x%"HWADDR_PRIx"\n",
__func__, offset);
@@ -69,6 +70,7 @@ static void a9_scu_write(void *opaque, hwaddr offset,
case 0x50: /* SCU Access Control Register */
case 0x54: /* SCU Non-secure Access Control Register */
/* unimplemented, fall through */
+ fallthrough;
default:
qemu_log_mask(LOG_UNIMP, "%s: Unsupported offset 0x%"HWADDR_PRIx
" value 0x%"PRIx64"\n",
diff --git a/hw/misc/aspeed_scu.c b/hw/misc/aspeed_scu.c
index 8335364906..4a1ea2fa21 100644
--- a/hw/misc/aspeed_scu.c
+++ b/hw/misc/aspeed_scu.c
@@ -672,7 +672,7 @@ static void aspeed_ast2600_scu_write(void *opaque, hwaddr offset,
if (s->regs[reg + 2]) {
return;
}
- /* fall through */
+ fallthrough;
case AST2600_SYS_RST_CTRL:
case AST2600_SYS_RST_CTRL2:
case AST2600_CLK_STOP_CTRL:
diff --git a/hw/misc/bcm2835_property.c b/hw/misc/bcm2835_property.c
index 4ed9faa54a..98170f34a6 100644
--- a/hw/misc/bcm2835_property.c
+++ b/hw/misc/bcm2835_property.c
@@ -182,7 +182,7 @@ static void bcm2835_property_mbox_push(BCM2835PropertyState *s, uint32_t value)
fbconfig.yres = ldl_le_phys(&s->dma_as, value + 16);
bcm2835_fb_validate_config(&fbconfig);
fbconfig_updated = true;
- /* fall through */
+ fallthrough;
case RPI_FWREQ_FRAMEBUFFER_GET_PHYSICAL_WIDTH_HEIGHT:
stl_le_phys(&s->dma_as, value + 12, fbconfig.xres);
stl_le_phys(&s->dma_as, value + 16, fbconfig.yres);
@@ -193,7 +193,7 @@ static void bcm2835_property_mbox_push(BCM2835PropertyState *s, uint32_t value)
fbconfig.yres_virtual = ldl_le_phys(&s->dma_as, value + 16);
bcm2835_fb_validate_config(&fbconfig);
fbconfig_updated = true;
- /* fall through */
+ fallthrough;
case RPI_FWREQ_FRAMEBUFFER_GET_VIRTUAL_WIDTH_HEIGHT:
stl_le_phys(&s->dma_as, value + 12, fbconfig.xres_virtual);
stl_le_phys(&s->dma_as, value + 16, fbconfig.yres_virtual);
@@ -206,7 +206,7 @@ static void bcm2835_property_mbox_push(BCM2835PropertyState *s, uint32_t value)
fbconfig.bpp = ldl_le_phys(&s->dma_as, value + 12);
bcm2835_fb_validate_config(&fbconfig);
fbconfig_updated = true;
- /* fall through */
+ fallthrough;
case RPI_FWREQ_FRAMEBUFFER_GET_DEPTH:
stl_le_phys(&s->dma_as, value + 12, fbconfig.bpp);
resplen = 4;
@@ -218,7 +218,7 @@ static void bcm2835_property_mbox_push(BCM2835PropertyState *s, uint32_t value)
fbconfig.pixo = ldl_le_phys(&s->dma_as, value + 12);
bcm2835_fb_validate_config(&fbconfig);
fbconfig_updated = true;
- /* fall through */
+ fallthrough;
case RPI_FWREQ_FRAMEBUFFER_GET_PIXEL_ORDER:
stl_le_phys(&s->dma_as, value + 12, fbconfig.pixo);
resplen = 4;
@@ -230,7 +230,7 @@ static void bcm2835_property_mbox_push(BCM2835PropertyState *s, uint32_t value)
fbconfig.alpha = ldl_le_phys(&s->dma_as, value + 12);
bcm2835_fb_validate_config(&fbconfig);
fbconfig_updated = true;
- /* fall through */
+ fallthrough;
case RPI_FWREQ_FRAMEBUFFER_GET_ALPHA_MODE:
stl_le_phys(&s->dma_as, value + 12, fbconfig.alpha);
resplen = 4;
@@ -248,7 +248,7 @@ static void bcm2835_property_mbox_push(BCM2835PropertyState *s, uint32_t value)
fbconfig.yoffset = ldl_le_phys(&s->dma_as, value + 16);
bcm2835_fb_validate_config(&fbconfig);
fbconfig_updated = true;
- /* fall through */
+ fallthrough;
case RPI_FWREQ_FRAMEBUFFER_GET_VIRTUAL_OFFSET:
stl_le_phys(&s->dma_as, value + 12, fbconfig.xoffset);
stl_le_phys(&s->dma_as, value + 16, fbconfig.yoffset);
diff --git a/hw/misc/mos6522.c b/hw/misc/mos6522.c
index d6ba47bde9..a62349e6a0 100644
--- a/hw/misc/mos6522.c
+++ b/hw/misc/mos6522.c
@@ -320,7 +320,7 @@ uint64_t mos6522_read(void *opaque, hwaddr addr, unsigned size)
break;
case VIA_REG_A:
qemu_log_mask(LOG_UNIMP, "Read access to register A with handshake");
- /* fall through */
+ fallthrough;
case VIA_REG_ANH:
val = s->a;
ctrl = (s->pcr & CA2_CTRL_MASK) >> CA2_CTRL_SHIFT;
@@ -412,7 +412,7 @@ void mos6522_write(void *opaque, hwaddr addr, uint64_t val, unsigned size)
break;
case VIA_REG_A:
qemu_log_mask(LOG_UNIMP, "Write access to register A with handshake");
- /* fall through */
+ fallthrough;
case VIA_REG_ANH:
s->a = (s->a & ~s->dira) | (val & s->dira);
mdc->portA_write(s);
--
2.39.2
^ permalink raw reply related [flat|nested] 106+ messages in thread
* [RFC PATCH v3 44/78] hw/m68k/mcf_intc.c: add fallthrough pseudo-keyword
2023-10-13 8:45 [RFC PATCH v3 00/78] Strict disable implicit fallthrough Emmanouil Pitsidianakis
` (42 preceding siblings ...)
2023-10-13 8:46 ` [RFC PATCH v3 43/78] hw/misc: " Emmanouil Pitsidianakis
@ 2023-10-13 8:46 ` Emmanouil Pitsidianakis
2023-10-13 8:46 ` [RFC PATCH v3 45/78] hw/dma: " Emmanouil Pitsidianakis
` (35 subsequent siblings)
79 siblings, 0 replies; 106+ messages in thread
From: Emmanouil Pitsidianakis @ 2023-10-13 8:46 UTC (permalink / raw)
To: qemu-devel; +Cc: Emmanouil Pitsidianakis, Thomas Huth
In preparation of raising -Wimplicit-fallthrough to 5, replace all
fall-through comments with the fallthrough attribute pseudo-keyword.
Signed-off-by: Emmanouil Pitsidianakis <manos.pitsidianakis@linaro.org>
---
hw/m68k/mcf_intc.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/hw/m68k/mcf_intc.c b/hw/m68k/mcf_intc.c
index 4cd30188c0..9556a0ccb7 100644
--- a/hw/m68k/mcf_intc.c
+++ b/hw/m68k/mcf_intc.c
@@ -84,7 +84,7 @@ static uint64_t mcf_intc_read(void *opaque, hwaddr addr,
/* LnIACK */
qemu_log_mask(LOG_UNIMP, "%s: LnIACK not implemented (offset 0x%02x)\n",
__func__, offset);
- /* fallthru */
+ fallthrough;
default:
return 0;
}
--
2.39.2
^ permalink raw reply related [flat|nested] 106+ messages in thread
* [RFC PATCH v3 45/78] hw/dma: add fallthrough pseudo-keyword
2023-10-13 8:45 [RFC PATCH v3 00/78] Strict disable implicit fallthrough Emmanouil Pitsidianakis
` (43 preceding siblings ...)
2023-10-13 8:46 ` [RFC PATCH v3 44/78] hw/m68k/mcf_intc.c: " Emmanouil Pitsidianakis
@ 2023-10-13 8:46 ` Emmanouil Pitsidianakis
2023-10-13 8:46 ` [RFC PATCH v3 46/78] disas: " Emmanouil Pitsidianakis
` (34 subsequent siblings)
79 siblings, 0 replies; 106+ messages in thread
From: Emmanouil Pitsidianakis @ 2023-10-13 8:46 UTC (permalink / raw)
To: qemu-devel
Cc: Emmanouil Pitsidianakis, Peter Maydell, Mark Cave-Ayland,
open list:OMAP
In preparation of raising -Wimplicit-fallthrough to 5, replace all
fall-through comments with the fallthrough attribute pseudo-keyword.
Signed-off-by: Emmanouil Pitsidianakis <manos.pitsidianakis@linaro.org>
---
hw/dma/omap_dma.c | 32 ++++++++++++++++----------------
hw/dma/pxa2xx_dma.c | 4 ++--
hw/dma/sparc32_dma.c | 2 +-
3 files changed, 19 insertions(+), 19 deletions(-)
diff --git a/hw/dma/omap_dma.c b/hw/dma/omap_dma.c
index 77797a67b5..dd43dbf3d2 100644
--- a/hw/dma/omap_dma.c
+++ b/hw/dma/omap_dma.c
@@ -1471,7 +1471,7 @@ static uint64_t omap_dma_read(void *opaque, hwaddr addr, unsigned size)
break;
return ret;
}
- /* Fall through. */
+ fallthrough;
case 0x000 ... 0x2fe:
reg = addr & 0x3f;
ch = (addr >> 6) & 0x0f;
@@ -1482,7 +1482,7 @@ static uint64_t omap_dma_read(void *opaque, hwaddr addr, unsigned size)
case 0x404 ... 0x4fe:
if (s->model <= omap_dma_3_1)
break;
- /* Fall through. */
+ fallthrough;
case 0x400:
if (omap_dma_sys_read(s, addr, &ret))
break;
@@ -1519,7 +1519,7 @@ static void omap_dma_write(void *opaque, hwaddr addr,
break;
return;
}
- /* Fall through. */
+ fallthrough;
case 0x000 ... 0x2fe:
reg = addr & 0x3f;
ch = (addr >> 6) & 0x0f;
@@ -1530,7 +1530,7 @@ static void omap_dma_write(void *opaque, hwaddr addr,
case 0x404 ... 0x4fe:
if (s->model <= omap_dma_3_1)
break;
- /* fall through */
+ fallthrough;
case 0x400:
if (omap_dma_sys_write(s, addr, value))
break;
@@ -1716,25 +1716,25 @@ static uint64_t omap_dma4_read(void *opaque, hwaddr addr,
case 0x14: /* DMA4_IRQSTATUS_L3 */
irqn ++;
- /* fall through */
+ fallthrough;
case 0x10: /* DMA4_IRQSTATUS_L2 */
irqn ++;
- /* fall through */
+ fallthrough;
case 0x0c: /* DMA4_IRQSTATUS_L1 */
irqn ++;
- /* fall through */
+ fallthrough;
case 0x08: /* DMA4_IRQSTATUS_L0 */
return s->irqstat[irqn];
case 0x24: /* DMA4_IRQENABLE_L3 */
irqn ++;
- /* fall through */
+ fallthrough;
case 0x20: /* DMA4_IRQENABLE_L2 */
irqn ++;
- /* fall through */
+ fallthrough;
case 0x1c: /* DMA4_IRQENABLE_L1 */
irqn ++;
- /* fall through */
+ fallthrough;
case 0x18: /* DMA4_IRQENABLE_L0 */
return s->irqen[irqn];
@@ -1870,13 +1870,13 @@ static void omap_dma4_write(void *opaque, hwaddr addr,
switch (addr) {
case 0x14: /* DMA4_IRQSTATUS_L3 */
irqn ++;
- /* fall through */
+ fallthrough;
case 0x10: /* DMA4_IRQSTATUS_L2 */
irqn ++;
- /* fall through */
+ fallthrough;
case 0x0c: /* DMA4_IRQSTATUS_L1 */
irqn ++;
- /* fall through */
+ fallthrough;
case 0x08: /* DMA4_IRQSTATUS_L0 */
s->irqstat[irqn] &= ~value;
if (!s->irqstat[irqn])
@@ -1885,13 +1885,13 @@ static void omap_dma4_write(void *opaque, hwaddr addr,
case 0x24: /* DMA4_IRQENABLE_L3 */
irqn ++;
- /* fall through */
+ fallthrough;
case 0x20: /* DMA4_IRQENABLE_L2 */
irqn ++;
- /* fall through */
+ fallthrough;
case 0x1c: /* DMA4_IRQENABLE_L1 */
irqn ++;
- /* fall through */
+ fallthrough;
case 0x18: /* DMA4_IRQENABLE_L0 */
s->irqen[irqn] = value;
return;
diff --git a/hw/dma/pxa2xx_dma.c b/hw/dma/pxa2xx_dma.c
index fa896f7edf..ac47256572 100644
--- a/hw/dma/pxa2xx_dma.c
+++ b/hw/dma/pxa2xx_dma.c
@@ -278,7 +278,7 @@ static uint64_t pxa2xx_dma_read(void *opaque, hwaddr offset,
switch (offset) {
case DRCMR64 ... DRCMR74:
offset -= DRCMR64 - DRCMR0 - (64 << 2);
- /* Fall through */
+ fallthrough;
case DRCMR0 ... DRCMR63:
channel = (offset - DRCMR0) >> 2;
return s->req[channel];
@@ -338,7 +338,7 @@ static void pxa2xx_dma_write(void *opaque, hwaddr offset,
switch (offset) {
case DRCMR64 ... DRCMR74:
offset -= DRCMR64 - DRCMR0 - (64 << 2);
- /* Fall through */
+ fallthrough;
case DRCMR0 ... DRCMR63:
channel = (offset - DRCMR0) >> 2;
diff --git a/hw/dma/sparc32_dma.c b/hw/dma/sparc32_dma.c
index 0ef13c5e9a..c68e068cc9 100644
--- a/hw/dma/sparc32_dma.c
+++ b/hw/dma/sparc32_dma.c
@@ -220,7 +220,7 @@ static void dma_mem_write(void *opaque, hwaddr addr,
break;
case 1:
s->dmaregs[0] |= DMA_LOADED;
- /* fall through */
+ fallthrough;
default:
s->dmaregs[saddr] = val;
break;
--
2.39.2
^ permalink raw reply related [flat|nested] 106+ messages in thread
* [RFC PATCH v3 46/78] disas: add fallthrough pseudo-keyword
2023-10-13 8:45 [RFC PATCH v3 00/78] Strict disable implicit fallthrough Emmanouil Pitsidianakis
` (44 preceding siblings ...)
2023-10-13 8:46 ` [RFC PATCH v3 45/78] hw/dma: " Emmanouil Pitsidianakis
@ 2023-10-13 8:46 ` Emmanouil Pitsidianakis
2023-10-13 8:46 ` [RFC PATCH v3 47/78] contrib/rdmacm-mux: " Emmanouil Pitsidianakis
` (33 subsequent siblings)
79 siblings, 0 replies; 106+ messages in thread
From: Emmanouil Pitsidianakis @ 2023-10-13 8:46 UTC (permalink / raw)
To: qemu-devel
Cc: Emmanouil Pitsidianakis, Richard Henderson, Laurent Vivier,
Yoshinori Sato, Mark Cave-Ayland, Artyom Tarasenko
In preparation of raising -Wimplicit-fallthrough to 5, replace all
fall-through comments with the fallthrough attribute pseudo-keyword.
Signed-off-by: Emmanouil Pitsidianakis <manos.pitsidianakis@linaro.org>
---
disas/hppa.c | 4 ++--
disas/m68k.c | 2 +-
disas/sh4.c | 6 +++---
disas/sparc.c | 2 +-
4 files changed, 7 insertions(+), 7 deletions(-)
diff --git a/disas/hppa.c b/disas/hppa.c
index dcf9a47f34..1a2bdb8d39 100644
--- a/disas/hppa.c
+++ b/disas/hppa.c
@@ -2027,7 +2027,7 @@ print_insn_hppa (bfd_vma memaddr, disassemble_info *info)
completer. */
case 'X':
fputs_filtered (" ", info);
- /* FALLTHRU */
+ fallthrough;
case 'A':
if (GET_FIELD (insn, 24, 24))
@@ -2104,7 +2104,7 @@ print_insn_hppa (bfd_vma memaddr, disassemble_info *info)
format completer. */
case 'E':
fputs_filtered (" ", info);
- /* FALLTHRU */
+ fallthrough;
case 'e':
if (GET_FIELD (insn, 30, 30))
diff --git a/disas/m68k.c b/disas/m68k.c
index 1f16e295ab..a755951bb7 100644
--- a/disas/m68k.c
+++ b/disas/m68k.c
@@ -1623,7 +1623,7 @@ print_insn_arg (const char *d,
case 'X':
place = '8';
- /* fall through */
+ fallthrough;
case 'Y':
case 'Z':
case 'W':
diff --git a/disas/sh4.c b/disas/sh4.c
index dcdbdf26d8..f7c95407ca 100644
--- a/disas/sh4.c
+++ b/disas/sh4.c
@@ -1757,7 +1757,7 @@ print_insn_sh (bfd_vma memaddr, struct disassemble_info *info)
case REG_N_D:
if ((nibs[n] & 1) != 0)
goto fail;
- /* fall through */
+ fallthrough;
case REG_N:
rn = nibs[n];
break;
@@ -1963,7 +1963,7 @@ print_insn_sh (bfd_vma memaddr, struct disassemble_info *info)
fprintf_fn (stream, "xd%d", rn & ~1);
break;
}
- /* fallthrough */
+ fallthrough;
case D_REG_N:
fprintf_fn (stream, "dr%d", rn);
break;
@@ -1973,7 +1973,7 @@ print_insn_sh (bfd_vma memaddr, struct disassemble_info *info)
fprintf_fn (stream, "xd%d", rm & ~1);
break;
}
- /* fallthrough */
+ fallthrough;
case D_REG_M:
fprintf_fn (stream, "dr%d", rm);
break;
diff --git a/disas/sparc.c b/disas/sparc.c
index 5689533ce1..61139256b0 100644
--- a/disas/sparc.c
+++ b/disas/sparc.c
@@ -2803,7 +2803,7 @@ print_insn_sparc (bfd_vma memaddr, disassemble_info *info)
{
case '+':
found_plus = 1;
- /* Fall through. */
+ fallthrough;
default:
(*info->fprintf_func) (stream, "%c", *s);
--
2.39.2
^ permalink raw reply related [flat|nested] 106+ messages in thread
* [RFC PATCH v3 47/78] contrib/rdmacm-mux: add fallthrough pseudo-keyword
2023-10-13 8:45 [RFC PATCH v3 00/78] Strict disable implicit fallthrough Emmanouil Pitsidianakis
` (45 preceding siblings ...)
2023-10-13 8:46 ` [RFC PATCH v3 46/78] disas: " Emmanouil Pitsidianakis
@ 2023-10-13 8:46 ` Emmanouil Pitsidianakis
2023-10-13 8:46 ` [RFC PATCH v3 48/78] contrib/vhost-user-scsi: " Emmanouil Pitsidianakis
` (32 subsequent siblings)
79 siblings, 0 replies; 106+ messages in thread
From: Emmanouil Pitsidianakis @ 2023-10-13 8:46 UTC (permalink / raw)
To: qemu-devel; +Cc: Emmanouil Pitsidianakis, Yuval Shaia, Marcel Apfelbaum
In preparation of raising -Wimplicit-fallthrough to 5, replace all
fall-through comments with the fallthrough attribute pseudo-keyword.
Signed-off-by: Emmanouil Pitsidianakis <manos.pitsidianakis@linaro.org>
---
contrib/rdmacm-mux/main.c | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/contrib/rdmacm-mux/main.c b/contrib/rdmacm-mux/main.c
index 771ca01e03..dda6917d58 100644
--- a/contrib/rdmacm-mux/main.c
+++ b/contrib/rdmacm-mux/main.c
@@ -342,16 +342,16 @@ static int get_fd(const char *mad, int umad_len, int *fd, __be64 *gid_ifid)
break;
case UMAD_CM_ATTR_REP:
- /* Fall through */
+ fallthrough;
case UMAD_CM_ATTR_REJ:
- /* Fall through */
+ fallthrough;
case UMAD_CM_ATTR_DREQ:
- /* Fall through */
+ fallthrough;
case UMAD_CM_ATTR_DREP:
- /* Fall through */
+ fallthrough;
case UMAD_CM_ATTR_RTU:
data += sizeof(comm_id);
- /* Fall through */
+ fallthrough;
case UMAD_CM_ATTR_SIDR_REP:
if (unlikely(umad_len < sizeof(*hdr) + sizeof(comm_id))) {
rc = -EINVAL;
--
2.39.2
^ permalink raw reply related [flat|nested] 106+ messages in thread
* [RFC PATCH v3 48/78] contrib/vhost-user-scsi: add fallthrough pseudo-keyword
2023-10-13 8:45 [RFC PATCH v3 00/78] Strict disable implicit fallthrough Emmanouil Pitsidianakis
` (46 preceding siblings ...)
2023-10-13 8:46 ` [RFC PATCH v3 47/78] contrib/rdmacm-mux: " Emmanouil Pitsidianakis
@ 2023-10-13 8:46 ` Emmanouil Pitsidianakis
2023-10-13 8:46 ` [RFC PATCH v3 49/78] hw/arm: " Emmanouil Pitsidianakis
` (31 subsequent siblings)
79 siblings, 0 replies; 106+ messages in thread
From: Emmanouil Pitsidianakis @ 2023-10-13 8:46 UTC (permalink / raw)
To: qemu-devel; +Cc: Emmanouil Pitsidianakis, Michael S. Tsirkin, Raphael Norwitz
In preparation of raising -Wimplicit-fallthrough to 5, replace all
fall-through comments with the fallthrough attribute pseudo-keyword.
Signed-off-by: Emmanouil Pitsidianakis <manos.pitsidianakis@linaro.org>
---
contrib/vhost-user-scsi/vhost-user-scsi.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/contrib/vhost-user-scsi/vhost-user-scsi.c b/contrib/vhost-user-scsi/vhost-user-scsi.c
index 9ef61cf5a7..71076f579b 100644
--- a/contrib/vhost-user-scsi/vhost-user-scsi.c
+++ b/contrib/vhost-user-scsi/vhost-user-scsi.c
@@ -112,7 +112,8 @@ static int get_cdb_len(uint8_t *cdb)
switch (cdb[0] >> 5) {
case 0: return 6;
- case 1: /* fall through */
+ case 1:
+ fallthrough;
case 2: return 10;
case 4: return 16;
case 5: return 12;
--
2.39.2
^ permalink raw reply related [flat|nested] 106+ messages in thread
* [RFC PATCH v3 49/78] hw/arm: add fallthrough pseudo-keyword
2023-10-13 8:45 [RFC PATCH v3 00/78] Strict disable implicit fallthrough Emmanouil Pitsidianakis
` (47 preceding siblings ...)
2023-10-13 8:46 ` [RFC PATCH v3 48/78] contrib/vhost-user-scsi: " Emmanouil Pitsidianakis
@ 2023-10-13 8:46 ` Emmanouil Pitsidianakis
2023-10-13 8:46 ` [RFC PATCH v3 50/78] hw/audio: " Emmanouil Pitsidianakis
` (30 subsequent siblings)
79 siblings, 0 replies; 106+ messages in thread
From: Emmanouil Pitsidianakis @ 2023-10-13 8:46 UTC (permalink / raw)
To: qemu-devel; +Cc: Emmanouil Pitsidianakis, Peter Maydell, open list:OMAP
In preparation of raising -Wimplicit-fallthrough to 5, replace all
fall-through comments with the fallthrough attribute pseudo-keyword.
Signed-off-by: Emmanouil Pitsidianakis <manos.pitsidianakis@linaro.org>
---
hw/arm/omap1.c | 8 ++++----
hw/arm/pxa2xx.c | 6 +++---
hw/arm/stellaris.c | 1 +
3 files changed, 8 insertions(+), 7 deletions(-)
diff --git a/hw/arm/omap1.c b/hw/arm/omap1.c
index d5438156ee..c54a4ec553 100644
--- a/hw/arm/omap1.c
+++ b/hw/arm/omap1.c
@@ -552,7 +552,7 @@ static uint64_t omap_ulpd_pm_read(void *opaque, hwaddr addr,
case 0x28: /* Reserved */
case 0x2c: /* Reserved */
OMAP_BAD_REG(addr);
- /* fall through */
+ fallthrough;
case 0x00: /* COUNTER_32_LSB */
case 0x04: /* COUNTER_32_MSB */
case 0x08: /* COUNTER_HIGH_FREQ_LSB */
@@ -658,7 +658,7 @@ static void omap_ulpd_pm_write(void *opaque, hwaddr addr,
case 0x28: /* Reserved */
case 0x2c: /* Reserved */
OMAP_BAD_REG(addr);
- /* fall through */
+ fallthrough;
case 0x24: /* SETUP_ANALOG_CELL3_ULPD1 */
case 0x38: /* COUNTER_32_FIQ */
case 0x48: /* LOCL_TIME */
@@ -3181,7 +3181,7 @@ static uint64_t omap_mcbsp_read(void *opaque, hwaddr addr,
case 0x00: /* DRR2 */
if (((s->rcr[0] >> 5) & 7) < 3) /* RWDLEN1 */
return 0x0000;
- /* Fall through. */
+ fallthrough;
case 0x02: /* DRR1 */
if (s->rx_req < 2) {
printf("%s: Rx FIFO underrun\n", __func__);
@@ -3279,7 +3279,7 @@ static void omap_mcbsp_writeh(void *opaque, hwaddr addr,
case 0x04: /* DXR2 */
if (((s->xcr[0] >> 5) & 7) < 3) /* XWDLEN1 */
return;
- /* Fall through. */
+ fallthrough;
case 0x06: /* DXR1 */
if (s->tx_req > 1) {
s->tx_req -= 2;
diff --git a/hw/arm/pxa2xx.c b/hw/arm/pxa2xx.c
index 07d5dd8691..eaa6684243 100644
--- a/hw/arm/pxa2xx.c
+++ b/hw/arm/pxa2xx.c
@@ -285,7 +285,7 @@ static void pxa2xx_pwrmode_write(CPUARMState *env, const ARMCPRegInfo *ri,
cpu_interrupt(CPU(s->cpu), CPU_INTERRUPT_HALT);
break;
}
- /* Fall through. */
+ fallthrough;
case 2:
/* Deep-Idle */
@@ -425,7 +425,7 @@ static uint64_t pxa2xx_mm_read(void *opaque, hwaddr addr,
case MDCNFG ... SA1110:
if ((addr & 3) == 0)
return s->mm_regs[addr >> 2];
- /* fall through */
+ fallthrough;
default:
qemu_log_mask(LOG_GUEST_ERROR,
"%s: Bad read offset 0x%"HWADDR_PRIx"\n",
@@ -446,7 +446,7 @@ static void pxa2xx_mm_write(void *opaque, hwaddr addr,
s->mm_regs[addr >> 2] = value;
break;
}
- /* fallthrough */
+ fallthrough;
default:
qemu_log_mask(LOG_GUEST_ERROR,
"%s: Bad write offset 0x%"HWADDR_PRIx"\n",
diff --git a/hw/arm/stellaris.c b/hw/arm/stellaris.c
index aa5b0ddfaa..d68602ab71 100644
--- a/hw/arm/stellaris.c
+++ b/hw/arm/stellaris.c
@@ -157,6 +157,7 @@ static int ssys_board_class(const ssys_state *s)
return did0 & DID0_CLASS_MASK;
}
/* for unknown classes, fall through */
+ fallthrough;
default:
/* This can only happen if the hardwired constant did0 value
* in this board's stellaris_board_info struct is wrong.
--
2.39.2
^ permalink raw reply related [flat|nested] 106+ messages in thread
* [RFC PATCH v3 50/78] hw/audio: add fallthrough pseudo-keyword
2023-10-13 8:45 [RFC PATCH v3 00/78] Strict disable implicit fallthrough Emmanouil Pitsidianakis
` (48 preceding siblings ...)
2023-10-13 8:46 ` [RFC PATCH v3 49/78] hw/arm: " Emmanouil Pitsidianakis
@ 2023-10-13 8:46 ` Emmanouil Pitsidianakis
2023-10-13 8:46 ` [RFC PATCH v3 51/78] chardev: " Emmanouil Pitsidianakis
` (29 subsequent siblings)
79 siblings, 0 replies; 106+ messages in thread
From: Emmanouil Pitsidianakis @ 2023-10-13 8:46 UTC (permalink / raw)
To: qemu-devel; +Cc: Emmanouil Pitsidianakis, Laurent Vivier, Gerd Hoffmann
In preparation of raising -Wimplicit-fallthrough to 5, replace all
fall-through comments with the fallthrough attribute pseudo-keyword.
Signed-off-by: Emmanouil Pitsidianakis <manos.pitsidianakis@linaro.org>
---
hw/audio/asc.c | 2 +-
hw/audio/cs4231a.c | 2 +-
hw/audio/gusemu_hal.c | 2 +-
3 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/hw/audio/asc.c b/hw/audio/asc.c
index 0f36b4ce9b..336da09509 100644
--- a/hw/audio/asc.c
+++ b/hw/audio/asc.c
@@ -229,7 +229,7 @@ static int generate_fifo(ASCState *s, int maxsamples)
break;
default:
- /* fallthrough */
+ fallthrough;
case 0x80:
/* Raw mode */
if (fs->cnt) {
diff --git a/hw/audio/cs4231a.c b/hw/audio/cs4231a.c
index 3aa105748d..3bf0116c68 100644
--- a/hw/audio/cs4231a.c
+++ b/hw/audio/cs4231a.c
@@ -311,7 +311,7 @@ static void cs_reset_voices (CSState *s, uint32_t val)
case 6:
as.endianness = 1;
- /* fall through */
+ fallthrough;
case 2:
as.fmt = AUDIO_FORMAT_S16;
s->shift = as.nchannels;
diff --git a/hw/audio/gusemu_hal.c b/hw/audio/gusemu_hal.c
index f159978b49..76dd906ea1 100644
--- a/hw/audio/gusemu_hal.c
+++ b/hw/audio/gusemu_hal.c
@@ -261,7 +261,7 @@ void gus_write(GUSEmuState * state, int port, int size, unsigned int data)
GUSregb(IRQStatReg2x6) = 0x10;
GUS_irqrequest(state, state->gusirq, 1);
}
- /* fall through */
+ fallthrough;
case 0x20D: /* SB2xCd no IRQ */
GUSregb(SB2xCd) = (uint8_t) data;
break;
--
2.39.2
^ permalink raw reply related [flat|nested] 106+ messages in thread
* [RFC PATCH v3 51/78] chardev: add fallthrough pseudo-keyword
2023-10-13 8:45 [RFC PATCH v3 00/78] Strict disable implicit fallthrough Emmanouil Pitsidianakis
` (49 preceding siblings ...)
2023-10-13 8:46 ` [RFC PATCH v3 50/78] hw/audio: " Emmanouil Pitsidianakis
@ 2023-10-13 8:46 ` Emmanouil Pitsidianakis
2023-10-13 8:46 ` [RFC PATCH v3 52/78] hw/char: " Emmanouil Pitsidianakis
` (28 subsequent siblings)
79 siblings, 0 replies; 106+ messages in thread
From: Emmanouil Pitsidianakis @ 2023-10-13 8:46 UTC (permalink / raw)
To: qemu-devel; +Cc: Emmanouil Pitsidianakis, Marc-André Lureau, Paolo Bonzini
In preparation of raising -Wimplicit-fallthrough to 5, replace all
fall-through comments with the fallthrough attribute pseudo-keyword.
Signed-off-by: Emmanouil Pitsidianakis <manos.pitsidianakis@linaro.org>
---
chardev/char-socket.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/chardev/char-socket.c b/chardev/char-socket.c
index 73947da188..1562e066a4 100644
--- a/chardev/char-socket.c
+++ b/chardev/char-socket.c
@@ -564,7 +564,7 @@ static char *qemu_chr_compute_filename(SocketChardev *s)
case AF_INET6:
left = "[";
right = "]";
- /* fall through */
+ fallthrough;
case AF_INET:
getnameinfo((struct sockaddr *) ss, ss_len, shost, sizeof(shost),
sserv, sizeof(sserv), NI_NUMERICHOST | NI_NUMERICSERV);
--
2.39.2
^ permalink raw reply related [flat|nested] 106+ messages in thread
* [RFC PATCH v3 52/78] hw/char: add fallthrough pseudo-keyword
2023-10-13 8:45 [RFC PATCH v3 00/78] Strict disable implicit fallthrough Emmanouil Pitsidianakis
` (50 preceding siblings ...)
2023-10-13 8:46 ` [RFC PATCH v3 51/78] chardev: " Emmanouil Pitsidianakis
@ 2023-10-13 8:46 ` Emmanouil Pitsidianakis
2023-10-13 8:46 ` [RFC PATCH v3 53/78] nbd: " Emmanouil Pitsidianakis
` (27 subsequent siblings)
79 siblings, 0 replies; 106+ messages in thread
From: Emmanouil Pitsidianakis @ 2023-10-13 8:46 UTC (permalink / raw)
To: qemu-devel
Cc: Emmanouil Pitsidianakis, Joel Stanley, Peter Maydell,
Marc-André Lureau, Paolo Bonzini, open list:NRF51
In preparation of raising -Wimplicit-fallthrough to 5, replace all
fall-through comments with the fallthrough attribute pseudo-keyword.
Signed-off-by: Emmanouil Pitsidianakis <manos.pitsidianakis@linaro.org>
---
hw/char/nrf51_uart.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/hw/char/nrf51_uart.c b/hw/char/nrf51_uart.c
index dfe2276d71..3e2b35c7ad 100644
--- a/hw/char/nrf51_uart.c
+++ b/hw/char/nrf51_uart.c
@@ -170,13 +170,13 @@ static void uart_write(void *opaque, hwaddr addr,
}
s->enabled = false;
value = 1;
- /* fall through */
+ fallthrough;
case A_UART_SUSPEND:
case A_UART_STOPTX:
if (value == 1) {
s->tx_started = false;
}
- /* fall through */
+ fallthrough;
case A_UART_STOPRX:
if (addr != A_UART_STOPTX && value == 1) {
s->rx_started = false;
--
2.39.2
^ permalink raw reply related [flat|nested] 106+ messages in thread
* [RFC PATCH v3 53/78] nbd: add fallthrough pseudo-keyword
2023-10-13 8:45 [RFC PATCH v3 00/78] Strict disable implicit fallthrough Emmanouil Pitsidianakis
` (51 preceding siblings ...)
2023-10-13 8:46 ` [RFC PATCH v3 52/78] hw/char: " Emmanouil Pitsidianakis
@ 2023-10-13 8:46 ` Emmanouil Pitsidianakis
2023-10-13 8:46 ` [RFC PATCH v3 54/78] hw/core: " Emmanouil Pitsidianakis
` (26 subsequent siblings)
79 siblings, 0 replies; 106+ messages in thread
From: Emmanouil Pitsidianakis @ 2023-10-13 8:46 UTC (permalink / raw)
To: qemu-devel
Cc: Emmanouil Pitsidianakis, Eric Blake, Vladimir Sementsov-Ogievskiy,
open list:Network Block Dev...
In preparation of raising -Wimplicit-fallthrough to 5, replace all
fall-through comments with the fallthrough attribute pseudo-keyword.
Signed-off-by: Emmanouil Pitsidianakis <manos.pitsidianakis@linaro.org>
---
nbd/client.c | 4 ++--
nbd/common.c | 2 +-
qemu-nbd.c | 4 ++--
3 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/nbd/client.c b/nbd/client.c
index 29ffc609a4..04507249b2 100644
--- a/nbd/client.c
+++ b/nbd/client.c
@@ -1051,7 +1051,7 @@ int nbd_receive_negotiate(QIOChannel *ioc, QCryptoTLSCreds *tlscreds,
}
info->base_allocation = result == 1;
}
- /* fall through */
+ fallthrough;
case NBD_MODE_SIMPLE:
/* Try NBD_OPT_GO first - if it works, we are done (it
* also gives us a good message if the server requires
@@ -1074,7 +1074,7 @@ int nbd_receive_negotiate(QIOChannel *ioc, QCryptoTLSCreds *tlscreds,
if (nbd_receive_query_exports(ioc, info->name, errp) < 0) {
return -EINVAL;
}
- /* fall through */
+ fallthrough;
case NBD_MODE_EXPORT_NAME:
/* write the export name request */
if (nbd_send_option_request(ioc, NBD_OPT_EXPORT_NAME, -1, info->name,
diff --git a/nbd/common.c b/nbd/common.c
index 3247c1d618..1140ea0888 100644
--- a/nbd/common.c
+++ b/nbd/common.c
@@ -249,7 +249,7 @@ int nbd_errno_to_system_errno(int err)
break;
default:
trace_nbd_unknown_error(err);
- /* fallthrough */
+ fallthrough;
case NBD_EINVAL:
ret = EINVAL;
break;
diff --git a/qemu-nbd.c b/qemu-nbd.c
index 186e6468b1..41e50208a5 100644
--- a/qemu-nbd.c
+++ b/qemu-nbd.c
@@ -632,7 +632,7 @@ int main(int argc, char **argv)
break;
case 'n':
optarg = (char *) "none";
- /* fallthrough */
+ fallthrough;
case QEMU_NBD_OPT_CACHE:
if (seen_cache) {
error_report("-n and --cache can only be specified once");
@@ -708,7 +708,7 @@ int main(int argc, char **argv)
} else {
sn_id_or_name = optarg;
}
- /* fall through */
+ fallthrough;
case 'r':
readonly = true;
flags &= ~BDRV_O_RDWR;
--
2.39.2
^ permalink raw reply related [flat|nested] 106+ messages in thread
* [RFC PATCH v3 54/78] hw/core: add fallthrough pseudo-keyword
2023-10-13 8:45 [RFC PATCH v3 00/78] Strict disable implicit fallthrough Emmanouil Pitsidianakis
` (52 preceding siblings ...)
2023-10-13 8:46 ` [RFC PATCH v3 53/78] nbd: " Emmanouil Pitsidianakis
@ 2023-10-13 8:46 ` Emmanouil Pitsidianakis
2023-10-13 8:46 ` [RFC PATCH v3 55/78] hw/display: " Emmanouil Pitsidianakis
` (25 subsequent siblings)
79 siblings, 0 replies; 106+ messages in thread
From: Emmanouil Pitsidianakis @ 2023-10-13 8:46 UTC (permalink / raw)
To: qemu-devel; +Cc: Emmanouil Pitsidianakis
In preparation of raising -Wimplicit-fallthrough to 5, replace all
fall-through comments with the fallthrough attribute pseudo-keyword.
Signed-off-by: Emmanouil Pitsidianakis <manos.pitsidianakis@linaro.org>
---
hw/core/loader.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/hw/core/loader.c b/hw/core/loader.c
index 4dd5a71fb7..559d63a1e2 100644
--- a/hw/core/loader.c
+++ b/hw/core/loader.c
@@ -672,7 +672,7 @@ static ssize_t load_uboot_image(const char *filename, hwaddr *ep,
hdr->ih_load = *loadaddr + sizeof(*hdr);
hdr->ih_ep += hdr->ih_load;
- /* fall through */
+ fallthrough;
case IH_TYPE_KERNEL:
address = hdr->ih_load;
if (translate_fn) {
--
2.39.2
^ permalink raw reply related [flat|nested] 106+ messages in thread
* [RFC PATCH v3 55/78] hw/display: add fallthrough pseudo-keyword
2023-10-13 8:45 [RFC PATCH v3 00/78] Strict disable implicit fallthrough Emmanouil Pitsidianakis
` (53 preceding siblings ...)
2023-10-13 8:46 ` [RFC PATCH v3 54/78] hw/core: " Emmanouil Pitsidianakis
@ 2023-10-13 8:46 ` Emmanouil Pitsidianakis
2023-10-13 8:46 ` [RFC PATCH v3 56/78] hw/input: " Emmanouil Pitsidianakis
` (24 subsequent siblings)
79 siblings, 0 replies; 106+ messages in thread
From: Emmanouil Pitsidianakis @ 2023-10-13 8:46 UTC (permalink / raw)
To: qemu-devel; +Cc: Emmanouil Pitsidianakis, Mark Cave-Ayland, Gerd Hoffmann
In preparation of raising -Wimplicit-fallthrough to 5, replace all
fall-through comments with the fallthrough attribute pseudo-keyword.
Signed-off-by: Emmanouil Pitsidianakis <manos.pitsidianakis@linaro.org>
---
hw/display/cg3.c | 2 +-
hw/display/cirrus_vga.c | 2 +-
hw/display/tcx.c | 4 ++--
3 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/hw/display/cg3.c b/hw/display/cg3.c
index 2e9656ae1c..53eb9831b2 100644
--- a/hw/display/cg3.c
+++ b/hw/display/cg3.c
@@ -231,7 +231,7 @@ static void cg3_reg_write(void *opaque, hwaddr addr, uint64_t val,
s->b[s->dac_index] = regval;
/* Index autoincrement */
s->dac_index = (s->dac_index + 1) & 0xff;
- /* fall through */
+ fallthrough;
default:
s->dac_state = 0;
break;
diff --git a/hw/display/cirrus_vga.c b/hw/display/cirrus_vga.c
index b80f98b6c4..f1513a084c 100644
--- a/hw/display/cirrus_vga.c
+++ b/hw/display/cirrus_vga.c
@@ -1360,7 +1360,7 @@ static void cirrus_vga_write_sr(CirrusVGAState * s, uint32_t val)
break;
case 0x07: // Extended Sequencer Mode
cirrus_update_memory_access(s);
- /* fall through */
+ fallthrough;
case 0x08: // EEPROM Control
case 0x09: // Scratch Register 0
case 0x0a: // Scratch Register 1
diff --git a/hw/display/tcx.c b/hw/display/tcx.c
index 1b27b64f6d..e21450d726 100644
--- a/hw/display/tcx.c
+++ b/hw/display/tcx.c
@@ -396,7 +396,7 @@ static uint64_t tcx_dac_readl(void *opaque, hwaddr addr,
case 2:
val = s->b[s->dac_index] << 24;
s->dac_index = (s->dac_index + 1) & 0xff; /* Index autoincrement */
- /* fall through */
+ fallthrough;
default:
s->dac_state = 0;
break;
@@ -438,7 +438,7 @@ static void tcx_dac_writel(void *opaque, hwaddr addr, uint64_t val,
s->b[index] = val >> 24;
update_palette_entries(s, index, index + 1);
s->dac_index = (s->dac_index + 1) & 0xff; /* Index autoincrement */
- /* fall through */
+ fallthrough;
default:
s->dac_state = 0;
break;
--
2.39.2
^ permalink raw reply related [flat|nested] 106+ messages in thread
* [RFC PATCH v3 56/78] hw/input: add fallthrough pseudo-keyword
2023-10-13 8:45 [RFC PATCH v3 00/78] Strict disable implicit fallthrough Emmanouil Pitsidianakis
` (54 preceding siblings ...)
2023-10-13 8:46 ` [RFC PATCH v3 55/78] hw/display: " Emmanouil Pitsidianakis
@ 2023-10-13 8:46 ` Emmanouil Pitsidianakis
2023-10-13 8:46 ` [RFC PATCH v3 57/78] hw/net: " Emmanouil Pitsidianakis
` (23 subsequent siblings)
79 siblings, 0 replies; 106+ messages in thread
From: Emmanouil Pitsidianakis @ 2023-10-13 8:46 UTC (permalink / raw)
To: qemu-devel; +Cc: Emmanouil Pitsidianakis, Peter Maydell, open list:nSeries
In preparation of raising -Wimplicit-fallthrough to 5, replace all
fall-through comments with the fallthrough attribute pseudo-keyword.
Signed-off-by: Emmanouil Pitsidianakis <manos.pitsidianakis@linaro.org>
---
hw/input/hid.c | 3 ++-
hw/input/tsc2005.c | 4 ++--
hw/input/tsc210x.c | 2 +-
3 files changed, 5 insertions(+), 4 deletions(-)
diff --git a/hw/input/hid.c b/hw/input/hid.c
index a9c7dd1ce1..15fffc5dfb 100644
--- a/hw/input/hid.c
+++ b/hw/input/hid.c
@@ -283,6 +283,7 @@ static void hid_keyboard_process_keycode(HIDState *hs)
return;
}
/* fall through to process Ctrl_L */
+ fallthrough;
case 0xe1 ... 0xe7:
/* Ctrl_L/Ctrl_R, Shift_L/Shift_R, Alt_L/Alt_R, Win_L/Win_R.
* Handle releases here, or fall through to process presses.
@@ -291,7 +292,7 @@ static void hid_keyboard_process_keycode(HIDState *hs)
hs->kbd.modifiers &= ~(1 << (hid_code & 0x0f));
return;
}
- /* fall through */
+ fallthrough;
case 0xe8 ... 0xe9:
/* USB modifiers are just 1 byte long. Bits 8 and 9 of
* hs->kbd.modifiers implement a state machine that detects the
diff --git a/hw/input/tsc2005.c b/hw/input/tsc2005.c
index db2b80e35f..4f3f1d9d12 100644
--- a/hw/input/tsc2005.c
+++ b/hw/input/tsc2005.c
@@ -262,7 +262,7 @@ static void tsc2005_pin_update(TSC2005State *s)
s->enabled = false;
if (!s->pressure)
return;
- /* Fall through */
+ fallthrough;
case TSC_MODE_AUX_SCAN:
break;
@@ -271,7 +271,7 @@ static void tsc2005_pin_update(TSC2005State *s)
case TSC_MODE_Z:
if (!s->pressure)
return;
- /* Fall through */
+ fallthrough;
case TSC_MODE_AUX:
case TSC_MODE_TEMP1:
case TSC_MODE_TEMP2:
diff --git a/hw/input/tsc210x.c b/hw/input/tsc210x.c
index 950506fb38..9ae426e1a6 100644
--- a/hw/input/tsc210x.c
+++ b/hw/input/tsc210x.c
@@ -809,7 +809,7 @@ static void tsc210x_pin_update(TSC210xState *s)
case TSC_MODE_Z:
if (!s->pressure)
return;
- /* Fall through */
+ fallthrough;
case TSC_MODE_BAT1:
case TSC_MODE_BAT2:
case TSC_MODE_AUX:
--
2.39.2
^ permalink raw reply related [flat|nested] 106+ messages in thread
* [RFC PATCH v3 57/78] hw/net: add fallthrough pseudo-keyword
2023-10-13 8:45 [RFC PATCH v3 00/78] Strict disable implicit fallthrough Emmanouil Pitsidianakis
` (55 preceding siblings ...)
2023-10-13 8:46 ` [RFC PATCH v3 56/78] hw/input: " Emmanouil Pitsidianakis
@ 2023-10-13 8:46 ` Emmanouil Pitsidianakis
2023-10-13 9:11 ` Akihiko Odaki
2023-10-13 8:46 ` [RFC PATCH v3 58/78] hw/ppc: " Emmanouil Pitsidianakis
` (22 subsequent siblings)
79 siblings, 1 reply; 106+ messages in thread
From: Emmanouil Pitsidianakis @ 2023-10-13 8:46 UTC (permalink / raw)
To: qemu-devel
Cc: Emmanouil Pitsidianakis, Edgar E. Iglesias, Alistair Francis,
Peter Maydell, Jason Wang, Pavel Pisa, Vikram Garhwal,
Akihiko Odaki, Sriram Yagnaraman, Dmitry Fleytman,
open list:Xilinx Zynq
In preparation of raising -Wimplicit-fallthrough to 5, replace all
fall-through comments with the fallthrough attribute pseudo-keyword.
Signed-off-by: Emmanouil Pitsidianakis <manos.pitsidianakis@linaro.org>
---
hw/net/cadence_gem.c | 4 ++--
hw/net/can/can_sja1000.c | 4 ++--
hw/net/igb_core.c | 2 +-
hw/net/igbvf.c | 2 +-
hw/net/imx_fec.c | 2 +-
hw/net/net_rx_pkt.c | 2 +-
hw/net/pcnet.c | 2 +-
hw/net/rtl8139.c | 6 ++++--
hw/net/xilinx_ethlite.c | 2 +-
9 files changed, 14 insertions(+), 12 deletions(-)
diff --git a/hw/net/cadence_gem.c b/hw/net/cadence_gem.c
index f445d8bb5e..a59991af5b 100644
--- a/hw/net/cadence_gem.c
+++ b/hw/net/cadence_gem.c
@@ -834,10 +834,10 @@ static int get_queue_from_screen(CadenceGEMState *s, uint8_t *rxbuf_ptr,
qemu_log_mask(LOG_UNIMP, "TCP compare offsets"
"unimplemented - assuming UDP\n");
offset += 8;
- /* Fallthrough */
+ fallthrough;
case 2: /* skip the IP header */
offset += 20;
- /* Fallthrough */
+ fallthrough;
case 1: /* Count from after the ethertype */
offset += 14;
break;
diff --git a/hw/net/can/can_sja1000.c b/hw/net/can/can_sja1000.c
index 73201f9139..14052b2700 100644
--- a/hw/net/can/can_sja1000.c
+++ b/hw/net/can/can_sja1000.c
@@ -544,7 +544,7 @@ void can_sja_mem_write(CanSJA1000State *s, hwaddr addr, uint64_t val,
break;
case 16: /* RX frame information addr16-28. */
s->status_pel |= (1 << 5); /* Set transmit status. */
- /* fallthrough */
+ fallthrough;
case 17 ... 28:
if (s->mode & 0x01) { /* Reset mode */
if (addr < 24) {
@@ -642,7 +642,7 @@ void can_sja_mem_write(CanSJA1000State *s, hwaddr addr, uint64_t val,
break;
case 10:
s->status_bas |= (1 << 5); /* Set transmit status. */
- /* fallthrough */
+ fallthrough;
case 11 ... 19:
if ((s->control & 0x01) == 0) { /* Operation mode */
s->tx_buff[addr - 10] = val; /* Store to TX buffer directly. */
diff --git a/hw/net/igb_core.c b/hw/net/igb_core.c
index f6a5e2327b..1117f7cb59 100644
--- a/hw/net/igb_core.c
+++ b/hw/net/igb_core.c
@@ -1419,7 +1419,7 @@ igb_build_rx_metadata_common(IGBCore *core,
if (!csum_valid) {
*status_flags |= E1000_RXDEXT_STATERR_TCPE;
}
- /* fall through */
+ fallthrough;
case ETH_L4_HDR_PROTO_TCP:
*status_flags |= E1000_RXD_STAT_TCPCS;
break;
diff --git a/hw/net/igbvf.c b/hw/net/igbvf.c
index d55e1e8a6a..ff68a4f3c5 100644
--- a/hw/net/igbvf.c
+++ b/hw/net/igbvf.c
@@ -188,7 +188,7 @@ static hwaddr vf_to_pf_addr(hwaddr addr, uint16_t vfn, bool write)
if (write) {
return HWADDR_MAX;
}
- /* fallthrough */
+ fallthrough;
case 0x34E8: /* PBTWAC */
case 0x24E8: /* PBRWAC */
return addr;
diff --git a/hw/net/imx_fec.c b/hw/net/imx_fec.c
index 5d1f1f104c..a7e8b06d48 100644
--- a/hw/net/imx_fec.c
+++ b/hw/net/imx_fec.c
@@ -918,7 +918,7 @@ static void imx_eth_write(void *opaque, hwaddr offset, uint64_t value,
TYPE_IMX_FEC, __func__);
return;
}
- /* fall through */
+ fallthrough;
case ENET_TDAR:
if (s->regs[ENET_ECR] & ENET_ECR_ETHEREN) {
s->regs[index] = ENET_TDAR_TDAR;
diff --git a/hw/net/net_rx_pkt.c b/hw/net/net_rx_pkt.c
index 32e5f3f9cf..52e2432c9b 100644
--- a/hw/net/net_rx_pkt.c
+++ b/hw/net/net_rx_pkt.c
@@ -605,7 +605,7 @@ bool net_rx_pkt_validate_l4_csum(struct NetRxPkt *pkt, bool *csum_valid)
trace_net_rx_pkt_l4_csum_validate_udp_with_no_checksum();
return false;
}
- /* fall through */
+ fallthrough;
case ETH_L4_HDR_PROTO_TCP:
csum = _net_rx_pkt_calc_l4_csum(pkt);
*csum_valid = ((csum == 0) || (csum == 0xFFFF));
diff --git a/hw/net/pcnet.c b/hw/net/pcnet.c
index 02828ae716..a32174ef93 100644
--- a/hw/net/pcnet.c
+++ b/hw/net/pcnet.c
@@ -1502,7 +1502,7 @@ static void pcnet_bcr_writew(PCNetState *s, uint32_t rap, uint32_t val)
#ifdef PCNET_DEBUG
printf("BCR_SWS=0x%04x\n", val);
#endif
- /* fall through */
+ fallthrough;
case BCR_LNKST:
case BCR_LED1:
case BCR_LED2:
diff --git a/hw/net/rtl8139.c b/hw/net/rtl8139.c
index 4525fda383..42f19618b1 100644
--- a/hw/net/rtl8139.c
+++ b/hw/net/rtl8139.c
@@ -2447,8 +2447,10 @@ static uint32_t rtl8139_TxStatus_TxAddr_read(RTL8139State *s, uint32_t regs[],
}
switch (size) {
- case 1: /* fall through */
- case 2: /* fall through */
+ case 1:
+ fallthrough;
+ case 2:
+ fallthrough;
case 4:
ret = (regs[reg] >> offset * 8) & (((uint64_t)1 << (size * 8)) - 1);
DPRINTF("TxStatus/TxAddr[%d] read addr=0x%x size=0x%x val=0x%08x\n",
diff --git a/hw/net/xilinx_ethlite.c b/hw/net/xilinx_ethlite.c
index 89f4f3b254..5ae4032ec2 100644
--- a/hw/net/xilinx_ethlite.c
+++ b/hw/net/xilinx_ethlite.c
@@ -151,7 +151,7 @@ eth_write(void *opaque, hwaddr addr,
if (!(value & CTRL_S)) {
qemu_flush_queued_packets(qemu_get_queue(s->nic));
}
- /* fall through */
+ fallthrough;
case R_TX_LEN0:
case R_TX_LEN1:
case R_TX_GIE0:
--
2.39.2
^ permalink raw reply related [flat|nested] 106+ messages in thread
* Re: [RFC PATCH v3 57/78] hw/net: add fallthrough pseudo-keyword
2023-10-13 8:46 ` [RFC PATCH v3 57/78] hw/net: " Emmanouil Pitsidianakis
@ 2023-10-13 9:11 ` Akihiko Odaki
2023-10-13 9:20 ` Manos Pitsidianakis
0 siblings, 1 reply; 106+ messages in thread
From: Akihiko Odaki @ 2023-10-13 9:11 UTC (permalink / raw)
To: Emmanouil Pitsidianakis, qemu-devel
Cc: Edgar E. Iglesias, Alistair Francis, Peter Maydell, Jason Wang,
Pavel Pisa, Vikram Garhwal, Sriram Yagnaraman, Dmitry Fleytman,
open list:Xilinx Zynq
On 2023/10/13 17:46, Emmanouil Pitsidianakis wrote:
> In preparation of raising -Wimplicit-fallthrough to 5, replace all
> fall-through comments with the fallthrough attribute pseudo-keyword.
>
> Signed-off-by: Emmanouil Pitsidianakis <manos.pitsidianakis@linaro.org>
> ---
> hw/net/cadence_gem.c | 4 ++--
> hw/net/can/can_sja1000.c | 4 ++--
> hw/net/igb_core.c | 2 +-
> hw/net/igbvf.c | 2 +-
> hw/net/imx_fec.c | 2 +-
> hw/net/net_rx_pkt.c | 2 +-
> hw/net/pcnet.c | 2 +-
> hw/net/rtl8139.c | 6 ++++--
> hw/net/xilinx_ethlite.c | 2 +-
> 9 files changed, 14 insertions(+), 12 deletions(-)
>
> diff --git a/hw/net/cadence_gem.c b/hw/net/cadence_gem.c
> index f445d8bb5e..a59991af5b 100644
> --- a/hw/net/cadence_gem.c
> +++ b/hw/net/cadence_gem.c
> @@ -834,10 +834,10 @@ static int get_queue_from_screen(CadenceGEMState *s, uint8_t *rxbuf_ptr,
> qemu_log_mask(LOG_UNIMP, "TCP compare offsets"
> "unimplemented - assuming UDP\n");
> offset += 8;
> - /* Fallthrough */
> + fallthrough;
> case 2: /* skip the IP header */
> offset += 20;
> - /* Fallthrough */
> + fallthrough;
> case 1: /* Count from after the ethertype */
> offset += 14;
> break;
> diff --git a/hw/net/can/can_sja1000.c b/hw/net/can/can_sja1000.c
> index 73201f9139..14052b2700 100644
> --- a/hw/net/can/can_sja1000.c
> +++ b/hw/net/can/can_sja1000.c
> @@ -544,7 +544,7 @@ void can_sja_mem_write(CanSJA1000State *s, hwaddr addr, uint64_t val,
> break;
> case 16: /* RX frame information addr16-28. */
> s->status_pel |= (1 << 5); /* Set transmit status. */
> - /* fallthrough */
> + fallthrough;
> case 17 ... 28:
> if (s->mode & 0x01) { /* Reset mode */
> if (addr < 24) {
> @@ -642,7 +642,7 @@ void can_sja_mem_write(CanSJA1000State *s, hwaddr addr, uint64_t val,
> break;
> case 10:
> s->status_bas |= (1 << 5); /* Set transmit status. */
> - /* fallthrough */
> + fallthrough;
> case 11 ... 19:
> if ((s->control & 0x01) == 0) { /* Operation mode */
> s->tx_buff[addr - 10] = val; /* Store to TX buffer directly. */
> diff --git a/hw/net/igb_core.c b/hw/net/igb_core.c
> index f6a5e2327b..1117f7cb59 100644
> --- a/hw/net/igb_core.c
> +++ b/hw/net/igb_core.c
> @@ -1419,7 +1419,7 @@ igb_build_rx_metadata_common(IGBCore *core,
> if (!csum_valid) {
> *status_flags |= E1000_RXDEXT_STATERR_TCPE;
> }
> - /* fall through */
> + fallthrough;
> case ETH_L4_HDR_PROTO_TCP:
> *status_flags |= E1000_RXD_STAT_TCPCS;
> break;
> diff --git a/hw/net/igbvf.c b/hw/net/igbvf.c
> index d55e1e8a6a..ff68a4f3c5 100644
> --- a/hw/net/igbvf.c
> +++ b/hw/net/igbvf.c
> @@ -188,7 +188,7 @@ static hwaddr vf_to_pf_addr(hwaddr addr, uint16_t vfn, bool write)
> if (write) {
> return HWADDR_MAX;
> }
> - /* fallthrough */
> + fallthrough;
> case 0x34E8: /* PBTWAC */
> case 0x24E8: /* PBRWAC */
> return addr;
> diff --git a/hw/net/imx_fec.c b/hw/net/imx_fec.c
> index 5d1f1f104c..a7e8b06d48 100644
> --- a/hw/net/imx_fec.c
> +++ b/hw/net/imx_fec.c
> @@ -918,7 +918,7 @@ static void imx_eth_write(void *opaque, hwaddr offset, uint64_t value,
> TYPE_IMX_FEC, __func__);
> return;
> }
> - /* fall through */
> + fallthrough;
> case ENET_TDAR:
> if (s->regs[ENET_ECR] & ENET_ECR_ETHEREN) {
> s->regs[index] = ENET_TDAR_TDAR;
> diff --git a/hw/net/net_rx_pkt.c b/hw/net/net_rx_pkt.c
> index 32e5f3f9cf..52e2432c9b 100644
> --- a/hw/net/net_rx_pkt.c
> +++ b/hw/net/net_rx_pkt.c
> @@ -605,7 +605,7 @@ bool net_rx_pkt_validate_l4_csum(struct NetRxPkt *pkt, bool *csum_valid)
> trace_net_rx_pkt_l4_csum_validate_udp_with_no_checksum();
> return false;
> }
> - /* fall through */
> + fallthrough;
> case ETH_L4_HDR_PROTO_TCP:
> csum = _net_rx_pkt_calc_l4_csum(pkt);
> *csum_valid = ((csum == 0) || (csum == 0xFFFF));
> diff --git a/hw/net/pcnet.c b/hw/net/pcnet.c
> index 02828ae716..a32174ef93 100644
> --- a/hw/net/pcnet.c
> +++ b/hw/net/pcnet.c
> @@ -1502,7 +1502,7 @@ static void pcnet_bcr_writew(PCNetState *s, uint32_t rap, uint32_t val)
> #ifdef PCNET_DEBUG
> printf("BCR_SWS=0x%04x\n", val);
> #endif
> - /* fall through */
> + fallthrough;
> case BCR_LNKST:
> case BCR_LED1:
> case BCR_LED2:
> diff --git a/hw/net/rtl8139.c b/hw/net/rtl8139.c
> index 4525fda383..42f19618b1 100644
> --- a/hw/net/rtl8139.c
> +++ b/hw/net/rtl8139.c
> @@ -2447,8 +2447,10 @@ static uint32_t rtl8139_TxStatus_TxAddr_read(RTL8139State *s, uint32_t regs[],
> }
>
> switch (size) {
> - case 1: /* fall through */
> - case 2: /* fall through */
> + case 1:
> + fallthrough;
> + case 2:
> + fallthrough;
> case 4:
I don't think you need comments or pseudo-keywords here.
^ permalink raw reply [flat|nested] 106+ messages in thread
* Re: [RFC PATCH v3 57/78] hw/net: add fallthrough pseudo-keyword
2023-10-13 9:11 ` Akihiko Odaki
@ 2023-10-13 9:20 ` Manos Pitsidianakis
0 siblings, 0 replies; 106+ messages in thread
From: Manos Pitsidianakis @ 2023-10-13 9:20 UTC (permalink / raw)
To: Akihiko Odaki
Cc: qemu-devel, Edgar E. Iglesias, Alistair Francis, Peter Maydell,
Jason Wang, Pavel Pisa, Vikram Garhwal, Sriram Yagnaraman,
Dmitry Fleytman, open list:Xilinx Zynq
On Fri, 13 Oct 2023 at 12:11, Akihiko Odaki <akihiko.odaki@daynix.com> wrote:
> > diff --git a/hw/net/rtl8139.c b/hw/net/rtl8139.c
> > index 4525fda383..42f19618b1 100644
> > --- a/hw/net/rtl8139.c
> > +++ b/hw/net/rtl8139.c
> > @@ -2447,8 +2447,10 @@ static uint32_t rtl8139_TxStatus_TxAddr_read(RTL8139State *s, uint32_t regs[],
> > }
> >
> > switch (size) {
> > - case 1: /* fall through */
> > - case 2: /* fall through */
> > + case 1:
> > + fallthrough;
> > + case 2:
> > + fallthrough;
> > case 4:
>
> I don't think you need comments or pseudo-keywords here.
That's correct, it was a stylistic change. I can remove them in the
next version. Thank you!
Manos
^ permalink raw reply [flat|nested] 106+ messages in thread
* [RFC PATCH v3 58/78] hw/ppc: add fallthrough pseudo-keyword
2023-10-13 8:45 [RFC PATCH v3 00/78] Strict disable implicit fallthrough Emmanouil Pitsidianakis
` (56 preceding siblings ...)
2023-10-13 8:46 ` [RFC PATCH v3 57/78] hw/net: " Emmanouil Pitsidianakis
@ 2023-10-13 8:46 ` Emmanouil Pitsidianakis
2023-10-13 8:46 ` [RFC PATCH v3 59/78] hw/intc: " Emmanouil Pitsidianakis
` (21 subsequent siblings)
79 siblings, 0 replies; 106+ messages in thread
From: Emmanouil Pitsidianakis @ 2023-10-13 8:46 UTC (permalink / raw)
To: qemu-devel
Cc: Emmanouil Pitsidianakis, Harsh Prateek Bora,
Cédric Le Goater, Nicholas Piggin, Frédéric Barrat,
Daniel Henrique Barboza, David Gibson
In preparation of raising -Wimplicit-fallthrough to 5, replace all
fall-through comments with the fallthrough attribute pseudo-keyword.
Reviewed-by: Harsh Prateek Bora <harshpb@linux.ibm.com>
Signed-off-by: Emmanouil Pitsidianakis <manos.pitsidianakis@linaro.org>
---
hw/ppc/pnv_bmc.c | 2 +-
hw/ppc/spapr_events.c | 1 +
2 files changed, 2 insertions(+), 1 deletion(-)
diff --git a/hw/ppc/pnv_bmc.c b/hw/ppc/pnv_bmc.c
index 99f1e8d7f9..9bff7d03cb 100644
--- a/hw/ppc/pnv_bmc.c
+++ b/hw/ppc/pnv_bmc.c
@@ -210,7 +210,7 @@ static void hiomap_cmd(IPMIBmcSim *ibs, uint8_t *cmd, unsigned int cmd_len,
case HIOMAP_C_CREATE_READ_WINDOW:
readonly = true;
- /* Fall through */
+ fallthrough;
case HIOMAP_C_CREATE_WRITE_WINDOW:
memory_region_set_readonly(&pnor->mmio, readonly);
diff --git a/hw/ppc/spapr_events.c b/hw/ppc/spapr_events.c
index 4508e40814..9d51746daf 100644
--- a/hw/ppc/spapr_events.c
+++ b/hw/ppc/spapr_events.c
@@ -423,6 +423,7 @@ rtas_event_log_to_source(SpaprMachineState *spapr, int log_type)
break;
}
/* fall through back to epow for legacy hotplug interrupt source */
+ fallthrough;
case RTAS_LOG_TYPE_EPOW:
source = spapr_event_sources_get_source(spapr->event_sources,
EVENT_CLASS_EPOW);
--
2.39.2
^ permalink raw reply related [flat|nested] 106+ messages in thread
* [RFC PATCH v3 59/78] hw/intc: add fallthrough pseudo-keyword
2023-10-13 8:45 [RFC PATCH v3 00/78] Strict disable implicit fallthrough Emmanouil Pitsidianakis
` (57 preceding siblings ...)
2023-10-13 8:46 ` [RFC PATCH v3 58/78] hw/ppc: " Emmanouil Pitsidianakis
@ 2023-10-13 8:46 ` Emmanouil Pitsidianakis
2023-10-13 8:46 ` [RFC PATCH v3 60/78] qga: " Emmanouil Pitsidianakis
` (20 subsequent siblings)
79 siblings, 0 replies; 106+ messages in thread
From: Emmanouil Pitsidianakis @ 2023-10-13 8:46 UTC (permalink / raw)
To: qemu-devel
Cc: Emmanouil Pitsidianakis, Michael S. Tsirkin, Paolo Bonzini,
Peter Maydell, Edgar E. Iglesias, Alistair Francis,
open list:ARM cores
In preparation of raising -Wimplicit-fallthrough to 5, replace all
fall-through comments with the fallthrough attribute pseudo-keyword.
Signed-off-by: Emmanouil Pitsidianakis <manos.pitsidianakis@linaro.org>
---
hw/intc/apic.c | 2 +-
hw/intc/arm_gicv3_kvm.c | 16 ++++++++--------
hw/intc/armv7m_nvic.c | 12 ++++++------
hw/intc/xilinx_intc.c | 2 +-
4 files changed, 16 insertions(+), 16 deletions(-)
diff --git a/hw/intc/apic.c b/hw/intc/apic.c
index ac3d47d231..30f341c722 100644
--- a/hw/intc/apic.c
+++ b/hw/intc/apic.c
@@ -183,7 +183,7 @@ void apic_deliver_pic_intr(DeviceState *dev, int level)
if (!(lvt & APIC_LVT_LEVEL_TRIGGER))
break;
apic_reset_bit(s->irr, lvt & 0xff);
- /* fall through */
+ fallthrough;
case APIC_DM_EXTINT:
apic_update_irq(s);
break;
diff --git a/hw/intc/arm_gicv3_kvm.c b/hw/intc/arm_gicv3_kvm.c
index 72ad916d3d..782cef3390 100644
--- a/hw/intc/arm_gicv3_kvm.c
+++ b/hw/intc/arm_gicv3_kvm.c
@@ -479,11 +479,11 @@ static void kvm_arm_gicv3_put(GICv3State *s)
kvm_gicc_access(s, ICC_AP0R_EL1(3), ncpu, ®64, true);
reg64 = c->icc_apr[GICV3_G0][2];
kvm_gicc_access(s, ICC_AP0R_EL1(2), ncpu, ®64, true);
- /* fall through */
+ fallthrough;
case 6:
reg64 = c->icc_apr[GICV3_G0][1];
kvm_gicc_access(s, ICC_AP0R_EL1(1), ncpu, ®64, true);
- /* fall through */
+ fallthrough;
default:
reg64 = c->icc_apr[GICV3_G0][0];
kvm_gicc_access(s, ICC_AP0R_EL1(0), ncpu, ®64, true);
@@ -495,11 +495,11 @@ static void kvm_arm_gicv3_put(GICv3State *s)
kvm_gicc_access(s, ICC_AP1R_EL1(3), ncpu, ®64, true);
reg64 = c->icc_apr[GICV3_G1NS][2];
kvm_gicc_access(s, ICC_AP1R_EL1(2), ncpu, ®64, true);
- /* fall through */
+ fallthrough;
case 6:
reg64 = c->icc_apr[GICV3_G1NS][1];
kvm_gicc_access(s, ICC_AP1R_EL1(1), ncpu, ®64, true);
- /* fall through */
+ fallthrough;
default:
reg64 = c->icc_apr[GICV3_G1NS][0];
kvm_gicc_access(s, ICC_AP1R_EL1(0), ncpu, ®64, true);
@@ -636,11 +636,11 @@ static void kvm_arm_gicv3_get(GICv3State *s)
c->icc_apr[GICV3_G0][3] = reg64;
kvm_gicc_access(s, ICC_AP0R_EL1(2), ncpu, ®64, false);
c->icc_apr[GICV3_G0][2] = reg64;
- /* fall through */
+ fallthrough;
case 6:
kvm_gicc_access(s, ICC_AP0R_EL1(1), ncpu, ®64, false);
c->icc_apr[GICV3_G0][1] = reg64;
- /* fall through */
+ fallthrough;
default:
kvm_gicc_access(s, ICC_AP0R_EL1(0), ncpu, ®64, false);
c->icc_apr[GICV3_G0][0] = reg64;
@@ -652,11 +652,11 @@ static void kvm_arm_gicv3_get(GICv3State *s)
c->icc_apr[GICV3_G1NS][3] = reg64;
kvm_gicc_access(s, ICC_AP1R_EL1(2), ncpu, ®64, false);
c->icc_apr[GICV3_G1NS][2] = reg64;
- /* fall through */
+ fallthrough;
case 6:
kvm_gicc_access(s, ICC_AP1R_EL1(1), ncpu, ®64, false);
c->icc_apr[GICV3_G1NS][1] = reg64;
- /* fall through */
+ fallthrough;
default:
kvm_gicc_access(s, ICC_AP1R_EL1(0), ncpu, ®64, false);
c->icc_apr[GICV3_G1NS][0] = reg64;
diff --git a/hw/intc/armv7m_nvic.c b/hw/intc/armv7m_nvic.c
index 03b6b8c986..72d3ae985e 100644
--- a/hw/intc/armv7m_nvic.c
+++ b/hw/intc/armv7m_nvic.c
@@ -2224,7 +2224,7 @@ static MemTxResult nvic_sysreg_read(void *opaque, hwaddr addr,
/* reads of set and clear both return the status */
case 0x100 ... 0x13f: /* NVIC Set enable */
offset += 0x80;
- /* fall through */
+ fallthrough;
case 0x180 ... 0x1bf: /* NVIC Clear enable */
val = 0;
startvec = 8 * (offset - 0x180) + NVIC_FIRST_IRQ; /* vector # */
@@ -2238,7 +2238,7 @@ static MemTxResult nvic_sysreg_read(void *opaque, hwaddr addr,
break;
case 0x200 ... 0x23f: /* NVIC Set pend */
offset += 0x80;
- /* fall through */
+ fallthrough;
case 0x280 ... 0x2bf: /* NVIC Clear pend */
val = 0;
startvec = 8 * (offset - 0x280) + NVIC_FIRST_IRQ; /* vector # */
@@ -2280,7 +2280,7 @@ static MemTxResult nvic_sysreg_read(void *opaque, hwaddr addr,
val = 0;
break;
}
- /* fall through */
+ fallthrough;
case 0xd1c ... 0xd23: /* System Handler Priority (SHPR2, SHPR3) */
val = 0;
for (i = 0; i < size; i++) {
@@ -2355,7 +2355,7 @@ static MemTxResult nvic_sysreg_write(void *opaque, hwaddr addr,
case 0x100 ... 0x13f: /* NVIC Set enable */
offset += 0x80;
setval = 1;
- /* fall through */
+ fallthrough;
case 0x180 ... 0x1bf: /* NVIC Clear enable */
startvec = 8 * (offset - 0x180) + NVIC_FIRST_IRQ;
@@ -2373,7 +2373,7 @@ static MemTxResult nvic_sysreg_write(void *opaque, hwaddr addr,
*/
offset += 0x80;
setval = 1;
- /* fall through */
+ fallthrough;
case 0x280 ... 0x2bf: /* NVIC Clear pend */
startvec = 8 * (offset - 0x280) + NVIC_FIRST_IRQ; /* vector # */
@@ -2408,7 +2408,7 @@ static MemTxResult nvic_sysreg_write(void *opaque, hwaddr addr,
if (!arm_feature(&s->cpu->env, ARM_FEATURE_M_MAIN)) {
goto exit_ok;
}
- /* fall through */
+ fallthrough;
case 0xd1c ... 0xd23: /* System Handler Priority (SHPR2, SHPR3) */
for (i = 0; i < size; i++) {
unsigned hdlidx = (offset - 0xd14) + i;
diff --git a/hw/intc/xilinx_intc.c b/hw/intc/xilinx_intc.c
index 6e5012e66e..245f452898 100644
--- a/hw/intc/xilinx_intc.c
+++ b/hw/intc/xilinx_intc.c
@@ -131,7 +131,7 @@ static void pic_write(void *opaque, hwaddr addr,
if ((p->regs[R_MER] & 2)) {
break;
}
- /* fallthrough */
+ fallthrough;
default:
if (addr < ARRAY_SIZE(p->regs))
p->regs[addr] = value;
--
2.39.2
^ permalink raw reply related [flat|nested] 106+ messages in thread
* [RFC PATCH v3 60/78] qga: add fallthrough pseudo-keyword
2023-10-13 8:45 [RFC PATCH v3 00/78] Strict disable implicit fallthrough Emmanouil Pitsidianakis
` (58 preceding siblings ...)
2023-10-13 8:46 ` [RFC PATCH v3 59/78] hw/intc: " Emmanouil Pitsidianakis
@ 2023-10-13 8:46 ` Emmanouil Pitsidianakis
2023-10-17 7:48 ` Konstantin Kostiuk
2023-10-13 8:46 ` [RFC PATCH v3 61/78] semihosting: " Emmanouil Pitsidianakis
` (19 subsequent siblings)
79 siblings, 1 reply; 106+ messages in thread
From: Emmanouil Pitsidianakis @ 2023-10-13 8:46 UTC (permalink / raw)
To: qemu-devel; +Cc: Emmanouil Pitsidianakis, Michael Roth, Konstantin Kostiuk
In preparation of raising -Wimplicit-fallthrough to 5, replace all
fall-through comments with the fallthrough attribute pseudo-keyword.
Signed-off-by: Emmanouil Pitsidianakis <manos.pitsidianakis@linaro.org>
---
qga/main.c | 2 +-
qga/vss-win32/requester.cpp | 1 +
2 files changed, 2 insertions(+), 1 deletion(-)
diff --git a/qga/main.c b/qga/main.c
index 8668b9f3d3..40471e8a0b 100644
--- a/qga/main.c
+++ b/qga/main.c
@@ -663,7 +663,7 @@ static gboolean channel_event_cb(GIOCondition condition, gpointer data)
if (!s->virtio) {
return false;
}
- /* fall through */
+ fallthrough;
case G_IO_STATUS_AGAIN:
/* virtio causes us to spin here when no process is attached to
* host-side chardev. sleep a bit to mitigate this
diff --git a/qga/vss-win32/requester.cpp b/qga/vss-win32/requester.cpp
index 9884c65e70..36fa4fdf28 100644
--- a/qga/vss-win32/requester.cpp
+++ b/qga/vss-win32/requester.cpp
@@ -611,6 +611,7 @@ void requester_thaw(int *num_vols, void *mountpints, ErrorSet *errset)
break;
}
/* fall through if hEventTimeout is signaled */
+ fallthrough;
case (HRESULT)VSS_E_HOLD_WRITES_TIMEOUT:
err_set(errset, hr, "couldn't hold writes: "
--
2.39.2
^ permalink raw reply related [flat|nested] 106+ messages in thread
* Re: [RFC PATCH v3 60/78] qga: add fallthrough pseudo-keyword
2023-10-13 8:46 ` [RFC PATCH v3 60/78] qga: " Emmanouil Pitsidianakis
@ 2023-10-17 7:48 ` Konstantin Kostiuk
0 siblings, 0 replies; 106+ messages in thread
From: Konstantin Kostiuk @ 2023-10-17 7:48 UTC (permalink / raw)
To: Emmanouil Pitsidianakis; +Cc: qemu-devel, Michael Roth
[-- Attachment #1: Type: text/plain, Size: 1575 bytes --]
Reviewed-by: Konstantin Kostiuk <kkostiuk@redhat.com>
On Fri, Oct 13, 2023 at 11:50 AM Emmanouil Pitsidianakis <
manos.pitsidianakis@linaro.org> wrote:
> In preparation of raising -Wimplicit-fallthrough to 5, replace all
> fall-through comments with the fallthrough attribute pseudo-keyword.
>
> Signed-off-by: Emmanouil Pitsidianakis <manos.pitsidianakis@linaro.org>
> ---
> qga/main.c | 2 +-
> qga/vss-win32/requester.cpp | 1 +
> 2 files changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/qga/main.c b/qga/main.c
> index 8668b9f3d3..40471e8a0b 100644
> --- a/qga/main.c
> +++ b/qga/main.c
> @@ -663,7 +663,7 @@ static gboolean channel_event_cb(GIOCondition
> condition, gpointer data)
> if (!s->virtio) {
> return false;
> }
> - /* fall through */
> + fallthrough;
> case G_IO_STATUS_AGAIN:
> /* virtio causes us to spin here when no process is attached to
> * host-side chardev. sleep a bit to mitigate this
> diff --git a/qga/vss-win32/requester.cpp b/qga/vss-win32/requester.cpp
> index 9884c65e70..36fa4fdf28 100644
> --- a/qga/vss-win32/requester.cpp
> +++ b/qga/vss-win32/requester.cpp
> @@ -611,6 +611,7 @@ void requester_thaw(int *num_vols, void *mountpints,
> ErrorSet *errset)
> break;
> }
> /* fall through if hEventTimeout is signaled */
> + fallthrough;
>
> case (HRESULT)VSS_E_HOLD_WRITES_TIMEOUT:
> err_set(errset, hr, "couldn't hold writes: "
> --
> 2.39.2
>
>
[-- Attachment #2: Type: text/html, Size: 2146 bytes --]
^ permalink raw reply [flat|nested] 106+ messages in thread
* [RFC PATCH v3 61/78] semihosting: add fallthrough pseudo-keyword
2023-10-13 8:45 [RFC PATCH v3 00/78] Strict disable implicit fallthrough Emmanouil Pitsidianakis
` (59 preceding siblings ...)
2023-10-13 8:46 ` [RFC PATCH v3 60/78] qga: " Emmanouil Pitsidianakis
@ 2023-10-13 8:46 ` Emmanouil Pitsidianakis
2023-10-13 8:46 ` [RFC PATCH v3 62/78] hw/gpio: " Emmanouil Pitsidianakis
` (18 subsequent siblings)
79 siblings, 0 replies; 106+ messages in thread
From: Emmanouil Pitsidianakis @ 2023-10-13 8:46 UTC (permalink / raw)
To: qemu-devel; +Cc: Emmanouil Pitsidianakis, Alex Bennée
In preparation of raising -Wimplicit-fallthrough to 5, replace all
fall-through comments with the fallthrough attribute pseudo-keyword.
Signed-off-by: Emmanouil Pitsidianakis <manos.pitsidianakis@linaro.org>
---
semihosting/arm-compat-semi.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/semihosting/arm-compat-semi.c b/semihosting/arm-compat-semi.c
index 329ea11260..c7d32cfca0 100644
--- a/semihosting/arm-compat-semi.c
+++ b/semihosting/arm-compat-semi.c
@@ -786,7 +786,7 @@ void do_common_semihosting(CPUState *cs)
common_semi_set_ret(cs, 0);
break;
}
- /* fall through */
+ fallthrough;
default:
fprintf(stderr, "qemu: Unsupported SemiHosting SWI 0x%02x\n", nr);
cpu_dump_state(cs, stderr, 0);
--
2.39.2
^ permalink raw reply related [flat|nested] 106+ messages in thread
* [RFC PATCH v3 62/78] hw/gpio: add fallthrough pseudo-keyword
2023-10-13 8:45 [RFC PATCH v3 00/78] Strict disable implicit fallthrough Emmanouil Pitsidianakis
` (60 preceding siblings ...)
2023-10-13 8:46 ` [RFC PATCH v3 61/78] semihosting: " Emmanouil Pitsidianakis
@ 2023-10-13 8:46 ` Emmanouil Pitsidianakis
2023-10-13 8:46 ` [RFC PATCH v3 63/78] hw/ipmi: " Emmanouil Pitsidianakis
` (17 subsequent siblings)
79 siblings, 0 replies; 106+ messages in thread
From: Emmanouil Pitsidianakis @ 2023-10-13 8:46 UTC (permalink / raw)
To: qemu-devel; +Cc: Emmanouil Pitsidianakis, Peter Maydell, open list:OMAP
In preparation of raising -Wimplicit-fallthrough to 5, replace all
fall-through comments with the fallthrough attribute pseudo-keyword.
Signed-off-by: Emmanouil Pitsidianakis <manos.pitsidianakis@linaro.org>
---
hw/gpio/omap_gpio.c | 2 +-
hw/i2c/bitbang_i2c.c | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/hw/gpio/omap_gpio.c b/hw/gpio/omap_gpio.c
index a3341d70f1..82a9ea4810 100644
--- a/hw/gpio/omap_gpio.c
+++ b/hw/gpio/omap_gpio.c
@@ -563,7 +563,7 @@ static void omap2_gpio_module_writep(void *opaque, hwaddr addr,
cur = omap2_gpio_module_read(opaque, addr & ~3) &
~(mask << ((addr & 3) << 3));
- /* Fall through. */
+ fallthrough;
case 0x18: /* GPIO_IRQSTATUS1 */
case 0x28: /* GPIO_IRQSTATUS2 */
case 0x60: /* GPIO_CLEARIRQENABLE1 */
diff --git a/hw/i2c/bitbang_i2c.c b/hw/i2c/bitbang_i2c.c
index de5f5aacf5..3d768ae564 100644
--- a/hw/i2c/bitbang_i2c.c
+++ b/hw/i2c/bitbang_i2c.c
@@ -156,7 +156,7 @@ int bitbang_i2c_set(bitbang_i2c_interface *i2c, int line, int level)
case RECEIVING_BIT7:
i2c->buffer = i2c_recv(i2c->bus);
trace_bitbang_i2c_recv(i2c->buffer);
- /* Fall through... */
+ fallthrough;
case RECEIVING_BIT6 ... RECEIVING_BIT0:
data = i2c->buffer >> 7;
/* will end up in SENDING_ACK */
--
2.39.2
^ permalink raw reply related [flat|nested] 106+ messages in thread
* [RFC PATCH v3 63/78] hw/ipmi: add fallthrough pseudo-keyword
2023-10-13 8:45 [RFC PATCH v3 00/78] Strict disable implicit fallthrough Emmanouil Pitsidianakis
` (61 preceding siblings ...)
2023-10-13 8:46 ` [RFC PATCH v3 62/78] hw/gpio: " Emmanouil Pitsidianakis
@ 2023-10-13 8:46 ` Emmanouil Pitsidianakis
2023-10-13 8:46 ` [RFC PATCH v3 64/78] hw/mips: " Emmanouil Pitsidianakis
` (16 subsequent siblings)
79 siblings, 0 replies; 106+ messages in thread
From: Emmanouil Pitsidianakis @ 2023-10-13 8:46 UTC (permalink / raw)
To: qemu-devel; +Cc: Emmanouil Pitsidianakis, Corey Minyard
In preparation of raising -Wimplicit-fallthrough to 5, replace all
fall-through comments with the fallthrough attribute pseudo-keyword.
Signed-off-by: Emmanouil Pitsidianakis <manos.pitsidianakis@linaro.org>
---
hw/ipmi/ipmi_bmc_extern.c | 2 +-
hw/ipmi/smbus_ipmi.c | 4 ++--
2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/hw/ipmi/ipmi_bmc_extern.c b/hw/ipmi/ipmi_bmc_extern.c
index e232d35ba2..b2ca02b21f 100644
--- a/hw/ipmi/ipmi_bmc_extern.c
+++ b/hw/ipmi/ipmi_bmc_extern.c
@@ -174,7 +174,7 @@ static void addchar(IPMIBmcExtern *ibe, unsigned char ch)
ibe->outbuf[ibe->outlen] = VM_ESCAPE_CHAR;
ibe->outlen++;
ch |= 0x10;
- /* fall through */
+ fallthrough;
default:
ibe->outbuf[ibe->outlen] = ch;
ibe->outlen++;
diff --git a/hw/ipmi/smbus_ipmi.c b/hw/ipmi/smbus_ipmi.c
index d0991ab7f9..58f5328a19 100644
--- a/hw/ipmi/smbus_ipmi.c
+++ b/hw/ipmi/smbus_ipmi.c
@@ -252,7 +252,7 @@ static int ipmi_write_data(SMBusDevice *dev, uint8_t *buf, uint8_t len)
switch (cmd) {
case SSIF_IPMI_REQUEST:
send = true;
- /* FALLTHRU */
+ fallthrough;
case SSIF_IPMI_MULTI_PART_REQUEST_START:
if (len < 2) {
return -1; /* Bogus. */
@@ -263,7 +263,7 @@ static int ipmi_write_data(SMBusDevice *dev, uint8_t *buf, uint8_t len)
case SSIF_IPMI_MULTI_PART_REQUEST_END:
send = true;
- /* FALLTHRU */
+ fallthrough;
case SSIF_IPMI_MULTI_PART_REQUEST_MIDDLE:
if (!sid->inlen) {
return -1; /* Bogus. */
--
2.39.2
^ permalink raw reply related [flat|nested] 106+ messages in thread
* [RFC PATCH v3 64/78] hw/mips: add fallthrough pseudo-keyword
2023-10-13 8:45 [RFC PATCH v3 00/78] Strict disable implicit fallthrough Emmanouil Pitsidianakis
` (62 preceding siblings ...)
2023-10-13 8:46 ` [RFC PATCH v3 63/78] hw/ipmi: " Emmanouil Pitsidianakis
@ 2023-10-13 8:46 ` Emmanouil Pitsidianakis
2023-10-17 10:30 ` Philippe Mathieu-Daudé
2023-10-13 8:46 ` [RFC PATCH v3 65/78] hw/nvme: " Emmanouil Pitsidianakis
` (15 subsequent siblings)
79 siblings, 1 reply; 106+ messages in thread
From: Emmanouil Pitsidianakis @ 2023-10-13 8:46 UTC (permalink / raw)
To: qemu-devel
Cc: Emmanouil Pitsidianakis, Paul Burton, Aleksandar Rikalo,
Philippe Mathieu-Daudé, Jiaxun Yang
In preparation of raising -Wimplicit-fallthrough to 5, replace all
fall-through comments with the fallthrough attribute pseudo-keyword.
Signed-off-by: Emmanouil Pitsidianakis <manos.pitsidianakis@linaro.org>
---
hw/mips/boston.c | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/hw/mips/boston.c b/hw/mips/boston.c
index 4e11ff6cd6..4ca53b790a 100644
--- a/hw/mips/boston.c
+++ b/hw/mips/boston.c
@@ -173,14 +173,14 @@ static uint64_t boston_lcd_read(void *opaque, hwaddr addr,
val |= (uint64_t)s->lcd_content[(addr + 6) & 0x7] << 48;
val |= (uint64_t)s->lcd_content[(addr + 5) & 0x7] << 40;
val |= (uint64_t)s->lcd_content[(addr + 4) & 0x7] << 32;
- /* fall through */
+ fallthrough;
case 4:
val |= (uint64_t)s->lcd_content[(addr + 3) & 0x7] << 24;
val |= (uint64_t)s->lcd_content[(addr + 2) & 0x7] << 16;
- /* fall through */
+ fallthrough;
case 2:
val |= (uint64_t)s->lcd_content[(addr + 1) & 0x7] << 8;
- /* fall through */
+ fallthrough;
case 1:
val |= (uint64_t)s->lcd_content[(addr + 0) & 0x7];
break;
@@ -200,14 +200,14 @@ static void boston_lcd_write(void *opaque, hwaddr addr,
s->lcd_content[(addr + 6) & 0x7] = val >> 48;
s->lcd_content[(addr + 5) & 0x7] = val >> 40;
s->lcd_content[(addr + 4) & 0x7] = val >> 32;
- /* fall through */
+ fallthrough;
case 4:
s->lcd_content[(addr + 3) & 0x7] = val >> 24;
s->lcd_content[(addr + 2) & 0x7] = val >> 16;
- /* fall through */
+ fallthrough;
case 2:
s->lcd_content[(addr + 1) & 0x7] = val >> 8;
- /* fall through */
+ fallthrough;
case 1:
s->lcd_content[(addr + 0) & 0x7] = val;
break;
--
2.39.2
^ permalink raw reply related [flat|nested] 106+ messages in thread
* Re: [RFC PATCH v3 64/78] hw/mips: add fallthrough pseudo-keyword
2023-10-13 8:46 ` [RFC PATCH v3 64/78] hw/mips: " Emmanouil Pitsidianakis
@ 2023-10-17 10:30 ` Philippe Mathieu-Daudé
0 siblings, 0 replies; 106+ messages in thread
From: Philippe Mathieu-Daudé @ 2023-10-17 10:30 UTC (permalink / raw)
To: Emmanouil Pitsidianakis, qemu-devel
Cc: Paul Burton, Aleksandar Rikalo, Jiaxun Yang
On 13/10/23 10:46, Emmanouil Pitsidianakis wrote:
> In preparation of raising -Wimplicit-fallthrough to 5, replace all
> fall-through comments with the fallthrough attribute pseudo-keyword.
>
> Signed-off-by: Emmanouil Pitsidianakis <manos.pitsidianakis@linaro.org>
> ---
> hw/mips/boston.c | 12 ++++++------
> 1 file changed, 6 insertions(+), 6 deletions(-)
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
^ permalink raw reply [flat|nested] 106+ messages in thread
* [RFC PATCH v3 65/78] hw/nvme: add fallthrough pseudo-keyword
2023-10-13 8:45 [RFC PATCH v3 00/78] Strict disable implicit fallthrough Emmanouil Pitsidianakis
` (63 preceding siblings ...)
2023-10-13 8:46 ` [RFC PATCH v3 64/78] hw/mips: " Emmanouil Pitsidianakis
@ 2023-10-13 8:46 ` Emmanouil Pitsidianakis
2023-11-15 9:30 ` Klaus Jensen
2023-10-13 8:46 ` [RFC PATCH v3 66/78] hw/nvram/eeprom_at24c.c: " Emmanouil Pitsidianakis
` (14 subsequent siblings)
79 siblings, 1 reply; 106+ messages in thread
From: Emmanouil Pitsidianakis @ 2023-10-13 8:46 UTC (permalink / raw)
To: qemu-devel
Cc: Emmanouil Pitsidianakis, Keith Busch, Klaus Jensen,
open list:nvme
In preparation of raising -Wimplicit-fallthrough to 5, replace all
fall-through comments with the fallthrough attribute pseudo-keyword.
Signed-off-by: Emmanouil Pitsidianakis <manos.pitsidianakis@linaro.org>
---
hw/nvme/ctrl.c | 24 ++++++++++++------------
hw/nvme/dif.c | 4 ++--
2 files changed, 14 insertions(+), 14 deletions(-)
diff --git a/hw/nvme/ctrl.c b/hw/nvme/ctrl.c
index f026245d1e..acb2012fb9 100644
--- a/hw/nvme/ctrl.c
+++ b/hw/nvme/ctrl.c
@@ -1918,7 +1918,7 @@ static uint16_t nvme_zrm_finish(NvmeNamespace *ns, NvmeZone *zone)
case NVME_ZONE_STATE_IMPLICITLY_OPEN:
case NVME_ZONE_STATE_EXPLICITLY_OPEN:
nvme_aor_dec_open(ns);
- /* fallthrough */
+ fallthrough;
case NVME_ZONE_STATE_CLOSED:
nvme_aor_dec_active(ns);
@@ -1929,7 +1929,7 @@ static uint16_t nvme_zrm_finish(NvmeNamespace *ns, NvmeZone *zone)
}
}
- /* fallthrough */
+ fallthrough;
case NVME_ZONE_STATE_EMPTY:
nvme_assign_zone_state(ns, zone, NVME_ZONE_STATE_FULL);
return NVME_SUCCESS;
@@ -1946,7 +1946,7 @@ static uint16_t nvme_zrm_close(NvmeNamespace *ns, NvmeZone *zone)
case NVME_ZONE_STATE_IMPLICITLY_OPEN:
nvme_aor_dec_open(ns);
nvme_assign_zone_state(ns, zone, NVME_ZONE_STATE_CLOSED);
- /* fall through */
+ fallthrough;
case NVME_ZONE_STATE_CLOSED:
return NVME_SUCCESS;
@@ -1961,7 +1961,7 @@ static uint16_t nvme_zrm_reset(NvmeNamespace *ns, NvmeZone *zone)
case NVME_ZONE_STATE_EXPLICITLY_OPEN:
case NVME_ZONE_STATE_IMPLICITLY_OPEN:
nvme_aor_dec_open(ns);
- /* fallthrough */
+ fallthrough;
case NVME_ZONE_STATE_CLOSED:
nvme_aor_dec_active(ns);
@@ -1971,12 +1971,12 @@ static uint16_t nvme_zrm_reset(NvmeNamespace *ns, NvmeZone *zone)
}
}
- /* fallthrough */
+ fallthrough;
case NVME_ZONE_STATE_FULL:
zone->w_ptr = zone->d.zslba;
zone->d.wp = zone->w_ptr;
nvme_assign_zone_state(ns, zone, NVME_ZONE_STATE_EMPTY);
- /* fallthrough */
+ fallthrough;
case NVME_ZONE_STATE_EMPTY:
return NVME_SUCCESS;
@@ -2017,7 +2017,7 @@ static uint16_t nvme_zrm_open_flags(NvmeCtrl *n, NvmeNamespace *ns,
case NVME_ZONE_STATE_EMPTY:
act = 1;
- /* fallthrough */
+ fallthrough;
case NVME_ZONE_STATE_CLOSED:
if (n->params.auto_transition_zones) {
@@ -2040,7 +2040,7 @@ static uint16_t nvme_zrm_open_flags(NvmeCtrl *n, NvmeNamespace *ns,
return NVME_SUCCESS;
}
- /* fallthrough */
+ fallthrough;
case NVME_ZONE_STATE_IMPLICITLY_OPEN:
if (flags & NVME_ZRM_AUTO) {
@@ -2049,7 +2049,7 @@ static uint16_t nvme_zrm_open_flags(NvmeCtrl *n, NvmeNamespace *ns,
nvme_assign_zone_state(ns, zone, NVME_ZONE_STATE_EXPLICITLY_OPEN);
- /* fallthrough */
+ fallthrough;
case NVME_ZONE_STATE_EXPLICITLY_OPEN:
if (flags & NVME_ZRM_ZRWA) {
@@ -3582,7 +3582,7 @@ static uint16_t nvme_do_write(NvmeCtrl *n, NvmeRequest *req, bool append,
return NVME_INVALID_PROT_INFO | NVME_DNR;
}
- /* fallthrough */
+ fallthrough;
case NVME_ID_NS_DPS_TYPE_2:
if (piremap) {
@@ -3737,7 +3737,7 @@ static uint16_t nvme_offline_zone(NvmeNamespace *ns, NvmeZone *zone,
switch (state) {
case NVME_ZONE_STATE_READ_ONLY:
nvme_assign_zone_state(ns, zone, NVME_ZONE_STATE_OFFLINE);
- /* fall through */
+ fallthrough;
case NVME_ZONE_STATE_OFFLINE:
return NVME_SUCCESS;
default:
@@ -4914,7 +4914,7 @@ static uint16_t nvme_cmd_effects(NvmeCtrl *n, uint8_t csi, uint32_t buf_len,
switch (NVME_CC_CSS(ldl_le_p(&n->bar.cc))) {
case NVME_CC_CSS_NVM:
src_iocs = nvme_cse_iocs_nvm;
- /* fall through */
+ fallthrough;
case NVME_CC_CSS_ADMIN_ONLY:
break;
case NVME_CC_CSS_CSI:
diff --git a/hw/nvme/dif.c b/hw/nvme/dif.c
index 01b19c3373..00dd96bdb3 100644
--- a/hw/nvme/dif.c
+++ b/hw/nvme/dif.c
@@ -161,7 +161,7 @@ static uint16_t nvme_dif_prchk_crc16(NvmeNamespace *ns, NvmeDifTuple *dif,
break;
}
- /* fallthrough */
+ fallthrough;
case NVME_ID_NS_DPS_TYPE_1:
case NVME_ID_NS_DPS_TYPE_2:
if (be16_to_cpu(dif->g16.apptag) != 0xffff) {
@@ -229,7 +229,7 @@ static uint16_t nvme_dif_prchk_crc64(NvmeNamespace *ns, NvmeDifTuple *dif,
break;
}
- /* fallthrough */
+ fallthrough;
case NVME_ID_NS_DPS_TYPE_1:
case NVME_ID_NS_DPS_TYPE_2:
if (be16_to_cpu(dif->g64.apptag) != 0xffff) {
--
2.39.2
^ permalink raw reply related [flat|nested] 106+ messages in thread
* Re: [RFC PATCH v3 65/78] hw/nvme: add fallthrough pseudo-keyword
2023-10-13 8:46 ` [RFC PATCH v3 65/78] hw/nvme: " Emmanouil Pitsidianakis
@ 2023-11-15 9:30 ` Klaus Jensen
0 siblings, 0 replies; 106+ messages in thread
From: Klaus Jensen @ 2023-11-15 9:30 UTC (permalink / raw)
To: Emmanouil Pitsidianakis; +Cc: qemu-devel, Keith Busch, open list:nvme
[-- Attachment #1: Type: text/plain, Size: 5321 bytes --]
On Oct 13 11:46, Emmanouil Pitsidianakis wrote:
> In preparation of raising -Wimplicit-fallthrough to 5, replace all
> fall-through comments with the fallthrough attribute pseudo-keyword.
>
> Signed-off-by: Emmanouil Pitsidianakis <manos.pitsidianakis@linaro.org>
> ---
> hw/nvme/ctrl.c | 24 ++++++++++++------------
> hw/nvme/dif.c | 4 ++--
> 2 files changed, 14 insertions(+), 14 deletions(-)
>
> diff --git a/hw/nvme/ctrl.c b/hw/nvme/ctrl.c
> index f026245d1e..acb2012fb9 100644
> --- a/hw/nvme/ctrl.c
> +++ b/hw/nvme/ctrl.c
> @@ -1918,7 +1918,7 @@ static uint16_t nvme_zrm_finish(NvmeNamespace *ns, NvmeZone *zone)
> case NVME_ZONE_STATE_IMPLICITLY_OPEN:
> case NVME_ZONE_STATE_EXPLICITLY_OPEN:
> nvme_aor_dec_open(ns);
> - /* fallthrough */
> + fallthrough;
> case NVME_ZONE_STATE_CLOSED:
> nvme_aor_dec_active(ns);
>
> @@ -1929,7 +1929,7 @@ static uint16_t nvme_zrm_finish(NvmeNamespace *ns, NvmeZone *zone)
> }
> }
>
> - /* fallthrough */
> + fallthrough;
> case NVME_ZONE_STATE_EMPTY:
> nvme_assign_zone_state(ns, zone, NVME_ZONE_STATE_FULL);
> return NVME_SUCCESS;
> @@ -1946,7 +1946,7 @@ static uint16_t nvme_zrm_close(NvmeNamespace *ns, NvmeZone *zone)
> case NVME_ZONE_STATE_IMPLICITLY_OPEN:
> nvme_aor_dec_open(ns);
> nvme_assign_zone_state(ns, zone, NVME_ZONE_STATE_CLOSED);
> - /* fall through */
> + fallthrough;
> case NVME_ZONE_STATE_CLOSED:
> return NVME_SUCCESS;
>
> @@ -1961,7 +1961,7 @@ static uint16_t nvme_zrm_reset(NvmeNamespace *ns, NvmeZone *zone)
> case NVME_ZONE_STATE_EXPLICITLY_OPEN:
> case NVME_ZONE_STATE_IMPLICITLY_OPEN:
> nvme_aor_dec_open(ns);
> - /* fallthrough */
> + fallthrough;
> case NVME_ZONE_STATE_CLOSED:
> nvme_aor_dec_active(ns);
>
> @@ -1971,12 +1971,12 @@ static uint16_t nvme_zrm_reset(NvmeNamespace *ns, NvmeZone *zone)
> }
> }
>
> - /* fallthrough */
> + fallthrough;
> case NVME_ZONE_STATE_FULL:
> zone->w_ptr = zone->d.zslba;
> zone->d.wp = zone->w_ptr;
> nvme_assign_zone_state(ns, zone, NVME_ZONE_STATE_EMPTY);
> - /* fallthrough */
> + fallthrough;
> case NVME_ZONE_STATE_EMPTY:
> return NVME_SUCCESS;
>
> @@ -2017,7 +2017,7 @@ static uint16_t nvme_zrm_open_flags(NvmeCtrl *n, NvmeNamespace *ns,
> case NVME_ZONE_STATE_EMPTY:
> act = 1;
>
> - /* fallthrough */
> + fallthrough;
>
> case NVME_ZONE_STATE_CLOSED:
> if (n->params.auto_transition_zones) {
> @@ -2040,7 +2040,7 @@ static uint16_t nvme_zrm_open_flags(NvmeCtrl *n, NvmeNamespace *ns,
> return NVME_SUCCESS;
> }
>
> - /* fallthrough */
> + fallthrough;
>
> case NVME_ZONE_STATE_IMPLICITLY_OPEN:
> if (flags & NVME_ZRM_AUTO) {
> @@ -2049,7 +2049,7 @@ static uint16_t nvme_zrm_open_flags(NvmeCtrl *n, NvmeNamespace *ns,
>
> nvme_assign_zone_state(ns, zone, NVME_ZONE_STATE_EXPLICITLY_OPEN);
>
> - /* fallthrough */
> + fallthrough;
>
> case NVME_ZONE_STATE_EXPLICITLY_OPEN:
> if (flags & NVME_ZRM_ZRWA) {
> @@ -3582,7 +3582,7 @@ static uint16_t nvme_do_write(NvmeCtrl *n, NvmeRequest *req, bool append,
> return NVME_INVALID_PROT_INFO | NVME_DNR;
> }
>
> - /* fallthrough */
> + fallthrough;
>
> case NVME_ID_NS_DPS_TYPE_2:
> if (piremap) {
> @@ -3737,7 +3737,7 @@ static uint16_t nvme_offline_zone(NvmeNamespace *ns, NvmeZone *zone,
> switch (state) {
> case NVME_ZONE_STATE_READ_ONLY:
> nvme_assign_zone_state(ns, zone, NVME_ZONE_STATE_OFFLINE);
> - /* fall through */
> + fallthrough;
> case NVME_ZONE_STATE_OFFLINE:
> return NVME_SUCCESS;
> default:
> @@ -4914,7 +4914,7 @@ static uint16_t nvme_cmd_effects(NvmeCtrl *n, uint8_t csi, uint32_t buf_len,
> switch (NVME_CC_CSS(ldl_le_p(&n->bar.cc))) {
> case NVME_CC_CSS_NVM:
> src_iocs = nvme_cse_iocs_nvm;
> - /* fall through */
> + fallthrough;
> case NVME_CC_CSS_ADMIN_ONLY:
> break;
> case NVME_CC_CSS_CSI:
> diff --git a/hw/nvme/dif.c b/hw/nvme/dif.c
> index 01b19c3373..00dd96bdb3 100644
> --- a/hw/nvme/dif.c
> +++ b/hw/nvme/dif.c
> @@ -161,7 +161,7 @@ static uint16_t nvme_dif_prchk_crc16(NvmeNamespace *ns, NvmeDifTuple *dif,
> break;
> }
>
> - /* fallthrough */
> + fallthrough;
> case NVME_ID_NS_DPS_TYPE_1:
> case NVME_ID_NS_DPS_TYPE_2:
> if (be16_to_cpu(dif->g16.apptag) != 0xffff) {
> @@ -229,7 +229,7 @@ static uint16_t nvme_dif_prchk_crc64(NvmeNamespace *ns, NvmeDifTuple *dif,
> break;
> }
>
> - /* fallthrough */
> + fallthrough;
> case NVME_ID_NS_DPS_TYPE_1:
> case NVME_ID_NS_DPS_TYPE_2:
> if (be16_to_cpu(dif->g64.apptag) != 0xffff) {
> --
> 2.39.2
>
>
Reviewed-by: Klaus Jensen <k.jensen@samsung.com>
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]
^ permalink raw reply [flat|nested] 106+ messages in thread
* [RFC PATCH v3 66/78] hw/nvram/eeprom_at24c.c: add fallthrough pseudo-keyword
2023-10-13 8:45 [RFC PATCH v3 00/78] Strict disable implicit fallthrough Emmanouil Pitsidianakis
` (64 preceding siblings ...)
2023-10-13 8:46 ` [RFC PATCH v3 65/78] hw/nvme: " Emmanouil Pitsidianakis
@ 2023-10-13 8:46 ` Emmanouil Pitsidianakis
2023-10-13 8:46 ` [RFC PATCH v3 67/78] hw/pci-host/pnv_phb3.c: " Emmanouil Pitsidianakis
` (13 subsequent siblings)
79 siblings, 0 replies; 106+ messages in thread
From: Emmanouil Pitsidianakis @ 2023-10-13 8:46 UTC (permalink / raw)
To: qemu-devel; +Cc: Emmanouil Pitsidianakis
In preparation of raising -Wimplicit-fallthrough to 5, replace all
fall-through comments with the fallthrough attribute pseudo-keyword.
Signed-off-by: Emmanouil Pitsidianakis <manos.pitsidianakis@linaro.org>
---
hw/nvram/eeprom_at24c.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/hw/nvram/eeprom_at24c.c b/hw/nvram/eeprom_at24c.c
index 3272068663..aa3685db33 100644
--- a/hw/nvram/eeprom_at24c.c
+++ b/hw/nvram/eeprom_at24c.c
@@ -71,7 +71,7 @@ int at24c_eeprom_event(I2CSlave *s, enum i2c_event event)
case I2C_START_SEND:
case I2C_FINISH:
ee->haveaddr = 0;
- /* fallthrough */
+ fallthrough;
case I2C_START_RECV:
DPRINTK("clear\n");
if (ee->blk && ee->changed) {
--
2.39.2
^ permalink raw reply related [flat|nested] 106+ messages in thread
* [RFC PATCH v3 67/78] hw/pci-host/pnv_phb3.c: add fallthrough pseudo-keyword
2023-10-13 8:45 [RFC PATCH v3 00/78] Strict disable implicit fallthrough Emmanouil Pitsidianakis
` (65 preceding siblings ...)
2023-10-13 8:46 ` [RFC PATCH v3 66/78] hw/nvram/eeprom_at24c.c: " Emmanouil Pitsidianakis
@ 2023-10-13 8:46 ` Emmanouil Pitsidianakis
2023-10-13 12:53 ` Cédric Le Goater
2023-10-13 8:46 ` [RFC PATCH v3 68/78] hw/pci: " Emmanouil Pitsidianakis
` (12 subsequent siblings)
79 siblings, 1 reply; 106+ messages in thread
From: Emmanouil Pitsidianakis @ 2023-10-13 8:46 UTC (permalink / raw)
To: qemu-devel
Cc: Emmanouil Pitsidianakis, Cédric Le Goater, Nicholas Piggin,
Frédéric Barrat
In preparation of raising -Wimplicit-fallthrough to 5, replace all
fall-through comments with the fallthrough attribute pseudo-keyword.
Signed-off-by: Emmanouil Pitsidianakis <manos.pitsidianakis@linaro.org>
---
hw/pci-host/pnv_phb3.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/hw/pci-host/pnv_phb3.c b/hw/pci-host/pnv_phb3.c
index c5e58f4086..6a805d3900 100644
--- a/hw/pci-host/pnv_phb3.c
+++ b/hw/pci-host/pnv_phb3.c
@@ -531,7 +531,7 @@ void pnv_phb3_reg_write(void *opaque, hwaddr off, uint64_t val, unsigned size)
if (changed) {
pnv_phb3_update_all_msi_regions(phb);
}
- /* fall through */
+ fallthrough;
case PHB_M32_BASE_ADDR:
case PHB_M32_BASE_MASK:
case PHB_M32_START_ADDR:
--
2.39.2
^ permalink raw reply related [flat|nested] 106+ messages in thread
* Re: [RFC PATCH v3 67/78] hw/pci-host/pnv_phb3.c: add fallthrough pseudo-keyword
2023-10-13 8:46 ` [RFC PATCH v3 67/78] hw/pci-host/pnv_phb3.c: " Emmanouil Pitsidianakis
@ 2023-10-13 12:53 ` Cédric Le Goater
0 siblings, 0 replies; 106+ messages in thread
From: Cédric Le Goater @ 2023-10-13 12:53 UTC (permalink / raw)
To: Emmanouil Pitsidianakis, qemu-devel
Cc: Nicholas Piggin, Frédéric Barrat
On 10/13/23 10:46, Emmanouil Pitsidianakis wrote:
> In preparation of raising -Wimplicit-fallthrough to 5, replace all
> fall-through comments with the fallthrough attribute pseudo-keyword.
>
> Signed-off-by: Emmanouil Pitsidianakis <manos.pitsidianakis@linaro.org>
Reviewed-by: Cédric Le Goater <clg@kaod.org>
Thanks,
C.
> ---
> hw/pci-host/pnv_phb3.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/hw/pci-host/pnv_phb3.c b/hw/pci-host/pnv_phb3.c
> index c5e58f4086..6a805d3900 100644
> --- a/hw/pci-host/pnv_phb3.c
> +++ b/hw/pci-host/pnv_phb3.c
> @@ -531,7 +531,7 @@ void pnv_phb3_reg_write(void *opaque, hwaddr off, uint64_t val, unsigned size)
> if (changed) {
> pnv_phb3_update_all_msi_regions(phb);
> }
> - /* fall through */
> + fallthrough;
> case PHB_M32_BASE_ADDR:
> case PHB_M32_BASE_MASK:
> case PHB_M32_START_ADDR:
^ permalink raw reply [flat|nested] 106+ messages in thread
* [RFC PATCH v3 68/78] hw/pci: add fallthrough pseudo-keyword
2023-10-13 8:45 [RFC PATCH v3 00/78] Strict disable implicit fallthrough Emmanouil Pitsidianakis
` (66 preceding siblings ...)
2023-10-13 8:46 ` [RFC PATCH v3 67/78] hw/pci-host/pnv_phb3.c: " Emmanouil Pitsidianakis
@ 2023-10-13 8:46 ` Emmanouil Pitsidianakis
2023-10-13 8:46 ` [RFC PATCH v3 69/78] hw/rdma/rdma_backend.c: " Emmanouil Pitsidianakis
` (11 subsequent siblings)
79 siblings, 0 replies; 106+ messages in thread
From: Emmanouil Pitsidianakis @ 2023-10-13 8:46 UTC (permalink / raw)
To: qemu-devel
Cc: Emmanouil Pitsidianakis, Michael S. Tsirkin, Marcel Apfelbaum,
Huai-Cheng Kuo, Chris Browy
In preparation of raising -Wimplicit-fallthrough to 5, replace all
fall-through comments with the fallthrough attribute pseudo-keyword.
Signed-off-by: Emmanouil Pitsidianakis <manos.pitsidianakis@linaro.org>
---
hw/pci/pcie_aer.c | 3 ++-
hw/pci/pcie_doe.c | 2 +-
2 files changed, 3 insertions(+), 2 deletions(-)
diff --git a/hw/pci/pcie_aer.c b/hw/pci/pcie_aer.c
index b68c7ecb49..c99ecce2a1 100644
--- a/hw/pci/pcie_aer.c
+++ b/hw/pci/pcie_aer.c
@@ -151,8 +151,9 @@ int pcie_aer_init(PCIDevice *dev, uint8_t cap_ver, uint16_t offset,
switch (pcie_cap_get_type(dev)) {
case PCI_EXP_TYPE_ROOT_PORT:
/* this case will be set by pcie_aer_root_init() */
- /* fallthrough */
+ fallthrough;
case PCI_EXP_TYPE_DOWNSTREAM:
+ fallthrough;
case PCI_EXP_TYPE_UPSTREAM:
pci_word_test_and_set_mask(dev->wmask + PCI_BRIDGE_CONTROL,
PCI_BRIDGE_CTL_SERR);
diff --git a/hw/pci/pcie_doe.c b/hw/pci/pcie_doe.c
index 2210f86968..f04a36e664 100644
--- a/hw/pci/pcie_doe.c
+++ b/hw/pci/pcie_doe.c
@@ -360,7 +360,7 @@ void pcie_doe_write_config(DOECap *doe_cap,
doe_cap->write_mbox_len++;
break;
case PCI_EXP_DOE_CAP:
- /* fallthrough */
+ fallthrough;
default:
break;
}
--
2.39.2
^ permalink raw reply related [flat|nested] 106+ messages in thread
* [RFC PATCH v3 69/78] hw/rdma/rdma_backend.c: add fallthrough pseudo-keyword
2023-10-13 8:45 [RFC PATCH v3 00/78] Strict disable implicit fallthrough Emmanouil Pitsidianakis
` (67 preceding siblings ...)
2023-10-13 8:46 ` [RFC PATCH v3 68/78] hw/pci: " Emmanouil Pitsidianakis
@ 2023-10-13 8:46 ` Emmanouil Pitsidianakis
2023-10-13 8:46 ` [RFC PATCH v3 70/78] hw/rtc: " Emmanouil Pitsidianakis
` (10 subsequent siblings)
79 siblings, 0 replies; 106+ messages in thread
From: Emmanouil Pitsidianakis @ 2023-10-13 8:46 UTC (permalink / raw)
To: qemu-devel; +Cc: Emmanouil Pitsidianakis, Yuval Shaia, Marcel Apfelbaum
In preparation of raising -Wimplicit-fallthrough to 5, replace all
fall-through comments with the fallthrough attribute pseudo-keyword.
Signed-off-by: Emmanouil Pitsidianakis <manos.pitsidianakis@linaro.org>
---
hw/rdma/rdma_backend.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/hw/rdma/rdma_backend.c b/hw/rdma/rdma_backend.c
index 6dcdfbbbe2..09e5ad961e 100644
--- a/hw/rdma/rdma_backend.c
+++ b/hw/rdma/rdma_backend.c
@@ -812,7 +812,7 @@ int rdma_backend_create_qp(RdmaBackendQP *qp, uint8_t qp_type,
return 0;
case IBV_QPT_RC:
- /* fall through */
+ fallthrough;
case IBV_QPT_UD:
/* do nothing */
break;
--
2.39.2
^ permalink raw reply related [flat|nested] 106+ messages in thread
* [RFC PATCH v3 70/78] hw/rtc: add fallthrough pseudo-keyword
2023-10-13 8:45 [RFC PATCH v3 00/78] Strict disable implicit fallthrough Emmanouil Pitsidianakis
` (68 preceding siblings ...)
2023-10-13 8:46 ` [RFC PATCH v3 69/78] hw/rdma/rdma_backend.c: " Emmanouil Pitsidianakis
@ 2023-10-13 8:46 ` Emmanouil Pitsidianakis
2023-10-13 12:53 ` Cédric Le Goater
2023-10-13 8:46 ` [RFC PATCH v3 71/78] hw/s390x: " Emmanouil Pitsidianakis
` (9 subsequent siblings)
79 siblings, 1 reply; 106+ messages in thread
From: Emmanouil Pitsidianakis @ 2023-10-13 8:46 UTC (permalink / raw)
To: qemu-devel
Cc: Emmanouil Pitsidianakis, Cédric Le Goater, Peter Maydell,
Andrew Jeffery, Joel Stanley, Michael S. Tsirkin, Paolo Bonzini,
open list:ASPEED BMCs
In preparation of raising -Wimplicit-fallthrough to 5, replace all
fall-through comments with the fallthrough attribute pseudo-keyword.
Signed-off-by: Emmanouil Pitsidianakis <manos.pitsidianakis@linaro.org>
---
hw/rtc/aspeed_rtc.c | 4 ++--
hw/rtc/mc146818rtc.c | 4 ++--
2 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/hw/rtc/aspeed_rtc.c b/hw/rtc/aspeed_rtc.c
index fa861e2d49..59c64b01b9 100644
--- a/hw/rtc/aspeed_rtc.c
+++ b/hw/rtc/aspeed_rtc.c
@@ -78,7 +78,7 @@ static uint64_t aspeed_rtc_read(void *opaque, hwaddr addr,
if (rtc->reg[CONTROL] & RTC_ENABLED) {
rtc->reg[r] = aspeed_rtc_get_counter(rtc, r);
}
- /* fall through */
+ fallthrough;
case CONTROL:
val = rtc->reg[r];
break;
@@ -106,7 +106,7 @@ static void aspeed_rtc_write(void *opaque, hwaddr addr,
if (!(rtc->reg[CONTROL] & RTC_UNLOCKED)) {
break;
}
- /* fall through */
+ fallthrough;
case CONTROL:
rtc->reg[r] = val;
aspeed_rtc_calc_offset(rtc);
diff --git a/hw/rtc/mc146818rtc.c b/hw/rtc/mc146818rtc.c
index c27c362db9..6b6eef94fd 100644
--- a/hw/rtc/mc146818rtc.c
+++ b/hw/rtc/mc146818rtc.c
@@ -457,7 +457,7 @@ static void cmos_ioport_write(void *opaque, hwaddr addr,
break;
case RTC_IBM_PS2_CENTURY_BYTE:
s->cmos_index = RTC_CENTURY;
- /* fall through */
+ fallthrough;
case RTC_CENTURY:
case RTC_SECONDS:
case RTC_MINUTES:
@@ -686,7 +686,7 @@ static uint64_t cmos_ioport_read(void *opaque, hwaddr addr,
switch(s->cmos_index) {
case RTC_IBM_PS2_CENTURY_BYTE:
s->cmos_index = RTC_CENTURY;
- /* fall through */
+ fallthrough;
case RTC_CENTURY:
case RTC_SECONDS:
case RTC_MINUTES:
--
2.39.2
^ permalink raw reply related [flat|nested] 106+ messages in thread
* Re: [RFC PATCH v3 70/78] hw/rtc: add fallthrough pseudo-keyword
2023-10-13 8:46 ` [RFC PATCH v3 70/78] hw/rtc: " Emmanouil Pitsidianakis
@ 2023-10-13 12:53 ` Cédric Le Goater
0 siblings, 0 replies; 106+ messages in thread
From: Cédric Le Goater @ 2023-10-13 12:53 UTC (permalink / raw)
To: Emmanouil Pitsidianakis, qemu-devel
Cc: Peter Maydell, Andrew Jeffery, Joel Stanley, Michael S. Tsirkin,
Paolo Bonzini, open list:ASPEED BMCs
On 10/13/23 10:46, Emmanouil Pitsidianakis wrote:
> In preparation of raising -Wimplicit-fallthrough to 5, replace all
> fall-through comments with the fallthrough attribute pseudo-keyword.
>
> Signed-off-by: Emmanouil Pitsidianakis <manos.pitsidianakis@linaro.org>
Reviewed-by: Cédric Le Goater <clg@kaod.org>
Thanks,
C.
> ---
> hw/rtc/aspeed_rtc.c | 4 ++--
> hw/rtc/mc146818rtc.c | 4 ++--
> 2 files changed, 4 insertions(+), 4 deletions(-)
>
> diff --git a/hw/rtc/aspeed_rtc.c b/hw/rtc/aspeed_rtc.c
> index fa861e2d49..59c64b01b9 100644
> --- a/hw/rtc/aspeed_rtc.c
> +++ b/hw/rtc/aspeed_rtc.c
> @@ -78,7 +78,7 @@ static uint64_t aspeed_rtc_read(void *opaque, hwaddr addr,
> if (rtc->reg[CONTROL] & RTC_ENABLED) {
> rtc->reg[r] = aspeed_rtc_get_counter(rtc, r);
> }
> - /* fall through */
> + fallthrough;
> case CONTROL:
> val = rtc->reg[r];
> break;
> @@ -106,7 +106,7 @@ static void aspeed_rtc_write(void *opaque, hwaddr addr,
> if (!(rtc->reg[CONTROL] & RTC_UNLOCKED)) {
> break;
> }
> - /* fall through */
> + fallthrough;
> case CONTROL:
> rtc->reg[r] = val;
> aspeed_rtc_calc_offset(rtc);
> diff --git a/hw/rtc/mc146818rtc.c b/hw/rtc/mc146818rtc.c
> index c27c362db9..6b6eef94fd 100644
> --- a/hw/rtc/mc146818rtc.c
> +++ b/hw/rtc/mc146818rtc.c
> @@ -457,7 +457,7 @@ static void cmos_ioport_write(void *opaque, hwaddr addr,
> break;
> case RTC_IBM_PS2_CENTURY_BYTE:
> s->cmos_index = RTC_CENTURY;
> - /* fall through */
> + fallthrough;
> case RTC_CENTURY:
> case RTC_SECONDS:
> case RTC_MINUTES:
> @@ -686,7 +686,7 @@ static uint64_t cmos_ioport_read(void *opaque, hwaddr addr,
> switch(s->cmos_index) {
> case RTC_IBM_PS2_CENTURY_BYTE:
> s->cmos_index = RTC_CENTURY;
> - /* fall through */
> + fallthrough;
> case RTC_CENTURY:
> case RTC_SECONDS:
> case RTC_MINUTES:
^ permalink raw reply [flat|nested] 106+ messages in thread
* [RFC PATCH v3 71/78] hw/s390x: add fallthrough pseudo-keyword
2023-10-13 8:45 [RFC PATCH v3 00/78] Strict disable implicit fallthrough Emmanouil Pitsidianakis
` (69 preceding siblings ...)
2023-10-13 8:46 ` [RFC PATCH v3 70/78] hw/rtc: " Emmanouil Pitsidianakis
@ 2023-10-13 8:46 ` Emmanouil Pitsidianakis
2023-10-13 8:46 ` [RFC PATCH v3 72/78] hw/ssi: " Emmanouil Pitsidianakis
` (8 subsequent siblings)
79 siblings, 0 replies; 106+ messages in thread
From: Emmanouil Pitsidianakis @ 2023-10-13 8:46 UTC (permalink / raw)
To: qemu-devel
Cc: Emmanouil Pitsidianakis, David Hildenbrand, Christian Borntraeger,
Thomas Huth, Halil Pasic, Eric Farman, Richard Henderson,
Ilya Leoshkevich, Matthew Rosato, open list:S390-ccw boot
In preparation of raising -Wimplicit-fallthrough to 5, replace all
fall-through comments with the fallthrough attribute pseudo-keyword.
Reviewed-by: David Hildenbrand <david@redhat.com>
Signed-off-by: Emmanouil Pitsidianakis <manos.pitsidianakis@linaro.org>
---
hw/s390x/ipl.c | 1 +
hw/s390x/s390-pci-inst.c | 4 ++--
hw/s390x/sclp.c | 4 ++--
3 files changed, 5 insertions(+), 4 deletions(-)
diff --git a/hw/s390x/ipl.c b/hw/s390x/ipl.c
index 515dcf51b5..da2333846f 100644
--- a/hw/s390x/ipl.c
+++ b/hw/s390x/ipl.c
@@ -429,6 +429,7 @@ static bool s390_gen_initial_iplb(S390IPLState *ipl)
case CCW_DEVTYPE_VIRTIO_NET:
ipl->netboot = true;
/* Fall through to CCW_DEVTYPE_VIRTIO case */
+ fallthrough;
case CCW_DEVTYPE_VIRTIO:
ipl->iplb.len = cpu_to_be32(S390_IPLB_MIN_CCW_LEN);
ipl->iplb.blk0_len =
diff --git a/hw/s390x/s390-pci-inst.c b/hw/s390x/s390-pci-inst.c
index 30149546c0..171320384c 100644
--- a/hw/s390x/s390-pci-inst.c
+++ b/hw/s390x/s390-pci-inst.c
@@ -1380,10 +1380,10 @@ int stpcifc_service_call(S390CPU *cpu, uint8_t r1, uint64_t fiba, uint8_t ar,
* FH Enabled bit is set to one in states of ENABLED, BLOCKED or ERROR. */
case ZPCI_FS_ERROR:
fib.fc |= 0x20;
- /* fallthrough */
+ fallthrough;
case ZPCI_FS_BLOCKED:
fib.fc |= 0x40;
- /* fallthrough */
+ fallthrough;
case ZPCI_FS_ENABLED:
fib.fc |= 0x80;
if (pbdev->iommu->enabled) {
diff --git a/hw/s390x/sclp.c b/hw/s390x/sclp.c
index eff74479f4..9b8c7ff043 100644
--- a/hw/s390x/sclp.c
+++ b/hw/s390x/sclp.c
@@ -66,7 +66,7 @@ static bool sccb_verify_boundary(uint64_t sccb_addr, uint16_t sccb_len,
if (s390_has_feat(S390_FEAT_EXTENDED_LENGTH_SCCB)) {
return true;
}
- /* fallthrough */
+ fallthrough;
default:
if (sccb_max_addr < sccb_boundary) {
return true;
@@ -224,7 +224,7 @@ static void sclp_configure_io_adapter(SCLPDevice *sclp, SCCB *sccb,
}
return;
}
- /* fallthrough */
+ fallthrough;
default:
rc = SCLP_RC_ADAPTER_TYPE_NOT_RECOGNIZED;
}
--
2.39.2
^ permalink raw reply related [flat|nested] 106+ messages in thread
* [RFC PATCH v3 72/78] hw/ssi: add fallthrough pseudo-keyword
2023-10-13 8:45 [RFC PATCH v3 00/78] Strict disable implicit fallthrough Emmanouil Pitsidianakis
` (70 preceding siblings ...)
2023-10-13 8:46 ` [RFC PATCH v3 71/78] hw/s390x: " Emmanouil Pitsidianakis
@ 2023-10-13 8:46 ` Emmanouil Pitsidianakis
2023-10-13 8:46 ` [RFC PATCH v3 73/78] hw/watchdog/wdt_diag288.c: " Emmanouil Pitsidianakis
` (7 subsequent siblings)
79 siblings, 0 replies; 106+ messages in thread
From: Emmanouil Pitsidianakis @ 2023-10-13 8:46 UTC (permalink / raw)
To: qemu-devel
Cc: Emmanouil Pitsidianakis, Alistair Francis, Tyrone Ting, Hao Wu,
Peter Maydell, open list:Nuvoton NPCM7xx
In preparation of raising -Wimplicit-fallthrough to 5, replace all
fall-through comments with the fallthrough attribute pseudo-keyword.
Signed-off-by: Emmanouil Pitsidianakis <manos.pitsidianakis@linaro.org>
---
hw/ssi/npcm7xx_fiu.c | 14 ++++++-------
hw/ssi/omap_spi.c | 48 ++++++++++++++++++++++----------------------
2 files changed, 31 insertions(+), 31 deletions(-)
diff --git a/hw/ssi/npcm7xx_fiu.c b/hw/ssi/npcm7xx_fiu.c
index 4eedb2927e..fadd66a675 100644
--- a/hw/ssi/npcm7xx_fiu.c
+++ b/hw/ssi/npcm7xx_fiu.c
@@ -167,7 +167,7 @@ static uint64_t npcm7xx_fiu_flash_read(void *opaque, hwaddr addr,
switch (FIU_DRD_CFG_ADDSIZ(drd_cfg)) {
case FIU_ADDSIZ_4BYTES:
ssi_transfer(fiu->spi, extract32(addr, 24, 8));
- /* fall through */
+ fallthrough;
case FIU_ADDSIZ_3BYTES:
ssi_transfer(fiu->spi, extract32(addr, 16, 8));
ssi_transfer(fiu->spi, extract32(addr, 8, 8));
@@ -226,7 +226,7 @@ static void npcm7xx_fiu_flash_write(void *opaque, hwaddr addr, uint64_t v,
switch (FIU_DWR_CFG_ADDSIZ(dwr_cfg)) {
case FIU_ADDSIZ_4BYTES:
ssi_transfer(fiu->spi, extract32(addr, 24, 8));
- /* fall through */
+ fallthrough;
case FIU_ADDSIZ_3BYTES:
ssi_transfer(fiu->spi, extract32(addr, 16, 8));
ssi_transfer(fiu->spi, extract32(addr, 8, 8));
@@ -285,16 +285,16 @@ static void send_address(SSIBus *spi, unsigned int addsiz, uint32_t addr)
switch (addsiz) {
case 4:
ssi_transfer(spi, extract32(addr, 24, 8));
- /* fall through */
+ fallthrough;
case 3:
ssi_transfer(spi, extract32(addr, 16, 8));
- /* fall through */
+ fallthrough;
case 2:
ssi_transfer(spi, extract32(addr, 8, 8));
- /* fall through */
+ fallthrough;
case 1:
ssi_transfer(spi, extract32(addr, 0, 8));
- /* fall through */
+ fallthrough;
case 0:
break;
}
@@ -391,7 +391,7 @@ static void npcm7xx_fiu_ctrl_write(void *opaque, hwaddr addr, uint64_t v,
value &= ~FIU_UMA_CFG_CMMLCK_MASK;
value |= (s->regs[reg] & FIU_UMA_CFG_CMMLCK_MASK);
}
- /* fall through */
+ fallthrough;
case NPCM7XX_FIU_DRD_CFG:
case NPCM7XX_FIU_DWR_CFG:
if (s->regs[reg] & NPCM7XX_FIU_CFG_LCK) {
diff --git a/hw/ssi/omap_spi.c b/hw/ssi/omap_spi.c
index 8f85c3e391..a0f367bd17 100644
--- a/hw/ssi/omap_spi.c
+++ b/hw/ssi/omap_spi.c
@@ -170,47 +170,47 @@ static uint64_t omap_mcspi_read(void *opaque, hwaddr addr, unsigned size)
return s->control;
case 0x68: ch ++;
- /* fall through */
+ fallthrough;
case 0x54: ch ++;
- /* fall through */
+ fallthrough;
case 0x40: ch ++;
- /* fall through */
+ fallthrough;
case 0x2c: /* MCSPI_CHCONF */
return s->ch[ch].config;
case 0x6c: ch ++;
- /* fall through */
+ fallthrough;
case 0x58: ch ++;
- /* fall through */
+ fallthrough;
case 0x44: ch ++;
- /* fall through */
+ fallthrough;
case 0x30: /* MCSPI_CHSTAT */
return s->ch[ch].status;
case 0x70: ch ++;
- /* fall through */
+ fallthrough;
case 0x5c: ch ++;
- /* fall through */
+ fallthrough;
case 0x48: ch ++;
- /* fall through */
+ fallthrough;
case 0x34: /* MCSPI_CHCTRL */
return s->ch[ch].control;
case 0x74: ch ++;
- /* fall through */
+ fallthrough;
case 0x60: ch ++;
- /* fall through */
+ fallthrough;
case 0x4c: ch ++;
- /* fall through */
+ fallthrough;
case 0x38: /* MCSPI_TX */
return s->ch[ch].tx;
case 0x78: ch ++;
- /* fall through */
+ fallthrough;
case 0x64: ch ++;
- /* fall through */
+ fallthrough;
case 0x50: ch ++;
- /* fall through */
+ fallthrough;
case 0x3c: /* MCSPI_RX */
s->ch[ch].status &= ~(1 << 0); /* RXS */
ret = s->ch[ch].rx;
@@ -288,11 +288,11 @@ static void omap_mcspi_write(void *opaque, hwaddr addr,
break;
case 0x68: ch ++;
- /* fall through */
+ fallthrough;
case 0x54: ch ++;
- /* fall through */
+ fallthrough;
case 0x40: ch ++;
- /* fall through */
+ fallthrough;
case 0x2c: /* MCSPI_CHCONF */
if ((value ^ s->ch[ch].config) & (3 << 14)) /* DMAR | DMAW */
omap_mcspi_dmarequest_update(s->ch + ch);
@@ -309,11 +309,11 @@ static void omap_mcspi_write(void *opaque, hwaddr addr,
break;
case 0x70: ch ++;
- /* fall through */
+ fallthrough;
case 0x5c: ch ++;
- /* fall through */
+ fallthrough;
case 0x48: ch ++;
- /* fall through */
+ fallthrough;
case 0x34: /* MCSPI_CHCTRL */
if (value & ~s->ch[ch].control & 1) { /* EN */
s->ch[ch].control |= 1;
@@ -323,11 +323,11 @@ static void omap_mcspi_write(void *opaque, hwaddr addr,
break;
case 0x74: ch ++;
- /* fall through */
+ fallthrough;
case 0x60: ch ++;
- /* fall through */
+ fallthrough;
case 0x4c: ch ++;
- /* fall through */
+ fallthrough;
case 0x38: /* MCSPI_TX */
s->ch[ch].tx = value;
s->ch[ch].status &= ~(1 << 1); /* TXS */
--
2.39.2
^ permalink raw reply related [flat|nested] 106+ messages in thread
* [RFC PATCH v3 73/78] hw/watchdog/wdt_diag288.c: add fallthrough pseudo-keyword
2023-10-13 8:45 [RFC PATCH v3 00/78] Strict disable implicit fallthrough Emmanouil Pitsidianakis
` (71 preceding siblings ...)
2023-10-13 8:46 ` [RFC PATCH v3 72/78] hw/ssi: " Emmanouil Pitsidianakis
@ 2023-10-13 8:46 ` Emmanouil Pitsidianakis
2023-10-13 8:46 ` [RFC PATCH v3 74/78] hw/cxl/cxl-device-utils.c: " Emmanouil Pitsidianakis
` (6 subsequent siblings)
79 siblings, 0 replies; 106+ messages in thread
From: Emmanouil Pitsidianakis @ 2023-10-13 8:46 UTC (permalink / raw)
To: qemu-devel
Cc: Emmanouil Pitsidianakis, Halil Pasic, Christian Borntraeger,
Thomas Huth, open list:S390 diag 288 wat...
In preparation of raising -Wimplicit-fallthrough to 5, replace all
fall-through comments with the fallthrough attribute pseudo-keyword.
Signed-off-by: Emmanouil Pitsidianakis <manos.pitsidianakis@linaro.org>
---
hw/watchdog/wdt_diag288.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/hw/watchdog/wdt_diag288.c b/hw/watchdog/wdt_diag288.c
index 76d89fbf78..24fb7fcb62 100644
--- a/hw/watchdog/wdt_diag288.c
+++ b/hw/watchdog/wdt_diag288.c
@@ -69,7 +69,7 @@ static int wdt_diag288_handle_timer(DIAG288State *diag288,
switch (func) {
case WDT_DIAG288_INIT:
diag288->enabled = true;
- /* fall through */
+ fallthrough;
case WDT_DIAG288_CHANGE:
if (!diag288->enabled) {
return -1;
--
2.39.2
^ permalink raw reply related [flat|nested] 106+ messages in thread
* [RFC PATCH v3 74/78] hw/cxl/cxl-device-utils.c: add fallthrough pseudo-keyword
2023-10-13 8:45 [RFC PATCH v3 00/78] Strict disable implicit fallthrough Emmanouil Pitsidianakis
` (72 preceding siblings ...)
2023-10-13 8:46 ` [RFC PATCH v3 73/78] hw/watchdog/wdt_diag288.c: " Emmanouil Pitsidianakis
@ 2023-10-13 8:46 ` Emmanouil Pitsidianakis
2023-10-16 10:31 ` Jonathan Cameron via
2023-10-13 8:46 ` [RFC PATCH v3 75/78] migration: " Emmanouil Pitsidianakis
` (5 subsequent siblings)
79 siblings, 1 reply; 106+ messages in thread
From: Emmanouil Pitsidianakis @ 2023-10-13 8:46 UTC (permalink / raw)
To: qemu-devel; +Cc: Emmanouil Pitsidianakis, Jonathan Cameron, Fan Ni
In preparation of raising -Wimplicit-fallthrough to 5, replace all
fall-through comments with the fallthrough attribute pseudo-keyword.
Signed-off-by: Emmanouil Pitsidianakis <manos.pitsidianakis@linaro.org>
---
hw/cxl/cxl-device-utils.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/hw/cxl/cxl-device-utils.c b/hw/cxl/cxl-device-utils.c
index bd68328032..63f009847e 100644
--- a/hw/cxl/cxl-device-utils.c
+++ b/hw/cxl/cxl-device-utils.c
@@ -80,7 +80,7 @@ static void mailbox_mem_writel(uint32_t *reg_state, hwaddr offset,
{
switch (offset) {
case A_CXL_DEV_MAILBOX_CTRL:
- /* fallthrough */
+ fallthrough;
case A_CXL_DEV_MAILBOX_CAP:
/* RO register */
break;
@@ -102,7 +102,7 @@ static void mailbox_mem_writeq(uint64_t *reg_state, hwaddr offset,
break;
case A_CXL_DEV_BG_CMD_STS:
/* BG not supported */
- /* fallthrough */
+ fallthrough;
case A_CXL_DEV_MAILBOX_STS:
/* Read only register, will get updated by the state machine */
return;
--
2.39.2
^ permalink raw reply related [flat|nested] 106+ messages in thread
* Re: [RFC PATCH v3 74/78] hw/cxl/cxl-device-utils.c: add fallthrough pseudo-keyword
2023-10-13 8:46 ` [RFC PATCH v3 74/78] hw/cxl/cxl-device-utils.c: " Emmanouil Pitsidianakis
@ 2023-10-16 10:31 ` Jonathan Cameron via
2023-10-16 10:31 ` Jonathan Cameron
0 siblings, 1 reply; 106+ messages in thread
From: Jonathan Cameron via @ 2023-10-16 10:31 UTC (permalink / raw)
To: Emmanouil Pitsidianakis; +Cc: qemu-devel, Fan Ni
On Fri, 13 Oct 2023 11:46:42 +0300
Emmanouil Pitsidianakis <manos.pitsidianakis@linaro.org> wrote:
> In preparation of raising -Wimplicit-fallthrough to 5, replace all
> fall-through comments with the fallthrough attribute pseudo-keyword.
>
> Signed-off-by: Emmanouil Pitsidianakis <manos.pitsidianakis@linaro.org>
Looking at this, I think the code in question needs a closer look, cleanup
but that has nothing to do with what you are doing here!
Acked-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
> ---
> hw/cxl/cxl-device-utils.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/hw/cxl/cxl-device-utils.c b/hw/cxl/cxl-device-utils.c
> index bd68328032..63f009847e 100644
> --- a/hw/cxl/cxl-device-utils.c
> +++ b/hw/cxl/cxl-device-utils.c
> @@ -80,7 +80,7 @@ static void mailbox_mem_writel(uint32_t *reg_state, hwaddr offset,
> {
> switch (offset) {
> case A_CXL_DEV_MAILBOX_CTRL:
> - /* fallthrough */
> + fallthrough;
> case A_CXL_DEV_MAILBOX_CAP:
> /* RO register */
> break;
> @@ -102,7 +102,7 @@ static void mailbox_mem_writeq(uint64_t *reg_state, hwaddr offset,
> break;
> case A_CXL_DEV_BG_CMD_STS:
> /* BG not supported */
> - /* fallthrough */
> + fallthrough;
> case A_CXL_DEV_MAILBOX_STS:
> /* Read only register, will get updated by the state machine */
> return;
^ permalink raw reply [flat|nested] 106+ messages in thread
* Re: [RFC PATCH v3 74/78] hw/cxl/cxl-device-utils.c: add fallthrough pseudo-keyword
2023-10-16 10:31 ` Jonathan Cameron via
@ 2023-10-16 10:31 ` Jonathan Cameron
0 siblings, 0 replies; 106+ messages in thread
From: Jonathan Cameron @ 2023-10-16 10:31 UTC (permalink / raw)
To: Emmanouil Pitsidianakis; +Cc: qemu-devel, Fan Ni
On Fri, 13 Oct 2023 11:46:42 +0300
Emmanouil Pitsidianakis <manos.pitsidianakis@linaro.org> wrote:
> In preparation of raising -Wimplicit-fallthrough to 5, replace all
> fall-through comments with the fallthrough attribute pseudo-keyword.
>
> Signed-off-by: Emmanouil Pitsidianakis <manos.pitsidianakis@linaro.org>
Looking at this, I think the code in question needs a closer look, cleanup
but that has nothing to do with what you are doing here!
Acked-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
> ---
> hw/cxl/cxl-device-utils.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/hw/cxl/cxl-device-utils.c b/hw/cxl/cxl-device-utils.c
> index bd68328032..63f009847e 100644
> --- a/hw/cxl/cxl-device-utils.c
> +++ b/hw/cxl/cxl-device-utils.c
> @@ -80,7 +80,7 @@ static void mailbox_mem_writel(uint32_t *reg_state, hwaddr offset,
> {
> switch (offset) {
> case A_CXL_DEV_MAILBOX_CTRL:
> - /* fallthrough */
> + fallthrough;
> case A_CXL_DEV_MAILBOX_CAP:
> /* RO register */
> break;
> @@ -102,7 +102,7 @@ static void mailbox_mem_writeq(uint64_t *reg_state, hwaddr offset,
> break;
> case A_CXL_DEV_BG_CMD_STS:
> /* BG not supported */
> - /* fallthrough */
> + fallthrough;
> case A_CXL_DEV_MAILBOX_STS:
> /* Read only register, will get updated by the state machine */
> return;
^ permalink raw reply [flat|nested] 106+ messages in thread
* [RFC PATCH v3 75/78] migration: add fallthrough pseudo-keyword
2023-10-13 8:45 [RFC PATCH v3 00/78] Strict disable implicit fallthrough Emmanouil Pitsidianakis
` (73 preceding siblings ...)
2023-10-13 8:46 ` [RFC PATCH v3 74/78] hw/cxl/cxl-device-utils.c: " Emmanouil Pitsidianakis
@ 2023-10-13 8:46 ` Emmanouil Pitsidianakis
2023-10-16 14:02 ` Fabiano Rosas
2023-10-13 8:46 ` [RFC PATCH v3 76/78] qemu-img.c: " Emmanouil Pitsidianakis
` (4 subsequent siblings)
79 siblings, 1 reply; 106+ messages in thread
From: Emmanouil Pitsidianakis @ 2023-10-13 8:46 UTC (permalink / raw)
To: qemu-devel
Cc: Emmanouil Pitsidianakis, Juan Quintela, Peter Xu, Fabiano Rosas,
Leonardo Bras
In preparation of raising -Wimplicit-fallthrough to 5, replace all
fall-through comments with the fallthrough attribute pseudo-keyword.
Signed-off-by: Emmanouil Pitsidianakis <manos.pitsidianakis@linaro.org>
---
migration/migration.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/migration/migration.c b/migration/migration.c
index 585d3c8f55..fdad37efbb 100644
--- a/migration/migration.c
+++ b/migration/migration.c
@@ -2784,7 +2784,7 @@ static void migration_iteration_finish(MigrationState *s)
assert(migrate_colo());
migrate_start_colo_process(s);
s->vm_old_state = RUN_STATE_RUNNING;
- /* Fallthrough */
+ fallthrough;
case MIGRATION_STATUS_FAILED:
case MIGRATION_STATUS_CANCELLED:
case MIGRATION_STATUS_CANCELLING:
--
2.39.2
^ permalink raw reply related [flat|nested] 106+ messages in thread
* Re: [RFC PATCH v3 75/78] migration: add fallthrough pseudo-keyword
2023-10-13 8:46 ` [RFC PATCH v3 75/78] migration: " Emmanouil Pitsidianakis
@ 2023-10-16 14:02 ` Fabiano Rosas
0 siblings, 0 replies; 106+ messages in thread
From: Fabiano Rosas @ 2023-10-16 14:02 UTC (permalink / raw)
To: Emmanouil Pitsidianakis, qemu-devel
Cc: Emmanouil Pitsidianakis, Juan Quintela, Peter Xu, Leonardo Bras
Emmanouil Pitsidianakis <manos.pitsidianakis@linaro.org> writes:
> In preparation of raising -Wimplicit-fallthrough to 5, replace all
> fall-through comments with the fallthrough attribute pseudo-keyword.
>
> Signed-off-by: Emmanouil Pitsidianakis <manos.pitsidianakis@linaro.org>
Reviewed-by: Fabiano Rosas <farosas@suse.de>
^ permalink raw reply [flat|nested] 106+ messages in thread
* [RFC PATCH v3 76/78] qemu-img.c: add fallthrough pseudo-keyword
2023-10-13 8:45 [RFC PATCH v3 00/78] Strict disable implicit fallthrough Emmanouil Pitsidianakis
` (74 preceding siblings ...)
2023-10-13 8:46 ` [RFC PATCH v3 75/78] migration: " Emmanouil Pitsidianakis
@ 2023-10-13 8:46 ` Emmanouil Pitsidianakis
2023-10-13 8:46 ` [RFC PATCH v3 77/78] tests/unit/test-char.c: " Emmanouil Pitsidianakis
` (3 subsequent siblings)
79 siblings, 0 replies; 106+ messages in thread
From: Emmanouil Pitsidianakis @ 2023-10-13 8:46 UTC (permalink / raw)
To: qemu-devel
Cc: Emmanouil Pitsidianakis, Kevin Wolf, Hanna Reitz,
open list:Block layer core
In preparation of raising -Wimplicit-fallthrough to 5, replace all
fall-through comments with the fallthrough attribute pseudo-keyword.
Signed-off-by: Emmanouil Pitsidianakis <manos.pitsidianakis@linaro.org>
---
qemu-img.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/qemu-img.c b/qemu-img.c
index 6068ab0d27..df2457a6fe 100644
--- a/qemu-img.c
+++ b/qemu-img.c
@@ -1906,7 +1906,7 @@ static int coroutine_fn convert_co_write(ImgConvertState *s, int64_t sector_num,
}
break;
}
- /* fall-through */
+ fallthrough;
case BLK_ZERO:
if (s->has_zero_init) {
--
2.39.2
^ permalink raw reply related [flat|nested] 106+ messages in thread
* [RFC PATCH v3 77/78] tests/unit/test-char.c: add fallthrough pseudo-keyword
2023-10-13 8:45 [RFC PATCH v3 00/78] Strict disable implicit fallthrough Emmanouil Pitsidianakis
` (75 preceding siblings ...)
2023-10-13 8:46 ` [RFC PATCH v3 76/78] qemu-img.c: " Emmanouil Pitsidianakis
@ 2023-10-13 8:46 ` Emmanouil Pitsidianakis
2023-10-13 8:46 ` [RFC PATCH v3 78/78] meson.build: increase -Wimplicit-fallthrough to 5 Emmanouil Pitsidianakis
` (2 subsequent siblings)
79 siblings, 0 replies; 106+ messages in thread
From: Emmanouil Pitsidianakis @ 2023-10-13 8:46 UTC (permalink / raw)
To: qemu-devel; +Cc: Emmanouil Pitsidianakis
In preparation of raising -Wimplicit-fallthrough to 5, replace all
fall-through comments with the fallthrough attribute pseudo-keyword.
Signed-off-by: Emmanouil Pitsidianakis <manos.pitsidianakis@linaro.org>
---
tests/unit/test-char.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/tests/unit/test-char.c b/tests/unit/test-char.c
index 649fdf64e1..6f5a2c4108 100644
--- a/tests/unit/test-char.c
+++ b/tests/unit/test-char.c
@@ -70,7 +70,7 @@ static void fe_event(void *opaque, QEMUChrEvent event)
h->openclose_mismatch = true;
}
h->is_open = new_open_state;
- /* fallthrough */
+ fallthrough;
default:
quit = true;
break;
--
2.39.2
^ permalink raw reply related [flat|nested] 106+ messages in thread
* [RFC PATCH v3 78/78] meson.build: increase -Wimplicit-fallthrough to 5
2023-10-13 8:45 [RFC PATCH v3 00/78] Strict disable implicit fallthrough Emmanouil Pitsidianakis
` (76 preceding siblings ...)
2023-10-13 8:46 ` [RFC PATCH v3 77/78] tests/unit/test-char.c: " Emmanouil Pitsidianakis
@ 2023-10-13 8:46 ` Emmanouil Pitsidianakis
2023-10-13 10:44 ` [RFC PATCH v3 00/78] Strict disable implicit fallthrough Philippe Mathieu-Daudé
2023-10-13 13:52 ` Richard Henderson
79 siblings, 0 replies; 106+ messages in thread
From: Emmanouil Pitsidianakis @ 2023-10-13 8:46 UTC (permalink / raw)
To: qemu-devel
Cc: Emmanouil Pitsidianakis, Alex Bennée,
Daniel P. Berrangé, Thomas Huth, Markus Armbruster,
Philippe Mathieu-Daudé, Juan Quintela, Paolo Bonzini,
Marc-André Lureau
Make GCC's implicit fall-through static analysis stricter by requiring
the use of the fallthrough attribute statement instead of comments.
This makes the QEMU code style more consistent.
Signed-off-by: Emmanouil Pitsidianakis <manos.pitsidianakis@linaro.org>
---
docs/devel/style.rst | 23 +++++++++++++++++++++++
meson.build | 2 +-
2 files changed, 24 insertions(+), 1 deletion(-)
diff --git a/docs/devel/style.rst b/docs/devel/style.rst
index 2f68b50079..f473dd24e9 100644
--- a/docs/devel/style.rst
+++ b/docs/devel/style.rst
@@ -634,6 +634,29 @@ are still some caveats to beware of
return g_steal_pointer(&foo);
}
+Implicit switch case fall-through
+=================================
+
+The C language allows switch cases to "fall-through" when a "break" statement
+is missing at the end of a case. This, however, introduces ambiguity in the
+code, as it's not always clear if the missing break is intentional or a bug.
+
+As this behaviour allows for bugs we do not allow "implicit fall-through".
+
+In order to identify intentional fall-through cases, we have adopted a
+pseudo-keyword macro 'fallthrough' which expands to gcc's extension
+__attribute__((__fallthrough__)). `Statement Attributes
+<https://gcc.gnu.org/onlinedocs/gcc/Statement-Attributes.html>`_
+
+All switch/case blocks must end in one of:
+
+.. code-block:: c
+
+ break;
+ fallthrough;
+ continue;
+ goto <label>;
+ return [expression];
QEMU Specific Idioms
********************
diff --git a/meson.build b/meson.build
index 79aef19bdc..e8805f0e0c 100644
--- a/meson.build
+++ b/meson.build
@@ -452,7 +452,7 @@ warn_flags = [
'-Wnested-externs',
'-Wendif-labels',
'-Wexpansion-to-defined',
- '-Wimplicit-fallthrough=2',
+ '-Wimplicit-fallthrough=5',
'-Wmissing-format-attribute',
'-Wno-initializer-overrides',
'-Wno-missing-include-dirs',
--
2.39.2
^ permalink raw reply related [flat|nested] 106+ messages in thread
* Re: [RFC PATCH v3 00/78] Strict disable implicit fallthrough
2023-10-13 8:45 [RFC PATCH v3 00/78] Strict disable implicit fallthrough Emmanouil Pitsidianakis
` (77 preceding siblings ...)
2023-10-13 8:46 ` [RFC PATCH v3 78/78] meson.build: increase -Wimplicit-fallthrough to 5 Emmanouil Pitsidianakis
@ 2023-10-13 10:44 ` Philippe Mathieu-Daudé
2023-10-13 13:52 ` Richard Henderson
79 siblings, 0 replies; 106+ messages in thread
From: Philippe Mathieu-Daudé @ 2023-10-13 10:44 UTC (permalink / raw)
To: Emmanouil Pitsidianakis, qemu-devel
On 13/10/23 10:45, Emmanouil Pitsidianakis wrote:
> --
> Resending because --function-context was accidentally used in the
> previous version. Sincere apologies for the noise.
Thanks. TBH I discarded v1/v2 for that reason.
> --
>
> Hello,
>
> This RFC is inspired by the kernel's move to -Wimplicit-fallthrough=3
> back in 2019.[0]
> We take one step (or two) further by increasing it to 5 which rejects
> fall through comments and requires an attribute statement.
^ permalink raw reply [flat|nested] 106+ messages in thread
* Re: [RFC PATCH v3 00/78] Strict disable implicit fallthrough
2023-10-13 8:45 [RFC PATCH v3 00/78] Strict disable implicit fallthrough Emmanouil Pitsidianakis
` (78 preceding siblings ...)
2023-10-13 10:44 ` [RFC PATCH v3 00/78] Strict disable implicit fallthrough Philippe Mathieu-Daudé
@ 2023-10-13 13:52 ` Richard Henderson
2023-10-13 13:59 ` Manos Pitsidianakis
79 siblings, 1 reply; 106+ messages in thread
From: Richard Henderson @ 2023-10-13 13:52 UTC (permalink / raw)
To: Emmanouil Pitsidianakis, qemu-devel
On 10/13/23 01:45, Emmanouil Pitsidianakis wrote:
> --
> Resending because --function-context was accidentally used in the
> previous version. Sincere apologies for the noise.
> --
>
> Hello,
>
> This RFC is inspired by the kernel's move to -Wimplicit-fallthrough=3
> back in 2019.[0]
> We take one step (or two) further by increasing it to 5 which rejects
> fall through comments and requires an attribute statement.
>
> [0]:
> https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=a035d552a93b
>
> The line differences are not many, but they spread all over different
> subsystems, architectures and devices. An attempt has been made to split
> them in cohesive patches to aid post-RFC review. Part of the RFC is to
> determine whether these patch divisions needs improvement.
>
> Main questions this RFC poses
> =============================
>
> - Is this change desirable and net-positive.
Did this catch any new problems? If not, I really don't see the benefit.
The compiler comment matching appears to be sufficient.
r~
^ permalink raw reply [flat|nested] 106+ messages in thread