summaryrefslogtreecommitdiffstats
path: root/src/loader
diff options
context:
space:
mode:
authorEric Engestrom <[email protected]>2019-10-02 13:39:30 +0100
committerEric Engestrom <[email protected]>2019-10-07 21:30:16 +0100
commit26149d119be24c027a0a247bf9408bab642e5958 (patch)
tree232da043218cc82bc6bdb5cc1d42f2ba83fa3fc9 /src/loader
parent6202a13b71e18dc31ba7e2f4ea915b67eacc1ddb (diff)
loader: replace int/1/0 with bool/true/false
Signed-off-by: Eric Engestrom <[email protected]> Acked-by: Lionel Landwerlin <[email protected]>
Diffstat (limited to 'src/loader')
-rw-r--r--src/loader/loader.c17
-rw-r--r--src/loader/loader.h2
2 files changed, 9 insertions, 10 deletions
diff --git a/src/loader/loader.c b/src/loader/loader.c
index 6e3e59d1687..873f55c8a9c 100644
--- a/src/loader/loader.c
+++ b/src/loader/loader.c
@@ -386,27 +386,27 @@ int loader_get_user_preferred_fd(int default_fd, bool *different_device)
#if defined(HAVE_LIBDRM)
-static int
+static bool
drm_get_pci_id_for_fd(int fd, int *vendor_id, int *chip_id)
{
drmDevicePtr device;
- int ret;
+ bool ret;
if (drmGetDevice2(fd, 0, &device) == 0) {
if (device->bustype == DRM_BUS_PCI) {
*vendor_id = device->deviceinfo.pci->vendor_id;
*chip_id = device->deviceinfo.pci->device_id;
- ret = 1;
+ ret = true;
}
else {
log_(_LOADER_DEBUG, "MESA-LOADER: device is not located on the PCI bus\n");
- ret = 0;
+ ret = false;
}
drmFreeDevice(&device);
}
else {
log_(_LOADER_WARNING, "MESA-LOADER: failed to retrieve device information\n");
- ret = 0;
+ ret = false;
}
return ret;
@@ -414,14 +414,13 @@ drm_get_pci_id_for_fd(int fd, int *vendor_id, int *chip_id)
#endif
-int
+bool
loader_get_pci_id_for_fd(int fd, int *vendor_id, int *chip_id)
{
#if HAVE_LIBDRM
- if (drm_get_pci_id_for_fd(fd, vendor_id, chip_id))
- return 1;
+ return drm_get_pci_id_for_fd(fd, vendor_id, chip_id);
#endif
- return 0;
+ return false;
}
char *
diff --git a/src/loader/loader.h b/src/loader/loader.h
index d063ab3f6c4..4cb1e0eb6a3 100644
--- a/src/loader/loader.h
+++ b/src/loader/loader.h
@@ -43,7 +43,7 @@ loader_open_device(const char *);
int
loader_open_render_node(const char *name);
-int
+bool
loader_get_pci_id_for_fd(int fd, int *vendor_id, int *chip_id);
char *