make arm_cpu_pauth_finalize return a bool, and make the name canonical for the module (cpu_pauth_finalize).
Signed-off-by: Claudio Fontana <cfont...@suse.de> --- target/arm/tcg/cpu-pauth.h | 2 +- target/arm/cpu.c | 3 +-- target/arm/tcg/cpu-pauth.c | 5 ++++- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/target/arm/tcg/cpu-pauth.h b/target/arm/tcg/cpu-pauth.h index af127876fe..a0ef74dc77 100644 --- a/target/arm/tcg/cpu-pauth.h +++ b/target/arm/tcg/cpu-pauth.h @@ -26,7 +26,7 @@ #include "cpu.h" /* called by arm_cpu_finalize_features in realizefn */ -void arm_cpu_pauth_finalize(ARMCPU *cpu, Error **errp); +bool cpu_pauth_finalize(ARMCPU *cpu, Error **errp); /* add the CPU Pointer Authentication properties */ void cpu_pauth_add_props(Object *obj); diff --git a/target/arm/cpu.c b/target/arm/cpu.c index 229ef989b4..b91c48cd2f 100644 --- a/target/arm/cpu.c +++ b/target/arm/cpu.c @@ -837,8 +837,7 @@ void arm_cpu_finalize_features(ARMCPU *cpu, Error **errp) * is in use, so the user will not be able to set them. */ if (tcg_enabled()) { - arm_cpu_pauth_finalize(cpu, &local_err); - if (local_err != NULL) { + if (!cpu_pauth_finalize(cpu, &local_err)) { error_propagate(errp, local_err); return; } diff --git a/target/arm/tcg/cpu-pauth.c b/target/arm/tcg/cpu-pauth.c index f821087b14..4f087923ac 100644 --- a/target/arm/tcg/cpu-pauth.c +++ b/target/arm/tcg/cpu-pauth.c @@ -25,8 +25,9 @@ #include "tcg/cpu-pauth.h" #include "hw/qdev-properties.h" -void arm_cpu_pauth_finalize(ARMCPU *cpu, Error **errp) +bool cpu_pauth_finalize(ARMCPU *cpu, Error **errp) { + bool result = true; int arch_val = 0, impdef_val = 0; uint64_t t; @@ -40,6 +41,7 @@ void arm_cpu_pauth_finalize(ARMCPU *cpu, Error **errp) } else if (cpu->prop_pauth_impdef) { error_setg(errp, "cannot enable pauth-impdef without pauth"); error_append_hint(errp, "Add pauth=on to the CPU property list.\n"); + result = false; } t = cpu->isar.id_aa64isar1; @@ -48,6 +50,7 @@ void arm_cpu_pauth_finalize(ARMCPU *cpu, Error **errp) t = FIELD_DP64(t, ID_AA64ISAR1, API, impdef_val); t = FIELD_DP64(t, ID_AA64ISAR1, GPI, impdef_val); cpu->isar.id_aa64isar1 = t; + return result; } static Property arm_cpu_pauth_property = -- 2.26.2