diff mbox series

[v4,10/12] riscv: mm: Make asid_bits a local variable

Message ID 20240102220134.3229156-11-samuel.holland@sifive.com (mailing list archive)
State Superseded
Headers show
Series riscv: ASID-related and UP-related TLB flush enhancements | expand

Checks

Context Check Description
conchuod/vmtest-for-next-PR success PR summary
conchuod/vmtest-fixes-PR success PR summary
conchuod/patch-10-test-1 success .github/scripts/patches/tests/build_rv32_defconfig.sh
conchuod/patch-10-test-2 success .github/scripts/patches/tests/build_rv64_clang_allmodconfig.sh
conchuod/patch-10-test-3 success .github/scripts/patches/tests/build_rv64_gcc_allmodconfig.sh
conchuod/patch-10-test-4 success .github/scripts/patches/tests/build_rv64_nommu_k210_defconfig.sh
conchuod/patch-10-test-5 success .github/scripts/patches/tests/build_rv64_nommu_virt_defconfig.sh
conchuod/patch-10-test-6 success .github/scripts/patches/tests/checkpatch.sh
conchuod/patch-10-test-7 success .github/scripts/patches/tests/dtb_warn_rv64.sh
conchuod/patch-10-test-8 success .github/scripts/patches/tests/header_inline.sh
conchuod/patch-10-test-9 success .github/scripts/patches/tests/kdoc.sh
conchuod/patch-10-test-10 success .github/scripts/patches/tests/module_param.sh
conchuod/patch-10-test-11 success .github/scripts/patches/tests/verify_fixes.sh
conchuod/patch-10-test-12 success .github/scripts/patches/tests/verify_signedoff.sh

Commit Message

Samuel Holland Jan. 2, 2024, 10 p.m. UTC
This variable is only used inside asids_init().

Signed-off-by: Samuel Holland <samuel.holland@sifive.com>
---

(no changes since v1)

 arch/riscv/mm/context.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

Comments

Jisheng Zhang Jan. 3, 2024, 3 p.m. UTC | #1
On Tue, Jan 02, 2024 at 02:00:47PM -0800, Samuel Holland wrote:
> This variable is only used inside asids_init().

This is due to patch9, so can be folded into patch9.

> 
> Signed-off-by: Samuel Holland <samuel.holland@sifive.com>
> ---
> 
> (no changes since v1)
> 
>  arch/riscv/mm/context.c | 3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)
> 
> diff --git a/arch/riscv/mm/context.c b/arch/riscv/mm/context.c
> index b5170ac1b742..43a8bc2d5af4 100644
> --- a/arch/riscv/mm/context.c
> +++ b/arch/riscv/mm/context.c
> @@ -20,7 +20,6 @@
>  
>  DEFINE_STATIC_KEY_FALSE(use_asid_allocator);
>  
> -static unsigned long asid_bits;
>  static unsigned long num_asids;
>  
>  static atomic_long_t current_version;
> @@ -226,7 +225,7 @@ static inline void set_mm(struct mm_struct *prev,
>  
>  static int __init asids_init(void)
>  {
> -	unsigned long old;
> +	unsigned long asid_bits, old;
>  
>  	/* Figure-out number of ASID bits in HW */
>  	old = csr_read(CSR_SATP);
> -- 
> 2.42.0
> 
> 
> _______________________________________________
> linux-riscv mailing list
> linux-riscv@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/linux-riscv
Alexandre Ghiti Jan. 4, 2024, 12:47 p.m. UTC | #2
On Tue, Jan 2, 2024 at 11:01 PM Samuel Holland
<samuel.holland@sifive.com> wrote:
>
> This variable is only used inside asids_init().
>
> Signed-off-by: Samuel Holland <samuel.holland@sifive.com>
> ---
>
> (no changes since v1)
>
>  arch/riscv/mm/context.c | 3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)
>
> diff --git a/arch/riscv/mm/context.c b/arch/riscv/mm/context.c
> index b5170ac1b742..43a8bc2d5af4 100644
> --- a/arch/riscv/mm/context.c
> +++ b/arch/riscv/mm/context.c
> @@ -20,7 +20,6 @@
>
>  DEFINE_STATIC_KEY_FALSE(use_asid_allocator);
>
> -static unsigned long asid_bits;
>  static unsigned long num_asids;
>
>  static atomic_long_t current_version;
> @@ -226,7 +225,7 @@ static inline void set_mm(struct mm_struct *prev,
>
>  static int __init asids_init(void)
>  {
> -       unsigned long old;
> +       unsigned long asid_bits, old;
>
>         /* Figure-out number of ASID bits in HW */
>         old = csr_read(CSR_SATP);
> --
> 2.42.0
>

You can add:

Reviewed-by: Alexandre Ghiti <alexghiti@rivosinc.com>

Thanks,

Alex
Samuel Holland Jan. 4, 2024, 3:49 p.m. UTC | #3
On 2024-01-03 9:00 AM, Jisheng Zhang wrote:
> On Tue, Jan 02, 2024 at 02:00:47PM -0800, Samuel Holland wrote:
>> This variable is only used inside asids_init().
> 
> This is due to patch9, so can be folded into patch9.

I'm not sure what you mean here. Patch 9 does not touch any references to the
asid_bits variable, though it does touch adjacent lines.

>>
>> Signed-off-by: Samuel Holland <samuel.holland@sifive.com>
>> ---
>>
>> (no changes since v1)
>>
>>  arch/riscv/mm/context.c | 3 +--
>>  1 file changed, 1 insertion(+), 2 deletions(-)
>>
>> diff --git a/arch/riscv/mm/context.c b/arch/riscv/mm/context.c
>> index b5170ac1b742..43a8bc2d5af4 100644
>> --- a/arch/riscv/mm/context.c
>> +++ b/arch/riscv/mm/context.c
>> @@ -20,7 +20,6 @@
>>  
>>  DEFINE_STATIC_KEY_FALSE(use_asid_allocator);
>>  
>> -static unsigned long asid_bits;
>>  static unsigned long num_asids;
>>  
>>  static atomic_long_t current_version;
>> @@ -226,7 +225,7 @@ static inline void set_mm(struct mm_struct *prev,
>>  
>>  static int __init asids_init(void)
>>  {
>> -	unsigned long old;
>> +	unsigned long asid_bits, old;
>>  
>>  	/* Figure-out number of ASID bits in HW */
>>  	old = csr_read(CSR_SATP);
>> -- 
>> 2.42.0
>>
>>
>> _______________________________________________
>> linux-riscv mailing list
>> linux-riscv@lists.infradead.org
>> http://lists.infradead.org/mailman/listinfo/linux-riscv
diff mbox series

Patch

diff --git a/arch/riscv/mm/context.c b/arch/riscv/mm/context.c
index b5170ac1b742..43a8bc2d5af4 100644
--- a/arch/riscv/mm/context.c
+++ b/arch/riscv/mm/context.c
@@ -20,7 +20,6 @@ 
 
 DEFINE_STATIC_KEY_FALSE(use_asid_allocator);
 
-static unsigned long asid_bits;
 static unsigned long num_asids;
 
 static atomic_long_t current_version;
@@ -226,7 +225,7 @@  static inline void set_mm(struct mm_struct *prev,
 
 static int __init asids_init(void)
 {
-	unsigned long old;
+	unsigned long asid_bits, old;
 
 	/* Figure-out number of ASID bits in HW */
 	old = csr_read(CSR_SATP);