[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <20251211225114.20474-1-osama.abdelkader@gmail.com>
Date: Thu, 11 Dec 2025 23:51:09 +0100
From: Osama Abdelkader <osama.abdelkader@...il.com>
To: Marc Zyngier <maz@...nel.org>,
Oliver Upton <oupton@...nel.org>,
Joey Gouly <joey.gouly@....com>,
Suzuki K Poulose <suzuki.poulose@....com>,
Zenghui Yu <yuzenghui@...wei.com>,
Catalin Marinas <catalin.marinas@....com>,
Will Deacon <will@...nel.org>,
Timothy Hayes <timothy.hayes@....com>,
Sascha Bischoff <Sascha.Bischoff@....com>,
Raghavendra Rao Ananta <rananta@...gle.com>,
Osama Abdelkader <osama.abdelkader@...il.com>,
Jing Zhang <jingzhangos@...gle.com>,
linux-arm-kernel@...ts.infradead.org,
kvmarm@...ts.linux.dev,
linux-kernel@...r.kernel.org
Subject: [PATCH] KVM: arm64: vgic: simplify vgic_v3_redist_region_full()
Simplify the function by converting the if-return-false pattern to a
direct boolean expression return, making the code more concise and
readable.
Signed-off-by: Osama Abdelkader <osama.abdelkader@...il.com>
---
arch/arm64/kvm/vgic/vgic.h | 5 +----
1 file changed, 1 insertion(+), 4 deletions(-)
diff --git a/arch/arm64/kvm/vgic/vgic.h b/arch/arm64/kvm/vgic/vgic.h
index 5f0fc96b4dc2..04dd2055e7df 100644
--- a/arch/arm64/kvm/vgic/vgic.h
+++ b/arch/arm64/kvm/vgic/vgic.h
@@ -382,10 +382,7 @@ static inline int vgic_v3_max_apr_idx(struct kvm_vcpu *vcpu)
static inline bool
vgic_v3_redist_region_full(struct vgic_redist_region *region)
{
- if (!region->count)
- return false;
-
- return (region->free_index >= region->count);
+ return region->count > 0 && region->free_index >= region->count;
}
struct vgic_redist_region *vgic_v3_rdist_free_slot(struct list_head *rdregs);
--
2.43.0
Powered by blists - more mailing lists