From patchwork Mon Jun 25 12:45:16 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 9601 Return-Path: X-Original-To: patchwork@peony.canonical.com Delivered-To: patchwork@peony.canonical.com Received: from fiordland.canonical.com (fiordland.canonical.com [91.189.94.145]) by peony.canonical.com (Postfix) with ESMTP id C79F223EE2 for ; Mon, 25 Jun 2012 12:45:26 +0000 (UTC) Received: from mail-yx0-f180.google.com (mail-yx0-f180.google.com [209.85.213.180]) by fiordland.canonical.com (Postfix) with ESMTP id 98423A18606 for ; Mon, 25 Jun 2012 12:45:26 +0000 (UTC) Received: by mail-yx0-f180.google.com with SMTP id q6so2970005yen.11 for ; Mon, 25 Jun 2012 05:45:26 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-forwarded-to:x-forwarded-for:delivered-to:received-spf:from:to:cc :subject:date:message-id:x-mailer:in-reply-to:references :x-gm-message-state; bh=8iySWxqMzgkoK+V5HLZfBdDW+0YrTQc2CUMrjJutMdw=; b=YSIKnGaWLmhbdRHE1yapIYt2Y/dwaOA2z6nw3CkzOk/G9I23kQH5edSERqoLh/K0bs A4xFK9hhKWdcPKiXb5EzeO/x0qdZYC8dvZH+bpmFitAMGg9T5cx0X3y3kp8z7XWBg2N9 5814g69gwCHC/A7EWVSWWb0DCFuKrZsV1ZtsdgyEg3EM9DtuwKyOYE2otn57U6wr7AKi 46WzvGbJ6TcH1zbrKR9wJrsbjbE3zEVuNgycmRazO30CbvcLTU5y78O/rHxFtVuNNwzE MpQOa9EDdCD9VOzhNRpIOhTIUcndljVtbVWidfQNXN+6jQ1bdHt8I47hx5YLKx/UyC0e BWJg== Received: by 10.50.40.193 with SMTP id z1mr7911714igk.0.1340628326052; Mon, 25 Jun 2012 05:45:26 -0700 (PDT) X-Forwarded-To: linaro-patchwork@canonical.com X-Forwarded-For: patch@linaro.org linaro-patchwork@canonical.com Delivered-To: patches@linaro.org Received: by 10.231.24.148 with SMTP id v20csp46002ibb; Mon, 25 Jun 2012 05:45:22 -0700 (PDT) Received: by 10.205.117.3 with SMTP id fk3mr4093197bkc.136.1340628322054; Mon, 25 Jun 2012 05:45:22 -0700 (PDT) Received: from mnementh.archaic.org.uk (mnementh.archaic.org.uk. [81.2.115.146]) by mx.google.com with ESMTPS id hs3si10870470bkc.112.2012.06.25.05.45.20 (version=TLSv1/SSLv3 cipher=OTHER); Mon, 25 Jun 2012 05:45:22 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of pm215@archaic.org.uk designates 81.2.115.146 as permitted sender) client-ip=81.2.115.146; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of pm215@archaic.org.uk designates 81.2.115.146 as permitted sender) smtp.mail=pm215@archaic.org.uk Received: from pm215 by mnementh.archaic.org.uk with local (Exim 4.72) (envelope-from ) id 1Sj8fM-0006qE-PF; Mon, 25 Jun 2012 13:45:16 +0100 From: Peter Maydell To: qemu-devel@nongnu.org Cc: patches@linaro.org, Anthony Liguori , =?UTF-8?q?Andreas=20F=C3=A4rber?= Subject: [PATCH 4/4] monitor: Use PRI*PLX to avoid TARGET_PHYS_ADDR_BITS ifdef Date: Mon, 25 Jun 2012 13:45:16 +0100 Message-Id: <1340628316-26267-5-git-send-email-peter.maydell@linaro.org> X-Mailer: git-send-email 1.7.2.5 In-Reply-To: <1340628316-26267-1-git-send-email-peter.maydell@linaro.org> References: <1340628316-26267-1-git-send-email-peter.maydell@linaro.org> X-Gm-Message-State: ALoCoQmf2g13LLAa6wg8FsC/ThlKI1sAY7ZRZySIwxkrXtw2eu4ZP57MNM0LvQnAXZxgDcGVrrL0 Now we have PRX*PLX for printing target_phys_addr_t values, we can use them in monitor.c rather than having duplicate code in two arms of a TARGET_PHYS_ADDR_BITS ifdef. Signed-off-by: Peter Maydell --- monitor.c | 29 ++++------------------------- 1 files changed, 4 insertions(+), 25 deletions(-) diff --git a/monitor.c b/monitor.c index f6107ba..6dea2a3 100644 --- a/monitor.c +++ b/monitor.c @@ -1262,45 +1262,24 @@ static void do_print(Monitor *mon, const QDict *qdict) int format = qdict_get_int(qdict, "format"); target_phys_addr_t val = qdict_get_int(qdict, "val"); -#if TARGET_PHYS_ADDR_BITS == 32 switch(format) { case 'o': - monitor_printf(mon, "%#o", val); + monitor_printf(mon, "%#" PRIoPLX, val); break; case 'x': - monitor_printf(mon, "%#x", val); + monitor_printf(mon, "%#" PRIxPLX, val); break; case 'u': - monitor_printf(mon, "%u", val); + monitor_printf(mon, "%" PRIuPLX, val); break; default: case 'd': - monitor_printf(mon, "%d", val); + monitor_printf(mon, "%" PRIdPLX, val); break; case 'c': monitor_printc(mon, val); break; } -#else - switch(format) { - case 'o': - monitor_printf(mon, "%#" PRIo64, val); - break; - case 'x': - monitor_printf(mon, "%#" PRIx64, val); - break; - case 'u': - monitor_printf(mon, "%" PRIu64, val); - break; - default: - case 'd': - monitor_printf(mon, "%" PRId64, val); - break; - case 'c': - monitor_printc(mon, val); - break; - } -#endif monitor_printf(mon, "\n"); }