loader: s/int/bool/ for predicate result
authorEric Engestrom <eric.engestrom@intel.com>
Wed, 2 Oct 2019 19:09:50 +0000 (20:09 +0100)
committerEric Engestrom <eric.engestrom@intel.com>
Mon, 7 Oct 2019 20:30:16 +0000 (21:30 +0100)
Signed-off-by: Eric Engestrom <eric.engestrom@intel.com>
Acked-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
src/loader/pci_id_driver_map.c
src/loader/pci_id_driver_map.h

index 8b2079e4354c3cf60dbd424b9bc410672a91d777..d599abf78a521603a2f163ee928c7773bc32057a 100644 (file)
@@ -21,7 +21,9 @@
  * SOFTWARE.
  */
 
  * SOFTWARE.
  */
 
-int is_nouveau_vieux(int fd);
+#include <stdbool.h>
+
+bool is_nouveau_vieux(int fd);
 
 #ifdef HAVE_LIBDRM
 
 
 #ifdef HAVE_LIBDRM
 
@@ -42,7 +44,7 @@ nouveau_chipset(int fd)
    return gp.value;
 }
 
    return gp.value;
 }
 
-int
+bool
 is_nouveau_vieux(int fd)
 {
    int chipset = nouveau_chipset(fd);
 is_nouveau_vieux(int fd)
 {
    int chipset = nouveau_chipset(fd);
@@ -52,6 +54,6 @@ is_nouveau_vieux(int fd)
 
 #else
 
 
 #else
 
-int is_nouveau_vieux(int fd) { return 0; }
+bool is_nouveau_vieux(int fd) { return false; }
 
 #endif
 
 #endif
index 2909f69f24fb5d971aefc1000811ebdeddb26edb..63fb1ae01b65261ddc87ae20077681da1d2adba5 100644 (file)
@@ -1,6 +1,7 @@
 #ifndef _PCI_ID_DRIVER_MAP_H_
 #define _PCI_ID_DRIVER_MAP_H_
 
 #ifndef _PCI_ID_DRIVER_MAP_H_
 #define _PCI_ID_DRIVER_MAP_H_
 
+#include <stdbool.h>
 #include <stddef.h>
 
 #ifndef ARRAY_SIZE
 #include <stddef.h>
 
 #ifndef ARRAY_SIZE
@@ -83,14 +84,14 @@ static const int vmwgfx_chip_ids[] = {
 #undef CHIPSET
 };
 
 #undef CHIPSET
 };
 
-int is_nouveau_vieux(int fd);
+bool is_nouveau_vieux(int fd);
 
 static const struct {
    int vendor_id;
    const char *driver;
    const int *chip_ids;
    int num_chips_ids;
 
 static const struct {
    int vendor_id;
    const char *driver;
    const int *chip_ids;
    int num_chips_ids;
-   int (*predicate)(int fd);
+   bool (*predicate)(int fd);
 } driver_map[] = {
    { 0x8086, "i915", i915_chip_ids, ARRAY_SIZE(i915_chip_ids) },
    { 0x8086, "iris", iris_chip_ids_1, ARRAY_SIZE(iris_chip_ids_1) },
 } driver_map[] = {
    { 0x8086, "i915", i915_chip_ids, ARRAY_SIZE(i915_chip_ids) },
    { 0x8086, "iris", iris_chip_ids_1, ARRAY_SIZE(iris_chip_ids_1) },