aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZhenlei Huang <zlei@FreeBSD.org>2024-10-01 15:28:37 +0000
committerZhenlei Huang <zlei@FreeBSD.org>2024-10-01 15:28:37 +0000
commit941f8aceac1b6c16ca4d96b52e60ab437c4f9207 (patch)
tree927c07e62b86017b9f91192f996e389e7f5957d7
parent215fd38e2915d142cb4b0245f137329ef4da5a12 (diff)
downloadsrc-941f8aceac1b6c16ca4d96b52e60ab437c4f9207.tar.gz
src-941f8aceac1b6c16ca4d96b52e60ab437c4f9207.zip
hhook: Sprinkle const qualifiers where appropriate
No functional change intended. MFC after: 1 week
-rw-r--r--sys/kern/kern_hhook.c8
-rw-r--r--sys/sys/hhook.h8
2 files changed, 8 insertions, 8 deletions
diff --git a/sys/kern/kern_hhook.c b/sys/kern/kern_hhook.c
index 602cd28990f0..7085ac717b26 100644
--- a/sys/kern/kern_hhook.c
+++ b/sys/kern/kern_hhook.c
@@ -127,7 +127,7 @@ hhook_run_hooks(struct hhook_head *hhh, void *ctx_data, struct osd *hosd)
* Register a new helper hook function with a helper hook point.
*/
int
-hhook_add_hook(struct hhook_head *hhh, struct hookinfo *hki, uint32_t flags)
+hhook_add_hook(struct hhook_head *hhh, const struct hookinfo *hki, uint32_t flags)
{
struct hhook *hhk, *tmp;
int error;
@@ -184,7 +184,7 @@ hhook_add_hook(struct hhook_head *hhh, struct hookinfo *hki, uint32_t flags)
* struct in the array.
*/
int
-hhook_add_hook_lookup(struct hookinfo *hki, uint32_t flags)
+hhook_add_hook_lookup(const struct hookinfo *hki, uint32_t flags)
{
struct hhook_head **heads_to_hook, *hhh;
int error, i, n_heads_to_hook;
@@ -242,7 +242,7 @@ tryagain:
* Remove a helper hook function from a helper hook point.
*/
int
-hhook_remove_hook(struct hhook_head *hhh, struct hookinfo *hki)
+hhook_remove_hook(struct hhook_head *hhh, const struct hookinfo *hki)
{
struct hhook *tmp;
@@ -269,7 +269,7 @@ hhook_remove_hook(struct hhook_head *hhh, struct hookinfo *hki)
* virtual instances of the hook point if it is virtualised).
*/
int
-hhook_remove_hook_lookup(struct hookinfo *hki)
+hhook_remove_hook_lookup(const struct hookinfo *hki)
{
struct hhook_head *hhh;
diff --git a/sys/sys/hhook.h b/sys/sys/hhook.h
index 084023ccb546..f83389fec2e3 100644
--- a/sys/sys/hhook.h
+++ b/sys/sys/hhook.h
@@ -107,14 +107,14 @@ struct hhook_head {
/* Public KPI functions. */
void hhook_run_hooks(struct hhook_head *hhh, void *ctx_data, struct osd *hosd);
-int hhook_add_hook(struct hhook_head *hhh, struct hookinfo *hki,
+int hhook_add_hook(struct hhook_head *hhh, const struct hookinfo *hki,
uint32_t flags);
-int hhook_add_hook_lookup(struct hookinfo *hki, uint32_t flags);
+int hhook_add_hook_lookup(const struct hookinfo *hki, uint32_t flags);
-int hhook_remove_hook(struct hhook_head *hhh, struct hookinfo *hki);
+int hhook_remove_hook(struct hhook_head *hhh, const struct hookinfo *hki);
-int hhook_remove_hook_lookup(struct hookinfo *hki);
+int hhook_remove_hook_lookup(const struct hookinfo *hki);
int hhook_head_register(int32_t hhook_type, int32_t hhook_id,
struct hhook_head **hhh, uint32_t flags);