From patchwork Mon Jun 11 01:14:37 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 927469 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=nongnu.org (client-ip=2001:4830:134:3::11; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=amsat.org Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="exl9itLu"; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 413wYQ0w5tz9rvt for ; Mon, 11 Jun 2018 11:34:50 +1000 (AEST) Received: from localhost ([::1]:45793 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fSBjL-000395-NX for incoming@patchwork.ozlabs.org; Sun, 10 Jun 2018 21:34:47 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:42972) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fSBRc-0005MW-LU for qemu-devel@nongnu.org; Sun, 10 Jun 2018 21:16:31 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fSBRb-000317-Op for qemu-devel@nongnu.org; Sun, 10 Jun 2018 21:16:28 -0400 Received: from mail-qt0-x241.google.com ([2607:f8b0:400d:c0d::241]:41614) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fSBRb-00030x-Kf; Sun, 10 Jun 2018 21:16:27 -0400 Received: by mail-qt0-x241.google.com with SMTP id y20-v6so18862972qto.8; Sun, 10 Jun 2018 18:16:27 -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=7bVTiSVu+UWhOWC+PqanAHeZhjQ/cdQ2iLBIKH31zbk=; b=exl9itLum9ashP0LbqXkPmAbLz3+Ajju2Aldh/geXJRZ5/0H6eU9ySYmzenqC9cjg+ QDfoxtoBEyo5lrj391DfvGfHtYFNIbqBqBjCFpYZgrznJoTHd0tQquy8A+Z6UEmW7lmG lJGLOvkmk/nSkTT9EPlmDT+F9vDg3KBnKIgmiCFGz6z58RxknFi+W3kcLUOrJ4UAyALM i01l06CFvFAIDVx9SbMLGTcdgBgau9IWoIKazZbXC0blCSCKmYqzFULy8fh3g05cOvXq AkZHkoMme/qMsq+14XeGWYvRuNi4mN/wmJfq4J71tyU1GleWYjf2smvNOHw8fIUs4oho Woag== 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=7bVTiSVu+UWhOWC+PqanAHeZhjQ/cdQ2iLBIKH31zbk=; b=GBdLQbG9uTob/WQe+Q932exy0usFPCvDafNdStUOMf7VEJVb4c4pEcmdEAEYZbONrz QntzDC4a8stL74HRpRNasrav1oU/NCrcWtHxjo8kNqY7yLp7CVKgc7lHiw5+IqkIlnK+ g9c1unJQN/K+4SdLA4Xo8oVP8KwomrGibRje6dGV0j5BAUYb2kzVmqhLdriUpIkMX27K fxICIYCBORgaCVSl6XXeIdx0d2leSmZRSnjMkIyon5V1JLbYYBGMQl8gHTzucH9XxzsW n5f66R8uPxUSfzoGlcCemwCWui/+WRBymrWy61QgbG2clJHQi0ajmZ7vk7bc8yaNzz8D Ru0w== X-Gm-Message-State: APt69E3sIIiiBAiroLAwhvG/PtcX1JsAf75GcY4wOIyPI16PXsH9ltsb deOqAAYRqhaWcpcNXWG5bSA= X-Google-Smtp-Source: ADUXVKKluzbIMcCwpVm0Eedmq/iVpgPP7I6AFx0ffB/jcrBWZpmjtTPPFFpa40uZpK06Ie14JdpflQ== X-Received: by 2002:a0c:f612:: with SMTP id r18-v6mr13648968qvm.38.1528679787254; Sun, 10 Jun 2018 18:16:27 -0700 (PDT) Received: from x1.local ([138.117.48.222]) by smtp.gmail.com with ESMTPSA id o5-v6sm28237223qtm.60.2018.06.10.18.16.23 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 10 Jun 2018 18:16:26 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: Thomas Huth , Stefan Weil Date: Sun, 10 Jun 2018 22:14:37 -0300 Message-Id: <20180611011501.10235-17-f4bug@amsat.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20180611011501.10235-1-f4bug@amsat.org> References: <20180611011501.10235-1-f4bug@amsat.org> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:400d:c0d::241 Subject: [Qemu-devel] [PATCH v4 16/40] 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: Sagar Karandikar , qemu-trivial@nongnu.org, Bastian Koppelmann , Palmer Dabbelt , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , qemu-devel@nongnu.org, Michael Clark Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" 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é Reviewed-by: Michael Clark --- 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 ad03113e0f..34d48993a2 100644 --- a/hw/riscv/virt.c +++ b/hw/riscv/virt.c @@ -19,6 +19,7 @@ */ #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 = kernel_entry + MIN(mem_size / 2, 128 * 1024 * 1024); + *start = kernel_entry + MIN(mem_size / 2, 128 * MiB); size = load_ramdisk(filename, *start, mem_size - *start); if (size == -1) {