From 0eb0854858d9d2a3971dc86cd6598b2ef198d0e4 Mon Sep 17 00:00:00 2001 From: "Li, Fei1" Date: Mon, 15 Jul 2019 17:43:49 +0800 Subject: [PATCH] hv: schedule: minor fix about the return type of need_offline ACRN Coding guidelines requires type conversion shall be explicity. However, there's no need for this case since we could return bool directly. Tracked-On: #1842 Signed-off-by: Li, Fei1 Acked-by: Eddie Dong --- hypervisor/common/hv_main.c | 2 +- hypervisor/common/schedule.c | 2 +- hypervisor/include/common/schedule.h | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/hypervisor/common/hv_main.c b/hypervisor/common/hv_main.c index 5f0727657..ad4a6f44b 100644 --- a/hypervisor/common/hv_main.c +++ b/hypervisor/common/hv_main.c @@ -88,7 +88,7 @@ void default_idle(__unused struct sched_object *obj) while (1) { if (need_reschedule(pcpu_id)) { schedule(); - } else if (need_offline(pcpu_id) != 0) { + } else if (need_offline(pcpu_id)) { cpu_dead(); } else if (need_shutdown_vm(pcpu_id)) { shutdown_vm_from_idle(pcpu_id); diff --git a/hypervisor/common/schedule.c b/hypervisor/common/schedule.c index b5c7ed88a..928bdb3e8 100644 --- a/hypervisor/common/schedule.c +++ b/hypervisor/common/schedule.c @@ -136,7 +136,7 @@ void make_pcpu_offline(uint16_t pcpu_id) } } -int32_t need_offline(uint16_t pcpu_id) +bool need_offline(uint16_t pcpu_id) { struct sched_context *ctx = &per_cpu(sched_ctx, pcpu_id); diff --git a/hypervisor/include/common/schedule.h b/hypervisor/include/common/schedule.h index dbfc2f4db..2b7fab59d 100644 --- a/hypervisor/include/common/schedule.h +++ b/hypervisor/include/common/schedule.h @@ -49,7 +49,7 @@ void remove_from_cpu_runqueue(struct sched_object *obj); void make_reschedule_request(uint16_t pcpu_id, uint16_t delmode); bool need_reschedule(uint16_t pcpu_id); void make_pcpu_offline(uint16_t pcpu_id); -int32_t need_offline(uint16_t pcpu_id); +bool need_offline(uint16_t pcpu_id); void make_shutdown_vm_request(uint16_t pcpu_id); bool need_shutdown_vm(uint16_t pcpu_id);