summaryrefslogtreecommitdiff
path: root/mm/vmalloc.c
diff options
context:
space:
mode:
authorLi kunyu <kunyu@nfschina.com>2022-05-12 20:23:07 -0700
committerAndrew Morton <akpm@linux-foundation.org>2022-05-13 07:20:18 -0700
commitc8db8c2628afc7088a43de3f7cfbcc2ef1f182f7 (patch)
treee6d2f26445a3e3718a73e0161b7e7422eb044f12 /mm/vmalloc.c
parent3fee229a8eb936b96933c6b2cd02d2e87a4cc997 (diff)
downloadlwn-c8db8c2628afc7088a43de3f7cfbcc2ef1f182f7.tar.gz
lwn-c8db8c2628afc7088a43de3f7cfbcc2ef1f182f7.zip
mm: functions may simplify the use of return values
p4d_clear_huge may be optimized for void return type and function usage. vunmap_p4d_range function saves a few steps here. Link: https://lkml.kernel.org/r/20220507150630.90399-1-kunyu@nfschina.com Signed-off-by: Li kunyu <kunyu@nfschina.com> Cc: Dave Hansen <dave.hansen@linux.intel.com> Cc: Andy Lutomirski <luto@kernel.org> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Thomas Gleixner <tglx@linutronix.de> Cc: Ingo Molnar <mingo@redhat.com> Cc: Borislav Petkov <bp@alien8.de> Cc: "H. Peter Anvin" <hpa@zytor.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Diffstat (limited to 'mm/vmalloc.c')
-rw-r--r--mm/vmalloc.c7
1 files changed, 2 insertions, 5 deletions
diff --git a/mm/vmalloc.c b/mm/vmalloc.c
index c3af9b28e54f..5b59ccafcd46 100644
--- a/mm/vmalloc.c
+++ b/mm/vmalloc.c
@@ -389,18 +389,15 @@ static void vunmap_p4d_range(pgd_t *pgd, unsigned long addr, unsigned long end,
{
p4d_t *p4d;
unsigned long next;
- int cleared;
p4d = p4d_offset(pgd, addr);
do {
next = p4d_addr_end(addr, end);
- cleared = p4d_clear_huge(p4d);
- if (cleared || p4d_bad(*p4d))
+ p4d_clear_huge(p4d);
+ if (p4d_bad(*p4d))
*mask |= PGTBL_P4D_MODIFIED;
- if (cleared)
- continue;
if (p4d_none_or_clear_bad(p4d))
continue;
vunmap_pud_range(p4d, addr, next, mask);