The 'multi' element in PCI address struct used as 'virTristateSwitch',
and its default value is 'VIR_TRISTATE_SWITCH_ABSENT'. Current PCI
process use 'false' to initialization 'multi', which is ambiguously
for assignment or comparison. This patch use '{0}' to initialize
the whole PCI address struct, which fix the 'multi' initialization
and makes code more simplify and explicitly.
Signed-off-by: Xian Han Yu <xhyubj@linux.vnet.ibm.com>
/* default to starting the search for a free slot from
* the first slot of domain 0 bus 0...
*/
- virPCIDeviceAddress a = { 0, 0, 0, 0, false };
+ virPCIDeviceAddress a = {0};
char *addrStr = NULL;
if (addrs->nbuses == 0) {
goto cleanup;
for (i = 0; i < nAddrNodes; i++) {
- virPCIDeviceAddress addr = { 0, 0, 0, 0, 0 };
+ virPCIDeviceAddress addr = {0};
if (virPCIDeviceAddressParseXML(addrNodes[i], &addr) < 0)
goto cleanup;
if (VIR_ALLOC(pciAddr) < 0)
/* USB2 needs special handling to put all companions in the same slot */
if (IS_USB2_CONTROLLER(def->controllers[i])) {
- virPCIDeviceAddress addr = { 0, 0, 0, 0, false };
+ virPCIDeviceAddress addr = {0};
bool foundAddr = false;
memset(&tmp_addr, 0, sizeof(tmp_addr));