diff mbox series

[11/30] hw/s390x: use the BYTE-based definitions

Message ID 20180215042900.16078-12-f4bug@amsat.org
State New
Headers show
Series hw: use the BYTE-based definitions when useful | expand

Commit Message

Philippe Mathieu-Daudé Feb. 15, 2018, 4:28 a.m. UTC
It ease code review, unit is explicit.

Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
---
 hw/s390x/sclp.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Comments

Thomas Huth Feb. 15, 2018, 7:05 a.m. UTC | #1
On 15.02.2018 05:28, Philippe Mathieu-Daudé wrote:
> It ease code review, unit is explicit.
> 
> Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
> ---
>  hw/s390x/sclp.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/hw/s390x/sclp.c b/hw/s390x/sclp.c
> index 276972b59f..8537aa2688 100644
> --- a/hw/s390x/sclp.c
> +++ b/hw/s390x/sclp.c
> @@ -526,8 +526,8 @@ static void sclp_realize(DeviceState *dev, Error **errp)
>  
>      ret = s390_set_memory_limit(machine->maxram_size, &hw_limit);
>      if (ret == -E2BIG) {
> -        error_setg(&err, "host supports a maximum of %" PRIu64 " GB",
> -                   hw_limit >> 30);
> +        error_setg(&err, "host supports a maximum of %llu GB",
> +                   hw_limit / G_BYTE);
>      } else if (ret) {
>          error_setg(&err, "setting the guest size failed");
>      }

Reviewed-by: Thomas Huth <thuth@redhat.com>
Cornelia Huck March 5, 2018, 10:06 a.m. UTC | #2
On Thu, 15 Feb 2018 01:28:41 -0300
Philippe Mathieu-Daudé <f4bug@amsat.org> wrote:

> It ease code review, unit is explicit.

s/ease/eases/

> 
> Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
> ---
>  hw/s390x/sclp.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/hw/s390x/sclp.c b/hw/s390x/sclp.c
> index 276972b59f..8537aa2688 100644
> --- a/hw/s390x/sclp.c
> +++ b/hw/s390x/sclp.c
> @@ -526,8 +526,8 @@ static void sclp_realize(DeviceState *dev, Error **errp)
>  
>      ret = s390_set_memory_limit(machine->maxram_size, &hw_limit);
>      if (ret == -E2BIG) {
> -        error_setg(&err, "host supports a maximum of %" PRIu64 " GB",
> -                   hw_limit >> 30);
> +        error_setg(&err, "host supports a maximum of %llu GB",
> +                   hw_limit / G_BYTE);
>      } else if (ret) {
>          error_setg(&err, "setting the guest size failed");
>      }

Acked-by: Cornelia Huck <cohuck@redhat.com>
diff mbox series

Patch

diff --git a/hw/s390x/sclp.c b/hw/s390x/sclp.c
index 276972b59f..8537aa2688 100644
--- a/hw/s390x/sclp.c
+++ b/hw/s390x/sclp.c
@@ -526,8 +526,8 @@  static void sclp_realize(DeviceState *dev, Error **errp)
 
     ret = s390_set_memory_limit(machine->maxram_size, &hw_limit);
     if (ret == -E2BIG) {
-        error_setg(&err, "host supports a maximum of %" PRIu64 " GB",
-                   hw_limit >> 30);
+        error_setg(&err, "host supports a maximum of %llu GB",
+                   hw_limit / G_BYTE);
     } else if (ret) {
         error_setg(&err, "setting the guest size failed");
     }