From c3d4eb124cb9a29e56ce181fd17ec09d70bc8d05 Mon Sep 17 00:00:00 2001 From: Wei Jiangang Date: Thu, 15 Oct 2015 17:12:20 +0800 Subject: [PATCH] Fix conficts with HACKING doc Don't compare a bool variable against the literal, "true". Signed-off-by: Wei Jiangang Signed-off-by: Jiri Denemark --- src/conf/nwfilter_conf.c | 2 +- src/nwfilter/nwfilter_dhcpsnoop.c | 2 +- src/vz/vz_sdk.c | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/conf/nwfilter_conf.c b/src/conf/nwfilter_conf.c index aed82ad288..f7ccb75744 100644 --- a/src/conf/nwfilter_conf.c +++ b/src/conf/nwfilter_conf.c @@ -3416,7 +3416,7 @@ virNWFilterRuleDefDetailsFormat(virBufferPtr buf, break; case DATATYPE_BOOLEAN: - if (item->u.boolean == true) + if (item->u.boolean) virBufferAddLit(buf, "true"); else virBufferAddLit(buf, "false"); diff --git a/src/nwfilter/nwfilter_dhcpsnoop.c b/src/nwfilter/nwfilter_dhcpsnoop.c index f331e22e9e..f05d4a8687 100644 --- a/src/nwfilter/nwfilter_dhcpsnoop.c +++ b/src/nwfilter/nwfilter_dhcpsnoop.c @@ -1403,7 +1403,7 @@ virNWFilterDHCPSnoopThread(void *req0) } /* let creator know how well we initialized */ - if (error == true || !threadkey || tmp < 0 || !worker || + if (error || !threadkey || tmp < 0 || !worker || ifindex != req->ifindex) req->threadStatus = THREAD_STATUS_FAIL; else diff --git a/src/vz/vz_sdk.c b/src/vz/vz_sdk.c index 7a2afd6340..c24477ca5a 100644 --- a/src/vz/vz_sdk.c +++ b/src/vz/vz_sdk.c @@ -3293,7 +3293,7 @@ static int prlsdkAddDisk(PRL_HANDLE sdkdom, goto cleanup; } - if (bootDisk == true) { + if (bootDisk) { pret = PrlVmDev_GetIndex(sdkdisk, &devIndex); prlsdkCheckRetGoto(pret, cleanup); @@ -3551,7 +3551,7 @@ prlsdkDoApplyConfig(virConnectPtr conn, for (i = 0; i < def->ndisks; i++) { bool bootDisk = false; - if (needBoot == true && + if (needBoot && def->disks[i]->device == VIR_DOMAIN_DISK_DEVICE_DISK) { needBoot = false;