[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <87eed7tk24.wl-maz@kernel.org>
Date: Sat, 12 Jun 2021 12:10:43 +0100
From: Marc Zyngier <maz@...nel.org>
To: Austin Kim <austindh.kim@...il.com>
Cc: james.morse@....com, alexandru.elisei@....com,
suzuki.poulose@....com, catalin.marinas@....com, will@...nel.org,
linux-arm-kernel@...ts.infradead.org, kvmarm@...ts.cs.columbia.edu,
linux-kernel@...r.kernel.org, austin.kim@....com
Subject: Re: [PATCH] KVM: arm64: vgic: declear local variable 'flags' before for loop starts
On Sat, 12 Jun 2021 12:00:14 +0100,
Austin Kim <austindh.kim@...il.com> wrote:
>
> From: Austin Kim <austin.kim@....com>
>
> Normally local variable 'flags' is defined out of for loop,
> when 'flags' is used as the second parameter in a call to
> spinlock_irq[save/restore] function.
>
> So it had better declear local variable 'flags' ahead of for loop.
Why better? Reducing the scope of a variable is in general good
practice. Do you see any material advantage in moving this variable
out of the loop? Does the compiler generate better code?
Thanks,
M.
--
Without deviation from the norm, progress is not possible.
Powered by blists - more mailing lists