From: Osama Abdelkader <osama.abdelkader@gmail.com>
To: Marc Zyngier <maz@kernel.org>, Oliver Upton <oupton@kernel.org>,
Joey Gouly <joey.gouly@arm.com>,
Suzuki K Poulose <suzuki.poulose@arm.com>,
Zenghui Yu <yuzenghui@huawei.com>,
Catalin Marinas <catalin.marinas@arm.com>,
Will Deacon <will@kernel.org>,
Timothy Hayes <timothy.hayes@arm.com>,
Sascha Bischoff <Sascha.Bischoff@arm.com>,
Raghavendra Rao Ananta <rananta@google.com>,
Osama Abdelkader <osama.abdelkader@gmail.com>,
Jing Zhang <jingzhangos@google.com>,
linux-arm-kernel@lists.infradead.org, kvmarm@lists.linux.dev,
linux-kernel@vger.kernel.org
Subject: [PATCH] KVM: arm64: vgic: simplify vgic_v3_redist_region_full()
Date: Thu, 11 Dec 2025 23:51:09 +0100 [thread overview]
Message-ID: <20251211225114.20474-1-osama.abdelkader@gmail.com> (raw)
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@gmail.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
next reply other threads:[~2025-12-11 22:52 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-12-11 22:51 Osama Abdelkader [this message]
2025-12-12 9:35 ` [PATCH] KVM: arm64: vgic: simplify vgic_v3_redist_region_full() Marc Zyngier
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20251211225114.20474-1-osama.abdelkader@gmail.com \
--to=osama.abdelkader@gmail.com \
--cc=Sascha.Bischoff@arm.com \
--cc=catalin.marinas@arm.com \
--cc=jingzhangos@google.com \
--cc=joey.gouly@arm.com \
--cc=kvmarm@lists.linux.dev \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=maz@kernel.org \
--cc=oupton@kernel.org \
--cc=rananta@google.com \
--cc=suzuki.poulose@arm.com \
--cc=timothy.hayes@arm.com \
--cc=will@kernel.org \
--cc=yuzenghui@huawei.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox