mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] ext4: Fix sparse warning in extents kunit test when EXT4_KUNIT_TESTS=m
@ 2026-09-22 13:58 Ojaswin Mujoo
  2026-09-23 11:38 ` Jan Kara
  2026-09-23 12:54 ` Zhang Yi
  0 siblings, 2 replies; 3+ messages in thread
From: Ojaswin Mujoo @ 2026-09-22 13:58 UTC (permalink / raw)
  To: linux-ext4, Theodore Ts'o
  Cc: Ritesh Harjani, Zhang Yi, linux-kernel, Baokun Li, Jan Kara,
	Ye Bin, kernel test robot

When kunit tests are compiled as modules, the extents kunit test emits
a sparse warning:

>> fs/ext4/extents-test.c:59:3: sparse: sparse: symbol 'k_ctx' was not
   declared. Should it be static?

Fix this by declaring it as static.

Fixes: cb1e0c1d1fad ("ext4: kunit tests for extent splitting and conversion")
Reported-by: kernel test robot <lkp@intel.com>
Closes: https://lore.kernel.org/oe-kbuild-all/202609221900.Pgwrcp41-lkp@intel.com/
---
 fs/ext4/extents-test.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/fs/ext4/extents-test.c b/fs/ext4/extents-test.c
index bd7795a82607..9669b2197fca 100644
--- a/fs/ext4/extents-test.c
+++ b/fs/ext4/extents-test.c
@@ -48,7 +48,7 @@
 #define EXT_DATA_LBLK 10
 #define EXT_DATA_LEN 3
 
-struct kunit_ctx {
+static struct kunit_ctx {
 	/*
 	 * Ext4 inode which has only 1 unwrit extent
 	 */
-- 
2.55.0


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

* Re: [PATCH] ext4: Fix sparse warning in extents kunit test when EXT4_KUNIT_TESTS=m
  2026-09-22 13:58 [PATCH] ext4: Fix sparse warning in extents kunit test when EXT4_KUNIT_TESTS=m Ojaswin Mujoo
@ 2026-09-23 11:38 ` Jan Kara
  2026-09-23 12:54 ` Zhang Yi
  1 sibling, 0 replies; 3+ messages in thread
From: Jan Kara @ 2026-09-23 11:38 UTC (permalink / raw)
  To: Ojaswin Mujoo
  Cc: linux-ext4, Theodore Ts'o, Ritesh Harjani, Zhang Yi,
	linux-kernel, Baokun Li, Jan Kara, Ye Bin, kernel test robot

On Tue 22-09-26 19:28:08, Ojaswin Mujoo wrote:
> When kunit tests are compiled as modules, the extents kunit test emits
> a sparse warning:
> 
> >> fs/ext4/extents-test.c:59:3: sparse: sparse: symbol 'k_ctx' was not
>    declared. Should it be static?
> 
> Fix this by declaring it as static.
> 
> Fixes: cb1e0c1d1fad ("ext4: kunit tests for extent splitting and conversion")
> Reported-by: kernel test robot <lkp@intel.com>
> Closes: https://lore.kernel.org/oe-kbuild-all/202609221900.Pgwrcp41-lkp@intel.com/

Looks good. Feel free to add:

Reviewed-by: Jan Kara <jack@suse.cz>

								Honza

> ---
>  fs/ext4/extents-test.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/fs/ext4/extents-test.c b/fs/ext4/extents-test.c
> index bd7795a82607..9669b2197fca 100644
> --- a/fs/ext4/extents-test.c
> +++ b/fs/ext4/extents-test.c
> @@ -48,7 +48,7 @@
>  #define EXT_DATA_LBLK 10
>  #define EXT_DATA_LEN 3
>  
> -struct kunit_ctx {
> +static struct kunit_ctx {
>  	/*
>  	 * Ext4 inode which has only 1 unwrit extent
>  	 */
> -- 
> 2.55.0
> 
-- 
Jan Kara <jack@suse.com>
SUSE Labs, CR

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

* Re: [PATCH] ext4: Fix sparse warning in extents kunit test when EXT4_KUNIT_TESTS=m
  2026-09-22 13:58 [PATCH] ext4: Fix sparse warning in extents kunit test when EXT4_KUNIT_TESTS=m Ojaswin Mujoo
  2026-09-23 11:38 ` Jan Kara
@ 2026-09-23 12:54 ` Zhang Yi
  1 sibling, 0 replies; 3+ messages in thread
From: Zhang Yi @ 2026-09-23 12:54 UTC (permalink / raw)
  To: Ojaswin Mujoo, linux-ext4
  Cc: Theodore Ts'o, Ritesh Harjani, Zhang Yi, linux-kernel,
	Baokun Li, Jan Kara, Ye Bin, kernel test robot

On 9/22/2026 9:58 PM, Ojaswin Mujoo wrote:
> When kunit tests are compiled as modules, the extents kunit test emits
> a sparse warning:
> 
>>> fs/ext4/extents-test.c:59:3: sparse: sparse: symbol 'k_ctx' was not
>     declared. Should it be static?
> 
> Fix this by declaring it as static.
> 
> Fixes: cb1e0c1d1fad ("ext4: kunit tests for extent splitting and conversion")
> Reported-by: kernel test robot <lkp@intel.com>
> Closes: https://lore.kernel.org/oe-kbuild-all/202609221900.Pgwrcp41-lkp@intel.com/

Looks good to me.

Reviewed-by: Zhang Yi <yi.zhang@huawei.com>

> ---
>   fs/ext4/extents-test.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/fs/ext4/extents-test.c b/fs/ext4/extents-test.c
> index bd7795a82607..9669b2197fca 100644
> --- a/fs/ext4/extents-test.c
> +++ b/fs/ext4/extents-test.c
> @@ -48,7 +48,7 @@
>   #define EXT_DATA_LBLK 10
>   #define EXT_DATA_LEN 3
>   
> -struct kunit_ctx {
> +static struct kunit_ctx {
>   	/*
>   	 * Ext4 inode which has only 1 unwrit extent
>   	 */


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

end of thread, other threads:[~2026-09-23 12:54 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-09-22 13:58 [PATCH] ext4: Fix sparse warning in extents kunit test when EXT4_KUNIT_TESTS=m Ojaswin Mujoo
2026-09-23 11:38 ` Jan Kara
2026-09-23 12:54 ` Zhang Yi

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

all inboxes | Powered by JetHome®