Skip to contentSkip to conversation

f2fs: make "f2fs_fault_name[]" const char *

PATCH In review Alexey Dobriyan 2 participants 2 messages Nov 24, 2018

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 f2fs: make "f2fs_fault_name[]" const char *

Those strings are immutable.

---

 fs/f2fs/f2fs.h  |    2 +-
 fs/f2fs/super.c |    2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
fs/f2fs/f2fs.h +1 -1
@@ -67,7 +67,7 @@ struct f2fs_fault_info {
 	unsigned int inject_type;
 };
 
-extern char *f2fs_fault_name[FAULT_MAX];
+extern const char *f2fs_fault_name[FAULT_MAX];
 #define IS_FAULT_SET(fi, type) ((fi)->inject_type & (1 << (type)))
 #endif
 
fs/f2fs/super.c +1 -1
@@ -38,7 +38,7 @@ static struct kmem_cache *f2fs_inode_cachep;
 
 #ifdef CONFIG_F2FS_FAULT_INJECTION
 
-char *f2fs_fault_name[FAULT_MAX] = {
+const char *f2fs_fault_name[FAULT_MAX] = {
 	[FAULT_KMALLOC]		= "kmalloc",
 	[FAULT_KVMALLOC]	= "kvmalloc",
 	[FAULT_PAGE_ALLOC]	= "page alloc",