Skip to contentSkip to conversation

lib/test_lockup.c: make test_inode static

PATCH Applied Jason Yan 2 participants 2 messages Apr 17, 2020 – Apr 27, 2020 Library code

lore
Share & tools
lore

Jason Yan

author
#0 lore raw

PATCH 1/1 lib/test_lockup.c: make test_inode static

Fix the following sparse warning:

lib/test_lockup.c:145:14: warning: symbol 'test_inode' was not declared. Should it be static?

---
 lib/test_lockup.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
lib/test_lockup.c +1 -1
index ea09ca335b21..419fbaceba73 100644
@@ -142,7 +142,7 @@ module_param(reallocate_pages, bool, 0400);
 MODULE_PARM_DESC(reallocate_pages, "free and allocate pages between iterations");
 
 struct file *test_file;
-struct inode *test_inode;
+static struct inode *test_inode;
 static char test_file_path[256];
 module_param_string(file_path, test_file_path, sizeof(test_file_path), 0400);
 MODULE_PARM_DESC(file_path, "file path to test");
Signature · 1 line
2.21.1
#1 lore raw
Quoted 4 lines · Jason Yan

Fix the following sparse warning:

lib/test_lockup.c:145:14: warning: symbol 'test_inode' was not declared. Should it be static?

Yep, but that's not so important.

Quoted 12 lines
---
  lib/test_lockup.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
lib/test_lockup.c +0 -0
index ea09ca335b21..419fbaceba73 100644

lib/test_lockup.c module_param(reallocate_pages, bool, 0400); · line 144

Quoted 3 lines
lib/test_lockup.c +0 -0
@@ -142,7 +142,7 @@ module_param(reallocate_pages, bool, 0400);
  MODULE_PARM_DESC(reallocate_pages, "free and allocate pages between iterations");
 
  struct file *test_file;

Why you're fixing only this warning? =)
test_file above should generate the same.

Quoted 6 lines
lib/test_lockup.c +1 -1
-struct inode *test_inode;
+static struct inode *test_inode;
  static char test_file_path[256];
  module_param_string(file_path, test_file_path, sizeof(test_file_path), 0400);
  MODULE_PARM_DESC(file_path, "file path to test");