From nobody Tue Nov 4 18:44:21 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 1530339881362277.5924053151829; Fri, 29 Jun 2018 23:24:41 -0700 (PDT) Received: from localhost ([::1]:45734 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fZ9J8-0007FC-ST for importer@patchew.org; Sat, 30 Jun 2018 02:24:30 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:37905) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fZ968-0004AS-3i for qemu-devel@nongnu.org; Sat, 30 Jun 2018 02:11:05 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fZ967-00024k-6j for qemu-devel@nongnu.org; Sat, 30 Jun 2018 02:11:04 -0400 Received: from mail-wm0-x22b.google.com ([2a00:1450:400c:c09::22b]:34554) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fZ967-00023R-02 for qemu-devel@nongnu.org; Sat, 30 Jun 2018 02:11:03 -0400 Received: by mail-wm0-x22b.google.com with SMTP id l15-v6so3502415wmc.1 for ; Fri, 29 Jun 2018 23:11:02 -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.00 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 29 Jun 2018 23:11:01 -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=ShQopHbVLu2ZiuVM8IzDN7KgfPr2sew8y07HjHvWZaY=; b=mUlo7Ux+GR/btcTzr38cVuI0s+UsKkgRt9SZwe/cMyFDDvvL546mN1NiSdFwZdXnGn LDpIbmlKg7RBlaRhoXd3G7Ch6fMEaSMxk1W/opNJ6gNqw+XJE+oh7sjsKhhox2+dPNvr pYEo0//0S3DNZCyTAXTNB9zsFhkBv6Du6xfja0wscaKyCFnNE7rxhM1sq0BzlGbMPpL+ ycX5ORFrvJnLO8H1Q1ffi1zBFgcd+F36z4fgAXj5pXvYQvFthjecBmWJYaQ8kDLyJWvZ SKgfsd6MZTt0+luE8AWlpoUAOWBBRRIiGDdM9IMwknFdVCo4RPe8g2zFcgyXlrFc0nKX HvSA== 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=ShQopHbVLu2ZiuVM8IzDN7KgfPr2sew8y07HjHvWZaY=; b=Hz8d0ASEJcWHD9Ma2Ujt9IRmc5bvZ7Ydvf7zACn0E0jay8dnWNFPalFKJQ5yJ4pRH9 O+n/bLnzd23B0VGkUq93YW0NmGSubuqk8zgPElVweHPenM60cFiajpzBp9H61S9YyHQ3 2Y82HxPNsrqBQQHjxcE9jwXnWr0nEN+R+LS/l5p3SvqEbs6lgRxJInnEFORxDaJh/E1E 8QZ12b9j+8PFydjVmLvLAFP46efFRaaiFTB+uR6PRdPbwcN9+TeFjcpM3ZkUbwg+lMow +M87MtuDNy+Npn7qXArOAQBkumCrtRAa5uPWawTc7Wq49wDRwGme6zUfvvmH2tgtaQvq BtBg== X-Gm-Message-State: APt69E0w9NLtqWfAIT5LBA2MaTPlZPNhh8pO1xnwttXAW1H/pK8cxvs4 kWpuZ4CNPBnXD3VLp9Kv3K89lFlL X-Google-Smtp-Source: AAOMgpfcOhbFsRrmCQqyJ2De4BJzewCTg35Kaa4P0pEdpM/6FBW9CT/q1enFWyyts6EulopLml3HIA== X-Received: by 2002:a1c:e041:: with SMTP id x62-v6mr3304454wmg.155.1530339061783; Fri, 29 Jun 2018 23:11:01 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Date: Sat, 30 Jun 2018 08:10:11 +0200 Message-Id: <20180630061040.6018-19-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::22b Subject: [Qemu-devel] [PULL 18/47] hw/riscv: 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: Michael Clark Message-Id: <20180625124238.25339-17-f4bug@amsat.org> Signed-off-by: Paolo Bonzini --- hw/riscv/virt.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/hw/riscv/virt.c b/hw/riscv/virt.c index ad03113..34d4899 100644 --- a/hw/riscv/virt.c +++ b/hw/riscv/virt.c @@ -19,6 +19,7 @@ */ =20 #include "qemu/osdep.h" +#include "qemu/units.h" #include "qemu/log.h" #include "qemu/error-report.h" #include "qapi/error.h" @@ -84,7 +85,7 @@ static hwaddr load_initrd(const char *filename, uint64_t = mem_size, * halfway into RAM, and for boards with 256MB of RAM or more we put * the initrd at 128MB. */ - *start =3D kernel_entry + MIN(mem_size / 2, 128 * 1024 * 1024); + *start =3D kernel_entry + MIN(mem_size / 2, 128 * MiB); =20 size =3D load_ramdisk(filename, *start, mem_size - *start); if (size =3D=3D -1) { --=20 1.8.3.1