All of lore.kernel.org
 help / color / mirror / Atom feed
From: Marc Zyngier <maz@kernel.org>
To: Osama Abdelkader <osama.abdelkader@gmail.com>
Cc: 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>,
	Jing Zhang <jingzhangos@google.com>,
	linux-arm-kernel@lists.infradead.org, kvmarm@lists.linux.dev,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] KVM: arm64: vgic: simplify vgic_v3_redist_region_full()
Date: Fri, 12 Dec 2025 09:35:22 +0000	[thread overview]
Message-ID: <86pl8kniud.wl-maz@kernel.org> (raw)
In-Reply-To: <20251211225114.20474-1-osama.abdelkader@gmail.com>

On Thu, 11 Dec 2025 22:51:09 +0000,
Osama Abdelkader <osama.abdelkader@gmail.com> wrote:
> 
> 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);

This is not clearer. Checking for 0 is pretty important as it outlines
a specific condition, which is why this is written as a separate
statement.

Please stop sending patches that are only aligning things to your
personal taste. There is no shortage of real problems to fix in the
kernel, your time is better spent on that, and mine on reviewing
useful patches.

	M.

-- 
Without deviation from the norm, progress is not possible.

      reply	other threads:[~2025-12-12  9:35 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-12-11 22:51 [PATCH] KVM: arm64: vgic: simplify vgic_v3_redist_region_full() Osama Abdelkader
2025-12-12  9:35 ` Marc Zyngier [this message]

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=86pl8kniud.wl-maz@kernel.org \
    --to=maz@kernel.org \
    --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=osama.abdelkader@gmail.com \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.