qemu-stable
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH 3/4] hw/misc/bcm2835_property: Restrict scope of start_num, n


From: Philippe Mathieu-Daudé
Subject: Re: [PATCH 3/4] hw/misc/bcm2835_property: Restrict scope of start_num, number, otp_row
Date: Tue, 23 Jul 2024 15:36:00 +0200
User-agent: Mozilla Thunderbird

On 23/7/24 15:10, Peter Maydell wrote:
In the long function bcm2835_property_mbox_push(), the variables
start_num, number and otp_row are used only in the four cases which
access OTP data, and their uses don't overlap with each other.

Make these variables have scope restricted to the cases where they're
used, so it's easier to read each individual case without having to
cross-refer up to the variable declaration at the top of the function
and check whether the variable is also used later in the loop.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
---
  hw/misc/bcm2835_property.c | 34 ++++++++++++++++++++--------------
  1 file changed, 20 insertions(+), 14 deletions(-)

Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>




reply via email to

[Prev in Thread] Current Thread [Next in Thread]