From: Liu Ye <liuye@kylinos.cn>
To: akpm@linux-foundation.org
Cc: urezki@gmail.com, hch@infradead.org, linux-mm@kvack.org,
linux-kernel@vger.kernel.org, Liu Ye <liuye@kylinos.cn>
Subject: [PATCH 4/4] mm/vmalloc: Rename the variable real_align to original_align to prevent misunderstanding
Date: Mon, 3 Mar 2025 17:44:10 +0800 [thread overview]
Message-ID: <20250303094410.437985-5-liuye@kylinos.cn> (raw)
In-Reply-To: <20250303094410.437985-1-liuye@kylinos.cn>
The real prefix is generally used to indicate the adjusted value of a
parameter, but according to the code logic, it should indicate the
original value, so it is recommended to rename it to original_align.
Signed-off-by: Liu Ye <liuye@kylinos.cn>
---
mm/vmalloc.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/mm/vmalloc.c b/mm/vmalloc.c
index b4d2010e5105..a8488452b70b 100644
--- a/mm/vmalloc.c
+++ b/mm/vmalloc.c
@@ -3770,7 +3770,7 @@ void *__vmalloc_node_range_noprof(unsigned long size, unsigned long align,
struct vm_struct *area;
void *ret;
kasan_vmalloc_flags_t kasan_flags = KASAN_VMALLOC_NONE;
- unsigned long real_align = align;
+ unsigned long original_align = align;
unsigned int shift = PAGE_SHIFT;
if (WARN_ON_ONCE(!size))
@@ -3796,7 +3796,7 @@ void *__vmalloc_node_range_noprof(unsigned long size, unsigned long align,
else
shift = arch_vmap_pte_supported_shift(size);
- align = max(real_align, 1UL << shift);
+ align = max(original_align, 1UL << shift);
}
again:
@@ -3876,7 +3876,7 @@ void *__vmalloc_node_range_noprof(unsigned long size, unsigned long align,
fail:
if (shift > PAGE_SHIFT) {
shift = PAGE_SHIFT;
- align = real_align;
+ align = original_align;
goto again;
}
--
2.25.1
next prev parent reply other threads:[~2025-03-03 9:44 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-03-03 9:44 [PATCH 0/4] Optimize __vmalloc_node_range_noprof function Liu Ye
2025-03-03 9:44 ` [PATCH 1/4] mm/vmalloc: Remove unnecessary size ALIGN in __vmalloc_node_range_noprof Liu Ye
2025-03-03 18:30 ` Uladzislau Rezki
2025-03-05 1:46 ` liuye
2025-03-05 10:02 ` Baoquan He
2025-03-05 10:06 ` Uladzislau Rezki
2025-03-06 1:32 ` liuye
2025-03-03 9:44 ` [PATCH 2/4] mm/vmalloc: Size should be used instead of real_size " Liu Ye
2025-03-03 9:44 ` [PATCH 3/4] mm/vmalloc: Remove the real_size variable to simplify the code " Liu Ye
2025-03-03 9:44 ` Liu Ye [this message]
2025-03-03 16:09 ` [PATCH 0/4] Optimize __vmalloc_node_range_noprof function Uladzislau Rezki
2025-03-04 5:58 ` Dev Jain
2025-03-05 1:33 ` liuye
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20250303094410.437985-5-liuye@kylinos.cn \
--to=liuye@kylinos.cn \
--cc=akpm@linux-foundation.org \
--cc=hch@infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=urezki@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox