[PATCH 02/21] hw/arm/mps2: Use the IEC binary prefix definitions

Philippe Mathieu-Daudé posted 21 patches 6 years, 3 months ago
Maintainers: KONRAD Frederic <frederic.konrad@adacore.com>, "Cédric Le Goater" <clg@kaod.org>, Artyom Tarasenko <atar4qemu@gmail.com>, Thomas Huth <huth@tuxfamily.org>, Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>, Beniamino Galvani <b.galvani@gmail.com>, "Hervé Poussineau" <hpoussin@reactos.org>, Aleksandar Rikalo <arikalo@wavecomp.com>, Alistair Francis <alistair@alistair23.me>, Rob Herring <robh@kernel.org>, Andrzej Zaborowski <balrogg@gmail.com>, Leif Lindholm <leif.lindholm@linaro.org>, Aleksandar Markovic <amarkovic@wavecomp.com>, Andrew Jeffery <andrew@aj.id.au>, Richard Henderson <rth@twiddle.net>, Aurelien Jarno <aurelien@aurel32.net>, Antony Pavlov <antonynpavlov@gmail.com>, Andrey Smirnov <andrew.smirnov@gmail.com>, David Gibson <david@gibson.dropbear.id.au>, Jean-Christophe Dubois <jcd@tribudubois.net>, Peter Chubb <peter.chubb@nicta.com.au>, Eduardo Habkost <ehabkost@redhat.com>, Paolo Bonzini <pbonzini@redhat.com>, "Michael S. Tsirkin" <mst@redhat.com>, Marcel Apfelbaum <marcel.apfelbaum@gmail.com>, "Philippe Mathieu-Daudé" <philmd@redhat.com>, Joel Stanley <joel@jms.id.au>, Jan Kiszka <jan.kiszka@web.de>, Fabien Chouteau <chouteau@adacore.com>, "Edgar E. Iglesias" <edgar.iglesias@gmail.com>, Andrew Baumann <Andrew.Baumann@microsoft.com>, Radoslaw Biernacki <radoslaw.biernacki@linaro.org>, Peter Maydell <peter.maydell@linaro.org>, Helge Deller <deller@gmx.de>, Michael Walle <michael@walle.cc>, Paul Burton <pburton@wavecomp.com>
[PATCH 02/21] hw/arm/mps2: Use the IEC binary prefix definitions
Posted by Philippe Mathieu-Daudé 6 years, 3 months ago
IEC binary prefixes ease code review: the unit is explicit.

Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
---
 hw/arm/mps2-tz.c | 3 ++-
 hw/arm/mps2.c    | 3 ++-
 2 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/hw/arm/mps2-tz.c b/hw/arm/mps2-tz.c
index 6b24aaacde..f8b620bcc6 100644
--- a/hw/arm/mps2-tz.c
+++ b/hw/arm/mps2-tz.c
@@ -38,6 +38,7 @@
  */
 
 #include "qemu/osdep.h"
+#include "qemu/units.h"
 #include "qapi/error.h"
 #include "qemu/error-report.h"
 #include "hw/arm/boot.h"
@@ -458,7 +459,7 @@ static void mps2tz_common_init(MachineState *machine)
      * call the 16MB our "system memory", as it's the largest lump.
      */
     memory_region_allocate_system_memory(&mms->psram,
-                                         NULL, "mps.ram", 0x01000000);
+                                         NULL, "mps.ram", 16 * MiB);
     memory_region_add_subregion(system_memory, 0x80000000, &mms->psram);
 
     /* The overflow IRQs for all UARTs are ORed together.
diff --git a/hw/arm/mps2.c b/hw/arm/mps2.c
index 10efff36b2..d002b126d3 100644
--- a/hw/arm/mps2.c
+++ b/hw/arm/mps2.c
@@ -23,6 +23,7 @@
  */
 
 #include "qemu/osdep.h"
+#include "qemu/units.h"
 #include "qapi/error.h"
 #include "qemu/error-report.h"
 #include "hw/arm/boot.h"
@@ -146,7 +147,7 @@ static void mps2_common_init(MachineState *machine)
      * zbt_boot_ctrl is always zero).
      */
     memory_region_allocate_system_memory(&mms->psram,
-                                         NULL, "mps.ram", 0x1000000);
+                                         NULL, "mps.ram", 16 * MiB);
     memory_region_add_subregion(system_memory, 0x21000000, &mms->psram);
 
     switch (mmc->fpga_type) {
-- 
2.21.0


Re: [PATCH 02/21] hw/arm/mps2: Use the IEC binary prefix definitions
Posted by Richard Henderson 6 years, 3 months ago
On 10/20/19 3:56 PM, Philippe Mathieu-Daudé wrote:
> IEC binary prefixes ease code review: the unit is explicit.
> 
> Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
> ---
>  hw/arm/mps2-tz.c | 3 ++-
>  hw/arm/mps2.c    | 3 ++-
>  2 files changed, 4 insertions(+), 2 deletions(-)

Reviewed-by: Richard Henderson <richard.henderson@linaro.org>


r~


Re: [PATCH 02/21] hw/arm/mps2: Use the IEC binary prefix definitions
Posted by Alistair Francis 6 years, 3 months ago
On Sun, Oct 20, 2019 at 4:02 PM Philippe Mathieu-Daudé
<philmd@redhat.com> wrote:
>
> IEC binary prefixes ease code review: the unit is explicit.
>
> Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>

Reviewed-by: Alistair Francis <alistair.francis@wdc.com>

Alistair

> ---
>  hw/arm/mps2-tz.c | 3 ++-
>  hw/arm/mps2.c    | 3 ++-
>  2 files changed, 4 insertions(+), 2 deletions(-)
>
> diff --git a/hw/arm/mps2-tz.c b/hw/arm/mps2-tz.c
> index 6b24aaacde..f8b620bcc6 100644
> --- a/hw/arm/mps2-tz.c
> +++ b/hw/arm/mps2-tz.c
> @@ -38,6 +38,7 @@
>   */
>
>  #include "qemu/osdep.h"
> +#include "qemu/units.h"
>  #include "qapi/error.h"
>  #include "qemu/error-report.h"
>  #include "hw/arm/boot.h"
> @@ -458,7 +459,7 @@ static void mps2tz_common_init(MachineState *machine)
>       * call the 16MB our "system memory", as it's the largest lump.
>       */
>      memory_region_allocate_system_memory(&mms->psram,
> -                                         NULL, "mps.ram", 0x01000000);
> +                                         NULL, "mps.ram", 16 * MiB);
>      memory_region_add_subregion(system_memory, 0x80000000, &mms->psram);
>
>      /* The overflow IRQs for all UARTs are ORed together.
> diff --git a/hw/arm/mps2.c b/hw/arm/mps2.c
> index 10efff36b2..d002b126d3 100644
> --- a/hw/arm/mps2.c
> +++ b/hw/arm/mps2.c
> @@ -23,6 +23,7 @@
>   */
>
>  #include "qemu/osdep.h"
> +#include "qemu/units.h"
>  #include "qapi/error.h"
>  #include "qemu/error-report.h"
>  #include "hw/arm/boot.h"
> @@ -146,7 +147,7 @@ static void mps2_common_init(MachineState *machine)
>       * zbt_boot_ctrl is always zero).
>       */
>      memory_region_allocate_system_memory(&mms->psram,
> -                                         NULL, "mps.ram", 0x1000000);
> +                                         NULL, "mps.ram", 16 * MiB);
>      memory_region_add_subregion(system_memory, 0x21000000, &mms->psram);
>
>      switch (mmc->fpga_type) {
> --
> 2.21.0
>
>