qemu-trivial
[Top][All Lists]
Advanced

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

Re: [Qemu-trivial] [PATCH v5 41/46] hw/ppc: Use the IEC binary prefix de


From: David Gibson
Subject: Re: [Qemu-trivial] [PATCH v5 41/46] hw/ppc: Use the IEC binary prefix definitions
Date: Tue, 26 Jun 2018 10:48:44 +1000
User-agent: Mutt/1.10.0 (2018-05-17)

On Mon, Jun 25, 2018 at 09:42:33AM -0300, Philippe Mathieu-Daudé wrote:
> It eases code review, unit is explicit.
> 
> Patch generated using:
> 
>   $ git grep -n '[<>][<>]= ?[1-5]0'
> 
> and modified manually.
> 
> Signed-off-by: Philippe Mathieu-Daudé <address@hidden>

Acked-by: David Gibson <address@hidden>

> ---
>  hw/ppc/sam460ex.c       | 2 +-
>  target/ppc/mmu_helper.c | 8 ++++----
>  2 files changed, 5 insertions(+), 5 deletions(-)
> 
> diff --git a/hw/ppc/sam460ex.c b/hw/ppc/sam460ex.c
> index ffe561fbc1..c7c799b843 100644
> --- a/hw/ppc/sam460ex.c
> +++ b/hw/ppc/sam460ex.c
> @@ -126,7 +126,7 @@ static void generate_eeprom_spd(uint8_t *eeprom, 
> ram_addr_t ram_size)
>      int i;
>  
>      /* work in terms of MB */
> -    ram_size >>= 20;
> +    ram_size /= MiB;
>  
>      while ((ram_size >= 4) && (nbanks <= 2)) {
>          int sz_log2 = MIN(31 - clz32(ram_size), 14);
> diff --git a/target/ppc/mmu_helper.c b/target/ppc/mmu_helper.c
> index 98ce17985b..e6739e6c24 100644
> --- a/target/ppc/mmu_helper.c
> +++ b/target/ppc/mmu_helper.c
> @@ -17,6 +17,7 @@
>   * License along with this library; if not, see 
> <http://www.gnu.org/licenses/>.
>   */
>  #include "qemu/osdep.h"
> +#include "qemu/units.h"
>  #include "cpu.h"
>  #include "exec/helper-proto.h"
>  #include "sysemu/kvm.h"
> @@ -1090,11 +1091,10 @@ static void mmubooke_dump_mmu(FILE *f, 
> fprintf_function cpu_fprintf,
>          pa = entry->RPN & mask;
>          /* Extend the physical address to 36 bits */
>          pa |= (hwaddr)(entry->RPN & 0xF) << 32;
> -        size /= 1024;
> -        if (size >= 1024) {
> -            snprintf(size_buf, sizeof(size_buf), "%3" PRId64 "M", size / 
> 1024);
> +        if (size >= 1 * MiB) {
> +            snprintf(size_buf, sizeof(size_buf), "%3" PRId64 "M", size / 
> MiB);
>          } else {
> -            snprintf(size_buf, sizeof(size_buf), "%3" PRId64 "k", size);
> +            snprintf(size_buf, sizeof(size_buf), "%3" PRId64 "k", size / 
> KiB);
>          }
>          cpu_fprintf(f, "0x%016" PRIx64 " 0x%016" PRIx64 " %s %-5u %08x 
> %08x\n",
>                      (uint64_t)ea, (uint64_t)pa, size_buf, 
> (uint32_t)entry->PID,

-- 
David Gibson                    | I'll have my music baroque, and my code
david AT gibson.dropbear.id.au  | minimalist, thank you.  NOT _the_ _other_
                                | _way_ _around_!
http://www.ozlabs.org/~dgibson

Attachment: signature.asc
Description: PGP signature


reply via email to

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