[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <39c0a1bf-ce23-4905-a014-0a9ba0dc24c8@redhat.com>
Date: Wed, 9 Oct 2024 10:55:24 -0400
From: Waiman Long <llong@...hat.com>
To: Kuan-Wei Chiu <visitorckw@...il.com>, xavier_qy@....com,
lizefan.x@...edance.com, tj@...nel.org, hannes@...xchg.org,
mkoutny@...e.com, akpm@...ux-foundation.org
Cc: jserv@...s.ncku.edu.tw, linux-kernel@...r.kernel.org,
cgroups@...r.kernel.org
Subject: Re: [PATCH v2 1/6] lib/union_find: Add EXPORT_SYMBOL() for uf_find()
and uf_union()
On 10/7/24 11:28 AM, Kuan-Wei Chiu wrote:
> Add EXPORT_SYMBOL() for the uf_find() and uf_union() functions to allow
> kernel modules, including the KUnit tests for the union-find data
> structure, to use these functions. This enhances the usability of the
> union-find implementation in a modular context, facilitating easier
> testing and integration.
>
> Signed-off-by: Kuan-Wei Chiu <visitorckw@...il.com>
> ---
> lib/union_find.c | 3 +++
> 1 file changed, 3 insertions(+)
>
> diff --git a/lib/union_find.c b/lib/union_find.c
> index 413b0f8adf7a..c9fd30b8059c 100644
> --- a/lib/union_find.c
> +++ b/lib/union_find.c
> @@ -1,4 +1,5 @@
> // SPDX-License-Identifier: GPL-2.0
> +#include <linux/export.h>
> #include <linux/union_find.h>
>
> /**
> @@ -21,6 +22,7 @@ struct uf_node *uf_find(struct uf_node *node)
> }
> return node;
> }
> +EXPORT_SYMBOL(uf_find);
>
> /**
> * uf_union - Merge two sets, using union by rank
> @@ -47,3 +49,4 @@ void uf_union(struct uf_node *node1, struct uf_node *node2)
> root1->rank++;
> }
> }
> +EXPORT_SYMBOL(uf_union);
BTW, we don't need to export these functions until the time a kernel
module starts to use it. That is the usual rule.
Cheers,
Longman
Powered by blists - more mailing lists