git: 941f8aceac1b - main - hhook: Sprinkle const qualifiers where appropriate
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Tue, 01 Oct 2024 15:30:34 UTC
The branch main has been updated by zlei:
URL: https://cgit.FreeBSD.org/src/commit/?id=941f8aceac1b6c16ca4d96b52e60ab437c4f9207
commit 941f8aceac1b6c16ca4d96b52e60ab437c4f9207
Author: Zhenlei Huang <zlei@FreeBSD.org>
AuthorDate: 2024-10-01 15:28:37 +0000
Commit: Zhenlei Huang <zlei@FreeBSD.org>
CommitDate: 2024-10-01 15:28:37 +0000
hhook: Sprinkle const qualifiers where appropriate
No functional change intended.
MFC after: 1 week
---
sys/kern/kern_hhook.c | 8 ++++----
sys/sys/hhook.h | 8 ++++----
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);