提交 11ef5869 编写于 作者: A Andrea Bolognani

pci: Use bool return type for some virPCIDeviceGet*() functions

The affected functions are:

  virPCIDeviceGetManaged()
  virPCIDeviceGetUnbindFromStub()
  virPCIDeviceGetRemoveSlot()
  virPCIDeviceGetReprobe()

Change their return type from unsigned int to bool: the corresponding
members in struct _virPCIDevice are defined as bool, and even the
corresponding virPCIDeviceSet*() functions take a bool value as input
so there's no point in these functions having unsigned int as return
type.
Suggested-by: NJohn Ferlan <jferlan@redhat.com>
上级 3f3f7a82
...@@ -1707,7 +1707,7 @@ void virPCIDeviceSetManaged(virPCIDevicePtr dev, bool managed) ...@@ -1707,7 +1707,7 @@ void virPCIDeviceSetManaged(virPCIDevicePtr dev, bool managed)
dev->managed = managed; dev->managed = managed;
} }
unsigned int bool
virPCIDeviceGetManaged(virPCIDevicePtr dev) virPCIDeviceGetManaged(virPCIDevicePtr dev)
{ {
return dev->managed; return dev->managed;
...@@ -1725,7 +1725,7 @@ virPCIDeviceGetStubDriver(virPCIDevicePtr dev) ...@@ -1725,7 +1725,7 @@ virPCIDeviceGetStubDriver(virPCIDevicePtr dev)
return dev->stubDriver; return dev->stubDriver;
} }
unsigned int bool
virPCIDeviceGetUnbindFromStub(virPCIDevicePtr dev) virPCIDeviceGetUnbindFromStub(virPCIDevicePtr dev)
{ {
return dev->unbind_from_stub; return dev->unbind_from_stub;
...@@ -1737,7 +1737,7 @@ virPCIDeviceSetUnbindFromStub(virPCIDevicePtr dev, bool unbind) ...@@ -1737,7 +1737,7 @@ virPCIDeviceSetUnbindFromStub(virPCIDevicePtr dev, bool unbind)
dev->unbind_from_stub = unbind; dev->unbind_from_stub = unbind;
} }
unsigned int bool
virPCIDeviceGetRemoveSlot(virPCIDevicePtr dev) virPCIDeviceGetRemoveSlot(virPCIDevicePtr dev)
{ {
return dev->remove_slot; return dev->remove_slot;
...@@ -1749,7 +1749,7 @@ virPCIDeviceSetRemoveSlot(virPCIDevicePtr dev, bool remove_slot) ...@@ -1749,7 +1749,7 @@ virPCIDeviceSetRemoveSlot(virPCIDevicePtr dev, bool remove_slot)
dev->remove_slot = remove_slot; dev->remove_slot = remove_slot;
} }
unsigned int bool
virPCIDeviceGetReprobe(virPCIDevicePtr dev) virPCIDeviceGetReprobe(virPCIDevicePtr dev)
{ {
return dev->reprobe; return dev->reprobe;
......
...@@ -99,7 +99,7 @@ int virPCIDeviceReset(virPCIDevicePtr dev, ...@@ -99,7 +99,7 @@ int virPCIDeviceReset(virPCIDevicePtr dev,
void virPCIDeviceSetManaged(virPCIDevice *dev, void virPCIDeviceSetManaged(virPCIDevice *dev,
bool managed); bool managed);
unsigned int virPCIDeviceGetManaged(virPCIDevice *dev); bool virPCIDeviceGetManaged(virPCIDevice *dev);
void virPCIDeviceSetStubDriver(virPCIDevicePtr dev, void virPCIDeviceSetStubDriver(virPCIDevicePtr dev,
virPCIStubDriver driver); virPCIStubDriver driver);
virPCIStubDriver virPCIDeviceGetStubDriver(virPCIDevicePtr dev); virPCIStubDriver virPCIDeviceGetStubDriver(virPCIDevicePtr dev);
...@@ -110,13 +110,13 @@ int virPCIDeviceSetUsedBy(virPCIDevice *dev, ...@@ -110,13 +110,13 @@ int virPCIDeviceSetUsedBy(virPCIDevice *dev,
void virPCIDeviceGetUsedBy(virPCIDevice *dev, void virPCIDeviceGetUsedBy(virPCIDevice *dev,
const char **drv_name, const char **drv_name,
const char **dom_name); const char **dom_name);
unsigned int virPCIDeviceGetUnbindFromStub(virPCIDevicePtr dev); bool virPCIDeviceGetUnbindFromStub(virPCIDevicePtr dev);
void virPCIDeviceSetUnbindFromStub(virPCIDevice *dev, void virPCIDeviceSetUnbindFromStub(virPCIDevice *dev,
bool unbind); bool unbind);
unsigned int virPCIDeviceGetRemoveSlot(virPCIDevicePtr dev); bool virPCIDeviceGetRemoveSlot(virPCIDevicePtr dev);
void virPCIDeviceSetRemoveSlot(virPCIDevice *dev, void virPCIDeviceSetRemoveSlot(virPCIDevice *dev,
bool remove_slot); bool remove_slot);
unsigned int virPCIDeviceGetReprobe(virPCIDevicePtr dev); bool virPCIDeviceGetReprobe(virPCIDevicePtr dev);
void virPCIDeviceSetReprobe(virPCIDevice *dev, void virPCIDeviceSetReprobe(virPCIDevice *dev,
bool reprobe); bool reprobe);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册