From nobody Tue Nov 4 18:44:20 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.gnu.org (208.118.235.17 [208.118.235.17]) by mx.zohomail.com with SMTPS id 1530339883346557.3132172449673; Fri, 29 Jun 2018 23:24:43 -0700 (PDT) Received: from localhost ([::1]:45736 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fZ9JK-0007Pp-I0 for importer@patchew.org; Sat, 30 Jun 2018 02:24:42 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:37987) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fZ96E-0004JA-Vg for qemu-devel@nongnu.org; Sat, 30 Jun 2018 02:11:12 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fZ96A-00029T-R4 for qemu-devel@nongnu.org; Sat, 30 Jun 2018 02:11:10 -0400 Received: from mail-wm0-x229.google.com ([2a00:1450:400c:c09::229]:54090) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fZ96A-00028g-KO for qemu-devel@nongnu.org; Sat, 30 Jun 2018 02:11:06 -0400 Received: by mail-wm0-x229.google.com with SMTP id b188-v6so4122420wme.3 for ; Fri, 29 Jun 2018 23:11:06 -0700 (PDT) Received: from donizetti.lan ([82.84.124.111]) by smtp.gmail.com with ESMTPSA id 24-v6sm563454wrz.94.2018.06.29.23.11.04 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 29 Jun 2018 23:11:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=4315qx1yBDroBJU7hyaj853Jqtf3eAAha5O391dtDf4=; b=vTqEaLFLqmgiOdtOWwJxHo9To6fS4lkciOm3//FjbBaqWhjfus08S5x2vSyWg2QqaN g/85Co5nMa7/KzLFkxPD3h8trjkmtBW2oiRDZPZYNNN1e3zGp8RDK9NguP6LVQSFdg+j /6WahihTj4O/+QMs62P9Set0fLvccCptwd96GFgNsfx6aYqVO+k1sDYX7m2YkCaySt+3 DAnDkA7xAjZvMFjPvcyzKTvlbS2+saoemhxMxfZIxH479UxyS50jqaeuqV9bmr5qPAso 7fA8U2FlDatoVR04/X2O/APPMFOnDNT6OH91DGQU5+4pMZox3rX/jDZ1wZzBF23M7bsR Sd1w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=4315qx1yBDroBJU7hyaj853Jqtf3eAAha5O391dtDf4=; b=iYQXswc2uNTIW2Xa1MdBN6nNrobhJvOl6PjdbDhoQI+gffKtobb/x/nMqAZXGa5vPj OHPvJRdWkzKARWKjmzBleqVDs2SCc5RIXb5nhVzJfctPcRpRgrr2TwtjnHNZTW0+1BZC 4paxQS9PqU7tqXZMLb8yKqdB/G9DbovRkqrMli2uzVdb8MB6RPUk7rC8qJ7JjL4x/9NS AbxDcm9Z8f6kgetfLcsDt+mp7AxG9H/DGdG/qjBByfwXnhmnmlqGAWL3yhTsBJt6xN+E F8/JaQtopUPslWN8CLuAYvECZgISH7WrpzyDgGlx5gKrghvOKnhEX27Lautmuu60+MYz F6UQ== X-Gm-Message-State: APt69E3SV025BbXycwE5vE6fdULm5E7jOInyExp1HqRInUkvrgLhF/jF Jbh5pkwkCdujqAzc6Wor1G/ScMrJ X-Google-Smtp-Source: AAOMgpe174hkf4vrnxBfripBn/00uodonE+Ixv1S2abBXH61zXCBMtfand3/rDoDqHmCtx/iCV0ppg== X-Received: by 2002:a1c:2d54:: with SMTP id t81-v6mr3761637wmt.31.1530339065409; Fri, 29 Jun 2018 23:11:05 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Date: Sat, 30 Jun 2018 08:10:15 +0200 Message-Id: <20180630061040.6018-23-pbonzini@redhat.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20180630061040.6018-1-pbonzini@redhat.com> References: <20180630061040.6018-1-pbonzini@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:400c:c09::229 Subject: [Qemu-devel] [PULL 22/47] hw/hppa: Use the IEC binary prefix definitions X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZohoMail: RDKM_2 RSF_0 Z_629925259 SPT_0 From: Philippe Mathieu-Daud=C3=A9 It eases code review, unit is explicit. Patch generated using: $ git grep -E '(1024|2048|4096|8192|(<<|>>).?(10|20|30))' hw/ include/hw/ and modified manually. Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Thomas Huth Acked-by: Cornelia Huck Message-Id: <20180625124238.25339-20-f4bug@amsat.org> Signed-off-by: Paolo Bonzini --- hw/hppa/dino.c | 3 ++- hw/hppa/machine.c | 10 +++++----- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/hw/hppa/dino.c b/hw/hppa/dino.c index 26f2704..564b938 100644 --- a/hw/hppa/dino.c +++ b/hw/hppa/dino.c @@ -11,6 +11,7 @@ */ =20 #include "qemu/osdep.h" +#include "qemu/units.h" #include "qapi/error.h" #include "cpu.h" #include "hw/hw.h" @@ -76,7 +77,7 @@ /* #define xxx 0x200 - bit 9 not used */ #define RS232INT 0x400 =20 -#define DINO_MEM_CHUNK_SIZE (8 * 1024 * 1024) /* 8MB */ +#define DINO_MEM_CHUNK_SIZE (8 * MiB) =20 #define DINO_PCI_HOST_BRIDGE(obj) \ OBJECT_CHECK(DinoState, (obj), TYPE_DINO_PCI_HOST_BRIDGE) diff --git a/hw/hppa/machine.c b/hw/hppa/machine.c index 2ba2696..cf7c61c 100644 --- a/hw/hppa/machine.c +++ b/hw/hppa/machine.c @@ -17,7 +17,7 @@ #include "hw/timer/i8254.h" #include "hw/char/serial.h" #include "hppa_sys.h" -#include "qemu/cutils.h" +#include "qemu/units.h" #include "qapi/error.h" #include "qemu/log.h" =20 @@ -178,8 +178,8 @@ static void machine_hppa_init(MachineState *machine) } qemu_log_mask(CPU_LOG_PAGE, "Kernel loaded at 0x%08" PRIx64 "-0x%08" PRIx64 ", entry at 0x%08" PRIx64 - ", size %ld kB.\n", - kernel_low, kernel_high, kernel_entry, size / 1024); + ", size %" PRIu64 " kB\n", + kernel_low, kernel_high, kernel_entry, size / KiB); =20 if (kernel_cmdline) { cpu[0]->env.gr[24] =3D 0x4000; @@ -203,8 +203,8 @@ static void machine_hppa_init(MachineState *machine) (1) Due to sign-extension problems and PDC, put the initrd no higher than 1G. (2) Reserve 64k for stack. */ - initrd_base =3D MIN(ram_size, 1024 * 1024 * 1024); - initrd_base =3D initrd_base - 64 * 1024; + initrd_base =3D MIN(ram_size, 1 * GiB); + initrd_base =3D initrd_base - 64 * KiB; initrd_base =3D (initrd_base - initrd_size) & TARGET_PAGE_MASK; =20 if (initrd_base < kernel_high) { --=20 1.8.3.1