From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:46991) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ckjuu-0004Ps-US for qemu-devel@nongnu.org; Sun, 05 Mar 2017 23:06:37 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ckjur-0003VK-Nt for qemu-devel@nongnu.org; Sun, 05 Mar 2017 23:06:36 -0500 Sender: =?UTF-8?Q?Philippe_Mathieu=2DDaud=C3=A9?= References: <20170305214857.9510-1-krzk@kernel.org> <20170305214857.9510-3-krzk@kernel.org> From: =?UTF-8?Q?Philippe_Mathieu-Daud=c3=a9?= Message-ID: <2130c1b2-0f81-13f6-a1f8-c0a2e294e3f0@amsat.org> Date: Mon, 6 Mar 2017 01:06:29 -0300 MIME-Version: 1.0 In-Reply-To: <20170305214857.9510-3-krzk@kernel.org> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [Qemu-arm] [PATCH 3/3] hw/misc/exynos4210_pmu: Reorder local variables for readability List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Krzysztof Kozlowski , Igor Mitsyanko , Peter Maydell , Paolo Bonzini , qemu-arm@nongnu.org, qemu-devel@nongnu.org Hi Krzysztof, On 03/05/2017 06:48 PM, Krzysztof Kozlowski wrote: > Short declaration of 'i' was in the middle of declarations with > assignments. Make it a little bit more readable. No functional change. > > Signed-off-by: Krzysztof Kozlowski > --- > hw/misc/exynos4210_pmu.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/hw/misc/exynos4210_pmu.c b/hw/misc/exynos4210_pmu.c > index cbdfa0614600..60d1545c0baa 100644 > --- a/hw/misc/exynos4210_pmu.c > +++ b/hw/misc/exynos4210_pmu.c > @@ -401,8 +401,8 @@ static uint64_t exynos4210_pmu_read(void *opaque, hwaddr offset, > unsigned size) > { > const Exynos4210PmuState *s = (Exynos4210PmuState *)opaque; > - unsigned i; > const Exynos4210PmuReg *reg_p = exynos4210_pmu_regs; > + unsigned i; your change seems OK but while you are here, 'unsigned' is considered harmful since more than a decade. why not use 'size_t i' since PMU_NUM_OF_REGISTERS is indeed an ARRAY_SIZE()? > > for (i = 0; i < PMU_NUM_OF_REGISTERS; i++) { > if (reg_p->offset == offset) { > @@ -420,8 +420,8 @@ static void exynos4210_pmu_write(void *opaque, hwaddr offset, > uint64_t val, unsigned size) > { > Exynos4210PmuState *s = (Exynos4210PmuState *)opaque; > - unsigned i; > const Exynos4210PmuReg *reg_p = exynos4210_pmu_regs; > + unsigned i; > > for (i = 0; i < PMU_NUM_OF_REGISTERS; i++) { > if (reg_p->offset == offset) { >