Re: [PATCH v2 31/33] mm/vma: use guard clauses in can_vma_merge_[before, after]()

From: Vlastimil Babka (SUSE)

Date: Thu Jul 16 2026 - 04:41:11 EST


On 7/10/26 22:17, Lorenzo Stoakes wrote:
> Rather than combining a bunch of conditionals in a single expression,
> simplify by inverting the mergeability requirements into guard clauses.
>
> that is - instead of checking what must be true for the conditions to be
> met, instead check the inverse of the requirements and return false if any
> are true, defaulting to true.
>
> No functional change intended.
>
> Reviewed-by: Pedro Falcato <pfalcato@xxxxxxx>
> Reviewed-by: Gregory Price <gourry@xxxxxxxxxx>
> Signed-off-by: Lorenzo Stoakes <ljs@xxxxxxxxxx>

Reviewed-by: Vlastimil Babka (SUSE) <vbabka@xxxxxxxxxx>