From 1b97c6ea92f1749cc9b4e8c1872ce1dc06d36e21 Mon Sep 17 00:00:00 2001 From: Junjie Mao Date: Thu, 28 Jun 2018 20:00:17 +0800 Subject: [PATCH] HV: vpic: cleanup uses of boolean variables This patch drops the duplicated definitions to ''true'' and ''false'' and initializes boolean variables with boolean values instead of integers. Signed-off-by: Junjie Mao Acked-by: Eddie Dong --- hypervisor/arch/x86/guest/vpic.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/hypervisor/arch/x86/guest/vpic.c b/hypervisor/arch/x86/guest/vpic.c index b49ce42de..cd39bee27 100644 --- a/hypervisor/arch/x86/guest/vpic.c +++ b/hypervisor/arch/x86/guest/vpic.c @@ -37,9 +37,6 @@ #define vm_pic(vm) (vm->vpic) -#define true ((_Bool) 1) -#define false ((_Bool) 0) - #define ACRN_DBG_PIC 6 enum irqstate { @@ -259,7 +256,7 @@ static int vpic_icw1(struct vpic *vpic, struct pic *pic, uint8_t val) pic->mask = 0; pic->lowprio = 7; pic->rd_cmd_reg = 0U; - pic->poll = 0; + pic->poll = false; pic->smm = 0; if ((val & ICW1_SNGL) != 0) { @@ -680,7 +677,7 @@ static int vpic_read(struct vpic *vpic, struct pic *pic, VPIC_LOCK(vpic); if (pic->poll) { - pic->poll = 0; + pic->poll = false; pin = vpic_get_highest_irrpin(pic); if (pin >= 0) { vpic_pin_accepted(pic, pin);