diff options
| author | Baoquan He <[email protected]> | 2022-06-07 10:59:56 +0000 |
|---|---|---|
| committer | akpm <[email protected]> | 2022-06-17 02:48:28 +0000 |
| commit | 753df96be5d3a21cd70d8ab4f7464a868e1d2cb4 (patch) | |
| tree | 2fae7e970250796232c873041ed5d75dee545df1 /mm/vmalloc.c | |
| parent | mm/vmalloc: invoke classify_va_fit_type() in adjust_va_to_fit_type() (diff) | |
| download | kernel-753df96be5d3a21cd70d8ab4f7464a868e1d2cb4.tar.gz kernel-753df96be5d3a21cd70d8ab4f7464a868e1d2cb4.zip | |
mm/vmalloc: remove the redundant boundary check
In find_va_links(), when traversing the vmap_area tree, the comparing to
check if the passed in 'va' is above or below 'tmp_va' is redundant,
assuming both 'va' and 'tmp_va' has ->va_start <= ->va_end.
Here, to simplify the checking as code change.
Link: https://lkml.kernel.org/r/[email protected]
Signed-off-by: Baoquan He <[email protected]>
Reviewed-by: Uladzislau Rezki (Sony) <[email protected]>
Cc: Christoph Hellwig <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Diffstat (limited to 'mm/vmalloc.c')
| -rw-r--r-- | mm/vmalloc.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/mm/vmalloc.c b/mm/vmalloc.c index f9d45aa90b7c..b711bf82fd5d 100644 --- a/mm/vmalloc.c +++ b/mm/vmalloc.c @@ -874,11 +874,9 @@ find_va_links(struct vmap_area *va, * Trigger the BUG() if there are sides(left/right) * or full overlaps. */ - if (va->va_start < tmp_va->va_end && - va->va_end <= tmp_va->va_start) + if (va->va_end <= tmp_va->va_start) link = &(*link)->rb_left; - else if (va->va_end > tmp_va->va_start && - va->va_start >= tmp_va->va_end) + else if (va->va_start >= tmp_va->va_end) link = &(*link)->rb_right; else { WARN(1, "vmalloc bug: 0x%lx-0x%lx overlaps with 0x%lx-0x%lx\n", |
