git: d434607b3d51 - main - kinst: use bool where appropriate

From: Christos Margiolis <christos_at_FreeBSD.org>
Date: Sat, 03 Jun 2023 20:03:31 UTC
The branch main has been updated by christos:

URL: https://cgit.FreeBSD.org/src/commit/?id=d434607b3d5182d38b82f23fe0586b3744dd0273

commit d434607b3d5182d38b82f23fe0586b3744dd0273
Author:     Christos Margiolis <christos@FreeBSD.org>
AuthorDate: 2023-06-03 20:02:53 +0000
Commit:     Christos Margiolis <christos@FreeBSD.org>
CommitDate: 2023-06-03 20:02:53 +0000

    kinst: use bool where appropriate
    
    Reviewed by:    markj
    Approved by:    markj (mentor)
    Sponsored by:   The FreeBSD Foundation
    Differential Revision:  https://reviews.freebsd.org/D40412
---
 sys/cddl/dev/kinst/amd64/kinst_isa.c |  4 ++--
 sys/cddl/dev/kinst/kinst.c           | 16 ++++++++--------
 sys/cddl/dev/kinst/kinst.h           |  4 ++--
 3 files changed, 12 insertions(+), 12 deletions(-)

diff --git a/sys/cddl/dev/kinst/amd64/kinst_isa.c b/sys/cddl/dev/kinst/amd64/kinst_isa.c
index d29f1cd4181f..f8bfad8fae60 100644
--- a/sys/cddl/dev/kinst/amd64/kinst_isa.c
+++ b/sys/cddl/dev/kinst/amd64/kinst_isa.c
@@ -611,8 +611,8 @@ kinst_md_deinit(void)
 /*
  * Exclude machine-dependent functions that are not safe-to-trace.
  */
-int
+bool
 kinst_md_excluded(const char *name)
 {
-	return (0);
+	return (false);
 }
diff --git a/sys/cddl/dev/kinst/kinst.c b/sys/cddl/dev/kinst/kinst.c
index e30b813e0400..ea55b6fe5d0a 100644
--- a/sys/cddl/dev/kinst/kinst.c
+++ b/sys/cddl/dev/kinst/kinst.c
@@ -86,11 +86,11 @@ kinst_memcpy(volatile void *dst, volatile const void *src, size_t len)
 	return (dst);
 }
 
-int
+bool
 kinst_excluded(const char *name)
 {
 	if (kinst_md_excluded(name))
-		return (1);
+		return (true);
 
 	/*
 	 * Anything beginning with "dtrace_" may be called from probe context
@@ -99,7 +99,7 @@ kinst_excluded(const char *name)
 	 */
 	if (strncmp(name, "dtrace_", strlen("dtrace_")) == 0 &&
 	    strncmp(name, "dtrace_safe_", strlen("dtrace_safe_")) != 0)
-		return (1);
+		return (true);
 
 	/*
 	 * Omit instrumentation of functions that are probably in DDB.  It
@@ -110,7 +110,7 @@ kinst_excluded(const char *name)
 	 */
 	if (strncmp(name, "db_", strlen("db_")) == 0 ||
 	    strncmp(name, "kdb_", strlen("kdb_")) == 0)
-		return (1);
+		return (true);
 
 	/*
 	 * Lock owner methods may be called from probe context.
@@ -119,7 +119,7 @@ kinst_excluded(const char *name)
 	    strcmp(name, "owner_rm") == 0 ||
 	    strcmp(name, "owner_rw") == 0 ||
 	    strcmp(name, "owner_sx") == 0)
-		return (1);
+		return (true);
 
 	/*
 	 * When DTrace is built into the kernel we need to exclude the kinst
@@ -127,13 +127,13 @@ kinst_excluded(const char *name)
 	 */
 #ifndef _KLD_MODULE
 	if (strncmp(name, "kinst_", strlen("kinst_")) == 0)
-		return (1);
+		return (true);
 #endif
 
 	if (strcmp(name, "trap_check") == 0)
-		return (1);
+		return (true);
 
-	return (0);
+	return (false);
 }
 
 void
diff --git a/sys/cddl/dev/kinst/kinst.h b/sys/cddl/dev/kinst/kinst.h
index 1107a274333f..831526cb8a20 100644
--- a/sys/cddl/dev/kinst/kinst.h
+++ b/sys/cddl/dev/kinst/kinst.h
@@ -47,8 +47,8 @@ struct linker_file;
 struct linker_symval;
 
 volatile void	*kinst_memcpy(volatile void *, volatile const void *, size_t);
-int	kinst_excluded(const char *);
-int	kinst_md_excluded(const char *);
+bool	kinst_excluded(const char *);
+bool	kinst_md_excluded(const char *);
 int	kinst_invop(uintptr_t, struct trapframe *, uintptr_t);
 int	kinst_make_probe(struct linker_file *, int, struct linker_symval *,
 	    void *);