git: 609cdb12b962 - main - ofw: convert boolean_t to bool
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Wed, 26 Jun 2024 14:16:10 UTC
The branch main has been updated by mhorne:
URL: https://cgit.FreeBSD.org/src/commit/?id=609cdb12b9620dfa7c124b2f1834cd79e5cd98ec
commit 609cdb12b9620dfa7c124b2f1834cd79e5cd98ec
Author: Mitchell Horne <mhorne@FreeBSD.org>
AuthorDate: 2024-06-26 14:01:49 +0000
Commit: Mitchell Horne <mhorne@FreeBSD.org>
CommitDate: 2024-06-26 14:14:36 +0000
ofw: convert boolean_t to bool
Most of these already treat it as a proper bool, i.e. using true/false.
Also fix-up callers of OF_install().
No functional change intended.
Reviewed by: andrew, emaste
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D45733
---
sys/arm64/arm64/machdep.c | 2 +-
sys/dev/ofw/ofw_bus_subr.c | 4 ++--
sys/dev/ofw/ofw_cpu.c | 4 ++--
sys/dev/ofw/ofw_cpu.h | 2 +-
sys/dev/ofw/openfirm.c | 10 +++++-----
sys/dev/ofw/openfirm.h | 4 ++--
sys/powerpc/include/ofw_machdep.h | 2 +-
sys/powerpc/ofw/ofw_machdep.c | 18 +++++++++---------
sys/riscv/riscv/machdep.c | 2 +-
sys/x86/x86/fdt_machdep.c | 2 +-
10 files changed, 25 insertions(+), 25 deletions(-)
diff --git a/sys/arm64/arm64/machdep.c b/sys/arm64/arm64/machdep.c
index e7d46ff70531..090ea2c10853 100644
--- a/sys/arm64/arm64/machdep.c
+++ b/sys/arm64/arm64/machdep.c
@@ -754,7 +754,7 @@ try_load_dtb(caddr_t kmdp)
return;
}
- if (OF_install(OFW_FDT, 0) == FALSE)
+ if (!OF_install(OFW_FDT, 0))
panic("Cannot install FDT");
if (OF_init((void *)dtbp) != 0)
diff --git a/sys/dev/ofw/ofw_bus_subr.c b/sys/dev/ofw/ofw_bus_subr.c
index d63e89e2d677..a6d562cd8e9d 100644
--- a/sys/dev/ofw/ofw_bus_subr.c
+++ b/sys/dev/ofw/ofw_bus_subr.c
@@ -641,7 +641,7 @@ ofw_bus_intr_to_rl(device_t dev, phandle_t node,
phandle_t iparent;
uint32_t icells, *intr;
int err, i, irqnum, nintr, rid;
- boolean_t extended;
+ bool extended;
nintr = OF_getencprop_alloc_multi(node, "interrupts", sizeof(*intr),
(void **)&intr);
@@ -707,7 +707,7 @@ ofw_bus_intr_by_rid(device_t dev, phandle_t node, int wanted_rid,
phandle_t iparent;
uint32_t icells, *intr;
int err, i, nintr, rid;
- boolean_t extended;
+ bool extended;
nintr = OF_getencprop_alloc_multi(node, "interrupts", sizeof(*intr),
(void **)&intr);
diff --git a/sys/dev/ofw/ofw_cpu.c b/sys/dev/ofw/ofw_cpu.c
index e18004ae19d2..127510a64f4f 100644
--- a/sys/dev/ofw/ofw_cpu.c
+++ b/sys/dev/ofw/ofw_cpu.c
@@ -151,7 +151,7 @@ static int ofw_cpu_read_ivar(device_t dev, device_t child, int index,
struct ofw_cpu_softc {
struct pcpu *sc_cpu_pcpu;
uint32_t sc_nominal_mhz;
- boolean_t sc_reg_valid;
+ bool sc_reg_valid;
pcell_t sc_reg[2];
};
@@ -335,7 +335,7 @@ ofw_cpu_read_ivar(device_t dev, device_t child, int index, uintptr_t *result)
}
int
-ofw_cpu_early_foreach(ofw_cpu_foreach_cb callback, boolean_t only_runnable)
+ofw_cpu_early_foreach(ofw_cpu_foreach_cb callback, bool only_runnable)
{
phandle_t node, child;
pcell_t addr_cells, reg[2];
diff --git a/sys/dev/ofw/ofw_cpu.h b/sys/dev/ofw/ofw_cpu.h
index cb30dfb6e262..9f4e9e65aa61 100644
--- a/sys/dev/ofw/ofw_cpu.h
+++ b/sys/dev/ofw/ofw_cpu.h
@@ -30,6 +30,6 @@
#define _DEV_OFW_OFW_CPU_H_
typedef bool (*ofw_cpu_foreach_cb)(u_int, phandle_t, u_int, pcell_t *);
-int ofw_cpu_early_foreach(ofw_cpu_foreach_cb, boolean_t);
+int ofw_cpu_early_foreach(ofw_cpu_foreach_cb, bool);
#endif /* _DEV_OFW_OFW_CPU_H_ */
diff --git a/sys/dev/ofw/openfirm.c b/sys/dev/ofw/openfirm.c
index 881a2cccb072..f9c73122b454 100644
--- a/sys/dev/ofw/openfirm.c
+++ b/sys/dev/ofw/openfirm.c
@@ -96,7 +96,7 @@ struct xrefinfo {
static SLIST_HEAD(, xrefinfo) xreflist = SLIST_HEAD_INITIALIZER(xreflist);
static struct mtx xreflist_lock;
-static boolean_t xref_init_done;
+static bool xref_init_done;
#define FIND_BY_XREF 0
#define FIND_BY_NODE 1
@@ -193,7 +193,7 @@ xrefinfo_add(phandle_t node, phandle_t xref, device_t dev)
*/
SET_DECLARE(ofw_set, ofw_def_t);
-boolean_t
+bool
OF_install(char *name, int prio)
{
ofw_def_t *ofwp, **ofwpp;
@@ -202,7 +202,7 @@ OF_install(char *name, int prio)
/* Allow OF layer to be uninstalled */
if (name == NULL) {
ofw_def_impl = NULL;
- return (FALSE);
+ return (false);
}
/*
@@ -216,11 +216,11 @@ OF_install(char *name, int prio)
prio >= curr_prio) {
curr_prio = prio;
ofw_def_impl = ofwp;
- return (TRUE);
+ return (true);
}
}
- return (FALSE);
+ return (false);
}
/* Initializer */
diff --git a/sys/dev/ofw/openfirm.h b/sys/dev/ofw/openfirm.h
index 149f2a951745..30203404a6b0 100644
--- a/sys/dev/ofw/openfirm.h
+++ b/sys/dev/ofw/openfirm.h
@@ -83,8 +83,8 @@ MALLOC_DECLARE(M_OFWPROP);
* interface as the Open Firmware access mechanism, OF_init initializes it.
*/
-boolean_t OF_install(char *name, int prio);
-int OF_init(void *cookie);
+bool OF_install(char *name, int prio);
+int OF_init(void *cookie);
/*
* Known Open Firmware interface names
diff --git a/sys/powerpc/include/ofw_machdep.h b/sys/powerpc/include/ofw_machdep.h
index 7c3767dfc679..8b3f912fec8c 100644
--- a/sys/powerpc/include/ofw_machdep.h
+++ b/sys/powerpc/include/ofw_machdep.h
@@ -42,7 +42,7 @@ typedef uint32_t cell_t;
void OF_getetheraddr(device_t dev, u_char *addr);
void OF_initial_setup(void *fdt_ptr, void *junk, int (*openfirm)(void *));
-boolean_t OF_bootstrap(void);
+bool OF_bootstrap(void);
void OF_reboot(void);
diff --git a/sys/powerpc/ofw/ofw_machdep.c b/sys/powerpc/ofw/ofw_machdep.c
index 6d7b0b01fc84..bffc04b15259 100644
--- a/sys/powerpc/ofw/ofw_machdep.c
+++ b/sys/powerpc/ofw/ofw_machdep.c
@@ -595,10 +595,10 @@ OF_initial_setup(void *fdt_ptr, void *junk, int (*openfirm)(void *))
fdt = fdt_ptr;
}
-boolean_t
+bool
OF_bootstrap(void)
{
- boolean_t status = FALSE;
+ bool status = false;
int err = 0;
#ifdef AIM
@@ -613,8 +613,8 @@ OF_bootstrap(void)
#endif
}
- if (status != TRUE)
- return status;
+ if (!status)
+ return (status);
err = OF_init(openfirmware);
} else
@@ -629,8 +629,8 @@ OF_bootstrap(void)
#endif
status = OF_install(OFW_FDT, 0);
- if (status != TRUE)
- return status;
+ if (!status)
+ return (status);
#ifdef AIM /* AIM-only for now -- Book-E does this remapping in early init */
/* Get the FDT size for mapping if we can */
@@ -668,15 +668,15 @@ OF_bootstrap(void)
*/
else {
status = OF_install(OFW_FDT, 0);
- if (status != TRUE)
- return status;
+ if (!status)
+ return (status);
err = OF_init(&fdt_static_dtb);
}
#endif
if (err != 0) {
OF_install(NULL, 0);
- status = FALSE;
+ status = false;
}
return (status);
diff --git a/sys/riscv/riscv/machdep.c b/sys/riscv/riscv/machdep.c
index ffb29e53b88e..eda7ebc32bbf 100644
--- a/sys/riscv/riscv/machdep.c
+++ b/sys/riscv/riscv/machdep.c
@@ -321,7 +321,7 @@ try_load_dtb(caddr_t kmdp)
return;
}
- if (OF_install(OFW_FDT, 0) == FALSE)
+ if (!OF_install(OFW_FDT, 0))
panic("Cannot install FDT");
if (OF_init((void *)dtbp) != 0)
diff --git a/sys/x86/x86/fdt_machdep.c b/sys/x86/x86/fdt_machdep.c
index 901655d829b4..30820a88d263 100644
--- a/sys/x86/x86/fdt_machdep.c
+++ b/sys/x86/x86/fdt_machdep.c
@@ -46,7 +46,7 @@ x86_init_fdt(void)
void *dtbp, *mdp;
int error;
- if (OF_install(OFW_FDT, 0) == FALSE) {
+ if (!OF_install(OFW_FDT, 0)) {
error = ENXIO;
goto out;
}