[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[RFC PATCH v3 26/78] target/s390x: add fallthrough pseudo-keyword
From: |
Emmanouil Pitsidianakis |
Subject: |
[RFC PATCH v3 26/78] target/s390x: add fallthrough pseudo-keyword |
Date: |
Fri, 13 Oct 2023 11:45:54 +0300 |
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
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [RFC PATCH v3 26/78] target/s390x: add fallthrough pseudo-keyword,
Emmanouil Pitsidianakis <=