OSDN Git Service

mm/vmalloc: remove the redundant boundary check
authorBaoquan He <bhe@redhat.com>
Tue, 7 Jun 2022 10:59:56 +0000 (18:59 +0800)
committerakpm <akpm@linux-foundation.org>
Fri, 17 Jun 2022 02:48:28 +0000 (19:48 -0700)
commit753df96be5d3a21cd70d8ab4f7464a868e1d2cb4
tree2fae7e970250796232c873041ed5d75dee545df1
parent1b23ff80b399ae4561bbfd45f7c9c98f62797304
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/20220607105958.382076-3-bhe@redhat.com
Signed-off-by: Baoquan He <bhe@redhat.com>
Reviewed-by: Uladzislau Rezki (Sony) <urezki@gmail.com>
Cc: Christoph Hellwig <hch@infradead.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
mm/vmalloc.c