Skip to contentSkip to conversation

ext4: Fix sparse warning in extents kunit test when EXT4_KUNIT_TESTS=m

PATCH Superseded Ojaswin Mujoo 5 participants 6 messages Sep 22 – Sep 24 ext4 file system

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore

Ojaswin Mujoo

author reviewer
#0 lore raw

PATCH 1/1 ext4: Fix sparse warning in extents kunit test when EXT4_KUNIT_TESTS=m

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

Quoted 1 line
Quoted 1 line

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")
---
 fs/ext4/extents-test.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
fs/ext4/extents-test.c +1 -1
index bd7795a82607..9669b2197fca 100644
@@ -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
 	 */
Signature · 1 line
2.55.0
#1 lore raw
Sashiko has reviewed this patch and found no issues. It looks great!
Quoted 11 lines

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

Quoted 1 line
Quoted 1 line

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")

Sashiko has reviewed this patch and found no issues. It looks great!

Signature · 1 line
Sashiko AI review · https://sashiko.dev/#/patchset/[email protected]?part=1
reviewer Reviewed-by on v1 1/1
#2 lore raw
In reply to Ojaswin Mujoo
Quoted 11 lines · Ojaswin Mujoo

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

Quoted 1 line
Quoted 1 line

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")

Looks good. Feel free to add:

Honza

Quoted 20 lines
---
 fs/ext4/extents-test.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
fs/ext4/extents-test.c +1 -1
index bd7795a82607..9669b2197fca 100644
@@ -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
 	 */
Signature · 1 line
2.55.0
Signature · 2 lines
Jan Kara <[email protected]>
SUSE Labs, CR
Reviewed-by on v1 1/1
#3 lore raw
In reply to Ojaswin Mujoo
Quoted 11 lines · Ojaswin Mujoo

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

Quoted 1 line
Quoted 1 line

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")

Looks good to me.

Quoted 17 lines
---
  fs/ext4/extents-test.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
fs/ext4/extents-test.c +1 -1
index bd7795a82607..9669b2197fca 100644
@@ -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
  	 */
reviewer Reviewed-by on v1 1/1
#4 lore raw
In reply to Ojaswin Mujoo

Hi Ojaswin,

Quoted 2 lines · Ojaswin Mujoo

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

This is not module-specific, it also shows up with EXT4_KUNIT_TESTS=y, so maybe the "=m" can be dropped.

Quoted 8 lines
Quoted 1 line
Quoted 1 line

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")

Missing Signed-off-by, otherwise looks good to me.

Quoted 17 lines
---
 fs/ext4/extents-test.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
fs/ext4/extents-test.c +1 -1
index bd7795a82607..9669b2197fca 100644
@@ -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
 	 */
author reviewer
#5 lore raw
Quoted 12 lines · Baokun Li

Hi Ojaswin,

Quoted 2 lines · Ojaswin Mujoo

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

This is not module-specific, it also shows up with EXT4_KUNIT_TESTS=y, so maybe the "=m" can be dropped.

Quoted 3 lines
Quoted 1 line
Quoted 1 line

fs/ext4/extents-test.c:59:3: sparse: sparse: symbol 'k_ctx' was not

declared. Should it be static?

Quoted 8 lines
Quoted 5 lines

Fix this by declaring it as static.

Fixes cb1e0c1d1fad ("ext4: kunit tests for extent splitting and conversion")

Missing Signed-off-by, otherwise looks good to me.

Ahh idk how that got missed :) Thanks I'll fix it.

Regards,
ojaswin

Quoted 23 lines
Quoted 17 lines
---
 fs/ext4/extents-test.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
fs/ext4/extents-test.c +1 -1
index bd7795a82607..9669b2197fca 100644
@@ -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
 	 */