Skip to content

Commit 1b97c6e

Browse files
junjiemao1lijinxia
authored andcommitted
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 <junjie.mao@intel.com> Acked-by: Eddie Dong <eddie.dong@intel.com>
1 parent be90e42 commit 1b97c6e

File tree

1 file changed

+2
-5
lines changed
  • hypervisor/arch/x86/guest

1 file changed

+2
-5
lines changed

hypervisor/arch/x86/guest/vpic.c

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -37,9 +37,6 @@
3737

3838
#define vm_pic(vm) (vm->vpic)
3939

40-
#define true ((_Bool) 1)
41-
#define false ((_Bool) 0)
42-
4340
#define ACRN_DBG_PIC 6
4441

4542
enum irqstate {
@@ -259,7 +256,7 @@ static int vpic_icw1(struct vpic *vpic, struct pic *pic, uint8_t val)
259256
pic->mask = 0;
260257
pic->lowprio = 7;
261258
pic->rd_cmd_reg = 0U;
262-
pic->poll = 0;
259+
pic->poll = false;
263260
pic->smm = 0;
264261

265262
if ((val & ICW1_SNGL) != 0) {
@@ -680,7 +677,7 @@ static int vpic_read(struct vpic *vpic, struct pic *pic,
680677
VPIC_LOCK(vpic);
681678

682679
if (pic->poll) {
683-
pic->poll = 0;
680+
pic->poll = false;
684681
pin = vpic_get_highest_irrpin(pic);
685682
if (pin >= 0) {
686683
vpic_pin_accepted(pic, pin);

0 commit comments

Comments
 (0)