Skip to content

Commit 834570e

Browse files
hw/pci: fix functions that should return bool instead of int
Co-authored-by: Christian Inci <chris.gh@broke-the-inter.net>
1 parent 8ab64a9 commit 834570e

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

include/hw/pci/pci_device.h

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -189,30 +189,30 @@ static inline int pci_intx(PCIDevice *pci_dev)
189189
return pci_get_byte(pci_dev->config + PCI_INTERRUPT_PIN) - 1;
190190
}
191191

192-
static inline int pci_is_cxl(const PCIDevice *d)
192+
static inline bool pci_is_cxl(const PCIDevice *d)
193193
{
194-
return d->cap_present & QEMU_PCIE_CAP_CXL;
194+
return (d->cap_present & QEMU_PCIE_CAP_CXL) != 0;
195195
}
196196

197-
static inline int pci_is_express(const PCIDevice *d)
197+
static inline bool pci_is_express(const PCIDevice *d)
198198
{
199-
return d->cap_present & QEMU_PCI_CAP_EXPRESS;
199+
return (d->cap_present & QEMU_PCI_CAP_EXPRESS) != 0;
200200
}
201201

202-
static inline int pci_is_express_downstream_port(const PCIDevice *d)
202+
static inline bool pci_is_express_downstream_port(const PCIDevice *d)
203203
{
204204
uint8_t type;
205205

206206
if (!pci_is_express(d) || !d->exp.exp_cap) {
207-
return 0;
207+
return false;
208208
}
209209

210210
type = pcie_cap_get_type(d);
211211

212212
return type == PCI_EXP_TYPE_DOWNSTREAM || type == PCI_EXP_TYPE_ROOT_PORT;
213213
}
214214

215-
static inline int pci_is_vf(const PCIDevice *d)
215+
static inline bool pci_is_vf(const PCIDevice *d)
216216
{
217217
return d->sriov_pf || d->exp.sriov_vf.pf != NULL;
218218
}

0 commit comments

Comments
 (0)