diff mbox series

[4/5] mm/vmalloc: optimize function vm_unmap_aliases()

Message ID 20250415023952.27850-5-bhe@redhat.com (mailing list archive)
State New
Headers show
Series mm/vmalloc.c: code cleanup and improvements | expand

Commit Message

Baoquan He April 15, 2025, 2:39 a.m. UTC
Remove unneeded local variables and replace them with values.

Signed-off-by: Baoquan He <bhe@redhat.com>
---
 mm/vmalloc.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

Comments

Uladzislau Rezki April 15, 2025, 10:44 a.m. UTC | #1
On Tue, Apr 15, 2025 at 10:39:51AM +0800, Baoquan He wrote:
> Remove unneeded local variables and replace them with values.
> 
> Signed-off-by: Baoquan He <bhe@redhat.com>
> ---
>  mm/vmalloc.c | 5 +----
>  1 file changed, 1 insertion(+), 4 deletions(-)
> 
> diff --git a/mm/vmalloc.c b/mm/vmalloc.c
> index bf735c890878..3f38a232663b 100644
> --- a/mm/vmalloc.c
> +++ b/mm/vmalloc.c
> @@ -2930,10 +2930,7 @@ static void _vm_unmap_aliases(unsigned long start, unsigned long end, int flush)
>   */
>  void vm_unmap_aliases(void)
>  {
> -	unsigned long start = ULONG_MAX, end = 0;
> -	int flush = 0;
> -
> -	_vm_unmap_aliases(start, end, flush);
> +	_vm_unmap_aliases(ULONG_MAX, 0, 0);
>  }
>  EXPORT_SYMBOL_GPL(vm_unmap_aliases);
>  
> -- 
> 2.41.0
> 
Reviewed-by: Uladzislau Rezki (Sony) <urezki@gmail.com>

Makes sense!

--
Uladzislau Rezki
Shivank Garg April 15, 2025, 7:10 p.m. UTC | #2
On 4/15/2025 8:09 AM, Baoquan He wrote:
> Remove unneeded local variables and replace them with values.
> 
> Signed-off-by: Baoquan He <bhe@redhat.com>
> ---
>  mm/vmalloc.c | 5 +----
>  1 file changed, 1 insertion(+), 4 deletions(-)
> 
> diff --git a/mm/vmalloc.c b/mm/vmalloc.c
> index bf735c890878..3f38a232663b 100644
> --- a/mm/vmalloc.c
> +++ b/mm/vmalloc.c
> @@ -2930,10 +2930,7 @@ static void _vm_unmap_aliases(unsigned long start, unsigned long end, int flush)
>   */
>  void vm_unmap_aliases(void)
>  {
> -	unsigned long start = ULONG_MAX, end = 0;
> -	int flush = 0;
> -
> -	_vm_unmap_aliases(start, end, flush);
> +	_vm_unmap_aliases(ULONG_MAX, 0, 0);
>  }
>  EXPORT_SYMBOL_GPL(vm_unmap_aliases);
>  

Reviewed-by: Shivank Garg <shivankg@amd.com>
Tested-by: Shivank Garg <shivankg@amd.com>
Vishal Moola (Oracle) April 15, 2025, 11:54 p.m. UTC | #3
On Tue, Apr 15, 2025 at 10:39:51AM +0800, Baoquan He wrote:
> Remove unneeded local variables and replace them with values.
> 
> Signed-off-by: Baoquan He <bhe@redhat.com>

Reviewed-by: Vishal Moola (Oracle) <vishal.moola@gmail.com>
diff mbox series

Patch

diff --git a/mm/vmalloc.c b/mm/vmalloc.c
index bf735c890878..3f38a232663b 100644
--- a/mm/vmalloc.c
+++ b/mm/vmalloc.c
@@ -2930,10 +2930,7 @@  static void _vm_unmap_aliases(unsigned long start, unsigned long end, int flush)
  */
 void vm_unmap_aliases(void)
 {
-	unsigned long start = ULONG_MAX, end = 0;
-	int flush = 0;
-
-	_vm_unmap_aliases(start, end, flush);
+	_vm_unmap_aliases(ULONG_MAX, 0, 0);
 }
 EXPORT_SYMBOL_GPL(vm_unmap_aliases);