Skip to contentSkip to conversation

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

PATCH In review Ojaswin Mujoo 2 participants 3 messages Sep 24 – Oct 23 ext4 file system

lore
Share & tools
lore

Ojaswin Mujoo

author reviewer
#0 lore raw

PATCH v2 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.

---
 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 8 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.

Quoted 7 lines

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
author reviewer
#2 lore raw
In reply to Ojaswin Mujoo
Quoted 8 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.

Quoted 7 lines

Hi Ted,

A gentle ping on this small fix.

Regards,
ojaswin

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