diff options
| author | Pratyush Yadav (Google) <pratyush@kernel.org> | 2026-08-01 10:48:21 +0200 |
|---|---|---|
| committer | Mike Rapoport (Microsoft) <rppt@kernel.org> | 2026-08-04 09:22:36 +0300 |
| commit | 6442bfb211cbc22cd83cd8c339e6d1835e9605a1 (patch) | |
| tree | 62480ea5040c196926464d4d6c3046f783e607c2 /include | |
| parent | a8ea530d7d75006558944a564effd23b49a51f8a (diff) | |
| download | linux-6442bfb211cbc22cd83cd8c339e6d1835e9605a1.tar.gz linux-6442bfb211cbc22cd83cd8c339e6d1835e9605a1.zip | |
kho: add kho_radix_init_tree()
Move the initialization logic of the radix tree into
kho_radix_init_tree() instead of having users open-code it. Makes the
boundaries cleaner and reduces code duplication when a new user of the
radix tree will be added in a future commit.
Signed-off-by: Pratyush Yadav (Google) <pratyush@kernel.org>
Link: https://patch.msgid.link/20260801084833.1897543-13-pratyush@kernel.org
Signed-off-by: Mike Rapoport (Microsoft) <rppt@kernel.org>
Diffstat (limited to 'include')
| -rw-r--r-- | include/linux/kho_radix_tree.h | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/include/linux/kho_radix_tree.h b/include/linux/kho_radix_tree.h index b7532aff35d8..fcd69639721b 100644 --- a/include/linux/kho_radix_tree.h +++ b/include/linux/kho_radix_tree.h @@ -58,6 +58,7 @@ int kho_radix_add_key(struct kho_radix_tree *tree, unsigned long key); void kho_radix_del_key(struct kho_radix_tree *tree, unsigned long key); int kho_radix_walk_tree(struct kho_radix_tree *tree, const struct kho_radix_walk_cb *cb, void *data); +int kho_radix_init_tree(struct kho_radix_tree *tree, struct kho_radix_node *root); void kho_radix_destroy_tree(struct kho_radix_tree *tree); #else /* #ifdef CONFIG_KEXEC_HANDOVER */ @@ -76,6 +77,12 @@ static inline int kho_radix_walk_tree(struct kho_radix_tree *tree, return -EOPNOTSUPP; } +static inline int kho_radix_init_tree(struct kho_radix_tree *tree, + struct kho_radix_node *root) +{ + return 0; +} + static inline void kho_radix_destroy_tree(struct kho_radix_tree *tree) { } #endif /* #ifdef CONFIG_KEXEC_HANDOVER */ |
