From patchwork Tue Sep 6 03:43:05 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: David Gibson X-Patchwork-Id: 9315663 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 59CC360760 for ; Tue, 6 Sep 2016 05:22:40 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 48A2F28B34 for ; Tue, 6 Sep 2016 05:22:40 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 3AA4F28B41; Tue, 6 Sep 2016 05:22:40 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 5AD7D28B34 for ; Tue, 6 Sep 2016 05:22:39 +0000 (UTC) Received: from localhost ([::1]:58717 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bh8qE-0006VA-GD for patchwork-qemu-devel@patchwork.kernel.org; Tue, 06 Sep 2016 01:22:38 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:50245) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bh7GS-0003Fi-Fb for qemu-devel@nongnu.org; Mon, 05 Sep 2016 23:41:50 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bh7GH-0007v5-ER for qemu-devel@nongnu.org; Mon, 05 Sep 2016 23:41:35 -0400 Received: from ozlabs.org ([103.22.144.67]:35904) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bh7GG-0007lI-S0; Mon, 05 Sep 2016 23:41:25 -0400 Received: by ozlabs.org (Postfix, from userid 1007) id 3sSspD1Y8yz9sC3; Tue, 6 Sep 2016 13:41:21 +1000 (AEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gibson.dropbear.id.au; s=201602; t=1473133284; bh=I84eXpFVxQWvBWI/z8yE3uVsgc5pRxTkRo05gqgjcg8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=f7Z0o8/PQPAuvNLhUcOq9lAY8G0q0Acuhiy/VlIe5OrjGRXd9v1mYBZdiugh7/Xke qE0GqlR1moMPyxynD2InIRARHA3MFHsCW1eFq2jueyeUB3948MdW8fBb+051YHmDNL a4MGnFFyHahic3puUGztaLXt1ydnNtO25q4j3Lh0= From: David Gibson To: peter.maydell@linaro.org Date: Tue, 6 Sep 2016 13:43:05 +1000 Message-Id: <1473133396-18940-56-git-send-email-david@gibson.dropbear.id.au> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1473133396-18940-1-git-send-email-david@gibson.dropbear.id.au> References: <1473133396-18940-1-git-send-email-david@gibson.dropbear.id.au> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 103.22.144.67 Subject: [Qemu-devel] [PULL 55/66] hw/ppc: use error_report instead of fprintf 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?C=C3=A9dric=20Le=20Goater?= , David Gibson , qemu-ppc@nongnu.org, agraf@suse.de, qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP From: Cédric Le Goater Signed-off-by: Cédric Le Goater Signed-off-by: David Gibson --- hw/ppc/spapr.c | 12 ++++++------ hw/ppc/spapr_drc.c | 8 ++++---- hw/ppc/spapr_iommu.c | 4 ++-- hw/ppc/spapr_rtas.c | 13 +++++++------ hw/ppc/spapr_vio.c | 3 ++- include/hw/ppc/fdt.h | 8 +++++--- 6 files changed, 26 insertions(+), 22 deletions(-) diff --git a/hw/ppc/spapr.c b/hw/ppc/spapr.c index 79d136d..7ec2751 100644 --- a/hw/ppc/spapr.c +++ b/hw/ppc/spapr.c @@ -647,13 +647,13 @@ static void spapr_populate_cpu_dt(CPUState *cs, void *fdt, int offset, _FDT((fdt_setprop_cell(fdt, offset, "d-cache-size", pcc->l1_dcache_size))); } else { - fprintf(stderr, "Warning: Unknown L1 dcache size for cpu\n"); + error_report("Warning: Unknown L1 dcache size for cpu"); } if (pcc->l1_icache_size) { _FDT((fdt_setprop_cell(fdt, offset, "i-cache-size", pcc->l1_icache_size))); } else { - fprintf(stderr, "Warning: Unknown L1 icache size for cpu\n"); + error_report("Warning: Unknown L1 icache size for cpu"); } _FDT((fdt_setprop_cell(fdt, offset, "timebase-frequency", tbfreq))); @@ -945,20 +945,20 @@ static void spapr_finalize_fdt(sPAPRMachineState *spapr, ret = spapr_populate_memory(spapr, fdt); if (ret < 0) { - fprintf(stderr, "couldn't setup memory nodes in fdt\n"); + error_report("couldn't setup memory nodes in fdt"); exit(1); } ret = spapr_populate_vdevice(spapr->vio_bus, fdt); if (ret < 0) { - fprintf(stderr, "couldn't setup vio devices in fdt\n"); + error_report("couldn't setup vio devices in fdt"); exit(1); } if (object_resolve_path_type("", TYPE_SPAPR_RNG, NULL)) { ret = spapr_rng_populate_dt(fdt); if (ret < 0) { - fprintf(stderr, "could not set up rng device in the fdt\n"); + error_report("could not set up rng device in the fdt"); exit(1); } } @@ -974,7 +974,7 @@ static void spapr_finalize_fdt(sPAPRMachineState *spapr, /* RTAS */ ret = spapr_rtas_device_tree_setup(fdt, rtas_addr, rtas_size); if (ret < 0) { - fprintf(stderr, "Couldn't set up RTAS device tree properties\n"); + error_report("Couldn't set up RTAS device tree properties"); } /* cpus */ diff --git a/hw/ppc/spapr_drc.c b/hw/ppc/spapr_drc.c index 26a0679..4b1a943 100644 --- a/hw/ppc/spapr_drc.c +++ b/hw/ppc/spapr_drc.c @@ -816,7 +816,7 @@ int spapr_drc_populate_dt(void *fdt, int fdt_offset, Object *owner, drc_indexes->data, drc_indexes->len * sizeof(uint32_t)); if (ret) { - fprintf(stderr, "Couldn't create ibm,drc-indexes property\n"); + error_report("Couldn't create ibm,drc-indexes property"); goto out; } @@ -824,21 +824,21 @@ int spapr_drc_populate_dt(void *fdt, int fdt_offset, Object *owner, drc_power_domains->data, drc_power_domains->len * sizeof(uint32_t)); if (ret) { - fprintf(stderr, "Couldn't finalize ibm,drc-power-domains property\n"); + error_report("Couldn't finalize ibm,drc-power-domains property"); goto out; } ret = fdt_setprop(fdt, fdt_offset, "ibm,drc-names", drc_names->str, drc_names->len); if (ret) { - fprintf(stderr, "Couldn't finalize ibm,drc-names property\n"); + error_report("Couldn't finalize ibm,drc-names property"); goto out; } ret = fdt_setprop(fdt, fdt_offset, "ibm,drc-types", drc_types->str, drc_types->len); if (ret) { - fprintf(stderr, "Couldn't finalize ibm,drc-types property\n"); + error_report("Couldn't finalize ibm,drc-types property"); goto out; } diff --git a/hw/ppc/spapr_iommu.c b/hw/ppc/spapr_iommu.c index 6bc4d4d..f20b0b8 100644 --- a/hw/ppc/spapr_iommu.c +++ b/hw/ppc/spapr_iommu.c @@ -310,8 +310,8 @@ sPAPRTCETable *spapr_tce_new_table(DeviceState *owner, uint32_t liobn) char tmp[32]; if (spapr_tce_find_by_liobn(liobn)) { - fprintf(stderr, "Attempted to create TCE table with duplicate" - " LIOBN 0x%x\n", liobn); + error_report("Attempted to create TCE table with duplicate" + " LIOBN 0x%x", liobn); return NULL; } diff --git a/hw/ppc/spapr_rtas.c b/hw/ppc/spapr_rtas.c index dc058e5..27b5ad4 100644 --- a/hw/ppc/spapr_rtas.c +++ b/hw/ppc/spapr_rtas.c @@ -27,6 +27,7 @@ #include "qemu/osdep.h" #include "cpu.h" #include "qemu/log.h" +#include "qemu/error-report.h" #include "sysemu/sysemu.h" #include "sysemu/char.h" #include "hw/qdev.h" @@ -716,7 +717,7 @@ int spapr_rtas_device_tree_setup(void *fdt, hwaddr rtas_addr, ret = fdt_add_mem_rsv(fdt, rtas_addr, rtas_size); if (ret < 0) { - fprintf(stderr, "Couldn't add RTAS reserve entry: %s\n", + error_report("Couldn't add RTAS reserve entry: %s", fdt_strerror(ret)); return ret; } @@ -724,7 +725,7 @@ int spapr_rtas_device_tree_setup(void *fdt, hwaddr rtas_addr, ret = qemu_fdt_setprop_cell(fdt, "/rtas", "linux,rtas-base", rtas_addr); if (ret < 0) { - fprintf(stderr, "Couldn't add linux,rtas-base property: %s\n", + error_report("Couldn't add linux,rtas-base property: %s", fdt_strerror(ret)); return ret; } @@ -732,7 +733,7 @@ int spapr_rtas_device_tree_setup(void *fdt, hwaddr rtas_addr, ret = qemu_fdt_setprop_cell(fdt, "/rtas", "linux,rtas-entry", rtas_addr); if (ret < 0) { - fprintf(stderr, "Couldn't add linux,rtas-entry property: %s\n", + error_report("Couldn't add linux,rtas-entry property: %s", fdt_strerror(ret)); return ret; } @@ -740,7 +741,7 @@ int spapr_rtas_device_tree_setup(void *fdt, hwaddr rtas_addr, ret = qemu_fdt_setprop_cell(fdt, "/rtas", "rtas-size", rtas_size); if (ret < 0) { - fprintf(stderr, "Couldn't add rtas-size property: %s\n", + error_report("Couldn't add rtas-size property: %s", fdt_strerror(ret)); return ret; } @@ -755,7 +756,7 @@ int spapr_rtas_device_tree_setup(void *fdt, hwaddr rtas_addr, ret = qemu_fdt_setprop_cell(fdt, "/rtas", call->name, i + RTAS_TOKEN_BASE); if (ret < 0) { - fprintf(stderr, "Couldn't add rtas token for %s: %s\n", + error_report("Couldn't add rtas token for %s: %s", call->name, fdt_strerror(ret)); return ret; } @@ -770,7 +771,7 @@ int spapr_rtas_device_tree_setup(void *fdt, hwaddr rtas_addr, ret = qemu_fdt_setprop(fdt, "/rtas", "ibm,lrdr-capacity", lrdr_capacity, sizeof(lrdr_capacity)); if (ret < 0) { - fprintf(stderr, "Couldn't add ibm,lrdr-capacity rtas property\n"); + error_report("Couldn't add ibm,lrdr-capacity rtas property"); return ret; } diff --git a/hw/ppc/spapr_vio.c b/hw/ppc/spapr_vio.c index f93244d..497028f 100644 --- a/hw/ppc/spapr_vio.c +++ b/hw/ppc/spapr_vio.c @@ -20,6 +20,7 @@ */ #include "qemu/osdep.h" +#include "qemu/error-report.h" #include "qapi/error.h" #include "hw/hw.h" #include "qemu/log.h" @@ -276,7 +277,7 @@ int spapr_vio_send_crq(VIOsPAPRDevice *dev, uint8_t *crq) uint8_t byte; if (!dev->crq.qsize) { - fprintf(stderr, "spapr_vio_send_creq on uninitialized queue\n"); + error_report("spapr_vio_send_creq on uninitialized queue"); return -1; } diff --git a/include/hw/ppc/fdt.h b/include/hw/ppc/fdt.h index fff3e1b..2e5c61a 100644 --- a/include/hw/ppc/fdt.h +++ b/include/hw/ppc/fdt.h @@ -10,11 +10,13 @@ #ifndef PPC_FDT_H #define PPC_FDT_H -#define _FDT(exp) \ - do { \ +#include "qemu/error-report.h" + +#define _FDT(exp) \ + do { \ int ret = (exp); \ if (ret < 0) { \ - fprintf(stderr, "qemu: error creating device tree: %s: %s\n", \ + error_report("error creating device tree: %s: %s", \ #exp, fdt_strerror(ret)); \ exit(1); \ } \