mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH v1 1/1] smb/client: Use EXPORT_SYMBOL_IF_KUNIT() to export symbols in SMB2
@ 2026-07-14 13:53 Andy Shevchenko
  2026-07-14 14:07 ` ChenXiaoSong
  0 siblings, 1 reply; 3+ messages in thread
From: Andy Shevchenko @ 2026-07-14 13:53 UTC (permalink / raw)
  To: Steve French, ChenXiaoSong, David Howells, linux-cifs,
	samba-technical, linux-kernel
  Cc: Steve French, Paulo Alcantara, Ronnie Sahlberg, Shyam Prasad N,
	Tom Talpey, Bharath SM, Andy Shevchenko

Replace EXPORT_SYMBOL_FOR_MODULES() with EXPORT_SYMBOL_IF_KUNIT()
to mark the symbols as visible only if CONFIG_KUNIT is enabled.

Kunit test should import the namespace EXPORTED_FOR_KUNIT_TESTING to
use these marked symbols. This is the standard way for all KUnit
tests.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
---
 fs/smb/client/smb2maperror.c      | 12 ++++++------
 fs/smb/client/smb2maperror_test.c |  1 +
 2 files changed, 7 insertions(+), 6 deletions(-)

diff --git a/fs/smb/client/smb2maperror.c b/fs/smb/client/smb2maperror.c
index 9ed21f7b618c..d86f2460d0e5 100644
--- a/fs/smb/client/smb2maperror.c
+++ b/fs/smb/client/smb2maperror.c
@@ -8,6 +8,9 @@
  *
  */
 #include <linux/errno.h>
+
+#include <kunit/visibility.h>
+
 #include "cifsproto.h"
 #include "cifs_debug.h"
 #include "smb2proto.h"
@@ -109,18 +112,15 @@ int __init smb2_init_maperror(void)
 }
 
 #if IS_ENABLED(CONFIG_SMB_KUNIT_TESTS)
-#define EXPORT_SYMBOL_FOR_SMB_TEST(sym) \
-	EXPORT_SYMBOL_FOR_MODULES(sym, "smb2maperror_test")
-
 const struct status_to_posix_error *smb2_get_err_map_test(__u32 smb2_status)
 {
 	return smb2_get_err_map(smb2_status);
 }
-EXPORT_SYMBOL_FOR_SMB_TEST(smb2_get_err_map_test);
+EXPORT_SYMBOL_IF_KUNIT(smb2_get_err_map_test);
 
 const struct status_to_posix_error *smb2_error_map_table_test = smb2_error_map_table;
-EXPORT_SYMBOL_FOR_SMB_TEST(smb2_error_map_table_test);
+EXPORT_SYMBOL_IF_KUNIT(smb2_error_map_table_test);
 
 unsigned int smb2_error_map_num = ARRAY_SIZE(smb2_error_map_table);
-EXPORT_SYMBOL_FOR_SMB_TEST(smb2_error_map_num);
+EXPORT_SYMBOL_IF_KUNIT(smb2_error_map_num);
 #endif
diff --git a/fs/smb/client/smb2maperror_test.c b/fs/smb/client/smb2maperror_test.c
index 0f8a44a5ed3c..44dc5e899cad 100644
--- a/fs/smb/client/smb2maperror_test.c
+++ b/fs/smb/client/smb2maperror_test.c
@@ -47,3 +47,4 @@ kunit_test_suite(maperror_suite);
 
 MODULE_LICENSE("GPL");
 MODULE_DESCRIPTION("KUnit tests of SMB2 maperror");
+MODULE_IMPORT_NS("EXPORTED_FOR_KUNIT_TESTING");
-- 
2.50.1


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH v1 1/1] smb/client: Use EXPORT_SYMBOL_IF_KUNIT() to export symbols in SMB2
  2026-07-14 13:53 [PATCH v1 1/1] smb/client: Use EXPORT_SYMBOL_IF_KUNIT() to export symbols in SMB2 Andy Shevchenko
@ 2026-07-14 14:07 ` ChenXiaoSong
  2026-07-14 22:02   ` Steve French
  0 siblings, 1 reply; 3+ messages in thread
From: ChenXiaoSong @ 2026-07-14 14:07 UTC (permalink / raw)
  To: Andy Shevchenko, Steve French, ChenXiaoSong, David Howells,
	linux-cifs, samba-technical, linux-kernel
  Cc: Steve French, Paulo Alcantara, Ronnie Sahlberg, Shyam Prasad N,
	Tom Talpey, Bharath SM

Reviewed-by: ChenXiaoSong <chenxiaosong@kylinos.cn>

在 2026/7/14 21:53, Andy Shevchenko 写道:
> Replace EXPORT_SYMBOL_FOR_MODULES() with EXPORT_SYMBOL_IF_KUNIT()
> to mark the symbols as visible only if CONFIG_KUNIT is enabled.
> 
> Kunit test should import the namespace EXPORTED_FOR_KUNIT_TESTING to
> use these marked symbols. This is the standard way for all KUnit
> tests.
> 
> Signed-off-by: Andy Shevchenko<andriy.shevchenko@linux.intel.com>
> ---
>   fs/smb/client/smb2maperror.c      | 12 ++++++------
>   fs/smb/client/smb2maperror_test.c |  1 +
>   2 files changed, 7 insertions(+), 6 deletions(-)

-- 
ChenXiaoSong <chenxiaosong@chenxiaosong.com>
Chinese Homepage: https://chenxiaosong.com
English Homepage: https://chenxiaosong.com/en


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH v1 1/1] smb/client: Use EXPORT_SYMBOL_IF_KUNIT() to export symbols in SMB2
  2026-07-14 14:07 ` ChenXiaoSong
@ 2026-07-14 22:02   ` Steve French
  0 siblings, 0 replies; 3+ messages in thread
From: Steve French @ 2026-07-14 22:02 UTC (permalink / raw)
  To: ChenXiaoSong
  Cc: Andy Shevchenko, Steve French, ChenXiaoSong, David Howells,
	linux-cifs, samba-technical, linux-kernel, Tom Talpey,
	Shyam Prasad N, Paulo Alcantara, Steve French, Bharath SM

merged into cifs-2.6.git for-next

On Tue, Jul 14, 2026 at 9:22 AM ChenXiaoSong via samba-technical
<samba-technical@lists.samba.org> wrote:
>
> Reviewed-by: ChenXiaoSong <chenxiaosong@kylinos.cn>
>
> 在 2026/7/14 21:53, Andy Shevchenko 写道:
> > Replace EXPORT_SYMBOL_FOR_MODULES() with EXPORT_SYMBOL_IF_KUNIT()
> > to mark the symbols as visible only if CONFIG_KUNIT is enabled.
> >
> > Kunit test should import the namespace EXPORTED_FOR_KUNIT_TESTING to
> > use these marked symbols. This is the standard way for all KUnit
> > tests.
> >
> > Signed-off-by: Andy Shevchenko<andriy.shevchenko@linux.intel.com>
> > ---
> >   fs/smb/client/smb2maperror.c      | 12 ++++++------
> >   fs/smb/client/smb2maperror_test.c |  1 +
> >   2 files changed, 7 insertions(+), 6 deletions(-)
>
> --
> ChenXiaoSong <chenxiaosong@chenxiaosong.com>
> Chinese Homepage: https://chenxiaosong.com
> English Homepage: https://chenxiaosong.com/en
>
>


-- 
Thanks,

Steve

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2026-07-14 22:02 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-07-14 13:53 [PATCH v1 1/1] smb/client: Use EXPORT_SYMBOL_IF_KUNIT() to export symbols in SMB2 Andy Shevchenko
2026-07-14 14:07 ` ChenXiaoSong
2026-07-14 22:02   ` Steve French

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox