[PATCH v3 1/3] KVM: arm64: Avoid re-testing walk_continue
Marc Zyngier
maz at kernel.org
Wed Jul 8 09:41:05 PDT 2026
On Wed, 08 Jul 2026 14:40:57 +0100,
Leonardo Bras <leo.bras at arm.com> wrote:
>
> In __kvm_pgtable_visit(), a couple tests for kvm_pgtable_walk_continue()
> will 'goto out' if it should not continue. This means the same test will be
> ran again before returning ret, which is unnecessary.
>
> Return ret directly instead.
> This will simplify next patch.
This reads quite badly, and doesn't explain what you are trying to do.
How about something like:
"__kvm_pgtable_visit() performs a bunch of calls to
kvm_pgtable_walk_continue() to find out whether the walk can continue
further, and if not, falls back to an 'goto out' which retests the
possibility of continuing the walk.
Given that there is no reason why the situation would have changed
between the two checks, turn this goto into an early return,
simplifying the code and paving the way for further rework."
M.
--
Jazz isn't dead. It just smells funny.
More information about the linux-arm-kernel
mailing list