Skip to content

Commit 0eb0854

Browse files
lifeixacrnsi
authored andcommitted
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 <fei1.li@intel.com> Acked-by: Eddie Dong <eddie.dong@intel.com>
1 parent e69b3dc commit 0eb0854

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

hypervisor/common/hv_main.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ void default_idle(__unused struct sched_object *obj)
8888
while (1) {
8989
if (need_reschedule(pcpu_id)) {
9090
schedule();
91-
} else if (need_offline(pcpu_id) != 0) {
91+
} else if (need_offline(pcpu_id)) {
9292
cpu_dead();
9393
} else if (need_shutdown_vm(pcpu_id)) {
9494
shutdown_vm_from_idle(pcpu_id);

hypervisor/common/schedule.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ void make_pcpu_offline(uint16_t pcpu_id)
136136
}
137137
}
138138

139-
int32_t need_offline(uint16_t pcpu_id)
139+
bool need_offline(uint16_t pcpu_id)
140140
{
141141
struct sched_context *ctx = &per_cpu(sched_ctx, pcpu_id);
142142

hypervisor/include/common/schedule.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ void remove_from_cpu_runqueue(struct sched_object *obj);
4949
void make_reschedule_request(uint16_t pcpu_id, uint16_t delmode);
5050
bool need_reschedule(uint16_t pcpu_id);
5151
void make_pcpu_offline(uint16_t pcpu_id);
52-
int32_t need_offline(uint16_t pcpu_id);
52+
bool need_offline(uint16_t pcpu_id);
5353
void make_shutdown_vm_request(uint16_t pcpu_id);
5454
bool need_shutdown_vm(uint16_t pcpu_id);
5555

0 commit comments

Comments
 (0)