From 26149d119be24c027a0a247bf9408bab642e5958 Mon Sep 17 00:00:00 2001 From: Eric Engestrom Date: Wed, 2 Oct 2019 13:39:30 +0100 Subject: [PATCH] loader: replace int/1/0 with bool/true/false Signed-off-by: Eric Engestrom Acked-by: Lionel Landwerlin --- src/loader/loader.c | 17 ++++++++--------- src/loader/loader.h | 2 +- 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 * -- 2.30.2