Skip to contentSkip to conversation

erofs: mark z_erofs_lzma_init/erofs_pcpubuf_init w/ __init

PATCH Superseded Yangtao Li 3 participants 4 messages Mar 3, 2023 EROFS file system

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore

Yangtao Li

author
#0 lore raw

PATCH 1/1 erofs: mark z_erofs_lzma_init/erofs_pcpubuf_init w/ __init

They are used during the erofs module init phase. Let's mark it as __init like any other function.

---
 fs/erofs/decompressor_lzma.c | 2 +-
 fs/erofs/pcpubuf.c           | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
fs/erofs/decompressor_lzma.c +1 -1
index 091fd5adf818..307b37f0b9f5 100644
@@ -47,7 +47,7 @@ void z_erofs_lzma_exit(void)
 	}
 }
 
-int z_erofs_lzma_init(void)
+int __init z_erofs_lzma_init(void)
 {
 	unsigned int i;
 
fs/erofs/pcpubuf.c +1 -1
index a2efd833d1b6..c7a4b1d77069 100644
@@ -114,7 +114,7 @@ int erofs_pcpubuf_growsize(unsigned int nrpages)
 	return ret;
 }
 
-void erofs_pcpubuf_init(void)
+void __init erofs_pcpubuf_init(void)
 {
 	int cpu;
 
Signature · 1 line
2.25.1
Reviewed-by on v1 1/1
#1 lore raw
Quoted 4 lines · Yangtao Li

They are used during the erofs module init phase. Let's mark it as __init like any other function.

Thanks,
Gao Xiang

Quoted 31 lines
---
  fs/erofs/decompressor_lzma.c | 2 +-
  fs/erofs/pcpubuf.c           | 2 +-
  2 files changed, 2 insertions(+), 2 deletions(-)
fs/erofs/decompressor_lzma.c +1 -1
index 091fd5adf818..307b37f0b9f5 100644
@@ -47,7 +47,7 @@ void z_erofs_lzma_exit(void)
  	}
  }
 
-int z_erofs_lzma_init(void)
+int __init z_erofs_lzma_init(void)
  {
  	unsigned int i;
 
fs/erofs/pcpubuf.c +1 -1
index a2efd833d1b6..c7a4b1d77069 100644
@@ -114,7 +114,7 @@ int erofs_pcpubuf_growsize(unsigned int nrpages)
  	return ret;
  }
 
-void erofs_pcpubuf_init(void)
+void __init erofs_pcpubuf_init(void)
  {
  	int cpu;
 
reviewer
#2 lore raw
In reply to Yangtao Li
Quoted 27 lines · On Fri, 3 Mar 2023 11:14:18 +0800 Yangtao Li <[email protected]> wrote:

They are used during the erofs module init phase. Let's mark it as __init like any other function.

---
 fs/erofs/decompressor_lzma.c | 2 +-
 fs/erofs/pcpubuf.c           | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
fs/erofs/decompressor_lzma.c +1 -1
index 091fd5adf818..307b37f0b9f5 100644
@@ -47,7 +47,7 @@ void z_erofs_lzma_exit(void)
 	}
 }
 
-int z_erofs_lzma_init(void)
+int __init z_erofs_lzma_init(void)
 {
 	unsigned int i;
 
fs/erofs/pcpubuf.c +0 -0
index a2efd833d1b6..c7a4b1d77069 100644

fs/erofs/pcpubuf.c int erofs_pcpubuf_growsize(unsigned int nrpages) · line 120

Quoted 8 lines
fs/erofs/pcpubuf.c +1 -1
@@ -114,7 +114,7 @@ int erofs_pcpubuf_growsize(unsigned int nrpages)
 	return ret;
 }
 
-void erofs_pcpubuf_init(void)
+void __init erofs_pcpubuf_init(void)
 {
 	int cpu;
 

Update them in internal.h as well?

#3 lore raw
Quoted 33 lines · Yue Hu
Quoted 30 lines · On Fri, 3 Mar 2023 11:14:18 +0800 Yangtao Li <[email protected]> wrote:

They are used during the erofs module init phase. Let's mark it as __init like any other function.

---
  fs/erofs/decompressor_lzma.c | 2 +-
  fs/erofs/pcpubuf.c           | 2 +-
  2 files changed, 2 insertions(+), 2 deletions(-)
fs/erofs/decompressor_lzma.c +1 -1
index 091fd5adf818..307b37f0b9f5 100644
@@ -47,7 +47,7 @@ void z_erofs_lzma_exit(void)
  	}
  }
 
-int z_erofs_lzma_init(void)
+int __init z_erofs_lzma_init(void)
  {
  	unsigned int i;
 
fs/erofs/pcpubuf.c +0 -0
index a2efd833d1b6..c7a4b1d77069 100644
@@ -114,7 +114,7 @@ int erofs_pcpubuf_growsize(unsigned int nrpages)
  	return ret;
  }
 
Quoted 7 lines

fs/erofs/pcpubuf.c int erofs_pcpubuf_growsize(unsigned int nrpages) · line 120

Quoted 5 lines
fs/erofs/pcpubuf.c +1 -1
-void erofs_pcpubuf_init(void)
+void __init erofs_pcpubuf_init(void)
  {
  	int cpu;
 

Update them in internal.h as well?

Yeah, please help revise, thanks!

Thanks,
Gao Xiang