Skip to contentSkip to conversation

Minor cleanup of pgtable_l{4,5}_enabled

PATCH Applied Dawei Li 2 participants 4 messages Mar 20, 2024 – Apr 28, 2024 RISC-V

lore
Share & tools
lore

Dawei Li

author
#0 lore raw

cover Minor cleanup of pgtable_l{4,5}_enabled

Hi,

This is a trivial series of minor cleanup of pgtable_l{4,5}_enabled.

Change since v1:
- Split into 2 patches, as suggested by Alex.
- Add Reviewed-by from Alex.

v1:
https://lore.kernel.org/all/[email protected]/

Dawei Li (2):
riscv: Remove redundant CONFIG_64BIT from pgtable_l{4,5}_enabled
riscv: Annotate pgtable_l{4,5}_enabled with __ro_after_init

 arch/riscv/mm/init.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
Signature · 7 lines
2.27.0


_______________________________________________
linux-riscv mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-riscv
author
#1 lore raw

PATCH 1/2 riscv: Remove redundant CONFIG_64BIT from pgtable_l{4,5}_enabled

IS_ENABLED(CONFIG_64BIT) in initialization of pgtable_l{4,5}_enabled is redundant, remove it.

---
 arch/riscv/mm/init.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
arch/riscv/mm/init.c +2 -2
index fa34cf55037b..bab3e9943bb5 100644
@@ -50,8 +50,8 @@ u64 satp_mode __ro_after_init = SATP_MODE_32;
 EXPORT_SYMBOL(satp_mode);
 
 #ifdef CONFIG_64BIT
-bool pgtable_l4_enabled = IS_ENABLED(CONFIG_64BIT) && !IS_ENABLED(CONFIG_XIP_KERNEL);
-bool pgtable_l5_enabled = IS_ENABLED(CONFIG_64BIT) && !IS_ENABLED(CONFIG_XIP_KERNEL);
+bool pgtable_l4_enabled = !IS_ENABLED(CONFIG_XIP_KERNEL);
+bool pgtable_l5_enabled = !IS_ENABLED(CONFIG_XIP_KERNEL);
 EXPORT_SYMBOL(pgtable_l4_enabled);
 EXPORT_SYMBOL(pgtable_l5_enabled);
 #endif
Signature · 7 lines
2.27.0


_______________________________________________
linux-riscv mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-riscv
author
#2 lore raw

PATCH 2/2 riscv: Annotate pgtable_l{4,5}_enabled with __ro_after_init

In reply to Dawei Li

pgtable_l{4,5}_enabled are read only after initialization, make explicit annotation of __ro_after_init on them.

---
 arch/riscv/mm/init.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
arch/riscv/mm/init.c +2 -2
index bab3e9943bb5..204cdf5b829d 100644
@@ -50,8 +50,8 @@ u64 satp_mode __ro_after_init = SATP_MODE_32;
 EXPORT_SYMBOL(satp_mode);
 
 #ifdef CONFIG_64BIT
-bool pgtable_l4_enabled = !IS_ENABLED(CONFIG_XIP_KERNEL);
-bool pgtable_l5_enabled = !IS_ENABLED(CONFIG_XIP_KERNEL);
+bool pgtable_l4_enabled __ro_after_init = !IS_ENABLED(CONFIG_XIP_KERNEL);
+bool pgtable_l5_enabled __ro_after_init = !IS_ENABLED(CONFIG_XIP_KERNEL);
 EXPORT_SYMBOL(pgtable_l4_enabled);
 EXPORT_SYMBOL(pgtable_l5_enabled);
 #endif
Signature · 7 lines
2.27.0


_______________________________________________
linux-riscv mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-riscv
#3 lore raw
In reply to Dawei Li
This series was applied to riscv/linux.git (for-next) by Palmer Dabbelt <[email protected]>:

Hello:

This series was applied to riscv/linux.git (for-next) by Palmer Dabbelt <[email protected]>:

Quoted 9 lines · On Wed, 20 Mar 2024 14:47:10 +0800 you wrote:

Hi,

This is a trivial series of minor cleanup of pgtable_l{4,5}_enabled.

Change since v1:
- Split into 2 patches, as suggested by Alex.
- Add Reviewed-by from Alex.

[...]

Here is the summary with links:
- [1/2] riscv: Remove redundant CONFIG_64BIT from pgtable_l{4,5}_enabled

    https://git.kernel.org/riscv/c/3a0dc44899d4
  - [2/2] riscv: Annotate pgtable_l{4,5}_enabled with __ro_after_init
    https://git.kernel.org/riscv/c/7a04dd8fd75b

You are awesome, thank you!

Signature · 2 lines
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html