aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Boulby <daniel.boulby@arm.com>2023-08-07 10:36:53 +0100
committerDaniel Boulby <daniel.boulby@arm.com>2023-09-19 13:39:54 +0100
commit5fe882d53d0a84d3c8abc5783b7308148de80856 (patch)
tree10596ff39c65c77b6d5a4f4cccd2bf66c5d9c909
parent42a136386a1117d834c6bfc2eba33a28e5d72029 (diff)
fix: uninitialized value warning in handler.c
Initialize vcpu to null during declaration to silence the uninitialized value warning thrown by clang tidy. Signed-off-by: Daniel Boulby <daniel.boulby@arm.com> Change-Id: I3e5eaacb143015acb26c3829dfa9502b4727e39e
-rw-r--r--src/arch/aarch64/hypervisor/handler.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/arch/aarch64/hypervisor/handler.c b/src/arch/aarch64/hypervisor/handler.c
index 19b0f05c..572c8b84 100644
--- a/src/arch/aarch64/hypervisor/handler.c
+++ b/src/arch/aarch64/hypervisor/handler.c
@@ -360,7 +360,6 @@ static bool spmd_handler(struct ffa_value *args, struct vcpu *current)
uint32_t psci_msg_response = PSCI_ERROR_NOT_SUPPORTED;
struct vcpu *boot_vcpu = vcpu_get_boot_vcpu();
struct vm *vm = boot_vcpu->vm;
- struct vcpu *vcpu;
struct vcpu_locked vcpu_locked;
/*
@@ -370,10 +369,9 @@ static bool spmd_handler(struct ffa_value *args, struct vcpu *current)
*/
switch (args->arg3) {
case PSCI_CPU_OFF: {
- dlog_verbose("cpu%u off notification!\n",
- vcpu_index(vcpu));
-
if (vm_power_management_cpu_off_requested(vm) == true) {
+ struct vcpu *vcpu;
+
/* Allow only S-EL1 MP SPs to reach here. */
CHECK(vm->el0_partition == false);
CHECK(vm->vcpu_count > 1);
@@ -383,6 +381,8 @@ static bool spmd_handler(struct ffa_value *args, struct vcpu *current)
vcpu->state = VCPU_STATE_OFF;
vcpu_unlock(&vcpu_locked);
cpu_off(vcpu->cpu);
+ dlog_verbose("cpu%u off notification!\n",
+ vcpu_index(vcpu));
}
psci_msg_response = PSCI_RETURN_SUCCESS;