From patchwork Thu Oct 19 16:15:41 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alistair Francis X-Patchwork-Id: 828216 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; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=xilinx.onmicrosoft.com header.i=@xilinx.onmicrosoft.com header.b="IdgUCPxS"; 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 3yHvdG1n4Mz9t6m for ; Fri, 20 Oct 2017 03:33:54 +1100 (AEDT) Received: from localhost ([::1]:50127 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e5DlY-00075o-8O for incoming@patchwork.ozlabs.org; Thu, 19 Oct 2017 12:33:52 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:55435) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e5DYm-0004gt-Kl for qemu-devel@nongnu.org; Thu, 19 Oct 2017 12:20:54 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1e5DYc-0001Fc-Qx for qemu-devel@nongnu.org; Thu, 19 Oct 2017 12:20:40 -0400 Received: from mail-by2nam01on0060.outbound.protection.outlook.com ([104.47.34.60]:12016 helo=NAM01-BY2-obe.outbound.protection.outlook.com) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1e5DXw-0000ml-62; Thu, 19 Oct 2017 12:19:48 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=xilinx.onmicrosoft.com; s=selector1-xilinx-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=nlxDHf4EKNl5UGbcfGlgeCwIn4BHeHNHd30uprG69fE=; b=IdgUCPxSEbVLu6pln0tWEjDAaJYY1GsPzmJhSaHOeuh6vCM6Don+hNwIfecboTjfSmTkXKH+eR8Cn5u/oB+LnswF7rPMgBEw11y6ZRXctDe7Oi8IacL6lNKgT1u8JGvr1ilLtAxbCFY+fXTsBRoDVl4XAJ5HLPHb89fr+BJRMo4= Received: from SN4PR0201CA0011.namprd02.prod.outlook.com (10.161.238.149) by DM5PR02MB3388.namprd02.prod.outlook.com (10.164.153.11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.77.7; Thu, 19 Oct 2017 16:19:43 +0000 Received: from BL2NAM02FT029.eop-nam02.prod.protection.outlook.com (2a01:111:f400:7e46::206) by SN4PR0201CA0011.outlook.office365.com (2603:10b6:803:2b::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.156.4 via Frontend Transport; Thu, 19 Oct 2017 16:19:42 +0000 Authentication-Results: spf=pass (sender IP is 149.199.60.100) smtp.mailfrom=xilinx.com; lists.xenproject.org; dkim=none (message not signed) header.d=none; lists.xenproject.org; dmarc=bestguesspass action=none header.from=xilinx.com; Received-SPF: Pass (protection.outlook.com: domain of xilinx.com designates 149.199.60.100 as permitted sender) receiver=protection.outlook.com; client-ip=149.199.60.100; helo=xsj-pvapsmtpgw02; Received: from xsj-pvapsmtpgw02 (149.199.60.100) by BL2NAM02FT029.mail.protection.outlook.com (10.152.77.100) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.20.77.10 via Frontend Transport; Thu, 19 Oct 2017 16:19:41 +0000 Received: from unknown-38-66.xilinx.com ([149.199.38.66]:35167 helo=xsj-pvapsmtp01) by xsj-pvapsmtpgw02 with esmtp (Exim 4.63) (envelope-from ) id 1e5DXp-0007uw-MQ; Thu, 19 Oct 2017 09:19:41 -0700 Received: from [127.0.0.1] (helo=localhost) by xsj-pvapsmtp01 with smtp (Exim 4.63) (envelope-from ) id 1e5DXp-0002QS-IR; Thu, 19 Oct 2017 09:19:41 -0700 Received: from xsj-pvapsmtp01 (smtp3.xilinx.com [149.199.38.66]) by xsj-smtp-dlp2.xlnx.xilinx.com (8.13.8/8.13.1) with ESMTP id v9JGJYGC003067; Thu, 19 Oct 2017 09:19:34 -0700 Received: from [172.19.2.220] (helo=localhost.localdomain) by xsj-pvapsmtp01 with esmtp (Exim 4.63) (envelope-from ) id 1e5DXi-0002OJ-6u; Thu, 19 Oct 2017 09:19:34 -0700 From: Alistair Francis To: Date: Thu, 19 Oct 2017 09:15:41 -0700 Message-ID: X-Mailer: git-send-email 2.11.0 In-Reply-To: References: X-RCIS-Action: ALLOW X-TM-AS-Product-Ver: IMSS-7.1.0.1224-8.1.0.1062-23404.005 X-TM-AS-User-Approved-Sender: Yes;Yes X-EOPAttributedMessage: 0 X-MS-Office365-Filtering-HT: Tenant X-Forefront-Antispam-Report: CIP:149.199.60.100; IPV:NLI; CTRY:US; EFV:NLI; SFV:NSPM; SFS:(10009020)(6009001)(346002)(376002)(39860400002)(2980300002)(438002)(199003)(189002)(16586007)(63266004)(118296001)(36756003)(36386004)(5890100001)(5660300001)(50226002)(7416002)(106002)(478600001)(2906002)(48376002)(5003940100001)(316002)(356003)(551934003)(305945005)(54906003)(50466002)(47776003)(2950100002)(575784001)(81166006)(81156014)(16200700003)(6666003)(4326008)(6916009)(39060400002)(53946003)(9786002)(77096006)(8936002)(76176999)(2351001)(8676002)(106466001)(189998001)(8666007)(33646002)(50986999)(107986001)(21314002)(5001870100001)(579004)(569006); DIR:OUT; SFP:1101; SCL:1; SRVR:DM5PR02MB3388; H:xsj-pvapsmtpgw02; FPR:; SPF:Pass; PTR:unknown-60-100.xilinx.com,xapps1.xilinx.com; A:1; MX:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BL2NAM02FT029; 1:8b0CEmmfgNAvRgNvhFOuaQncBFeLEyQvYnxK0DEQeFVEAGmCOgainlWCH0BCmgRqQtMaYACvt+aSgMazAnEoZCNF6D0+y496/8Gr7q+gzPfSQwZCDZ9xjcnAP92SbvHn MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: d8c82cd4-046b-4ad3-28f7-08d5170d345c X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001)(2017030254152)(8251501002)(2017052603199)(201703131423075)(201703031133081)(201702281549075); SRVR:DM5PR02MB3388; X-Microsoft-Exchange-Diagnostics: 1; DM5PR02MB3388; 3:ttPt3lI5lmixaPsqqh+uQqcKW0xs4kEKHwIm7pUAJ25wuJ2E6YtoCeiNxXPQPIIUaeRgHmgWXTlAHsl7yQcY4EO5sU3BzOEEvlKOtEkCJZjTM8hepSWn/VEgma7usRiIebqIx2CN6FC2BW8YCRaersPuk6YO7jROFNxi5bNTeEDgDOF3JPiilIJ9QVwHm/i/sQ80mz2HVBz9odpiOKpqjPBXRIUY5R/9hJf9C7Tnoz1Z6Y6vfrkchETmIMFvjSv9ZW/+SggMsjqJ6Ohu4ZXQDgrbZv6OGBIhFgAPU7oCkqapJtqNKUrvKBTX/12YGfwaKEdIcJqrZdzblDVlGM5XM+YM7PH7EC0vGr4gkqGwUf4=; 25:umhAQNiHNhQLhWElPrZw3Q8pQb7iJAOO6nYF4WTIFwbdTvqt2k8xasP8Qd6fYDnyCHOgqZjjvGbnnYFCiAD6vLGR/J9bViGMxuFFg8iztwvVjZHOdI09++pBEKG/g0IbxHw5YXM3FuiIlUAn74jeQZ+XtxPMAAmt/7bs36tvEWwKO++RxrAXSElsBx7eOgSSFeIlxd4HDwh0DpOxHyhechfpo75PbnlpkgIGW7ZmvC9yY8nZ/k13u4U6ixb3NwJcCbJ7LBA1exotSsHmRScpFd0b4NT1IGXeqe0VV+ExXbu+lr0gBAIjAzluSiT6N1A43FGJP//KyphDLOCk7lwEjw== X-MS-TrafficTypeDiagnostic: DM5PR02MB3388: X-Microsoft-Exchange-Diagnostics: 1; DM5PR02MB3388; 31:tYjYZ/ReMLSCfpoCWnQeHf/nW/aFFZyMgPoJ/Kx4Mk07WWS/R870siVTyDHJf0Bofnvnfp2TliiC2wu+VNubcc5eJFBwLNQTEz3qYSgtjIqdPubKsQVjR0NJFNDXKzTGg1+qO2Mqc0iZOIQuYIODtCS1/LVLj4d4pT7waTpl5kDG58oV766radEna+JBYuAqwax+FsXE1EN0sS6yuGAzb/7recaFvZ6qRQKy+x2/T88=; 20:7u0azya5goXBvyjxe5OucoFy2Mah2LsSCYVrGKDRXvKV3dcOyRGRr7M7H3G+Uj72mc1XoKZAhDtgQccH8JMsMOPu2GNLsv1LvGmMv/I8OCjH44HDTewyNd4wvtStfLtb7NWQdiTK8EeAPX4OqNj5ERBDHp1AC8XbzcYelS+GW/XHa1ICADMNiUxSNGjKGJd7aJJTdw6MnUCmUAf1V0ch6emEJAILwCGdggEQFmJhyEiF28Nued5wcr3OjxjemPzeQXiQTAOGm8vOahxhgEeTeYLwRCa7RISk+U5HB9m76dYWi6b9X8A9MI58DCjl9ot1kKIzpjJVAxk9/MLPw5F0WZ/dhZrUbgvB64N1Monwc6j3vA9NYbo0A52oWzPVxkRTGQY0WG+Ioj9xJ8hr2CqY2AYeb3s6F73eZCj2JHcsCg5D2Ytb/UR71oDAcYkPFoknGD0sYZIyZUCXJFnEByxwTz+xYkZrdW407mxTEy2ybhtJhpgjOOx3KCOxa1W+v2nU X-Exchange-Antispam-Report-Test: UriScan:(131327999870524)(788757137089)(192813158149592)(70601490899591); X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(100000700101)(100105000095)(100000701101)(100105300095)(100000702101)(100105100095)(6040450)(2401047)(8121501046)(5005006)(100000703101)(100105400095)(93006095)(93004095)(10201501046)(3002001)(6055026)(6041248)(20161123558100)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123562025)(20161123560025)(20161123555025)(20161123564025)(6072148)(201708071742011)(100000704101)(100105200095)(100000705101)(100105500095); SRVR:DM5PR02MB3388; BCL:0; PCL:0; RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095); SRVR:DM5PR02MB3388; X-Microsoft-Exchange-Diagnostics: 1; DM5PR02MB3388; 4:8DuEYW9msqQMikrcXj5eVFtf8zFnfCn3E8K6uXhgwDR5agNrUrqzfQavYW8I2sT93cQoRIkbiiFgtfUSZrnT0ITtS0QEyDnn9SxYGKO12F/oBnYCooeDiZk1C7ZtmyQ24krPh8zqsg4uz+RLj43zS7qlAcZrV9UHPj3RqkbMwo6u+oIcDW0VT5kqAeMbWXmO0115CgGuFW3dMsIEizq+IUjiobwZkFw76qHIHkAcF5gR69ASnjscwo1dRy98vMnNyizi+uiVPkyj18q6gK/XuTSjDAATh7UQNOgNhJcihXDzugLbiYhDlLcsSh6Gs9dLhBqi8Q2mWgx5B7isgKBq2f/isNGrRoobl0OtIgaO75RnvNQZ46q061YhpdGe6L2wubrtzYqpe0XWPBXhIkC2ow== X-Forefront-PRVS: 0465429B7F X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; DM5PR02MB3388; 23:dn+SNUGfK7DRwRV2LNv1VcUmRke6iAa3TDBPMsQG/?= 3wIfMDhvIb2bxjDkzce+9xJ79IB2fy3977H6MXEb3BkvIB/uvzA4ubfjMtMe9Y7oVmqbgah5RHeKpvyePoJaQ0pWd9aUJfQSltzqG6sXyDYg9VA1NhavVGylDWm8TFPBZmu8P3Qr2Ubc/9Y0b72ZV/8vmK5PP/l52IupyZZ40oSdQdSdKo1VCp/gUItNj85buOb4eNN9h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ics: 1; DM5PR02MB3388; 6:wJRdajDDwnW6wCq2KEEpTsT4KbeDR8QPWBA8bvG35KJqVwV8frg5h95sXxu0StenOPPzbMOk4dGalJlEQYdvouE2qn/Wr2l68JBQtexj3qShP+a86OjL7M8x70MeXGBJsZ1V95PIJYPO+uuqUcT3G7QXh45UVTrdu1i78BemgudY/YHxeqTeUZCA2R2pmX2wS4hCxeEw+wBCoJg/VvYQ9MxDgbvyaPFxrhciOZ5WwpFvUGidm/sKwUlfarPYwFZ3GQW6xItIljgeuxGn2bBrb0xa1MXmeTWJ65jLIeELesOoQJkUlNk/8d9p4BW4Yyp/+m9p5UFViRyLUshs3bUSeA==; 5:4mEMuWIhSUeKVh8yXSAaZDei4v75VUoHQEH5A7hhorKz4LNfdkTfIngRhqDGKp5joMS9t0ixpJ1LlqWcQtZ+/xQiklm3EyWUJYhVbcBQZLF3m3lFUE0kybRuiWERensN8cX22PM6uOMilL4kVXoOug==; 24:qGscZj0blWxM44AtwnKSf7QOWcglF0f7qN0PnuCHQECS1f6g8sEiZCNnAf6on7NdsozrnOz6Ii+4e/+MZWW8xd0KL7Cjw4TRIXBt53KL6Sg=; 7:tw+40SYj++KbK5IVZrRetIuJ2Z7ue6gTIvmSoumBVY6ILE4OAorudKuJgzBkxCTrPtQp1ep0pXOIcDJYO0rSOfBtNyaJO3cEpqpbJRSIZUZjdn+EYXjUayjSbmYcjH1Qi9S6/oZMGiy4v9Z6MLv4HAd9JEJ7dw+SRGWKKRCtow4FSbevp/LRrWnEHDMZ9kJ6Mt6mRJZ9dkwzhhzTSFHjH9lGmqDXqa0jSX7Ft0dfwzo= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: xilinx.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 19 Oct 2017 16:19:41.9665 (UTC) X-MS-Exchange-CrossTenant-Id: 657af505-d5df-48d0-8300-c31994686c5c X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=657af505-d5df-48d0-8300-c31994686c5c; Ip=[149.199.60.100]; Helo=[xsj-pvapsmtpgw02] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM5PR02MB3388 X-detected-operating-system: by eggs.gnu.org: Windows 7 or 8 [fuzzy] X-Received-From: 104.47.34.60 Subject: [Qemu-devel] [PATCH v3 01/46] Replace all occurances of __FUNCTION__ with __func__ 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: "Dr. David Alan Gilbert" , Stefano Stabellini , Fam Zheng , qemu-block@nongnu.org, Peter Crosthwaite , John Snow , Juan Quintela , armbru@redhat.com, alistair.francis@xilinx.com, Yongbok Kim , qemu-arm@nongnu.org, Gerd Hoffmann , Stefan Hajnoczi , xen-devel@lists.xenproject.org, Anthony Perard , alistair23@gmail.com, Aurelien Jarno Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" Replace all occurs of __FUNCTION__ except for the check in checkpatch with the non GCC specific __func__. One line in hcd-musb.c was manually tweaked to pass checkpatch. Signed-off-by: Alistair Francis Cc: Gerd Hoffmann Cc: Andrzej Zaborowski Cc: Stefano Stabellini Cc: Anthony Perard Cc: John Snow Cc: Aurelien Jarno Cc: Yongbok Kim Cc: Peter Crosthwaite Cc: Stefan Hajnoczi Cc: Fam Zheng Cc: Juan Quintela Cc: "Dr. David Alan Gilbert" Cc: qemu-arm@nongnu.org Cc: qemu-block@nongnu.org Cc: xen-devel@lists.xenproject.org Reviewed-by: Eric Blake Reviewed-by: Stefan Hajnoczi Reviewed-by: Anthony PERARD Reviewed-by: Juan Quintela --- audio/audio_int.h | 2 +- hw/arm/nseries.c | 2 +- hw/arm/omap1.c | 42 +++++++++++++++++++++--------------------- hw/arm/omap2.c | 12 ++++++------ hw/arm/palm.c | 14 +++++++------- hw/arm/pxa2xx.c | 46 +++++++++++++++++++++++----------------------- hw/arm/pxa2xx_gpio.c | 6 +++--- hw/arm/pxa2xx_pic.c | 4 ++-- hw/arm/tosa.c | 10 +++++----- hw/audio/hda-codec.c | 10 +++++----- hw/audio/intel-hda.c | 28 ++++++++++++++-------------- hw/audio/wm8750.c | 4 ++-- hw/block/nand.c | 4 ++-- hw/block/onenand.c | 8 ++++---- hw/bt/core.c | 10 +++++----- hw/bt/hci-csr.c | 14 +++++++------- hw/bt/hci.c | 26 +++++++++++++------------- hw/bt/hid.c | 2 +- hw/bt/l2cap.c | 22 +++++++++++----------- hw/bt/sdp.c | 6 +++--- hw/display/blizzard.c | 18 +++++++++--------- hw/display/omap_dss.c | 6 +++--- hw/display/pxa2xx_lcd.c | 14 +++++++------- hw/display/qxl-render.c | 6 +++--- hw/display/qxl.h | 2 +- hw/display/tc6393xb.c | 2 +- hw/display/xenfb.c | 2 +- hw/dma/omap_dma.c | 26 +++++++++++++------------- hw/dma/pxa2xx_dma.c | 14 +++++++------- hw/gpio/max7310.c | 8 ++++---- hw/gpio/omap_gpio.c | 2 +- hw/i2c/omap_i2c.c | 6 +++--- hw/ide/ahci.c | 2 +- hw/ide/microdrive.c | 4 ++-- hw/input/lm832x.c | 6 +++--- hw/input/pxa2xx_keypad.c | 6 +++--- hw/input/tsc2005.c | 8 ++++---- hw/input/tsc210x.c | 4 ++-- hw/intc/omap_intc.c | 2 +- hw/isa/vt82c686.c | 2 +- hw/mips/gt64xxx_pci.c | 2 +- hw/misc/cbus.c | 12 ++++++------ hw/misc/omap_clk.c | 4 ++-- hw/misc/omap_gpmc.c | 6 +++--- hw/misc/omap_l4.c | 4 ++-- hw/misc/omap_sdrc.c | 2 +- hw/misc/omap_tap.c | 6 +++--- hw/misc/tmp105.c | 2 +- hw/pci-host/bonito.c | 2 +- hw/sd/pxa2xx_mmci.c | 6 +++--- hw/ssi/omap_spi.c | 6 +++--- hw/timer/omap_gptimer.c | 6 +++--- hw/timer/twl92230.c | 6 +++--- hw/usb/desc.c | 2 +- hw/usb/dev-bluetooth.c | 4 ++-- hw/usb/hcd-musb.c | 4 ++-- hw/usb/tusb6010.c | 14 +++++++------- hw/xenpv/xen_domainbuild.c | 16 ++++++++-------- hw/xenpv/xen_machine_pv.c | 2 +- include/hw/arm/omap.h | 10 +++++----- include/hw/arm/sharpsl.h | 2 +- memory_mapping.c | 2 +- migration/block.c | 4 ++-- ui/cursor.c | 6 +++--- ui/spice-display.c | 4 ++-- 65 files changed, 273 insertions(+), 273 deletions(-) diff --git a/audio/audio_int.h b/audio/audio_int.h index 5bcb1c60e1..543b1bd8d5 100644 --- a/audio/audio_int.h +++ b/audio/audio_int.h @@ -253,7 +253,7 @@ static inline int audio_ring_dist (int dst, int src, int len) #define AUDIO_STRINGIFY(n) AUDIO_STRINGIFY_(n) #if defined _MSC_VER || defined __GNUC__ -#define AUDIO_FUNC __FUNCTION__ +#define AUDIO_FUNC __func__ #else #define AUDIO_FUNC __FILE__ ":" AUDIO_STRINGIFY (__LINE__) #endif diff --git a/hw/arm/nseries.c b/hw/arm/nseries.c index 58005b6619..32687afced 100644 --- a/hw/arm/nseries.c +++ b/hw/arm/nseries.c @@ -463,7 +463,7 @@ static uint32_t mipid_txrx(void *opaque, uint32_t cmd, int len) uint8_t ret; if (len > 9) { - hw_error("%s: FIXME: bad SPI word width %i\n", __FUNCTION__, len); + hw_error("%s: FIXME: bad SPI word width %i\n", __func__, len); } if (s->p >= ARRAY_SIZE(s->resp)) { diff --git a/hw/arm/omap1.c b/hw/arm/omap1.c index b3e7625130..1388200191 100644 --- a/hw/arm/omap1.c +++ b/hw/arm/omap1.c @@ -999,7 +999,7 @@ static uint64_t omap_id_read(void *opaque, hwaddr addr, case omap1510: return 0x03310115; default: - hw_error("%s: bad mpu model\n", __FUNCTION__); + hw_error("%s: bad mpu model\n", __func__); } break; @@ -1010,7 +1010,7 @@ static uint64_t omap_id_read(void *opaque, hwaddr addr, case omap1510: return 0xfb47002f; default: - hw_error("%s: bad mpu model\n", __FUNCTION__); + hw_error("%s: bad mpu model\n", __func__); } break; } @@ -1716,7 +1716,7 @@ static void omap_clkm_write(void *opaque, hwaddr addr, case 0x18: /* ARM_SYSST */ if ((s->clkm.clocking_scheme ^ (value >> 11)) & 7) { s->clkm.clocking_scheme = (value >> 11) & 7; - printf("%s: clocking scheme set to %s\n", __FUNCTION__, + printf("%s: clocking scheme set to %s\n", __func__, clkschemename[s->clkm.clocking_scheme]); } s->clkm.cold_start &= value & 0x3f; @@ -2129,14 +2129,14 @@ qemu_irq *omap_mpuio_in_get(struct omap_mpuio_s *s) void omap_mpuio_out_set(struct omap_mpuio_s *s, int line, qemu_irq handler) { if (line >= 16 || line < 0) - hw_error("%s: No GPIO line %i\n", __FUNCTION__, line); + hw_error("%s: No GPIO line %i\n", __func__, line); s->handler[line] = handler; } void omap_mpuio_key(struct omap_mpuio_s *s, int row, int col, int down) { if (row >= 5 || row < 0) - hw_error("%s: No key %i-%i\n", __FUNCTION__, col, row); + hw_error("%s: No key %i-%i\n", __func__, col, row); if (down) s->buttons[row] |= 1 << col; @@ -2313,7 +2313,7 @@ void omap_uwire_attach(struct omap_uwire_s *s, uWireSlave *slave, int chipselect) { if (chipselect < 0 || chipselect > 3) { - fprintf(stderr, "%s: Bad chipselect %i\n", __FUNCTION__, chipselect); + fprintf(stderr, "%s: Bad chipselect %i\n", __func__, chipselect); exit(-1); } @@ -2335,7 +2335,7 @@ static void omap_pwl_update(struct omap_pwl_s *s) if (output != s->output) { s->output = output; - printf("%s: Backlight now at %i/256\n", __FUNCTION__, output); + printf("%s: Backlight now at %i/256\n", __func__, output); } } @@ -2473,7 +2473,7 @@ static void omap_pwt_write(void *opaque, hwaddr addr, case 0x04: /* VRC */ if ((value ^ s->vrc) & 1) { if (value & 1) - printf("%s: %iHz buzz on\n", __FUNCTION__, (int) + printf("%s: %iHz buzz on\n", __func__, (int) /* 1.5 MHz from a 12-MHz or 13-MHz PWT_CLK */ ((omap_clk_getrate(s->clk) >> 3) / /* Pre-multiplexer divider */ @@ -2490,7 +2490,7 @@ static void omap_pwt_write(void *opaque, hwaddr addr, ((value & (1 << 5)) ? 80 : 127) / (107 * 55 * 63 * 127))); else - printf("%s: silence!\n", __FUNCTION__); + printf("%s: silence!\n", __func__); } s->vrc = value & 0x7f; break; @@ -2562,7 +2562,7 @@ static void omap_rtc_alarm_update(struct omap_rtc_s *s) { s->alarm_ti = mktimegm(&s->alarm_tm); if (s->alarm_ti == -1) - printf("%s: conversion failed\n", __FUNCTION__); + printf("%s: conversion failed\n", __func__); } static uint64_t omap_rtc_read(void *opaque, hwaddr addr, @@ -3028,7 +3028,7 @@ static void omap_mcbsp_source_tick(void *opaque) if (!s->rx_rate) return; if (s->rx_req) - printf("%s: Rx FIFO overrun\n", __FUNCTION__); + printf("%s: Rx FIFO overrun\n", __func__); s->rx_req = s->rx_rate << bps[(s->rcr[0] >> 5) & 7]; @@ -3074,7 +3074,7 @@ static void omap_mcbsp_sink_tick(void *opaque) if (!s->tx_rate) return; if (s->tx_req) - printf("%s: Tx FIFO underrun\n", __FUNCTION__); + printf("%s: Tx FIFO underrun\n", __func__); s->tx_req = s->tx_rate << bps[(s->xcr[0] >> 5) & 7]; @@ -3176,7 +3176,7 @@ static uint64_t omap_mcbsp_read(void *opaque, hwaddr addr, /* Fall through. */ case 0x02: /* DRR1 */ if (s->rx_req < 2) { - printf("%s: Rx FIFO underrun\n", __FUNCTION__); + printf("%s: Rx FIFO underrun\n", __func__); omap_mcbsp_rx_done(s); } else { s->tx_req -= 2; @@ -3282,7 +3282,7 @@ static void omap_mcbsp_writeh(void *opaque, hwaddr addr, if (s->tx_req < 2) omap_mcbsp_tx_done(s); } else - printf("%s: Tx FIFO overrun\n", __FUNCTION__); + printf("%s: Tx FIFO overrun\n", __func__); return; case 0x08: /* SPCR2 */ @@ -3297,7 +3297,7 @@ static void omap_mcbsp_writeh(void *opaque, hwaddr addr, s->spcr[0] &= 0x0006; s->spcr[0] |= 0xf8f9 & value; if (value & (1 << 15)) /* DLB */ - printf("%s: Digital Loopback mode enable attempt\n", __FUNCTION__); + printf("%s: Digital Loopback mode enable attempt\n", __func__); if (~value & 1) { /* RRST */ s->spcr[0] &= ~6; s->rx_req = 0; @@ -3330,13 +3330,13 @@ static void omap_mcbsp_writeh(void *opaque, hwaddr addr, s->mcr[1] = value & 0x03e3; if (value & 3) /* XMCM */ printf("%s: Tx channel selection mode enable attempt\n", - __FUNCTION__); + __func__); return; case 0x1a: /* MCR1 */ s->mcr[0] = value & 0x03e1; if (value & 1) /* RMCM */ printf("%s: Rx channel selection mode enable attempt\n", - __FUNCTION__); + __func__); return; case 0x1c: /* RCERA */ s->rcer[0] = value & 0xffff; @@ -3418,7 +3418,7 @@ static void omap_mcbsp_writew(void *opaque, hwaddr addr, if (s->tx_req < 4) omap_mcbsp_tx_done(s); } else - printf("%s: Tx FIFO overrun\n", __FUNCTION__); + printf("%s: Tx FIFO overrun\n", __func__); return; } @@ -3536,7 +3536,7 @@ static void omap_lpg_tick(void *opaque) timer_mod(s->tm, qemu_clock_get_ms(QEMU_CLOCK_VIRTUAL) + s->on); s->cycle = !s->cycle; - printf("%s: LED is %s\n", __FUNCTION__, s->cycle ? "on" : "off"); + printf("%s: LED is %s\n", __func__, s->cycle ? "on" : "off"); } static void omap_lpg_update(struct omap_lpg_s *s) @@ -3557,9 +3557,9 @@ static void omap_lpg_update(struct omap_lpg_s *s) timer_del(s->tm); if (on == period && s->on < s->period) - printf("%s: LED is on\n", __FUNCTION__); + printf("%s: LED is on\n", __func__); else if (on == 0 && s->on) - printf("%s: LED is off\n", __FUNCTION__); + printf("%s: LED is off\n", __func__); else if (on && (on != s->on || period != s->period)) { s->cycle = 0; s->on = on; diff --git a/hw/arm/omap2.c b/hw/arm/omap2.c index f5b148881c..b53878b8b9 100644 --- a/hw/arm/omap2.c +++ b/hw/arm/omap2.c @@ -1312,7 +1312,7 @@ static void omap_prcm_apll_update(struct omap_prcm_s *s) if (mode[0] == 1 || mode[0] == 2 || mode[1] == 1 || mode[1] == 2) fprintf(stderr, "%s: bad EN_54M_PLL or bad EN_96M_PLL\n", - __FUNCTION__); + __func__); } static void omap_prcm_dpll_update(struct omap_prcm_s *s) @@ -1331,7 +1331,7 @@ static void omap_prcm_dpll_update(struct omap_prcm_s *s) s->dpll_lock = 0; switch (mode) { case 0: - fprintf(stderr, "%s: bad EN_DPLL\n", __FUNCTION__); + fprintf(stderr, "%s: bad EN_DPLL\n", __func__); break; case 1: /* Low-power bypass mode (Default) */ case 2: /* Fast-relock bypass mode */ @@ -1358,7 +1358,7 @@ static void omap_prcm_dpll_update(struct omap_prcm_s *s) omap_clk_reparent(core, dpll_x2); break; case 3: - fprintf(stderr, "%s: bad CORE_CLK_SRC\n", __FUNCTION__); + fprintf(stderr, "%s: bad CORE_CLK_SRC\n", __func__); break; } } @@ -1628,7 +1628,7 @@ static void omap_prcm_write(void *opaque, hwaddr addr, case 0x500: /* CM_CLKEN_PLL */ if (value & 0xffffff30) fprintf(stderr, "%s: write 0s in CM_CLKEN_PLL for " - "future compatibility\n", __FUNCTION__); + "future compatibility\n", __func__); if ((s->clken[9] ^ value) & 0xcc) { s->clken[9] &= ~0xcc; s->clken[9] |= value & 0xcc; @@ -1647,7 +1647,7 @@ static void omap_prcm_write(void *opaque, hwaddr addr, case 0x540: /* CM_CLKSEL1_PLL */ if (value & 0xfc4000d7) fprintf(stderr, "%s: write 0s in CM_CLKSEL1_PLL for " - "future compatibility\n", __FUNCTION__); + "future compatibility\n", __func__); if ((s->clksel[5] ^ value) & 0x003fff00) { s->clksel[5] = value & 0x03bfff28; omap_prcm_dpll_update(s); @@ -1659,7 +1659,7 @@ static void omap_prcm_write(void *opaque, hwaddr addr, case 0x544: /* CM_CLKSEL2_PLL */ if (value & ~3) fprintf(stderr, "%s: write 0s in CM_CLKSEL2_PLL[31:2] for " - "future compatibility\n", __FUNCTION__); + "future compatibility\n", __func__); if (s->clksel[6] != (value & 3)) { s->clksel[6] = value & 3; omap_prcm_dpll_update(s); diff --git a/hw/arm/palm.c b/hw/arm/palm.c index a1f55d79b4..285f43709d 100644 --- a/hw/arm/palm.c +++ b/hw/arm/palm.c @@ -44,7 +44,7 @@ static void static_write(void *opaque, hwaddr offset, uint64_t value, { #ifdef SPY printf("%s: value %08lx written at " PA_FMT "\n", - __FUNCTION__, value, offset); + __func__, value, offset); #endif } @@ -127,11 +127,11 @@ static void palmte_onoff_gpios(void *opaque, int line, int level) switch (line) { case 0: printf("%s: current to MMC/SD card %sabled.\n", - __FUNCTION__, level ? "dis" : "en"); + __func__, level ? "dis" : "en"); break; case 1: printf("%s: internal speaker amplifier %s.\n", - __FUNCTION__, level ? "down" : "on"); + __func__, level ? "down" : "on"); break; /* These LCD & Audio output signals have not been identified yet. */ @@ -139,12 +139,12 @@ static void palmte_onoff_gpios(void *opaque, int line, int level) case 3: case 4: printf("%s: LCD GPIO%i %s.\n", - __FUNCTION__, line - 1, level ? "high" : "low"); + __func__, line - 1, level ? "high" : "low"); break; case 5: case 6: printf("%s: Audio GPIO%i %s.\n", - __FUNCTION__, line - 4, level ? "high" : "low"); + __func__, line - 4, level ? "high" : "low"); break; } } @@ -234,7 +234,7 @@ static void palmte_init(MachineState *machine) rom_size = get_image_size(option_rom[0].name); if (rom_size > flash_size) { fprintf(stderr, "%s: ROM image too big (%x > %x)\n", - __FUNCTION__, rom_size, flash_size); + __func__, rom_size, flash_size); rom_size = 0; } if (rom_size > 0) { @@ -244,7 +244,7 @@ static void palmte_init(MachineState *machine) } if (rom_size < 0) { fprintf(stderr, "%s: error loading '%s'\n", - __FUNCTION__, option_rom[0].name); + __func__, option_rom[0].name); } } diff --git a/hw/arm/pxa2xx.c b/hw/arm/pxa2xx.c index ab691a7985..db860c238e 100644 --- a/hw/arm/pxa2xx.c +++ b/hw/arm/pxa2xx.c @@ -107,7 +107,7 @@ static uint64_t pxa2xx_pm_read(void *opaque, hwaddr addr, return s->pm_regs[addr >> 2]; default: fail: - printf("%s: Bad register " REG_FMT "\n", __FUNCTION__, addr); + printf("%s: Bad register " REG_FMT "\n", __func__, addr); break; } return 0; @@ -139,7 +139,7 @@ static void pxa2xx_pm_write(void *opaque, hwaddr addr, break; } - printf("%s: Bad register " REG_FMT "\n", __FUNCTION__, addr); + printf("%s: Bad register " REG_FMT "\n", __func__, addr); break; } } @@ -180,7 +180,7 @@ static uint64_t pxa2xx_cm_read(void *opaque, hwaddr addr, return s->cm_regs[CCCR >> 2] | (3 << 28); default: - printf("%s: Bad register " REG_FMT "\n", __FUNCTION__, addr); + printf("%s: Bad register " REG_FMT "\n", __func__, addr); break; } return 0; @@ -205,7 +205,7 @@ static void pxa2xx_cm_write(void *opaque, hwaddr addr, break; default: - printf("%s: Bad register " REG_FMT "\n", __FUNCTION__, addr); + printf("%s: Bad register " REG_FMT "\n", __func__, addr); break; } } @@ -410,7 +410,7 @@ static uint64_t pxa2xx_mm_read(void *opaque, hwaddr addr, return s->mm_regs[addr >> 2]; default: - printf("%s: Bad register " REG_FMT "\n", __FUNCTION__, addr); + printf("%s: Bad register " REG_FMT "\n", __func__, addr); break; } return 0; @@ -429,7 +429,7 @@ static void pxa2xx_mm_write(void *opaque, hwaddr addr, } default: - printf("%s: Bad register " REG_FMT "\n", __FUNCTION__, addr); + printf("%s: Bad register " REG_FMT "\n", __func__, addr); break; } } @@ -619,7 +619,7 @@ static uint64_t pxa2xx_ssp_read(void *opaque, hwaddr addr, if (!s->enable) return 0xffffffff; if (s->rx_level < 1) { - printf("%s: SSP Rx Underrun\n", __FUNCTION__); + printf("%s: SSP Rx Underrun\n", __func__); return 0xffffffff; } s->rx_level --; @@ -636,7 +636,7 @@ static uint64_t pxa2xx_ssp_read(void *opaque, hwaddr addr, case SSACD: return s->ssacd; default: - printf("%s: Bad register " REG_FMT "\n", __FUNCTION__, addr); + printf("%s: Bad register " REG_FMT "\n", __func__, addr); break; } return 0; @@ -653,9 +653,9 @@ static void pxa2xx_ssp_write(void *opaque, hwaddr addr, s->sscr[0] = value & 0xc7ffffff; s->enable = value & SSCR0_SSE; if (value & SSCR0_MOD) - printf("%s: Attempt to use network mode\n", __FUNCTION__); + printf("%s: Attempt to use network mode\n", __func__); if (s->enable && SSCR0_DSS(value) < 4) - printf("%s: Wrong data size: %i bits\n", __FUNCTION__, + printf("%s: Wrong data size: %i bits\n", __func__, SSCR0_DSS(value)); if (!(value & SSCR0_SSE)) { s->sssr = 0; @@ -668,7 +668,7 @@ static void pxa2xx_ssp_write(void *opaque, hwaddr addr, case SSCR1: s->sscr[1] = value; if (value & (SSCR1_LBM | SSCR1_EFWR)) - printf("%s: Attempt to use SSP test mode\n", __FUNCTION__); + printf("%s: Attempt to use SSP test mode\n", __func__); pxa2xx_ssp_fifo_update(s); break; @@ -728,7 +728,7 @@ static void pxa2xx_ssp_write(void *opaque, hwaddr addr, break; default: - printf("%s: Bad register " REG_FMT "\n", __FUNCTION__, addr); + printf("%s: Bad register " REG_FMT "\n", __func__, addr); break; } } @@ -990,7 +990,7 @@ static uint64_t pxa2xx_rtc_read(void *opaque, hwaddr addr, else return s->last_swcr; default: - printf("%s: Bad register " REG_FMT "\n", __FUNCTION__, addr); + printf("%s: Bad register " REG_FMT "\n", __func__, addr); break; } return 0; @@ -1096,7 +1096,7 @@ static void pxa2xx_rtc_write(void *opaque, hwaddr addr, break; default: - printf("%s: Bad register " REG_FMT "\n", __FUNCTION__, addr); + printf("%s: Bad register " REG_FMT "\n", __func__, addr); } } @@ -1344,7 +1344,7 @@ static uint64_t pxa2xx_i2c_read(void *opaque, hwaddr addr, s->ibmr = 0; return s->ibmr; default: - printf("%s: Bad register " REG_FMT "\n", __FUNCTION__, addr); + printf("%s: Bad register " REG_FMT "\n", __func__, addr); break; } return 0; @@ -1417,7 +1417,7 @@ static void pxa2xx_i2c_write(void *opaque, hwaddr addr, break; default: - printf("%s: Bad register " REG_FMT "\n", __FUNCTION__, addr); + printf("%s: Bad register " REG_FMT "\n", __func__, addr); } } @@ -1618,7 +1618,7 @@ static uint64_t pxa2xx_i2s_read(void *opaque, hwaddr addr, } return 0; default: - printf("%s: Bad register " REG_FMT "\n", __FUNCTION__, addr); + printf("%s: Bad register " REG_FMT "\n", __func__, addr); break; } return 0; @@ -1641,14 +1641,14 @@ static void pxa2xx_i2s_write(void *opaque, hwaddr addr, s->status &= ~(1 << 7); /* I2SOFF */ } if (value & (1 << 4)) /* EFWR */ - printf("%s: Attempt to use special function\n", __FUNCTION__); + printf("%s: Attempt to use special function\n", __func__); s->enable = (value & 9) == 1; /* ENB && !RST*/ pxa2xx_i2s_update(s); break; case SACR1: s->control[1] = value & 0x0039; if (value & (1 << 5)) /* ENLBF */ - printf("%s: Attempt to use loopback function\n", __FUNCTION__); + printf("%s: Attempt to use loopback function\n", __func__); if (value & (1 << 4)) /* DPRL */ s->fifo_len = 0; pxa2xx_i2s_update(s); @@ -1675,7 +1675,7 @@ static void pxa2xx_i2s_write(void *opaque, hwaddr addr, } break; default: - printf("%s: Bad register " REG_FMT "\n", __FUNCTION__, addr); + printf("%s: Bad register " REG_FMT "\n", __func__, addr); } } @@ -1851,7 +1851,7 @@ static uint64_t pxa2xx_fir_read(void *opaque, hwaddr addr, pxa2xx_fir_update(s); return ret; } - printf("%s: Rx FIFO underrun.\n", __FUNCTION__); + printf("%s: Rx FIFO underrun.\n", __func__); break; case ICSR0: return s->status[0]; @@ -1860,7 +1860,7 @@ static uint64_t pxa2xx_fir_read(void *opaque, hwaddr addr, case ICFOR: return s->rx_len; default: - printf("%s: Bad register " REG_FMT "\n", __FUNCTION__, addr); + printf("%s: Bad register " REG_FMT "\n", __func__, addr); break; } return 0; @@ -1912,7 +1912,7 @@ static void pxa2xx_fir_write(void *opaque, hwaddr addr, case ICFOR: break; default: - printf("%s: Bad register " REG_FMT "\n", __FUNCTION__, addr); + printf("%s: Bad register " REG_FMT "\n", __func__, addr); } } diff --git a/hw/arm/pxa2xx_gpio.c b/hw/arm/pxa2xx_gpio.c index 521dbad039..e15070188e 100644 --- a/hw/arm/pxa2xx_gpio.c +++ b/hw/arm/pxa2xx_gpio.c @@ -107,7 +107,7 @@ static void pxa2xx_gpio_set(void *opaque, int line, int level) uint32_t mask; if (line >= s->lines) { - printf("%s: No GPIO pin %i\n", __FUNCTION__, line); + printf("%s: No GPIO pin %i\n", __func__, line); return; } @@ -195,7 +195,7 @@ static uint64_t pxa2xx_gpio_read(void *opaque, hwaddr offset, return s->status[bank]; default: - hw_error("%s: Bad offset " REG_FMT "\n", __FUNCTION__, offset); + hw_error("%s: Bad offset " REG_FMT "\n", __func__, offset); } return 0; @@ -248,7 +248,7 @@ static void pxa2xx_gpio_write(void *opaque, hwaddr offset, break; default: - hw_error("%s: Bad offset " REG_FMT "\n", __FUNCTION__, offset); + hw_error("%s: Bad offset " REG_FMT "\n", __func__, offset); } } diff --git a/hw/arm/pxa2xx_pic.c b/hw/arm/pxa2xx_pic.c index b516ced8c0..61275fa040 100644 --- a/hw/arm/pxa2xx_pic.c +++ b/hw/arm/pxa2xx_pic.c @@ -165,7 +165,7 @@ static uint64_t pxa2xx_pic_mem_read(void *opaque, hwaddr offset, case ICHP: /* Highest Priority register */ return pxa2xx_pic_highest(s); default: - printf("%s: Bad register offset " REG_FMT "\n", __FUNCTION__, offset); + printf("%s: Bad register offset " REG_FMT "\n", __func__, offset); return 0; } } @@ -198,7 +198,7 @@ static void pxa2xx_pic_mem_write(void *opaque, hwaddr offset, s->priority[32 + ((offset - IPR32) >> 2)] = value & 0x8000003f; break; default: - printf("%s: Bad register offset " REG_FMT "\n", __FUNCTION__, offset); + printf("%s: Bad register offset " REG_FMT "\n", __func__, offset); return; } pxa2xx_pic_update(opaque); diff --git a/hw/arm/tosa.c b/hw/arm/tosa.c index 044796350a..a55b1a369c 100644 --- a/hw/arm/tosa.c +++ b/hw/arm/tosa.c @@ -159,7 +159,7 @@ static int tosa_dac_send(I2CSlave *i2c, uint8_t data) s->buf[s->len] = data; if (s->len ++ > 2) { #ifdef VERBOSE - fprintf(stderr, "%s: message too long (%i bytes)\n", __FUNCTION__, s->len); + fprintf(stderr, "%s: message too long (%i bytes)\n", __func__, s->len); #endif return 1; } @@ -181,14 +181,14 @@ static int tosa_dac_event(I2CSlave *i2c, enum i2c_event event) case I2C_START_SEND: break; case I2C_START_RECV: - printf("%s: recv not supported!!!\n", __FUNCTION__); + printf("%s: recv not supported!!!\n", __func__); break; case I2C_FINISH: #ifdef VERBOSE if (s->len < 2) - printf("%s: message too short (%i bytes)\n", __FUNCTION__, s->len); + printf("%s: message too short (%i bytes)\n", __func__, s->len); if (s->len > 2) - printf("%s: message too long\n", __FUNCTION__); + printf("%s: message too long\n", __func__); #endif break; default: @@ -200,7 +200,7 @@ static int tosa_dac_event(I2CSlave *i2c, enum i2c_event event) static int tosa_dac_recv(I2CSlave *s) { - printf("%s: recv not supported!!!\n", __FUNCTION__); + printf("%s: recv not supported!!!\n", __func__); return -1; } diff --git a/hw/audio/hda-codec.c b/hw/audio/hda-codec.c index 5402cd196c..e8aa7842e6 100644 --- a/hw/audio/hda-codec.c +++ b/hw/audio/hda-codec.c @@ -316,7 +316,7 @@ static void hda_audio_command(HDACodecDevice *hda, uint32_t nid, uint32_t data) goto fail; } dprint(a, 2, "%s: nid %d (%s), verb 0x%x, payload 0x%x\n", - __FUNCTION__, nid, node->name, verb, payload); + __func__, nid, node->name, verb, payload); switch (verb) { /* all nodes */ @@ -449,7 +449,7 @@ static void hda_audio_command(HDACodecDevice *hda, uint32_t nid, uint32_t data) fail: dprint(a, 1, "%s: not handled: nid %d (%s), verb 0x%x, payload 0x%x\n", - __FUNCTION__, nid, node ? node->name : "?", verb, payload); + __func__, nid, node ? node->name : "?", verb, payload); hda_codec_response(hda, true, 0); } @@ -484,7 +484,7 @@ static int hda_audio_init(HDACodecDevice *hda, const struct desc_codec *desc) a->desc = desc; a->name = object_get_typename(OBJECT(a)); - dprint(a, 1, "%s: cad %d\n", __FUNCTION__, a->hda.cad); + dprint(a, 1, "%s: cad %d\n", __func__, a->hda.cad); AUD_register_card("hda", &a->card); for (i = 0; i < a->desc->nnodes; i++) { @@ -526,7 +526,7 @@ static void hda_audio_exit(HDACodecDevice *hda) HDAAudioStream *st; int i; - dprint(a, 1, "%s\n", __FUNCTION__); + dprint(a, 1, "%s\n", __func__); for (i = 0; i < ARRAY_SIZE(a->st); i++) { st = a->st + i; if (st->node == NULL) { @@ -547,7 +547,7 @@ static int hda_audio_post_load(void *opaque, int version) HDAAudioStream *st; int i; - dprint(a, 1, "%s\n", __FUNCTION__); + dprint(a, 1, "%s\n", __func__); if (version == 1) { /* assume running_compat[] is for output streams */ for (i = 0; i < ARRAY_SIZE(a->running_compat); i++) diff --git a/hw/audio/intel-hda.c b/hw/audio/intel-hda.c index a3e670c188..948268afd8 100644 --- a/hw/audio/intel-hda.c +++ b/hw/audio/intel-hda.c @@ -265,7 +265,7 @@ static void intel_hda_update_irq(IntelHDAState *d) } else { level = 0; } - dprint(d, 2, "%s: level %d [%s]\n", __FUNCTION__, + dprint(d, 2, "%s: level %d [%s]\n", __func__, level, msi ? "msi" : "intx"); if (msi) { if (level) { @@ -285,7 +285,7 @@ static int intel_hda_send_command(IntelHDAState *d, uint32_t verb) cad = (verb >> 28) & 0x0f; if (verb & (1 << 27)) { /* indirect node addressing, not specified in HDA 1.0 */ - dprint(d, 1, "%s: indirect node addressing (guest bug?)\n", __FUNCTION__); + dprint(d, 1, "%s: indirect node addressing (guest bug?)\n", __func__); return -1; } nid = (verb >> 20) & 0x7f; @@ -293,7 +293,7 @@ static int intel_hda_send_command(IntelHDAState *d, uint32_t verb) codec = hda_codec_find(&d->codecs, cad); if (codec == NULL) { - dprint(d, 1, "%s: addressed non-existing codec\n", __FUNCTION__); + dprint(d, 1, "%s: addressed non-existing codec\n", __func__); return -1; } cdc = HDA_CODEC_DEVICE_GET_CLASS(codec); @@ -307,22 +307,22 @@ static void intel_hda_corb_run(IntelHDAState *d) uint32_t rp, verb; if (d->ics & ICH6_IRS_BUSY) { - dprint(d, 2, "%s: [icw] verb 0x%08x\n", __FUNCTION__, d->icw); + dprint(d, 2, "%s: [icw] verb 0x%08x\n", __func__, d->icw); intel_hda_send_command(d, d->icw); return; } for (;;) { if (!(d->corb_ctl & ICH6_CORBCTL_RUN)) { - dprint(d, 2, "%s: !run\n", __FUNCTION__); + dprint(d, 2, "%s: !run\n", __func__); return; } if ((d->corb_rp & 0xff) == d->corb_wp) { - dprint(d, 2, "%s: corb ring empty\n", __FUNCTION__); + dprint(d, 2, "%s: corb ring empty\n", __func__); return; } if (d->rirb_count == d->rirb_cnt) { - dprint(d, 2, "%s: rirb count reached\n", __FUNCTION__); + dprint(d, 2, "%s: rirb count reached\n", __func__); return; } @@ -331,7 +331,7 @@ static void intel_hda_corb_run(IntelHDAState *d) verb = ldl_le_pci_dma(&d->pci, addr + 4*rp); d->corb_rp = rp; - dprint(d, 2, "%s: [rp 0x%x] verb 0x%08x\n", __FUNCTION__, rp, verb); + dprint(d, 2, "%s: [rp 0x%x] verb 0x%08x\n", __func__, rp, verb); intel_hda_send_command(d, verb); } } @@ -345,7 +345,7 @@ static void intel_hda_response(HDACodecDevice *dev, bool solicited, uint32_t res if (d->ics & ICH6_IRS_BUSY) { dprint(d, 2, "%s: [irr] response 0x%x, cad 0x%x\n", - __FUNCTION__, response, dev->cad); + __func__, response, dev->cad); d->irr = response; d->ics &= ~(ICH6_IRS_BUSY | 0xf0); d->ics |= (ICH6_IRS_VALID | (dev->cad << 4)); @@ -353,7 +353,7 @@ static void intel_hda_response(HDACodecDevice *dev, bool solicited, uint32_t res } if (!(d->rirb_ctl & ICH6_RBCTL_DMA_EN)) { - dprint(d, 1, "%s: rirb dma disabled, drop codec response\n", __FUNCTION__); + dprint(d, 1, "%s: rirb dma disabled, drop codec response\n", __func__); return; } @@ -365,17 +365,17 @@ static void intel_hda_response(HDACodecDevice *dev, bool solicited, uint32_t res d->rirb_wp = wp; dprint(d, 2, "%s: [wp 0x%x] response 0x%x, extra 0x%x\n", - __FUNCTION__, wp, response, ex); + __func__, wp, response, ex); d->rirb_count++; if (d->rirb_count == d->rirb_cnt) { - dprint(d, 2, "%s: rirb count reached (%d)\n", __FUNCTION__, d->rirb_count); + dprint(d, 2, "%s: rirb count reached (%d)\n", __func__, d->rirb_count); if (d->rirb_ctl & ICH6_RBCTL_IRQ_EN) { d->rirb_sts |= ICH6_RBSTS_IRQ; intel_hda_update_irq(d); } } else if ((d->corb_rp & 0xff) == d->corb_wp) { - dprint(d, 2, "%s: corb ring empty (%d/%d)\n", __FUNCTION__, + dprint(d, 2, "%s: corb ring empty (%d/%d)\n", __func__, d->rirb_count, d->rirb_cnt); if (d->rirb_ctl & ICH6_RBCTL_IRQ_EN) { d->rirb_sts |= ICH6_RBSTS_IRQ; @@ -1144,7 +1144,7 @@ static int intel_hda_post_load(void *opaque, int version) IntelHDAState* d = opaque; int i; - dprint(d, 1, "%s\n", __FUNCTION__); + dprint(d, 1, "%s\n", __func__); for (i = 0; i < ARRAY_SIZE(d->st); i++) { if (d->st[i].ctl & 0x02) { intel_hda_parse_bdl(d, &d->st[i]); diff --git a/hw/audio/wm8750.c b/hw/audio/wm8750.c index 8bb44a7cc1..6d8b728923 100644 --- a/hw/audio/wm8750.c +++ b/hw/audio/wm8750.c @@ -315,7 +315,7 @@ static int wm8750_event(I2CSlave *i2c, enum i2c_event event) #ifdef VERBOSE if (s->i2c_len < 2) printf("%s: message too short (%i bytes)\n", - __FUNCTION__, s->i2c_len); + __func__, s->i2c_len); #endif break; default: @@ -555,7 +555,7 @@ static int wm8750_tx(I2CSlave *i2c, uint8_t data) #ifdef VERBOSE default: - printf("%s: unknown register %02x\n", __FUNCTION__, cmd); + printf("%s: unknown register %02x\n", __func__, cmd); #endif } diff --git a/hw/block/nand.c b/hw/block/nand.c index 76dcd3f76e..919cb9b803 100644 --- a/hw/block/nand.c +++ b/hw/block/nand.c @@ -321,7 +321,7 @@ static void nand_command(NANDFlashState *s) break; default: - printf("%s: Unknown NAND command 0x%02x\n", __FUNCTION__, s->cmd); + printf("%s: Unknown NAND command 0x%02x\n", __func__, s->cmd); } } @@ -640,7 +640,7 @@ DeviceState *nand_init(BlockBackend *blk, int manf_id, int chip_id) DeviceState *dev; if (nand_flash_ids[chip_id].size == 0) { - hw_error("%s: Unsupported NAND chip ID.\n", __FUNCTION__); + hw_error("%s: Unsupported NAND chip ID.\n", __func__); } dev = DEVICE(object_new(TYPE_NAND)); qdev_prop_set_uint8(dev, "manufacturer_id", manf_id); diff --git a/hw/block/onenand.c b/hw/block/onenand.c index de65c9ebb9..e243182394 100644 --- a/hw/block/onenand.c +++ b/hw/block/onenand.c @@ -659,12 +659,12 @@ static uint64_t onenand_read(void *opaque, hwaddr addr, case 0xff02: /* ECC Result of spare area data */ case 0xff03: /* ECC Result of main area data */ case 0xff04: /* ECC Result of spare area data */ - hw_error("%s: imeplement ECC\n", __FUNCTION__); + hw_error("%s: imeplement ECC\n", __func__); return 0x0000; } fprintf(stderr, "%s: unknown OneNAND register %x\n", - __FUNCTION__, offset); + __func__, offset); return 0; } @@ -709,7 +709,7 @@ static void onenand_write(void *opaque, hwaddr addr, default: fprintf(stderr, "%s: unknown OneNAND boot command %"PRIx64"\n", - __FUNCTION__, value); + __func__, value); } break; @@ -760,7 +760,7 @@ static void onenand_write(void *opaque, hwaddr addr, default: fprintf(stderr, "%s: unknown OneNAND register %x\n", - __FUNCTION__, offset); + __func__, offset); } } diff --git a/hw/bt/core.c b/hw/bt/core.c index 615f0af073..c1806b71a3 100644 --- a/hw/bt/core.c +++ b/hw/bt/core.c @@ -32,23 +32,23 @@ static void bt_dummy_lmp_connection_complete(struct bt_link_s *link) { if (link->slave->reject_reason) fprintf(stderr, "%s: stray LMP_not_accepted received, fixme\n", - __FUNCTION__); + __func__); else fprintf(stderr, "%s: stray LMP_accepted received, fixme\n", - __FUNCTION__); + __func__); exit(-1); } static void bt_dummy_lmp_disconnect_master(struct bt_link_s *link) { - fprintf(stderr, "%s: stray LMP_detach received, fixme\n", __FUNCTION__); + fprintf(stderr, "%s: stray LMP_detach received, fixme\n", __func__); exit(-1); } static void bt_dummy_lmp_acl_resp(struct bt_link_s *link, const uint8_t *data, int start, int len) { - fprintf(stderr, "%s: stray ACL response PDU, fixme\n", __FUNCTION__); + fprintf(stderr, "%s: stray ACL response PDU, fixme\n", __func__); exit(-1); } @@ -113,7 +113,7 @@ void bt_device_done(struct bt_device_s *dev) while (*p && *p != dev) p = &(*p)->next; if (*p != dev) { - fprintf(stderr, "%s: bad bt device \"%s\"\n", __FUNCTION__, + fprintf(stderr, "%s: bad bt device \"%s\"\n", __func__, dev->lmp_name ?: "(null)"); exit(-1); } diff --git a/hw/bt/hci-csr.c b/hw/bt/hci-csr.c index d13192b9b5..ac067b81f6 100644 --- a/hw/bt/hci-csr.c +++ b/hw/bt/hci-csr.c @@ -111,14 +111,14 @@ static uint8_t *csrhci_out_packet(struct csrhci_s *s, int len) if (off < FIFO_LEN) { if (off + len > FIFO_LEN && (s->out_size = off + len) > FIFO_LEN * 2) { - fprintf(stderr, "%s: can't alloc %i bytes\n", __FUNCTION__, len); + fprintf(stderr, "%s: can't alloc %i bytes\n", __func__, len); exit(-1); } return s->outfifo + off; } if (s->out_len > s->out_size) { - fprintf(stderr, "%s: can't alloc %i bytes\n", __FUNCTION__, len); + fprintf(stderr, "%s: can't alloc %i bytes\n", __func__, len); exit(-1); } @@ -169,7 +169,7 @@ static void csrhci_in_packet_vendor(struct csrhci_s *s, int ocf, s->hci->bdaddr_set(s->hci, s->bd_addr.b); fprintf(stderr, "%s: bd_address loaded from firmware: " - "%02x:%02x:%02x:%02x:%02x:%02x\n", __FUNCTION__, + "%02x:%02x:%02x:%02x:%02x:%02x\n", __func__, s->bd_addr.b[0], s->bd_addr.b[1], s->bd_addr.b[2], s->bd_addr.b[3], s->bd_addr.b[4], s->bd_addr.b[5]); } @@ -181,7 +181,7 @@ static void csrhci_in_packet_vendor(struct csrhci_s *s, int ocf, break; default: - fprintf(stderr, "%s: got a bad CMD packet\n", __FUNCTION__); + fprintf(stderr, "%s: got a bad CMD packet\n", __func__); return; } @@ -226,7 +226,7 @@ static void csrhci_in_packet(struct csrhci_s *s, uint8_t *pkt) case H4_NEG_PKT: if (s->in_hdr != sizeof(csrhci_neg_packet) || memcmp(pkt - 1, csrhci_neg_packet, s->in_hdr)) { - fprintf(stderr, "%s: got a bad NEG packet\n", __FUNCTION__); + fprintf(stderr, "%s: got a bad NEG packet\n", __func__); return; } pkt += 2; @@ -241,7 +241,7 @@ static void csrhci_in_packet(struct csrhci_s *s, uint8_t *pkt) case H4_ALIVE_PKT: if (s->in_hdr != 4 || pkt[1] != 0x55 || pkt[2] != 0x00) { - fprintf(stderr, "%s: got a bad ALIVE packet\n", __FUNCTION__); + fprintf(stderr, "%s: got a bad ALIVE packet\n", __func__); return; } @@ -254,7 +254,7 @@ static void csrhci_in_packet(struct csrhci_s *s, uint8_t *pkt) default: bad_pkt: /* TODO: error out */ - fprintf(stderr, "%s: got a bad packet\n", __FUNCTION__); + fprintf(stderr, "%s: got a bad packet\n", __func__); break; } diff --git a/hw/bt/hci.c b/hw/bt/hci.c index 476ebec0ab..df05f07887 100644 --- a/hw/bt/hci.c +++ b/hw/bt/hci.c @@ -458,7 +458,7 @@ static inline uint8_t *bt_hci_event_start(struct bt_hci_s *hci, if (len > 255) { fprintf(stderr, "%s: HCI event params too long (%ib)\n", - __FUNCTION__, len); + __func__, len); exit(-1); } @@ -589,7 +589,7 @@ static void bt_hci_inquiry_result(struct bt_hci_s *hci, bt_hci_inquiry_result_with_rssi(hci, slave); return; default: - fprintf(stderr, "%s: bad inquiry mode %02x\n", __FUNCTION__, + fprintf(stderr, "%s: bad inquiry mode %02x\n", __func__, hci->lm.inquiry_mode); exit(-1); } @@ -1528,7 +1528,7 @@ static void bt_submit_hci(struct HCIInfo *info, "the Inquiry command has been issued, a Command " "Status event has been received for the Inquiry " "command, and before the Inquiry Complete event " - "occurs", __FUNCTION__); + "occurs", __func__); bt_hci_event_complete_status(hci, HCI_COMMAND_DISALLOWED); break; } @@ -1567,7 +1567,7 @@ static void bt_submit_hci(struct HCIInfo *info, "the Inquiry command has been issued, a Command " "Status event has been received for the Inquiry " "command, and before the Inquiry Complete event " - "occurs", __FUNCTION__); + "occurs", __func__); bt_hci_event_complete_status(hci, HCI_COMMAND_DISALLOWED); break; } @@ -1972,7 +1972,7 @@ static void bt_submit_hci(struct HCIInfo *info, short_hci: fprintf(stderr, "%s: HCI packet too short (%iB)\n", - __FUNCTION__, length); + __func__, length); bt_hci_event_status(hci, HCI_INVALID_PARAMETERS); break; } @@ -1992,7 +1992,7 @@ static inline void bt_hci_lmp_acl_data(struct bt_hci_s *hci, uint16_t handle, if (len + HCI_ACL_HDR_SIZE > sizeof(hci->acl_buf)) { fprintf(stderr, "%s: can't take ACL packets %i bytes long\n", - __FUNCTION__, len); + __func__, len); return; } memcpy(hci->acl_buf + HCI_ACL_HDR_SIZE, data, len); @@ -2030,7 +2030,7 @@ static void bt_submit_acl(struct HCIInfo *info, if (length < HCI_ACL_HDR_SIZE) { fprintf(stderr, "%s: ACL packet too short (%iB)\n", - __FUNCTION__, length); + __func__, length); return; } @@ -2042,7 +2042,7 @@ static void bt_submit_acl(struct HCIInfo *info, if (bt_hci_handle_bad(hci, handle)) { fprintf(stderr, "%s: invalid ACL handle %03x\n", - __FUNCTION__, handle); + __func__, handle); /* TODO: signal an error */ return; } @@ -2050,7 +2050,7 @@ static void bt_submit_acl(struct HCIInfo *info, if (datalen > length) { fprintf(stderr, "%s: ACL packet too short (%iB < %iB)\n", - __FUNCTION__, length, datalen); + __func__, length, datalen); return; } @@ -2061,7 +2061,7 @@ static void bt_submit_acl(struct HCIInfo *info, hci->asb_handle = handle; else if (handle != hci->asb_handle) { fprintf(stderr, "%s: Bad handle %03x in Active Slave Broadcast\n", - __FUNCTION__, handle); + __func__, handle); /* TODO: signal an error */ return; } @@ -2074,7 +2074,7 @@ static void bt_submit_acl(struct HCIInfo *info, hci->psb_handle = handle; else if (handle != hci->psb_handle) { fprintf(stderr, "%s: Bad handle %03x in Parked Slave Broadcast\n", - __FUNCTION__, handle); + __func__, handle); /* TODO: signal an error */ return; } @@ -2106,13 +2106,13 @@ static void bt_submit_sco(struct HCIInfo *info, if (bt_hci_handle_bad(hci, handle)) { fprintf(stderr, "%s: invalid SCO handle %03x\n", - __FUNCTION__, handle); + __func__, handle); return; } if (datalen > length) { fprintf(stderr, "%s: SCO packet too short (%iB < %iB)\n", - __FUNCTION__, length, datalen); + __func__, length, datalen); return; } diff --git a/hw/bt/hid.c b/hw/bt/hid.c index f6affbbb44..09d17322e4 100644 --- a/hw/bt/hid.c +++ b/hw/bt/hid.c @@ -420,7 +420,7 @@ static void bt_hid_interrupt_sdu(void *opaque, const uint8_t *data, int len) return; bad: fprintf(stderr, "%s: bad transaction on Interrupt channel.\n", - __FUNCTION__); + __func__); } /* "Virtual cable" plug/unplug event. */ diff --git a/hw/bt/l2cap.c b/hw/bt/l2cap.c index e342045140..3e53dd082d 100644 --- a/hw/bt/l2cap.c +++ b/hw/bt/l2cap.c @@ -468,7 +468,7 @@ static void l2cap_channel_close(struct l2cap_instance_s *l2cap, if (likely(ch)) { if (ch->remote_cid != source_cid) { fprintf(stderr, "%s: Ignoring a Disconnection Request with the " - "invalid SCID %04x.\n", __FUNCTION__, source_cid); + "invalid SCID %04x.\n", __func__, source_cid); return; } @@ -791,7 +791,7 @@ static void l2cap_command(struct l2cap_instance_s *l2cap, int code, int id, /* TODO: do the IDs really have to be in sequence? */ if (!id || (id != l2cap->last_id && id != l2cap->next_id)) { fprintf(stderr, "%s: out of sequence command packet ignored.\n", - __FUNCTION__); + __func__); return; } #else @@ -814,7 +814,7 @@ static void l2cap_command(struct l2cap_instance_s *l2cap, int code, int id, /* We never issue commands other than Command Reject currently. */ fprintf(stderr, "%s: stray Command Reject (%02x, %04x) " - "packet, ignoring.\n", __FUNCTION__, id, + "packet, ignoring.\n", __func__, id, le16_to_cpu(((l2cap_cmd_rej *) params)->reason)); break; @@ -837,7 +837,7 @@ static void l2cap_command(struct l2cap_instance_s *l2cap, int code, int id, /* We never issue Connection Requests currently. TODO */ fprintf(stderr, "%s: unexpected Connection Response (%02x) " - "packet, ignoring.\n", __FUNCTION__, id); + "packet, ignoring.\n", __func__, id); break; case L2CAP_CONF_REQ: @@ -866,7 +866,7 @@ static void l2cap_command(struct l2cap_instance_s *l2cap, int code, int id, ((l2cap_conf_rsp *) params)->data, len - L2CAP_CONF_RSP_SIZE(0))) fprintf(stderr, "%s: unexpected Configure Response (%02x) " - "packet, ignoring.\n", __FUNCTION__, id); + "packet, ignoring.\n", __func__, id); break; case L2CAP_DISCONN_REQ: @@ -888,7 +888,7 @@ static void l2cap_command(struct l2cap_instance_s *l2cap, int code, int id, /* We never issue Disconnection Requests currently. TODO */ fprintf(stderr, "%s: unexpected Disconnection Response (%02x) " - "packet, ignoring.\n", __FUNCTION__, id); + "packet, ignoring.\n", __func__, id); break; case L2CAP_ECHO_REQ: @@ -898,7 +898,7 @@ static void l2cap_command(struct l2cap_instance_s *l2cap, int code, int id, case L2CAP_ECHO_RSP: /* We never issue Echo Requests currently. TODO */ fprintf(stderr, "%s: unexpected Echo Response (%02x) " - "packet, ignoring.\n", __FUNCTION__, id); + "packet, ignoring.\n", __func__, id); break; case L2CAP_INFO_REQ: @@ -918,7 +918,7 @@ static void l2cap_command(struct l2cap_instance_s *l2cap, int code, int id, /* We never issue Information Requests currently. TODO */ fprintf(stderr, "%s: unexpected Information Response (%02x) " - "packet, ignoring.\n", __FUNCTION__, id); + "packet, ignoring.\n", __func__, id); break; default: @@ -1067,7 +1067,7 @@ static void l2cap_frame_in(struct l2cap_instance_s *l2cap, if (unlikely(cid >= L2CAP_CID_MAX || !l2cap->cid[cid])) { fprintf(stderr, "%s: frame addressed to a non-existent L2CAP " - "channel %04x received.\n", __FUNCTION__, cid); + "channel %04x received.\n", __func__, cid); return; } @@ -1129,7 +1129,7 @@ static uint8_t *l2cap_bframe_out(struct bt_l2cap_conn_params_s *parm, int len) if (len > chan->params.remote_mtu) { fprintf(stderr, "%s: B-Frame for CID %04x longer than %i octets.\n", - __FUNCTION__, + __func__, chan->remote_cid, chan->params.remote_mtu); exit(-1); } @@ -1354,7 +1354,7 @@ void bt_l2cap_psm_register(struct bt_l2cap_device_s *dev, int psm, int min_mtu, if (new_psm) { fprintf(stderr, "%s: PSM %04x already registered for device `%s'.\n", - __FUNCTION__, psm, dev->device.lmp_name); + __func__, psm, dev->device.lmp_name); exit(-1); } diff --git a/hw/bt/sdp.c b/hw/bt/sdp.c index 3cb60b9495..7c0d38b504 100644 --- a/hw/bt/sdp.c +++ b/hw/bt/sdp.c @@ -506,7 +506,7 @@ static void bt_l2cap_sdp_sdu_in(void *opaque, const uint8_t *data, int len) int rsp_len = 0; if (len < 5) { - fprintf(stderr, "%s: short SDP PDU (%iB).\n", __FUNCTION__, len); + fprintf(stderr, "%s: short SDP PDU (%iB).\n", __func__, len); return; } @@ -518,7 +518,7 @@ static void bt_l2cap_sdp_sdu_in(void *opaque, const uint8_t *data, int len) if (len != plen) { fprintf(stderr, "%s: wrong SDP PDU length (%iB != %iB).\n", - __FUNCTION__, plen, len); + __func__, plen, len); err = SDP_INVALID_PDU_SIZE; goto respond; } @@ -545,7 +545,7 @@ static void bt_l2cap_sdp_sdu_in(void *opaque, const uint8_t *data, int len) case SDP_SVC_SEARCH_ATTR_RSP: default: fprintf(stderr, "%s: unexpected SDP PDU ID %02x.\n", - __FUNCTION__, pdu_id); + __func__, pdu_id); err = SDP_INVALID_SYNTAX; break; } diff --git a/hw/display/blizzard.c b/hw/display/blizzard.c index cbf07d14d9..291abe6fca 100644 --- a/hw/display/blizzard.c +++ b/hw/display/blizzard.c @@ -474,7 +474,7 @@ static uint16_t blizzard_reg_read(void *opaque, uint8_t reg) return s->gpio_pdown; default: - fprintf(stderr, "%s: unknown register %02x\n", __FUNCTION__, reg); + fprintf(stderr, "%s: unknown register %02x\n", __func__, reg); return 0; } } @@ -502,7 +502,7 @@ static void blizzard_reg_write(void *opaque, uint8_t reg, uint16_t value) s->pll_mode = value & 0x77; if ((value & 3) == 0 || (value & 3) == 3) fprintf(stderr, "%s: wrong PLL Control bits (%i)\n", - __FUNCTION__, value & 3); + __func__, value & 3); break; case 0x0e: /* Clock-Source Select */ @@ -541,7 +541,7 @@ static void blizzard_reg_write(void *opaque, uint8_t reg, uint16_t value) case 0x28: /* LCD Panel Configuration */ s->lcd_config = value & 0xff; if (value & (1 << 7)) - fprintf(stderr, "%s: data swap not supported!\n", __FUNCTION__); + fprintf(stderr, "%s: data swap not supported!\n", __func__); break; case 0x2a: /* LCD Horizontal Display Width */ @@ -586,7 +586,7 @@ static void blizzard_reg_write(void *opaque, uint8_t reg, uint16_t value) s->hssi_config[1] = value; if (((value >> 4) & 3) == 3) fprintf(stderr, "%s: Illegal active-data-links value\n", - __FUNCTION__); + __func__); break; case 0x42: /* High-speed Serial Interface Tx Mode */ s->hssi_config[2] = value & 0xbd; @@ -641,7 +641,7 @@ static void blizzard_reg_write(void *opaque, uint8_t reg, uint16_t value) s->enable = value & 1; s->blank = (value >> 1) & 1; if (value & (1 << 4)) - fprintf(stderr, "%s: Macrovision enable attempt!\n", __FUNCTION__); + fprintf(stderr, "%s: Macrovision enable attempt!\n", __func__); break; case 0x6a: /* Special Effects */ @@ -718,7 +718,7 @@ static void blizzard_reg_write(void *opaque, uint8_t reg, uint16_t value) s->bpp = blizzard_iformat_bpp[s->iformat]; if (!s->bpp) fprintf(stderr, "%s: Illegal or unsupported input format %x\n", - __FUNCTION__, s->iformat); + __func__, s->iformat); break; case 0x8e: /* Data Source Select */ s->source = value & 7; @@ -730,7 +730,7 @@ static void blizzard_reg_write(void *opaque, uint8_t reg, uint16_t value) !((s->ix[1] - s->ix[0]) & (s->iy[1] - s->iy[0]) & (s->ox[1] - s->ox[0]) & (s->oy[1] - s->oy[0]) & 1)) fprintf(stderr, "%s: Illegal input/output window positions\n", - __FUNCTION__); + __func__); blizzard_transfer_setup(s); break; @@ -784,7 +784,7 @@ static void blizzard_reg_write(void *opaque, uint8_t reg, uint16_t value) s->pm = value & 0x83; if (value & s->mode & 1) fprintf(stderr, "%s: The display must be disabled before entering " - "Standby Mode\n", __FUNCTION__); + "Standby Mode\n", __func__); break; case 0xe8: /* Non-display Period Control / Status */ s->status = value & 0x1b; @@ -815,7 +815,7 @@ static void blizzard_reg_write(void *opaque, uint8_t reg, uint16_t value) break; default: - fprintf(stderr, "%s: unknown register %02x\n", __FUNCTION__, reg); + fprintf(stderr, "%s: unknown register %02x\n", __func__, reg); break; } } diff --git a/hw/display/omap_dss.c b/hw/display/omap_dss.c index 783e9e1318..601f178fdd 100644 --- a/hw/display/omap_dss.c +++ b/hw/display/omap_dss.c @@ -526,7 +526,7 @@ static void omap_disc_write(void *opaque, hwaddr addr, s->dispc.l[0].attr = value & 0x7ff; if (value & (3 << 9)) fprintf(stderr, "%s: Big-endian pixel format not supported\n", - __FUNCTION__); + __func__); s->dispc.l[0].enable = value & 1; s->dispc.l[0].bpp = (value >> 1) & 0xf; s->dispc.invalidate = 1; @@ -617,7 +617,7 @@ static void omap_rfbi_transfer_start(struct omap_dss_s *s) if (s->rfbi.control & (1 << 1)) { /* BYPASS */ /* TODO: in non-Bypass mode we probably need to just assert the * DRQ and wait for DMA to write the pixels. */ - fprintf(stderr, "%s: Bypass mode unimplemented\n", __FUNCTION__); + fprintf(stderr, "%s: Bypass mode unimplemented\n", __func__); return; } @@ -1086,6 +1086,6 @@ struct omap_dss_s *omap_dss_init(struct omap_target_agent_s *ta, void omap_rfbi_attach(struct omap_dss_s *s, int cs, struct rfbi_chip_s *chip) { if (cs < 0 || cs > 1) - hw_error("%s: wrong CS %i\n", __FUNCTION__, cs); + hw_error("%s: wrong CS %i\n", __func__, cs); s->rfbi.chip[cs] = chip; } diff --git a/hw/display/pxa2xx_lcd.c b/hw/display/pxa2xx_lcd.c index 845521c5b2..b83f80753a 100644 --- a/hw/display/pxa2xx_lcd.c +++ b/hw/display/pxa2xx_lcd.c @@ -405,7 +405,7 @@ static uint64_t pxa2xx_lcdc_read(void *opaque, hwaddr offset, default: fail: - hw_error("%s: Bad offset " REG_FMT "\n", __FUNCTION__, offset); + hw_error("%s: Bad offset " REG_FMT "\n", __func__, offset); } return 0; @@ -424,7 +424,7 @@ static void pxa2xx_lcdc_write(void *opaque, hwaddr offset, s->status[0] |= LCSR0_QD; if (!(s->control[0] & LCCR0_LCDT) && (value & LCCR0_LCDT)) - printf("%s: internal frame buffer unsupported\n", __FUNCTION__); + printf("%s: internal frame buffer unsupported\n", __func__); if ((s->control[3] & LCCR3_API) && (value & LCCR0_ENB) && !(value & LCCR0_LCDT)) @@ -460,7 +460,7 @@ static void pxa2xx_lcdc_write(void *opaque, hwaddr offset, case OVL1C1: if (!(s->ovl1c[0] & OVLC1_EN) && (value & OVLC1_EN)) - printf("%s: Overlay 1 not supported\n", __FUNCTION__); + printf("%s: Overlay 1 not supported\n", __func__); s->ovl1c[0] = value & 0x80ffffff; s->dma_ch[1].up = (value & OVLC1_EN) || (s->control[0] & LCCR0_SDS); @@ -472,7 +472,7 @@ static void pxa2xx_lcdc_write(void *opaque, hwaddr offset, case OVL2C1: if (!(s->ovl2c[0] & OVLC1_EN) && (value & OVLC1_EN)) - printf("%s: Overlay 2 not supported\n", __FUNCTION__); + printf("%s: Overlay 2 not supported\n", __func__); s->ovl2c[0] = value & 0x80ffffff; s->dma_ch[2].up = !!(value & OVLC1_EN); @@ -486,7 +486,7 @@ static void pxa2xx_lcdc_write(void *opaque, hwaddr offset, case CCR: if (!(s->ccr & CCR_CEN) && (value & CCR_CEN)) - printf("%s: Hardware cursor unimplemented\n", __FUNCTION__); + printf("%s: Hardware cursor unimplemented\n", __func__); s->ccr = value & 0x81ffffe7; s->dma_ch[5].up = !!(value & CCR_CEN); @@ -560,7 +560,7 @@ static void pxa2xx_lcdc_write(void *opaque, hwaddr offset, default: fail: - hw_error("%s: Bad offset " REG_FMT "\n", __FUNCTION__, offset); + hw_error("%s: Bad offset " REG_FMT "\n", __func__, offset); } } @@ -1050,7 +1050,7 @@ PXA2xxLCDState *pxa2xx_lcdc_init(MemoryRegion *sysmem, s->dest_width = 4; break; default: - fprintf(stderr, "%s: Bad color depth\n", __FUNCTION__); + fprintf(stderr, "%s: Bad color depth\n", __func__); exit(1); } diff --git a/hw/display/qxl-render.c b/hw/display/qxl-render.c index 90e0865618..e7ac4f8789 100644 --- a/hw/display/qxl-render.c +++ b/hw/display/qxl-render.c @@ -78,7 +78,7 @@ void qxl_render_resize(PCIQXLDevice *qxl) qxl->guest_primary.bits_pp = 32; break; default: - fprintf(stderr, "%s: unhandled format: %x\n", __FUNCTION__, + fprintf(stderr, "%s: unhandled format: %x\n", __func__, qxl->guest_primary.surface.format); qxl->guest_primary.bytes_pp = 4; qxl->guest_primary.bits_pp = 32; @@ -248,7 +248,7 @@ static QEMUCursor *qxl_cursor(PCIQXLDevice *qxl, QXLCursor *cursor, break; default: fprintf(stderr, "%s: not implemented: type %d\n", - __FUNCTION__, cursor->header.type); + __func__, cursor->header.type); goto fail; } return c; @@ -275,7 +275,7 @@ int qxl_render_cursor(PCIQXLDevice *qxl, QXLCommandExt *ext) } if (qxl->debug > 1 && cmd->type != QXL_CURSOR_MOVE) { - fprintf(stderr, "%s", __FUNCTION__); + fprintf(stderr, "%s", __func__); qxl_log_cmd_cursor(qxl, cmd, ext->group_id); fprintf(stderr, "\n"); } diff --git a/hw/display/qxl.h b/hw/display/qxl.h index f6556adb73..7d1b60014a 100644 --- a/hw/display/qxl.h +++ b/hw/display/qxl.h @@ -133,7 +133,7 @@ typedef struct PCIQXLDevice { #define PCI_QXL(obj) OBJECT_CHECK(PCIQXLDevice, (obj), TYPE_PCI_QXL) #define PANIC_ON(x) if ((x)) { \ - printf("%s: PANIC %s failed\n", __FUNCTION__, #x); \ + printf("%s: PANIC %s failed\n", __func__, #x); \ abort(); \ } diff --git a/hw/display/tc6393xb.c b/hw/display/tc6393xb.c index 74d10af3d4..79f161740a 100644 --- a/hw/display/tc6393xb.c +++ b/hw/display/tc6393xb.c @@ -148,7 +148,7 @@ static void tc6393xb_gpio_set(void *opaque, int line, int level) // TC6393xbState *s = opaque; if (line > TC6393XB_GPIOS) { - printf("%s: No GPIO pin %i\n", __FUNCTION__, line); + printf("%s: No GPIO pin %i\n", __func__, line); return; } diff --git a/hw/display/xenfb.c b/hw/display/xenfb.c index 8e2547ac05..30cd415330 100644 --- a/hw/display/xenfb.c +++ b/hw/display/xenfb.c @@ -644,7 +644,7 @@ static void xenfb_guest_copy(struct XenFB *xenfb, int x, int y, int w, int h) } if (oops) /* should not happen */ xen_pv_printf(&xenfb->c.xendev, 0, "%s: oops: convert %d -> %d bpp?\n", - __FUNCTION__, xenfb->depth, bpp); + __func__, xenfb->depth, bpp); dpy_gfx_update(xenfb->con, x, y, w, h); } diff --git a/hw/dma/omap_dma.c b/hw/dma/omap_dma.c index 45dfe7aadd..abd18c67ea 100644 --- a/hw/dma/omap_dma.c +++ b/hw/dma/omap_dma.c @@ -161,7 +161,7 @@ static void omap_dma_channel_load(struct omap_dma_channel_s *ch) a->pck_element = 0; if (unlikely(!ch->elements || !ch->frames)) { - printf("%s: bad DMA request\n", __FUNCTION__); + printf("%s: bad DMA request\n", __func__); return; } @@ -519,7 +519,7 @@ static void omap_dma_transfer_setup(struct soc_dma_ch_s *dma) continue; #endif printf("%s: Bus time-out in DMA%i operation\n", - __FUNCTION__, dma->num); + __func__, dma->num); } min_elems = INT_MAX; @@ -879,14 +879,14 @@ static int omap_dma_ch_reg_write(struct omap_dma_s *s, ch->pack[0] = (value & 0x0040) >> 6; ch->port[0] = (enum omap_dma_port) ((value & 0x003c) >> 2); if (ch->port[0] >= __omap_dma_port_last) - printf("%s: invalid DMA port %i\n", __FUNCTION__, + printf("%s: invalid DMA port %i\n", __func__, ch->port[0]); if (ch->port[1] >= __omap_dma_port_last) - printf("%s: invalid DMA port %i\n", __FUNCTION__, + printf("%s: invalid DMA port %i\n", __func__, ch->port[1]); ch->data_type = 1 << (value & 3); if ((value & 3) == 3) { - printf("%s: bad data_type for DMA channel\n", __FUNCTION__); + printf("%s: bad data_type for DMA channel\n", __func__); ch->data_type >>= 1; } break; @@ -1440,7 +1440,7 @@ static int omap_dma_sys_read(struct omap_dma_s *s, int offset, case 0x482: /* DMA_PCh1_SR */ case 0x4c0: /* DMA_PChD_SR_0 */ printf("%s: Physical Channel Status Registers not implemented.\n", - __FUNCTION__); + __func__); *ret = 0xff; break; @@ -1898,13 +1898,13 @@ static void omap_dma4_write(void *opaque, hwaddr addr, omap_dma_reset(s->dma); s->ocp = value & 0x3321; if (((s->ocp >> 12) & 3) == 3) /* MIDLEMODE */ - fprintf(stderr, "%s: invalid DMA power mode\n", __FUNCTION__); + fprintf(stderr, "%s: invalid DMA power mode\n", __func__); return; case 0x78: /* DMA4_GCR */ s->gcr = value & 0x00ff00ff; if ((value & 0xff) == 0x00) /* MAX_CHANNEL_FIFO_DEPTH */ - fprintf(stderr, "%s: wrong FIFO depth in GCR\n", __FUNCTION__); + fprintf(stderr, "%s: wrong FIFO depth in GCR\n", __func__); return; case 0x80 ... 0xfff: @@ -1935,7 +1935,7 @@ static void omap_dma4_write(void *opaque, hwaddr addr, ch->src_sync = (value >> 24) & 1; /* XXX For CamDMA must be 1 */ if (ch->buf_disable && !ch->src_sync) fprintf(stderr, "%s: Buffering disable is not allowed in " - "destination synchronised mode\n", __FUNCTION__); + "destination synchronised mode\n", __func__); ch->prefetch = (value >> 23) & 1; ch->bs = (value >> 18) & 1; ch->transparent_copy = (value >> 17) & 1; @@ -1947,7 +1947,7 @@ static void omap_dma4_write(void *opaque, hwaddr addr, ch->fs = (value & 0x0020) >> 5; if (ch->fs && ch->bs && ch->mode[0] && ch->mode[1]) fprintf(stderr, "%s: For a packet transfer at least one port " - "must be constant-addressed\n", __FUNCTION__); + "must be constant-addressed\n", __func__); ch->sync = (value & 0x001f) | ((value >> 14) & 0x0060); /* XXX must be 0x01 for CamDMA */ @@ -1978,7 +1978,7 @@ static void omap_dma4_write(void *opaque, hwaddr addr, ch->endian_lock[1] =(value >> 18) & 1; if (ch->endian[0] != ch->endian[1]) fprintf(stderr, "%s: DMA endianness conversion enable attempt\n", - __FUNCTION__); + __func__); ch->write_mode = (value >> 16) & 3; ch->burst[1] = (value & 0xc000) >> 14; ch->pack[1] = (value & 0x2000) >> 13; @@ -1988,10 +1988,10 @@ static void omap_dma4_write(void *opaque, hwaddr addr, ch->translate[0] = (value & 0x003c) >> 2; if (ch->translate[0] | ch->translate[1]) fprintf(stderr, "%s: bad MReqAddressTranslate sideband signal\n", - __FUNCTION__); + __func__); ch->data_type = 1 << (value & 3); if ((value & 3) == 3) { - printf("%s: bad data_type for DMA channel\n", __FUNCTION__); + printf("%s: bad data_type for DMA channel\n", __func__); ch->data_type >>= 1; } break; diff --git a/hw/dma/pxa2xx_dma.c b/hw/dma/pxa2xx_dma.c index 634a4328f0..f4eb26cf17 100644 --- a/hw/dma/pxa2xx_dma.c +++ b/hw/dma/pxa2xx_dma.c @@ -169,7 +169,7 @@ static inline void pxa2xx_dma_descriptor_fetch( s->chan[ch].dest &= ~3; if (s->chan[ch].cmd & (DCMD_CMPEN | DCMD_FLYBYS | DCMD_FLYBYT)) - printf("%s: unsupported mode in channel %i\n", __FUNCTION__, ch); + printf("%s: unsupported mode in channel %i\n", __func__, ch); if (s->chan[ch].cmd & DCMD_STARTIRQEN) s->chan[ch].state |= DCSR_STARTINTR; @@ -264,7 +264,7 @@ static uint64_t pxa2xx_dma_read(void *opaque, hwaddr offset, unsigned int channel; if (size != 4) { - hw_error("%s: Bad access width\n", __FUNCTION__); + hw_error("%s: Bad access width\n", __func__); return 5; } @@ -312,7 +312,7 @@ static uint64_t pxa2xx_dma_read(void *opaque, hwaddr offset, } } - hw_error("%s: Bad offset 0x" TARGET_FMT_plx "\n", __FUNCTION__, offset); + hw_error("%s: Bad offset 0x" TARGET_FMT_plx "\n", __func__, offset); return 7; } @@ -323,7 +323,7 @@ static void pxa2xx_dma_write(void *opaque, hwaddr offset, unsigned int channel; if (size != 4) { - hw_error("%s: Bad access width\n", __FUNCTION__); + hw_error("%s: Bad access width\n", __func__); return; } @@ -337,7 +337,7 @@ static void pxa2xx_dma_write(void *opaque, hwaddr offset, if (value & DRCMR_MAPVLD) if ((value & DRCMR_CHLNUM) > s->channels) hw_error("%s: Bad DMA channel %i\n", - __FUNCTION__, (unsigned)value & DRCMR_CHLNUM); + __func__, (unsigned)value & DRCMR_CHLNUM); s->req[channel] = value; break; @@ -416,7 +416,7 @@ static void pxa2xx_dma_write(void *opaque, hwaddr offset, break; } fail: - hw_error("%s: Bad offset " TARGET_FMT_plx "\n", __FUNCTION__, offset); + hw_error("%s: Bad offset " TARGET_FMT_plx "\n", __func__, offset); } } @@ -431,7 +431,7 @@ static void pxa2xx_dma_request(void *opaque, int req_num, int on) PXA2xxDMAState *s = opaque; int ch; if (req_num < 0 || req_num >= PXA2XX_DMA_NUM_REQUESTS) - hw_error("%s: Bad DMA request %i\n", __FUNCTION__, req_num); + hw_error("%s: Bad DMA request %i\n", __func__, req_num); if (!(s->req[req_num] & DRCMR_MAPVLD)) return; diff --git a/hw/gpio/max7310.c b/hw/gpio/max7310.c index f82e3e6555..4c203ef5c6 100644 --- a/hw/gpio/max7310.c +++ b/hw/gpio/max7310.c @@ -67,7 +67,7 @@ static int max7310_rx(I2CSlave *i2c) default: #ifdef VERBOSE - printf("%s: unknown register %02x\n", __FUNCTION__, s->command); + printf("%s: unknown register %02x\n", __func__, s->command); #endif break; } @@ -82,7 +82,7 @@ static int max7310_tx(I2CSlave *i2c, uint8_t data) if (s->len ++ > 1) { #ifdef VERBOSE - printf("%s: message too long (%i bytes)\n", __FUNCTION__, s->len); + printf("%s: message too long (%i bytes)\n", __func__, s->len); #endif return 1; } @@ -121,7 +121,7 @@ static int max7310_tx(I2CSlave *i2c, uint8_t data) break; default: #ifdef VERBOSE - printf("%s: unknown register %02x\n", __FUNCTION__, s->command); + printf("%s: unknown register %02x\n", __func__, s->command); #endif return 1; } @@ -141,7 +141,7 @@ static int max7310_event(I2CSlave *i2c, enum i2c_event event) case I2C_FINISH: #ifdef VERBOSE if (s->len == 1) - printf("%s: message too short (%i bytes)\n", __FUNCTION__, s->len); + printf("%s: message too short (%i bytes)\n", __func__, s->len); #endif break; default: diff --git a/hw/gpio/omap_gpio.c b/hw/gpio/omap_gpio.c index 17891e2d0f..08472193b5 100644 --- a/hw/gpio/omap_gpio.c +++ b/hw/gpio/omap_gpio.c @@ -399,7 +399,7 @@ static void omap2_gpio_module_write(void *opaque, hwaddr addr, case 0x10: /* GPIO_SYSCONFIG */ if (((value >> 3) & 3) == 3) - fprintf(stderr, "%s: bad IDLEMODE value\n", __FUNCTION__); + fprintf(stderr, "%s: bad IDLEMODE value\n", __func__); if (value & 2) omap2_gpio_module_reset(s); s->config[0] = value & 0x1d; diff --git a/hw/i2c/omap_i2c.c b/hw/i2c/omap_i2c.c index 12264ee0f5..26e3e5ebf6 100644 --- a/hw/i2c/omap_i2c.c +++ b/hw/i2c/omap_i2c.c @@ -341,12 +341,12 @@ static void omap_i2c_write(void *opaque, hwaddr addr, } if ((value & (1 << 15)) && !(value & (1 << 10))) { /* MST */ fprintf(stderr, "%s: I^2C slave mode not supported\n", - __FUNCTION__); + __func__); break; } if ((value & (1 << 15)) && value & (1 << 8)) { /* XA */ fprintf(stderr, "%s: 10-bit addressing mode not supported\n", - __FUNCTION__); + __func__); break; } if ((value & (1 << 15)) && value & (1 << 0)) { /* STT */ @@ -393,7 +393,7 @@ static void omap_i2c_write(void *opaque, hwaddr addr, omap_i2c_interrupts_update(s); } if (value & (1 << 15)) /* ST_EN */ - fprintf(stderr, "%s: System Test not supported\n", __FUNCTION__); + fprintf(stderr, "%s: System Test not supported\n", __func__); break; default: diff --git a/hw/ide/ahci.c b/hw/ide/ahci.c index 32d1296a64..c25e293d88 100644 --- a/hw/ide/ahci.c +++ b/hw/ide/ahci.c @@ -1053,7 +1053,7 @@ static void process_ncq_command(AHCIState *s, int port, uint8_t *cmd_fis, g_assert(is_ncq(ncq_fis->command)); if (ncq_tfs->used) { /* error - already in use */ - fprintf(stderr, "%s: tag %d already used\n", __FUNCTION__, tag); + fprintf(stderr, "%s: tag %d already used\n", __func__, tag); return; } diff --git a/hw/ide/microdrive.c b/hw/ide/microdrive.c index 17917c0b30..3090254783 100644 --- a/hw/ide/microdrive.c +++ b/hw/ide/microdrive.c @@ -156,7 +156,7 @@ static uint8_t md_attr_read(PCMCIACardState *card, uint32_t at) return 0x00; #ifdef VERBOSE default: - printf("%s: Bad attribute space register %02x\n", __FUNCTION__, at); + printf("%s: Bad attribute space register %02x\n", __func__, at); #endif } @@ -193,7 +193,7 @@ static void md_attr_write(PCMCIACardState *card, uint32_t at, uint8_t value) case 0x06: /* Socket and Copy Register */ break; default: - printf("%s: Bad attribute space register %02x\n", __FUNCTION__, at); + printf("%s: Bad attribute space register %02x\n", __func__, at); } } diff --git a/hw/input/lm832x.c b/hw/input/lm832x.c index 2340523da0..d39953126b 100644 --- a/hw/input/lm832x.c +++ b/hw/input/lm832x.c @@ -239,7 +239,7 @@ static uint8_t lm_kbd_read(LM823KbdState *s, int reg, int byte) default: lm_kbd_error(s, ERR_CMDUNK); - fprintf(stderr, "%s: unknown command %02x\n", __FUNCTION__, reg); + fprintf(stderr, "%s: unknown command %02x\n", __func__, reg); return 0x00; } @@ -331,7 +331,7 @@ static void lm_kbd_write(LM823KbdState *s, int reg, int byte, uint8_t value) if ((value & 3) && (value & 3) != 3) { lm_kbd_error(s, ERR_BADPAR); fprintf(stderr, "%s: invalid clock setting in RCPWM\n", - __FUNCTION__); + __func__); } /* TODO: Validate that the command is only issued once */ break; @@ -378,7 +378,7 @@ static void lm_kbd_write(LM823KbdState *s, int reg, int byte, uint8_t value) break; default: lm_kbd_error(s, ERR_CMDUNK); - fprintf(stderr, "%s: unknown command %02x\n", __FUNCTION__, reg); + fprintf(stderr, "%s: unknown command %02x\n", __func__, reg); break; } } diff --git a/hw/input/pxa2xx_keypad.c b/hw/input/pxa2xx_keypad.c index 2b70bbb95c..93db9ed25b 100644 --- a/hw/input/pxa2xx_keypad.c +++ b/hw/input/pxa2xx_keypad.c @@ -231,7 +231,7 @@ static uint64_t pxa2xx_keypad_read(void *opaque, hwaddr offset, return s->kpkdi; break; default: - hw_error("%s: Bad offset " REG_FMT "\n", __FUNCTION__, offset); + hw_error("%s: Bad offset " REG_FMT "\n", __func__, offset); } return 0; @@ -278,7 +278,7 @@ static void pxa2xx_keypad_write(void *opaque, hwaddr offset, break; default: - hw_error("%s: Bad offset " REG_FMT "\n", __FUNCTION__, offset); + hw_error("%s: Bad offset " REG_FMT "\n", __func__, offset); } } @@ -326,7 +326,7 @@ void pxa27x_register_keypad(PXA2xxKeyPadState *kp, const struct keymap *map, int size) { if(!map || size < 0x80) { - fprintf(stderr, "%s - No PXA keypad map defined\n", __FUNCTION__); + fprintf(stderr, "%s - No PXA keypad map defined\n", __func__); exit(-1); } diff --git a/hw/input/tsc2005.c b/hw/input/tsc2005.c index eb5320af40..7990954b6c 100644 --- a/hw/input/tsc2005.c +++ b/hw/input/tsc2005.c @@ -201,7 +201,7 @@ static void tsc2005_write(TSC2005State *s, int reg, uint16_t data) if (s->enabled != !(data & 0x4000)) { s->enabled = !(data & 0x4000); fprintf(stderr, "%s: touchscreen sense %sabled\n", - __FUNCTION__, s->enabled ? "en" : "dis"); + __func__, s->enabled ? "en" : "dis"); if (s->busy && !s->enabled) timer_del(s->timer); s->busy = s->busy && s->enabled; @@ -210,7 +210,7 @@ static void tsc2005_write(TSC2005State *s, int reg, uint16_t data) s->timing[0] = data & 0x1fff; if ((s->timing[0] >> 11) == 3) fprintf(stderr, "%s: illegal conversion clock setting\n", - __FUNCTION__); + __func__); break; case 0xd: /* CFR1 */ s->timing[1] = data & 0xf07; @@ -222,7 +222,7 @@ static void tsc2005_write(TSC2005State *s, int reg, uint16_t data) default: fprintf(stderr, "%s: write into read-only register %x\n", - __FUNCTION__, reg); + __func__, reg); } } @@ -338,7 +338,7 @@ static uint8_t tsc2005_txrx_word(void *opaque, uint8_t value) if (s->enabled != !(value & 1)) { s->enabled = !(value & 1); fprintf(stderr, "%s: touchscreen sense %sabled\n", - __FUNCTION__, s->enabled ? "en" : "dis"); + __func__, s->enabled ? "en" : "dis"); if (s->busy && !s->enabled) timer_del(s->timer); s->busy = s->busy && s->enabled; diff --git a/hw/input/tsc210x.c b/hw/input/tsc210x.c index 75ac8c2ab5..1cad57f644 100644 --- a/hw/input/tsc210x.c +++ b/hw/input/tsc210x.c @@ -287,7 +287,7 @@ static void tsc2102_audio_rate_update(TSC210xState *s) rate->fsref == ((s->audio_ctrl3 >> 13) & 1))/* REFFS */ break; if (!rate->rate) { - printf("%s: unknown sampling rate configured\n", __FUNCTION__); + printf("%s: unknown sampling rate configured\n", __func__); return; } @@ -913,7 +913,7 @@ uint32_t tsc210x_txrx(void *opaque, uint32_t value, int len) uint32_t ret = 0; if (len != 16) - hw_error("%s: FIXME: bad SPI word width %i\n", __FUNCTION__, len); + hw_error("%s: FIXME: bad SPI word width %i\n", __func__, len); /* TODO: sequential reads etc - how do we make sure the host doesn't * unintentionally read out a conversion result from a register while diff --git a/hw/intc/omap_intc.c b/hw/intc/omap_intc.c index ccdda89dab..6844c1aa83 100644 --- a/hw/intc/omap_intc.c +++ b/hw/intc/omap_intc.c @@ -540,7 +540,7 @@ static void omap2_inth_write(void *opaque, hwaddr addr, * for every register, see Chapter 3 and 4 for privileged mode. */ if (value & 1) fprintf(stderr, "%s: protection mode enable attempt\n", - __FUNCTION__); + __func__); return; case 0x50: /* INTC_IDLE */ diff --git a/hw/isa/vt82c686.c b/hw/isa/vt82c686.c index c129985e2a..1c728cd24b 100644 --- a/hw/isa/vt82c686.c +++ b/hw/isa/vt82c686.c @@ -30,7 +30,7 @@ //#define DEBUG_VT82C686B #ifdef DEBUG_VT82C686B -#define DPRINTF(fmt, ...) fprintf(stderr, "%s: " fmt, __FUNCTION__, ##__VA_ARGS__) +#define DPRINTF(fmt, ...) fprintf(stderr, "%s: " fmt, __func__, ##__VA_ARGS__) #else #define DPRINTF(fmt, ...) #endif diff --git a/hw/mips/gt64xxx_pci.c b/hw/mips/gt64xxx_pci.c index 5a9dad9aae..e12336d14a 100644 --- a/hw/mips/gt64xxx_pci.c +++ b/hw/mips/gt64xxx_pci.c @@ -33,7 +33,7 @@ //#define DEBUG #ifdef DEBUG -#define DPRINTF(fmt, ...) fprintf(stderr, "%s: " fmt, __FUNCTION__, ##__VA_ARGS__) +#define DPRINTF(fmt, ...) fprintf(stderr, "%s: " fmt, __func__, ##__VA_ARGS__) #else #define DPRINTF(fmt, ...) #endif diff --git a/hw/misc/cbus.c b/hw/misc/cbus.c index 677274ce3e..25e337ea77 100644 --- a/hw/misc/cbus.c +++ b/hw/misc/cbus.c @@ -62,7 +62,7 @@ static void cbus_io(CBusPriv *s) s->slave[s->addr]->io(s->slave[s->addr]->opaque, s->rw, s->reg, &s->val); else - hw_error("%s: bad slave address %i\n", __FUNCTION__, s->addr); + hw_error("%s: bad slave address %i\n", __func__, s->addr); } static void cbus_cycle(CBusPriv *s) @@ -299,7 +299,7 @@ static inline uint16_t retu_read(CBusRetu *s, int reg) return 0x0000; default: - hw_error("%s: bad register %02x\n", __FUNCTION__, reg); + hw_error("%s: bad register %02x\n", __func__, reg); } } @@ -372,7 +372,7 @@ static inline void retu_write(CBusRetu *s, int reg, uint16_t val) break; default: - hw_error("%s: bad register %02x\n", __FUNCTION__, reg); + hw_error("%s: bad register %02x\n", __func__, reg); } } @@ -538,7 +538,7 @@ static inline uint16_t tahvo_read(CBusTahvo *s, int reg) return 0x0000; default: - hw_error("%s: bad register %02x\n", __FUNCTION__, reg); + hw_error("%s: bad register %02x\n", __func__, reg); } } @@ -567,7 +567,7 @@ static inline void tahvo_write(CBusTahvo *s, int reg, uint16_t val) if (s->backlight != (val & 0x7f)) { s->backlight = val & 0x7f; printf("%s: LCD backlight now at %i / 127\n", - __FUNCTION__, s->backlight); + __func__, s->backlight); } break; @@ -588,7 +588,7 @@ static inline void tahvo_write(CBusTahvo *s, int reg, uint16_t val) break; default: - hw_error("%s: bad register %02x\n", __FUNCTION__, reg); + hw_error("%s: bad register %02x\n", __func__, reg); } } diff --git a/hw/misc/omap_clk.c b/hw/misc/omap_clk.c index 19151d07d6..9ea14186d4 100644 --- a/hw/misc/omap_clk.c +++ b/hw/misc/omap_clk.c @@ -1109,7 +1109,7 @@ struct clk *omap_findclk(struct omap_mpu_state_s *mpu, const char *name) for (i = mpu->clks; i->name; i ++) if (!strcmp(i->name, name) || (i->alias && !strcmp(i->alias, name))) return i; - hw_error("%s: %s not found\n", __FUNCTION__, name); + hw_error("%s: %s not found\n", __func__, name); } void omap_clk_get(struct clk *clk) @@ -1120,7 +1120,7 @@ void omap_clk_get(struct clk *clk) void omap_clk_put(struct clk *clk) { if (!(clk->usecount --)) - hw_error("%s: %s is not in use\n", __FUNCTION__, clk->name); + hw_error("%s: %s is not in use\n", __func__, clk->name); } static void omap_clk_update(struct clk *clk) diff --git a/hw/misc/omap_gpmc.c b/hw/misc/omap_gpmc.c index 67d8e2f023..84f9e4c612 100644 --- a/hw/misc/omap_gpmc.c +++ b/hw/misc/omap_gpmc.c @@ -643,7 +643,7 @@ static void omap_gpmc_write(void *opaque, hwaddr addr, case 0x010: /* GPMC_SYSCONFIG */ if ((value >> 3) == 0x3) fprintf(stderr, "%s: bad SDRAM idle mode %"PRIi64"\n", - __FUNCTION__, value >> 3); + __func__, value >> 3); if (value & 2) omap_gpmc_reset(s); s->sysconfig = value & 0x19; @@ -806,7 +806,7 @@ static void omap_gpmc_write(void *opaque, hwaddr addr, break; case 0x230: /* GPMC_TESTMODE_CTRL */ if (value & 7) - fprintf(stderr, "%s: test mode enable attempt\n", __FUNCTION__); + fprintf(stderr, "%s: test mode enable attempt\n", __func__); break; default: @@ -864,7 +864,7 @@ void omap_gpmc_attach(struct omap_gpmc_s *s, int cs, MemoryRegion *iomem) assert(iomem); if (cs < 0 || cs >= 8) { - fprintf(stderr, "%s: bad chip-select %i\n", __FUNCTION__, cs); + fprintf(stderr, "%s: bad chip-select %i\n", __func__, cs); exit(-1); } f = &s->cs_file[cs]; diff --git a/hw/misc/omap_l4.c b/hw/misc/omap_l4.c index 88c533a0fe..96fc057b4e 100644 --- a/hw/misc/omap_l4.c +++ b/hw/misc/omap_l4.c @@ -126,7 +126,7 @@ struct omap_target_agent_s *omap_l4ta_get(struct omap_l4_s *bus, break; } if (!ta) { - fprintf(stderr, "%s: bad target agent (%i)\n", __FUNCTION__, cs); + fprintf(stderr, "%s: bad target agent (%i)\n", __func__, cs); exit(-1); } @@ -151,7 +151,7 @@ hwaddr omap_l4_attach(struct omap_target_agent_s *ta, hwaddr base; if (region < 0 || region >= ta->regions) { - fprintf(stderr, "%s: bad io region (%i)\n", __FUNCTION__, region); + fprintf(stderr, "%s: bad io region (%i)\n", __func__, region); exit(-1); } diff --git a/hw/misc/omap_sdrc.c b/hw/misc/omap_sdrc.c index dff37ecaf9..7b38c5568c 100644 --- a/hw/misc/omap_sdrc.c +++ b/hw/misc/omap_sdrc.c @@ -109,7 +109,7 @@ static void omap_sdrc_write(void *opaque, hwaddr addr, case 0x10: /* SDRC_SYSCONFIG */ if ((value >> 3) != 0x2) fprintf(stderr, "%s: bad SDRAM idle mode %i\n", - __FUNCTION__, (unsigned)value >> 3); + __func__, (unsigned)value >> 3); if (value & 2) omap_sdrc_reset(s); s->config = value & 0x18; diff --git a/hw/misc/omap_tap.c b/hw/misc/omap_tap.c index e6ea8ee235..3f595e8df7 100644 --- a/hw/misc/omap_tap.c +++ b/hw/misc/omap_tap.c @@ -44,7 +44,7 @@ static uint64_t omap_tap_read(void *opaque, hwaddr addr, case omap3430: return 0x1b7ae02f; /* ES 2 */ default: - hw_error("%s: Bad mpu model\n", __FUNCTION__); + hw_error("%s: Bad mpu model\n", __func__); } case 0x208: /* PRODUCTION_ID_reg for OMAP2 */ @@ -61,7 +61,7 @@ static uint64_t omap_tap_read(void *opaque, hwaddr addr, case omap3430: return 0x000000f0; default: - hw_error("%s: Bad mpu model\n", __FUNCTION__); + hw_error("%s: Bad mpu model\n", __func__); } case 0x20c: @@ -75,7 +75,7 @@ static uint64_t omap_tap_read(void *opaque, hwaddr addr, case omap3430: return 0xcafeb7ae; /* ES 2 */ default: - hw_error("%s: Bad mpu model\n", __FUNCTION__); + hw_error("%s: Bad mpu model\n", __func__); } case 0x218: /* DIE_ID_reg */ diff --git a/hw/misc/tmp105.c b/hw/misc/tmp105.c index 04e83787d4..9e22d64e36 100644 --- a/hw/misc/tmp105.c +++ b/hw/misc/tmp105.c @@ -131,7 +131,7 @@ static void tmp105_write(TMP105State *s) case TMP105_REG_CONFIG: if (s->buf[0] & ~s->config & (1 << 0)) /* SD */ - printf("%s: TMP105 shutdown\n", __FUNCTION__); + printf("%s: TMP105 shutdown\n", __func__); s->config = s->buf[0]; s->faults = tmp105_faultq[(s->config >> 3) & 3]; /* F */ tmp105_alarm_update(s); diff --git a/hw/pci-host/bonito.c b/hw/pci-host/bonito.c index 9f61e27edc..2ebeab5d90 100644 --- a/hw/pci-host/bonito.c +++ b/hw/pci-host/bonito.c @@ -50,7 +50,7 @@ //#define DEBUG_BONITO #ifdef DEBUG_BONITO -#define DPRINTF(fmt, ...) fprintf(stderr, "%s: " fmt, __FUNCTION__, ##__VA_ARGS__) +#define DPRINTF(fmt, ...) fprintf(stderr, "%s: " fmt, __func__, ##__VA_ARGS__) #else #define DPRINTF(fmt, ...) #endif diff --git a/hw/sd/pxa2xx_mmci.c b/hw/sd/pxa2xx_mmci.c index 3deccf02c9..0d4b88c609 100644 --- a/hw/sd/pxa2xx_mmci.c +++ b/hw/sd/pxa2xx_mmci.c @@ -330,7 +330,7 @@ static uint64_t pxa2xx_mmci_read(void *opaque, hwaddr offset, unsigned size) case MMC_BLKS_REM: return s->numblk; default: - hw_error("%s: Bad offset " REG_FMT "\n", __FUNCTION__, offset); + hw_error("%s: Bad offset " REG_FMT "\n", __func__, offset); } return 0; @@ -369,7 +369,7 @@ static void pxa2xx_mmci_write(void *opaque, case MMC_SPI: s->spi = value & 0xf; if (value & SPI_SPI_MODE) - printf("%s: attempted to use card in SPI mode\n", __FUNCTION__); + printf("%s: attempted to use card in SPI mode\n", __func__); break; case MMC_CMDAT: @@ -442,7 +442,7 @@ static void pxa2xx_mmci_write(void *opaque, break; default: - hw_error("%s: Bad offset " REG_FMT "\n", __FUNCTION__, offset); + hw_error("%s: Bad offset " REG_FMT "\n", __func__, offset); } } diff --git a/hw/ssi/omap_spi.c b/hw/ssi/omap_spi.c index 22034656b8..34163e5646 100644 --- a/hw/ssi/omap_spi.c +++ b/hw/ssi/omap_spi.c @@ -295,10 +295,10 @@ static void omap_mcspi_write(void *opaque, hwaddr addr, if ((value ^ s->ch[ch].config) & (3 << 14)) /* DMAR | DMAW */ omap_mcspi_dmarequest_update(s->ch + ch); if (((value >> 12) & 3) == 3) /* TRM */ - fprintf(stderr, "%s: invalid TRM value (3)\n", __FUNCTION__); + fprintf(stderr, "%s: invalid TRM value (3)\n", __func__); if (((value >> 7) & 0x1f) < 3) /* WL */ fprintf(stderr, "%s: invalid WL value (%" PRIx64 ")\n", - __FUNCTION__, (value >> 7) & 0x1f); + __func__, (value >> 7) & 0x1f); s->ch[ch].config = value & 0x7fffff; break; @@ -367,7 +367,7 @@ void omap_mcspi_attach(struct omap_mcspi_s *s, int chipselect) { if (chipselect < 0 || chipselect >= s->chnum) - hw_error("%s: Bad chipselect %i\n", __FUNCTION__, chipselect); + hw_error("%s: Bad chipselect %i\n", __func__, chipselect); s->ch[chipselect].txrx = txrx; s->ch[chipselect].opaque = opaque; diff --git a/hw/timer/omap_gptimer.c b/hw/timer/omap_gptimer.c index 6d7c8a396f..ae2dc99832 100644 --- a/hw/timer/omap_gptimer.c +++ b/hw/timer/omap_gptimer.c @@ -357,7 +357,7 @@ static void omap_gp_timer_write(void *opaque, hwaddr addr, s->config = value & 0x33d; if (((value >> 3) & 3) == 3) /* IDLEMODE */ fprintf(stderr, "%s: illegal IDLEMODE value in TIOCP_CFG\n", - __FUNCTION__); + __func__); if (value & 2) /* SOFTRESET */ omap_gp_timer_reset(s); break; @@ -395,10 +395,10 @@ static void omap_gp_timer_write(void *opaque, hwaddr addr, s->st = (value >> 0) & 1; if (s->inout && s->trigger != gpt_trigger_none) fprintf(stderr, "%s: GP timer pin must be an output " - "for this trigger mode\n", __FUNCTION__); + "for this trigger mode\n", __func__); if (!s->inout && s->capture != gpt_capture_none) fprintf(stderr, "%s: GP timer pin must be an input " - "for this capture mode\n", __FUNCTION__); + "for this capture mode\n", __func__); if (s->trigger == gpt_trigger_none) omap_gp_timer_out(s, s->scpwm); /* TODO: make sure this doesn't overflow 32-bits */ diff --git a/hw/timer/twl92230.c b/hw/timer/twl92230.c index eb58c378e0..ef116c636c 100644 --- a/hw/timer/twl92230.c +++ b/hw/timer/twl92230.c @@ -403,7 +403,7 @@ static uint8_t menelaus_read(void *opaque, uint8_t addr) default: #ifdef VERBOSE - printf("%s: unknown register %02x\n", __FUNCTION__, addr); + printf("%s: unknown register %02x\n", __func__, addr); #endif break; } @@ -615,7 +615,7 @@ static void menelaus_write(void *opaque, uint8_t addr, uint8_t value) rtc_badness: default: fprintf(stderr, "%s: bad RTC_UPDATE value %02x\n", - __FUNCTION__, value); + __func__, value); s->status |= 1 << 10; /* RTCERR */ menelaus_update(s); } @@ -708,7 +708,7 @@ static void menelaus_write(void *opaque, uint8_t addr, uint8_t value) default: #ifdef VERBOSE - printf("%s: unknown register %02x\n", __FUNCTION__, addr); + printf("%s: unknown register %02x\n", __func__, addr); #endif } } diff --git a/hw/usb/desc.c b/hw/usb/desc.c index c36bf30e4f..85c15addc5 100644 --- a/hw/usb/desc.c +++ b/hw/usb/desc.c @@ -688,7 +688,7 @@ int usb_desc_get_descriptor(USBDevice *dev, USBPacket *p, break; default: - fprintf(stderr, "%s: %d unknown type %d (len %zd)\n", __FUNCTION__, + fprintf(stderr, "%s: %d unknown type %d (len %zd)\n", __func__, dev->addr, type, len); break; } diff --git a/hw/usb/dev-bluetooth.c b/hw/usb/dev-bluetooth.c index 443e3c301d..0bbceaea0b 100644 --- a/hw/usb/dev-bluetooth.c +++ b/hw/usb/dev-bluetooth.c @@ -274,13 +274,13 @@ static void usb_bt_fifo_enqueue(struct usb_hci_in_fifo_s *fifo, if (off <= DFIFO_LEN_MASK) { if (off + len > DFIFO_LEN_MASK + 1 && (fifo->dsize = off + len) > (DFIFO_LEN_MASK + 1) * 2) { - fprintf(stderr, "%s: can't alloc %i bytes\n", __FUNCTION__, len); + fprintf(stderr, "%s: can't alloc %i bytes\n", __func__, len); exit(-1); } buf = fifo->data + off; } else { if (fifo->dlen > fifo->dsize) { - fprintf(stderr, "%s: can't alloc %i bytes\n", __FUNCTION__, len); + fprintf(stderr, "%s: can't alloc %i bytes\n", __func__, len); exit(-1); } buf = fifo->data + off - fifo->dsize; diff --git a/hw/usb/hcd-musb.c b/hw/usb/hcd-musb.c index 27d9d0bd82..d70a91a58c 100644 --- a/hw/usb/hcd-musb.c +++ b/hw/usb/hcd-musb.c @@ -253,8 +253,8 @@ /* #define MUSB_DEBUG */ #ifdef MUSB_DEBUG -#define TRACE(fmt,...) fprintf(stderr, "%s@%d: " fmt "\n", __FUNCTION__, \ - __LINE__, ##__VA_ARGS__) +#define TRACE(fmt, ...) fprintf(stderr, "%s@%d: " fmt "\n", __func__, \ + __LINE__, ##__VA_ARGS__) #else #define TRACE(...) #endif diff --git a/hw/usb/tusb6010.c b/hw/usb/tusb6010.c index 8f593a6fdb..2662c060ed 100644 --- a/hw/usb/tusb6010.c +++ b/hw/usb/tusb6010.c @@ -296,7 +296,7 @@ static uint32_t tusb_async_readb(void *opaque, hwaddr addr) } printf("%s: unknown register at %03x\n", - __FUNCTION__, (int) (addr & 0xfff)); + __func__, (int) (addr & 0xfff)); return 0; } @@ -313,7 +313,7 @@ static uint32_t tusb_async_readh(void *opaque, hwaddr addr) } printf("%s: unknown register at %03x\n", - __FUNCTION__, (int) (addr & 0xfff)); + __func__, (int) (addr & 0xfff)); return 0; } @@ -436,7 +436,7 @@ static uint32_t tusb_async_readw(void *opaque, hwaddr addr) return 0x54059adf; } - printf("%s: unknown register at %03x\n", __FUNCTION__, offset); + printf("%s: unknown register at %03x\n", __func__, offset); return 0; } @@ -456,7 +456,7 @@ static void tusb_async_writeb(void *opaque, hwaddr addr, default: printf("%s: unknown register at %03x\n", - __FUNCTION__, (int) (addr & 0xfff)); + __func__, (int) (addr & 0xfff)); return; } } @@ -477,7 +477,7 @@ static void tusb_async_writeh(void *opaque, hwaddr addr, default: printf("%s: unknown register at %03x\n", - __FUNCTION__, (int) (addr & 0xfff)); + __func__, (int) (addr & 0xfff)); return; } } @@ -505,7 +505,7 @@ static void tusb_async_writew(void *opaque, hwaddr addr, s->dev_config = value; s->host_mode = (value & TUSB_DEV_CONF_USB_HOST_MODE); if (value & TUSB_DEV_CONF_PROD_TEST_MODE) - hw_error("%s: Product Test mode not allowed\n", __FUNCTION__); + hw_error("%s: Product Test mode not allowed\n", __func__); break; case TUSB_PHY_OTG_CTRL_ENABLE: @@ -636,7 +636,7 @@ static void tusb_async_writew(void *opaque, hwaddr addr, break; default: - printf("%s: unknown register at %03x\n", __FUNCTION__, offset); + printf("%s: unknown register at %03x\n", __func__, offset); return; } } diff --git a/hw/xenpv/xen_domainbuild.c b/hw/xenpv/xen_domainbuild.c index c89ced2e88..027f76fad1 100644 --- a/hw/xenpv/xen_domainbuild.c +++ b/hw/xenpv/xen_domainbuild.c @@ -25,22 +25,22 @@ static int xenstore_domain_mkdir(char *path) int i; if (!xs_mkdir(xenstore, 0, path)) { - fprintf(stderr, "%s: xs_mkdir %s: failed\n", __FUNCTION__, path); + fprintf(stderr, "%s: xs_mkdir %s: failed\n", __func__, path); return -1; } if (!xs_set_permissions(xenstore, 0, path, perms_ro, 2)) { - fprintf(stderr, "%s: xs_set_permissions failed\n", __FUNCTION__); + fprintf(stderr, "%s: xs_set_permissions failed\n", __func__); return -1; } for (i = 0; writable[i]; i++) { snprintf(subpath, sizeof(subpath), "%s/%s", path, writable[i]); if (!xs_mkdir(xenstore, 0, subpath)) { - fprintf(stderr, "%s: xs_mkdir %s: failed\n", __FUNCTION__, subpath); + fprintf(stderr, "%s: xs_mkdir %s: failed\n", __func__, subpath); return -1; } if (!xs_set_permissions(xenstore, 0, subpath, perms_rw, 2)) { - fprintf(stderr, "%s: xs_set_permissions failed\n", __FUNCTION__); + fprintf(stderr, "%s: xs_set_permissions failed\n", __func__); return -1; } } @@ -158,7 +158,7 @@ static int xen_domain_watcher(void) char byte; if (pipe(fd) != 0) { - qemu_log("%s: Huh? pipe error: %s\n", __FUNCTION__, strerror(errno)); + qemu_log("%s: Huh? pipe error: %s\n", __func__, strerror(errno)); return -1; } if (fork() != 0) @@ -190,7 +190,7 @@ static int xen_domain_watcher(void) case -1: if (errno == EINTR) continue; - qemu_log("%s: Huh? read error: %s\n", __FUNCTION__, strerror(errno)); + qemu_log("%s: Huh? read error: %s\n", __func__, strerror(errno)); qemu_running = 0; break; case 0: @@ -198,13 +198,13 @@ static int xen_domain_watcher(void) qemu_running = 0; break; default: - qemu_log("%s: Huh? data on the watch pipe?\n", __FUNCTION__); + qemu_log("%s: Huh? data on the watch pipe?\n", __func__); break; } } /* cleanup */ - qemu_log("%s: destroy domain %d\n", __FUNCTION__, xen_domid); + qemu_log("%s: destroy domain %d\n", __func__, xen_domid); xc_domain_destroy(xen_xc, xen_domid); _exit(0); } diff --git a/hw/xenpv/xen_machine_pv.c b/hw/xenpv/xen_machine_pv.c index 31d2f25627..69a52a9f93 100644 --- a/hw/xenpv/xen_machine_pv.c +++ b/hw/xenpv/xen_machine_pv.c @@ -36,7 +36,7 @@ static void xen_init_pv(MachineState *machine) /* Initialize backend core & drivers */ if (xen_be_init() != 0) { - fprintf(stderr, "%s: xen backend core setup failed\n", __FUNCTION__); + fprintf(stderr, "%s: xen backend core setup failed\n", __func__); exit(1); } diff --git a/include/hw/arm/omap.h b/include/hw/arm/omap.h index cac1b2ba43..b398607b06 100644 --- a/include/hw/arm/omap.h +++ b/include/hw/arm/omap.h @@ -960,10 +960,10 @@ void omap_mpu_wakeup(void *opaque, int irq, int req); # define OMAP_BAD_REG(paddr) \ fprintf(stderr, "%s: Bad register " OMAP_FMT_plx "\n", \ - __FUNCTION__, paddr) + __func__, paddr) # define OMAP_RO_REG(paddr) \ fprintf(stderr, "%s: Read-only register " OMAP_FMT_plx "\n", \ - __FUNCTION__, paddr) + __func__, paddr) /* OMAP-specific Linux bootloader tags for the ATAG_BOARD area (Board-specifc tags are not here) */ @@ -998,13 +998,13 @@ enum { # ifdef TCMI_VERBOSE # define OMAP_8B_REG(paddr) \ fprintf(stderr, "%s: 8-bit register " OMAP_FMT_plx "\n", \ - __FUNCTION__, paddr) + __func__, paddr) # define OMAP_16B_REG(paddr) \ fprintf(stderr, "%s: 16-bit register " OMAP_FMT_plx "\n", \ - __FUNCTION__, paddr) + __func__, paddr) # define OMAP_32B_REG(paddr) \ fprintf(stderr, "%s: 32-bit register " OMAP_FMT_plx "\n", \ - __FUNCTION__, paddr) + __func__, paddr) # else # define OMAP_8B_REG(paddr) # define OMAP_16B_REG(paddr) diff --git a/include/hw/arm/sharpsl.h b/include/hw/arm/sharpsl.h index 13981a6d03..5bf6db1fa2 100644 --- a/include/hw/arm/sharpsl.h +++ b/include/hw/arm/sharpsl.h @@ -7,7 +7,7 @@ #define QEMU_SHARPSL_H #define zaurus_printf(format, ...) \ - fprintf(stderr, "%s: " format, __FUNCTION__, ##__VA_ARGS__) + fprintf(stderr, "%s: " format, __func__, ##__VA_ARGS__) /* zaurus.c */ diff --git a/memory_mapping.c b/memory_mapping.c index a5d38552a6..775466f3a8 100644 --- a/memory_mapping.c +++ b/memory_mapping.c @@ -256,7 +256,7 @@ static void guest_phys_blocks_region_add(MemoryListener *listener, #ifdef DEBUG_GUEST_PHYS_REGION_ADD fprintf(stderr, "%s: target_start=" TARGET_FMT_plx " target_end=" - TARGET_FMT_plx ": %s (count: %u)\n", __FUNCTION__, target_start, + TARGET_FMT_plx ": %s (count: %u)\n", __func__, target_start, target_end, predecessor ? "joined" : "added", g->list->num); #endif } diff --git a/migration/block.c b/migration/block.c index 3282809583..be01e1aec0 100644 --- a/migration/block.c +++ b/migration/block.c @@ -630,7 +630,7 @@ static int flush_blks(QEMUFile *f) int ret = 0; DPRINTF("%s Enter submitted %d read_done %d transferred %d\n", - __FUNCTION__, block_mig_state.submitted, block_mig_state.read_done, + __func__, block_mig_state.submitted, block_mig_state.read_done, block_mig_state.transferred); blk_mig_lock(); @@ -657,7 +657,7 @@ static int flush_blks(QEMUFile *f) } blk_mig_unlock(); - DPRINTF("%s Exit submitted %d read_done %d transferred %d\n", __FUNCTION__, + DPRINTF("%s Exit submitted %d read_done %d transferred %d\n", __func__, block_mig_state.submitted, block_mig_state.read_done, block_mig_state.transferred); return ret; diff --git a/ui/cursor.c b/ui/cursor.c index 2e2fe13fa6..f3da0cee79 100644 --- a/ui/cursor.c +++ b/ui/cursor.c @@ -19,11 +19,11 @@ static QEMUCursor *cursor_parse_xpm(const char *xpm[]) if (sscanf(xpm[line], "%u %u %u %u", &width, &height, &colors, &chars) != 4) { fprintf(stderr, "%s: header parse error: \"%s\"\n", - __FUNCTION__, xpm[line]); + __func__, xpm[line]); return NULL; } if (chars != 1) { - fprintf(stderr, "%s: chars != 1 not supported\n", __FUNCTION__); + fprintf(stderr, "%s: chars != 1 not supported\n", __func__); return NULL; } line++; @@ -41,7 +41,7 @@ static QEMUCursor *cursor_parse_xpm(const char *xpm[]) } } fprintf(stderr, "%s: color parse error: \"%s\"\n", - __FUNCTION__, xpm[line]); + __func__, xpm[line]); return NULL; } diff --git a/ui/spice-display.c b/ui/spice-display.c index 0963c7825f..346fff44f4 100644 --- a/ui/spice-display.c +++ b/ui/spice-display.c @@ -630,13 +630,13 @@ static int interface_req_cursor_notification(QXLInstance *sin) static void interface_notify_update(QXLInstance *sin, uint32_t update_id) { - fprintf(stderr, "%s: abort()\n", __FUNCTION__); + fprintf(stderr, "%s: abort()\n", __func__); abort(); } static int interface_flush_resources(QXLInstance *sin) { - fprintf(stderr, "%s: abort()\n", __FUNCTION__); + fprintf(stderr, "%s: abort()\n", __func__); abort(); return 0; } From patchwork Thu Oct 19 16:15:44 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alistair Francis X-Patchwork-Id: 828195 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; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=xilinx.onmicrosoft.com header.i=@xilinx.onmicrosoft.com header.b="0958Z2Ay"; 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 3yHvNF6Hf6z9t4P for ; Fri, 20 Oct 2017 03:22:37 +1100 (AEDT) Received: from localhost ([::1]:50070 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e5Dad-0005gO-SG for incoming@patchwork.ozlabs.org; Thu, 19 Oct 2017 12:22:35 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:54884) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e5DY4-0003xO-4A for qemu-devel@nongnu.org; Thu, 19 Oct 2017 12:19:59 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1e5DY0-0000pQ-Tr for qemu-devel@nongnu.org; Thu, 19 Oct 2017 12:19:56 -0400 Received: from mail-by2nam01on0058.outbound.protection.outlook.com ([104.47.34.58]:19764 helo=NAM01-BY2-obe.outbound.protection.outlook.com) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1e5DY0-0000oQ-J4 for qemu-devel@nongnu.org; Thu, 19 Oct 2017 12:19:52 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=xilinx.onmicrosoft.com; s=selector1-xilinx-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=h5TUrwJVeGXUYiXdARuYevCtIsNQt/wyyJjpXCVEqLw=; b=0958Z2Ay1tCKHt6vZvnLWSVBwTwRO8PRUV7fO1t3yjcxKeEY0BYQcSFU9L/0475NHUXDHX/FOTCdpTy73edo8V+TrGA+1R8pQnvO7XGm14OZ+SDidCsvWv/Vhtv4qsrfB6H89snaziQ3dO2Z30oHb6fWyxwZsIxNTPUmUeCoirw= Received: from BY2PR02CA0009.namprd02.prod.outlook.com (10.163.44.147) by DM5PR02MB3273.namprd02.prod.outlook.com (10.164.148.27) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.77.7; Thu, 19 Oct 2017 16:19:49 +0000 Received: from SN1NAM02FT052.eop-nam02.prod.protection.outlook.com (2a01:111:f400:7e44::203) by BY2PR02CA0009.outlook.office365.com (2a01:111:e400:5261::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.156.4 via Frontend Transport; Thu, 19 Oct 2017 16:19:49 +0000 Authentication-Results: spf=pass (sender IP is 149.199.60.100) smtp.mailfrom=xilinx.com; redhat.com; dkim=none (message not signed) header.d=none;redhat.com; dmarc=bestguesspass action=none header.from=xilinx.com; Received-SPF: Pass (protection.outlook.com: domain of xilinx.com designates 149.199.60.100 as permitted sender) receiver=protection.outlook.com; client-ip=149.199.60.100; helo=xsj-pvapsmtpgw02; Received: from xsj-pvapsmtpgw02 (149.199.60.100) by SN1NAM02FT052.mail.protection.outlook.com (10.152.72.146) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.20.77.10 via Frontend Transport; Thu, 19 Oct 2017 16:19:48 +0000 Received: from unknown-38-66.xilinx.com ([149.199.38.66]:35237 helo=xsj-pvapsmtp01) by xsj-pvapsmtpgw02 with esmtp (Exim 4.63) (envelope-from ) id 1e5DXw-0007v8-DP; Thu, 19 Oct 2017 09:19:48 -0700 Received: from [127.0.0.1] (helo=localhost) by xsj-pvapsmtp01 with smtp (Exim 4.63) (envelope-from ) id 1e5DXw-0002R4-8R; Thu, 19 Oct 2017 09:19:48 -0700 Received: from xsj-pvapsmtp01 (xsj-mail.xilinx.com [149.199.38.66]) by xsj-smtp-dlp1.xlnx.xilinx.com (8.13.8/8.13.1) with ESMTP id v9JGJb8b017240; Thu, 19 Oct 2017 09:19:37 -0700 Received: from [172.19.2.220] (helo=localhost.localdomain) by xsj-pvapsmtp01 with esmtp (Exim 4.63) (envelope-from ) id 1e5DXl-0002Pd-Bo; Thu, 19 Oct 2017 09:19:37 -0700 From: Alistair Francis To: Date: Thu, 19 Oct 2017 09:15:44 -0700 Message-ID: X-Mailer: git-send-email 2.11.0 In-Reply-To: References: X-RCIS-Action: ALLOW X-TM-AS-Product-Ver: IMSS-7.1.0.1224-8.1.0.1062-23404.005 X-TM-AS-User-Approved-Sender: Yes;Yes X-EOPAttributedMessage: 0 X-MS-Office365-Filtering-HT: Tenant X-Forefront-Antispam-Report: CIP:149.199.60.100; IPV:NLI; CTRY:US; EFV:NLI; SFV:NSPM; SFS:(10009020)(6009001)(376002)(346002)(39860400002)(2980300002)(438002)(199003)(189002)(356003)(50226002)(47776003)(316002)(9786002)(16586007)(2906002)(4326008)(6916009)(305945005)(36386004)(2950100002)(77096006)(6666003)(106002)(118296001)(50986999)(63266004)(5660300001)(33646002)(5003940100001)(2351001)(76176999)(106466001)(48376002)(39060400002)(81156014)(8936002)(189998001)(478600001)(81166006)(54906003)(50466002)(36756003)(8676002)(107986001)(5001870100001); DIR:OUT; SFP:1101; SCL:1; SRVR:DM5PR02MB3273; H:xsj-pvapsmtpgw02; FPR:; SPF:Pass; PTR:xapps1.xilinx.com,unknown-60-100.xilinx.com; A:1; MX:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; SN1NAM02FT052; 1:3AqJS9UORMj2vvxySqfsGFmEQDvdIrKUKU/di/yWMRyf5QK2vHFKcrzlF0T1ADu2HAqftUPaqd2TaxJWrqCiSnu7e4smDQDJ0hjwdsy4fsfQlgQGNTxNukonWGXa8iu5 MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 36947c8c-aeb8-45d1-cdca-08d5170d385b X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001)(2017030254152)(8251501002)(2017052603199)(201703131423075)(201703031133081)(201702281549075); SRVR:DM5PR02MB3273; X-Microsoft-Exchange-Diagnostics: 1; DM5PR02MB3273; 3:WT6FQKaEa70aoGUeCSB9TjjXCgYreghLzHrfyX9rTrt7lfs1aK10OywYr9VO1fVfTcj7JmM0v/3YqQXqErm2CZt9CwTs7h2sXF9xWpu+ilgMAqsq/3lLnznnXeZPoBRNTIvpalh2YWuOnNCG/AOqv7HA22q49GU2AzGpJx6aDxKO2gsRWWcGzb+/5q7WMiw70wer9NtEP5KFNxcdP6Hwxty+ZMhgqgY8+WcHpOUArkodloDOqEfgdVrLomUCrQtFnNrGTtyPpCL6YcR7cNePqwPYNqSFwZ/T3m+xsxcuk4S7UNKIoxT/YP3IGtiPnbdyYf05Wz74rvPq1QmDq2C363QUXwOfNedTpbygZ5am3xQ=; 25:WzZY6rx8gqGneXC2br+YLv1j4KV6DUk0yko7Q8XC3WIaP8SaZcGWEN1FiLdajsPTmQcqf2ZKHgFngrwm6SbuaQXL7YXAR90+z3SF95bf9MNNeN/AE6EpH4RLBzHg5vks9/fknEoSQsEE9k3Gw37FBi7k1x7/vC75RCXj+xXKVpT05duMAl2/oOWRYu7haTSJjr+CLjCLavuCX3x8KW4MyxVA2Yq1H1oxmRJPMtiJdF2hQ/SdMSlP1ua+S5VGtgZxZ9nSJBMjLBxTaLHFP+JsCA9LGIrPND0Y5Hu8Bg6dyNr6BkJzo5YHJqRqrKcpVXchTcpLhf6X812/kRY2C7kMtg== X-MS-TrafficTypeDiagnostic: DM5PR02MB3273: X-Microsoft-Exchange-Diagnostics: 1; DM5PR02MB3273; 31:SOZ1+S8iDTw8wlmJWMtV1KmoDf/ERMtc+5urI2fuLYa/s0x9x+JqK0AoKkcqbhCiFHkgDqQGhFGeSjU7PFqSUDlODjeUJk6JucjwTSp96JubnYphlZ/s4y3srRy5tccHsimtyQt0/gLvIbK2GdvtV1a6EfGsMQN+Jb30yA/leiVVjprzhjuIkrVWUulwO5wVpFpcnW7jcyWkDNwePz2zEwYjercJ1TmHtZVDjl2sv4A=; 20:C1HAVV9tquL6IlQF4xmPe28us5DwQIWK72gvdiW+Axhl3Aet6BUArESNJUDA6u61Lx2g4QTJN7brbNCN6Tw+pju5IvGt5eZkq79o/AvKcHelSJszrGOvjiAEjlQC+BjjAy0SZO7JHvmgtsazSAwjvLK0BceOJp3f3tIc8oYqL2Gc4OugX/4tJJcdC0ATrlNPkwmkDIgcC1VqSAyjqaBhun9XVY7vfbRLGf2wN4SNd8m8g+z/C5ZiFBw2oHSI62sKFv922wMBAu1n1/MYCcyguAgdZoOh9pAnKWNGjb3JTnYffuEdDNEapOJEY0opseK8a6hyqRURp0GQzE8hgOXTUC11w42R9Jf1+xrEzBhM5yp/btzMx1SsZ3lCQf4pbUCok93l1MkY1zHXEYZGE0+2lk/LAwxlDCcKU6yg3gmZU/WbLXhf0FsazLRPACBrrZsc7LlY1qaGmVQ/s+8NWvAbzqLvhh/WPGN2vJfhQIdmM0UuR7xHTVY+ZZ0WKemm8P/2 X-Exchange-Antispam-Report-Test: UriScan:(192813158149592); X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(100000700101)(100105000095)(100000701101)(100105300095)(100000702101)(100105100095)(6040450)(2401047)(5005006)(8121501046)(10201501046)(3002001)(93006095)(93004095)(100000703101)(100105400095)(6055026)(6041248)(20161123562025)(20161123555025)(20161123560025)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123558100)(20161123564025)(6072148)(201708071742011)(100000704101)(100105200095)(100000705101)(100105500095); SRVR:DM5PR02MB3273; BCL:0; PCL:0; RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095); SRVR:DM5PR02MB3273; X-Microsoft-Exchange-Diagnostics: 1; DM5PR02MB3273; 4:9GA+erWRBMbJyh4aTQdUwbHbv6jFtmBL8Ju/A6hyyYlQ6uIshqAV3u16jHD5Zz9Zc08V3d8oqTZwZFMyfdCjhAcMS3FhUk9bwE8JeM0Hr1hPLnIokeUGxHnuaZcImkkvsHXgq6JN2ccjbygRqlI9v8tFiN6pL/AGkpAxqWKyuKeLwdMHYE/g6rWeYUIIbcVcBTTdEPBD9+9Q1DDe80M5fpmB5LBsc6s7sS18/JD+/LNliNqC1NeB1ckD2lAm/JL5Mrbxkef2O1EtoZIg7SnUimsIScgjTM6Qtc3Z8ftIvaE= X-Forefront-PRVS: 0465429B7F X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; DM5PR02MB3273; 23:j1AF7Dfj6s91fzF4x+0KoVLUTcedYs85QQmiXmdQE?= NDt9hmoo7bIJpbUuIzxLefi/7BPd/IwrEYVp38S78aFrGYFe4siuNfjv+SKmW9GtLM+UwpKJD6NgTJcJAXOzLSgpci6duX304uzSNgIQqG9efP9mGhu8ztJcHd5SHqi7WHEpypG66LS8QDXuhugTLXXgI+erN1SQa5cCkFgjhSH2pBkmStRrE45C8SVqo4EovqFbUqR/DhsSbXXLzP8ZLQ2s5LL4Ua8fyWykPbSBPIraLNaRJsfS7NkbU5q0qONaTf/EjDry0hbrzpWD6jcUzMbbo7EQb1xsnDprRh+YIZHepB2piQ169L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Hsx35rvpKPkT7bqOQOVx3A9/LfXghRqTTPFYDl7fGpmlpMw==; 5:QmZEtdHUAxB8nMB9irGA5Uk9BGMm2BCPEyhyPHFh3sWWWWeU7Nm2FfaHKHn9O/dY80XN2hyT58y2T8SqauH95L5vQVTOMNKQ9/Bbapk1hvT9t2OcQ26kdI8MGis4NzP7GyDYc88VyIHj2bWPWzzgtw==; 24:SXhoRFoB3l/SzKw+fJpvMHDEHrOWv7PWO+Kka1UeQGW6TaZQnjDWqZan13caUmvw1gy5hkuMSwsK+tXBQ0Q1OADB7h/JvuF9sL6vuDPj5/c=; 7:28WZJlIoEtRNc1t6/4HDwesM0SK2Zfiyi0PjZtXCN/ojQpNNrE5VgwUmroXahOt6p6oWlGaYzBBwzQXkvKxNjTei5lKp1TRFAVLCdupyCQ+HKkJ+aCo2VdZ8l7Fj2jbT0/VgrsYY31PfHC3ihihBxD39eeD6GcI3I7VRFFoLWDonCn4VHVn7pDBqLa3YFMQX1NElxfYxqDVoThSt67qGtwCQGGoVZ62Kj1b1kQgS+pg= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: xilinx.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 19 Oct 2017 16:19:48.8472 (UTC) X-MS-Exchange-CrossTenant-Id: 657af505-d5df-48d0-8300-c31994686c5c X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=657af505-d5df-48d0-8300-c31994686c5c; Ip=[149.199.60.100]; Helo=[xsj-pvapsmtpgw02] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM5PR02MB3273 X-detected-operating-system: by eggs.gnu.org: Windows 7 or 8 [fuzzy] X-Received-From: 104.47.34.58 Subject: [Qemu-devel] [PATCH v3 02/46] Fixes after renaming __FUNCTION__ to __func__ 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: alistair23@gmail.com, armbru@redhat.com, alistair.francis@xilinx.com Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" Signed-off-by: Alistair Francis Cc: Eric Blake Reviewed-by: Eric Blake --- V3: - Squash onto single lines - Don't fix indentation of case in omap_prcm_apll_update() hw/arm/omap1.c | 8 +++----- hw/block/onenand.c | 2 +- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/hw/arm/omap1.c b/hw/arm/omap1.c index 1388200191..92e58f09c8 100644 --- a/hw/arm/omap1.c +++ b/hw/arm/omap1.c @@ -1717,7 +1717,7 @@ static void omap_clkm_write(void *opaque, hwaddr addr, if ((s->clkm.clocking_scheme ^ (value >> 11)) & 7) { s->clkm.clocking_scheme = (value >> 11) & 7; printf("%s: clocking scheme set to %s\n", __func__, - clkschemename[s->clkm.clocking_scheme]); + clkschemename[s->clkm.clocking_scheme]); } s->clkm.cold_start &= value & 0x3f; return; @@ -3329,14 +3329,12 @@ static void omap_mcbsp_writeh(void *opaque, hwaddr addr, case 0x18: /* MCR2 */ s->mcr[1] = value & 0x03e3; if (value & 3) /* XMCM */ - printf("%s: Tx channel selection mode enable attempt\n", - __func__); + printf("%s: Tx channel selection mode enable attempt\n", __func__); return; case 0x1a: /* MCR1 */ s->mcr[0] = value & 0x03e1; if (value & 1) /* RMCM */ - printf("%s: Rx channel selection mode enable attempt\n", - __func__); + printf("%s: Rx channel selection mode enable attempt\n", __func__); return; case 0x1c: /* RCERA */ s->rcer[0] = value & 0xffff; diff --git a/hw/block/onenand.c b/hw/block/onenand.c index e243182394..ed77f859e9 100644 --- a/hw/block/onenand.c +++ b/hw/block/onenand.c @@ -659,7 +659,7 @@ static uint64_t onenand_read(void *opaque, hwaddr addr, case 0xff02: /* ECC Result of spare area data */ case 0xff03: /* ECC Result of main area data */ case 0xff04: /* ECC Result of spare area data */ - hw_error("%s: imeplement ECC\n", __func__); + hw_error("%s: implement ECC\n", __func__); return 0x0000; } From patchwork Thu Oct 19 16:15:47 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alistair Francis X-Patchwork-Id: 828197 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; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=xilinx.onmicrosoft.com header.i=@xilinx.onmicrosoft.com header.b="4NJ9jCT8"; 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 3yHvPr6l3kz9t4P for ; Fri, 20 Oct 2017 03:24:00 +1100 (AEDT) Received: from localhost ([::1]:50076 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e5Dby-0006qc-Sh for incoming@patchwork.ozlabs.org; Thu, 19 Oct 2017 12:23:59 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:54928) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e5DY8-00042v-Nf for qemu-devel@nongnu.org; Thu, 19 Oct 2017 12:20:09 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1e5DY0-0000pW-VI for qemu-devel@nongnu.org; Thu, 19 Oct 2017 12:20:00 -0400 Received: from mail-cys01nam02on0076.outbound.protection.outlook.com ([104.47.37.76]:49499 helo=NAM02-CY1-obe.outbound.protection.outlook.com) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1e5DY0-0000p7-It for qemu-devel@nongnu.org; Thu, 19 Oct 2017 12:19:52 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=xilinx.onmicrosoft.com; s=selector1-xilinx-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=+e6rS9Xgva18cNW9iCztBMY1bBXaRhJMpz5dngzX1Ck=; b=4NJ9jCT8kjqRCLMQAo/IfsARfD6MeV0pVOr6tijto+gL2MZzz+w1ri4KISgv1gF5JEuVTRBtnKukK9H5FGCHPqbeRdZKJ5Mf3X6BSqVKRDcXKoLAWDfKo6tAjv9iOJE9jv0sO3MXJXGyNZKouQshNTrKV6rhGu1Gnw/iTwIdd78= Received: from SN4PR0201CA0018.namprd02.prod.outlook.com (10.161.238.156) by CY1PR02MB1333.namprd02.prod.outlook.com (10.161.170.24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.77.7; Thu, 19 Oct 2017 16:19:49 +0000 Received: from SN1NAM02FT049.eop-nam02.prod.protection.outlook.com (2a01:111:f400:7e44::200) by SN4PR0201CA0018.outlook.office365.com (2603:10b6:803:2b::28) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.156.4 via Frontend Transport; Thu, 19 Oct 2017 16:19:49 +0000 Received-SPF: Pass (protection.outlook.com: domain of xilinx.com designates 149.199.60.83 as permitted sender) receiver=protection.outlook.com; client-ip=149.199.60.83; helo=xsj-pvapsmtpgw01; Received: from xsj-pvapsmtpgw01 (149.199.60.83) by SN1NAM02FT049.mail.protection.outlook.com (10.152.72.166) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.20.77.10 via Frontend Transport; Thu, 19 Oct 2017 16:19:48 +0000 Received: from unknown-38-66.xilinx.com ([149.199.38.66] helo=xsj-pvapsmtp01) by xsj-pvapsmtpgw01 with esmtp (Exim 4.63) (envelope-from ) id 1e5DXw-0008UN-6Y; Thu, 19 Oct 2017 09:19:48 -0700 Received: from [127.0.0.1] (helo=localhost) by xsj-pvapsmtp01 with smtp (Exim 4.63) (envelope-from ) id 1e5DXw-0002R4-3W; Thu, 19 Oct 2017 09:19:48 -0700 Received: from xsj-pvapsmtp01 (xsj-smtp1.xilinx.com [149.199.38.66]) by xsj-smtp-dlp2.xlnx.xilinx.com (8.13.8/8.13.1) with ESMTP id v9JGJeOv003097; Thu, 19 Oct 2017 09:19:40 -0700 Received: from [172.19.2.220] (helo=localhost.localdomain) by xsj-pvapsmtp01 with esmtp (Exim 4.63) (envelope-from ) id 1e5DXo-0002QH-DP; Thu, 19 Oct 2017 09:19:40 -0700 From: Alistair Francis To: Date: Thu, 19 Oct 2017 09:15:47 -0700 Message-ID: <3549a38581ab634850a89487e10204db46aa72fd.1508390588.git.alistair.francis@xilinx.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: References: X-RCIS-Action: ALLOW X-TM-AS-Product-Ver: IMSS-7.1.0.1224-8.1.0.1062-23404.005 X-TM-AS-User-Approved-Sender: Yes;Yes X-EOPAttributedMessage: 0 X-MS-Office365-Filtering-HT: Tenant X-Forefront-Antispam-Report: CIP:149.199.60.83; IPV:NLI; CTRY:US; EFV:NLI; SFV:NSPM; SFS:(10009020)(6009001)(376002)(346002)(39860400002)(2980300002)(438002)(189002)(199003)(36756003)(5890100001)(50226002)(50466002)(2906002)(48376002)(2950100002)(5003940100001)(106466001)(54906003)(2351001)(575784001)(8676002)(8936002)(50986999)(81156014)(77096006)(81166006)(189998001)(6916009)(63266004)(76176999)(33646002)(478600001)(305945005)(106002)(316002)(118296001)(36386004)(5660300001)(39060400002)(4326008)(9786002)(16586007)(356003)(47776003)(107986001)(21314002); DIR:OUT; SFP:1101; SCL:1; SRVR:CY1PR02MB1333; H:xsj-pvapsmtpgw01; FPR:; SPF:Pass; PTR:unknown-60-83.xilinx.com; MX:1; A:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; SN1NAM02FT049; 1:Y7u18v0Xk6HzgwwGIou+fwwQTIEZ2HFab3/k+Ky2DTwNl0J9vk2qpg/nd3oXIFN9eWUwQciuSJocB3u4gr+C1VT7uxrvZXojKfJsySJeji4cZUVL8YKJvktoItZLBZeq MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 180e2ea6-cb08-46fc-f41d-08d5170d3874 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001)(2017030254168)(8251501002)(4534016)(4602075)(4627075)(201703031133081)(201702281549075)(2017052603229)(201703131423091); SRVR:CY1PR02MB1333; X-Microsoft-Exchange-Diagnostics: 1; CY1PR02MB1333; 3:PUDCl3yC5A+bNbTTmD9rVjp9S1MQHy4ahsoViuE2IhK5RQYWKndKRj7X1z2hL52GpXyGkk/DIpV+P504bMVGk/p5465ZrBJl7NAgTV8vfR5JO5fsN2sxOBa2qq5HG6cOADJjoXkPftwJ/yxPHKUxc1Q9ov6weV+Gu+oqfU4vacNmIrd+R5H0cDnqS/Jz+GSnzunOat6t6JLVMraoaGipiphiGvwjAL2mVrbGvZR19XS4ETYsCA9X8EOcL2BOvwGEuqXRMnD7EQsQGsHh0S3ALTY7F2nJyBXu5wsrq8gbjCaGQ7TfbfQUUq5sCgpQ/bEjRZeqgIKPt6JTeUIp5lF4LXWp1SBi/gVZJa4HvBOqHxQ=; 25:XNJXizf7ZH36+HazrsnmsOtqb4D7YqIzgFqxzI4tOmvT6u12HiINffMMXiVhMbKVDidWV52UXHsDLTfhZ99yRZNneuRH1dzi3emqorZZiqkiUCBKwfzlN9+PXaUTIjBK01Q0C6L8dFqHJ4pqbCTfC1KjsJzdgmTNn3u9Ng8SZO0PA/1BMGfZ4SVzwjADZ2Ny/xTdfEL+bVOpSrNRZUcAabQn/mIb6qojr40R5xfbciYFuUIfNw0YSaR8RU5Y+RpfxX+/GEhQChRd5qwZ3+dQjQZDY3QNATpHWClRLMp+LnFO4vS0ZEJQ0y21a1w2hhAfwPhaAn0kUjF1X8EsZdKk/A== X-MS-TrafficTypeDiagnostic: CY1PR02MB1333: X-Microsoft-Exchange-Diagnostics: 1; CY1PR02MB1333; 31:g8neV+qYYr6k615lmR1T63ttxX/DmuXLrYsIiKIyRjSt8HhBGOI9R6NhCkElKIIIKigoEnOKXMBfKWspyu4Wt9BW89t1lOxidrcbbAhoJif4cliMgLjkPwinY6FJ2ty1z+YdFKSjDqI5UUn1XsQUAfPTAvKU7aFnE6QlMI+qj6/fpjMKGzeT4K2QCzeCH3iQTCNVlRqqbK9WnMzNdSiihHqK4+p/4s7n5sBmC4y65+8=; 20:E+7lJXVRV6ceZo6miH9C5U8oGOs8Fum8CRp4YIcpyAXhhSMyhH9Sov2lzqsccBX7hj004FwuebK+0bDnAj0jhQ8o7GrlU3HepFOdCeyiArpMtgpekChhVYDqN1MNmSzmTLGY1oCAXDsffBXd9cAJv+9o8l9DHOstKaq6z7+iKr5uNSEDzBxBtjX2iUZI2socCjnI8/jk16EdDI/6AJMhFNbANdKLVCndUO6/+j9jpEZ1vWnrubyJvLqUZcB5mQ1CU9wJiNsORRbkt25WH5Il8sovboFOjZEHrL4OxCKjyHE5oi+IGVxV+x4eqtoIu7/7mtPgTOHaXxXFa1NZgWWTd76RRyKHdnlmMjgxHlSjRaYjIKRfY+MYTs+J+imlQhBnFVTVDwKWdExMseMJ32ojHRY+cIUaTTk3RMBZeoAD4INX/3H/T2nQP92/j30R3aRmxLWlIkn/t48zk1Lj1pQ1IBOuylaxpXW29qmfbs6OHD2UtSwJ4ZXkT52WiB3jCiUe X-Exchange-Antispam-Report-Test: UriScan:(788757137089)(192813158149592); X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(100000700101)(100105000095)(100000701101)(100105300095)(100000702101)(100105100095)(6040450)(2401047)(5005006)(8121501046)(10201501046)(100000703101)(100105400095)(3002001)(93006095)(93004095)(6055026)(6041248)(20161123564025)(20161123562025)(20161123560025)(20161123558100)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123555025)(6072148)(201708071742011)(100000704101)(100105200095)(100000705101)(100105500095); SRVR:CY1PR02MB1333; BCL:0; PCL:0; RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095); SRVR:CY1PR02MB1333; X-Microsoft-Exchange-Diagnostics: 1; CY1PR02MB1333; 4:Y2QQHy3h5+Gp855FoD37qyXPsXlUY5TofdB8UKH58fDuQ5831eZ7ionEmXHWfBpM9q6xw2/v36TMtooFtAZFc+iQnWc9ZjeAYHIGe8QOwAMeo7vpEnIXByjGz0uMFRnb+6sPuLsmHxCYCWGtCVgjIUH0SG3dLUWt4I0GrvV7IdcpyIuJZxZXJol08Bp0dcCcIoboSzDw3DpA6AGuFEc/3Av2pobUa/2gu2IASpNWMJBm4xtqtZY2I7RBf3LIVWxt7CNN8n4qU8zPPH07N4GuaFTM/3EffZttXTbrTNUGSsQ4Z1bCsuVBkZKfqYw6FqvqZYLq8K3qpCPg52TeES+0Xw== X-Forefront-PRVS: 0465429B7F X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; CY1PR02MB1333; 23:pabh/Us4sA0kibMZH98tdQv2NUmgElKcaK94suvDP?= HAa101F+sLg6+7cVBb/OeCLIDJGVsWeLjwBD7Wewe/lUGL0oEWM2wO12W8STPODA7rOz5kys6KULBnWPeVmLm48K6C7K46wxQAjZw1xVvULDP+2ZIoOakgARvmqB3SbqDF3/Mo7AXAx1v2nxnM/zN5SGKz7etIAdgoFV5AW89496owAnGLDvbztpd9Lt2ci1g6fkiCREtkTUOKgralpF85BWZ2H+MspGbWtwflv0/a4PEq5wmNPfFC0vvNP5JhZh63PlrDvPdA0pKROrLwViYLofzz/5jgcAnMVaXFp6Ds/AVSLKRBJuyBgWgNihFp9lpFuoJtNIXHqXjYdd99tAWeRRZQUrlLYkGL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eizritsSRJ/gD395ymWw==; 5:ME+UbsHMBgni7sTGquAb8ZhhOUiFav392/7yPc+HwPkjDgxjplfSTf/BAq2tlwpKOLHX3Kyh+X172IhxInoo5bfDCgQ/bgA1l285hElbmhA+TVBjWmBWtnFVh4EvAb7RiK2xgojgIKWHc1MllVAlYw==; 24:LiaA9JDqXb0aPlkeM5tjIbAoK9IiQ9eYIjVxydeudSSK6dqXPluXMb6rdKM7cyu1RsYtbPRJlRWmoajDYzDl9JTSxkTefG/eXQftdvZeevQ=; 7:/deCLxqoo8O634EY/hXVpmsn2qSHBfTiPPkK+fy3trruqwXZtXfBmEbunzsmwGt1XYfl+9AraiT1XjsmMrZbyIR+FqUdAgf4+3P3ZSospCxZTSdmOEmOiNe2EwvyojTCM9iKBYkC4ByMbJHGq8EzfhrXLP4YL0R03KIne9vSBmVhVeTkq/7T9B8cOjA93XiCJmqenNNsdnxvY2IKo61U+oJSWFd9E21PoU6U/F8I7cI= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: xilinx.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 19 Oct 2017 16:19:48.7308 (UTC) X-MS-Exchange-CrossTenant-Id: 657af505-d5df-48d0-8300-c31994686c5c X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=657af505-d5df-48d0-8300-c31994686c5c; Ip=[149.199.60.83]; Helo=[xsj-pvapsmtpgw01] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY1PR02MB1333 X-detected-operating-system: by eggs.gnu.org: Windows 7 or 8 [fuzzy] X-Received-From: 104.47.37.76 Subject: [Qemu-devel] [PATCH v3 03/46] audio: Replace AUDIO_FUNC with __func__ 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: alistair23@gmail.com, Gerd Hoffmann , armbru@redhat.com, alistair.francis@xilinx.com Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" Apparently we don't use __MSC_VER as a compiler anymore and we always require a C99 compiler (which means we always have __func__) so we don't need a special AUDIO_FUNC macro. We can just replace AUDIO_FUNC with __func__ instead. Checkpatch failures were manually fixed. Signed-off-by: Alistair Francis Cc: Gerd Hoffmann Reviewed-by: Thomas Huth Reviewed-by: Eric Blake --- audio/alsaaudio.c | 4 ++-- audio/audio.c | 40 ++++++++++++++++++------------------ audio/audio_int.h | 6 ------ audio/audio_pt_int.c | 28 ++++++++++++------------- audio/audio_template.h | 26 +++++++++++------------ audio/dsoundaudio.c | 2 +- audio/mixeng.c | 2 +- audio/ossaudio.c | 10 ++++----- audio/paaudio.c | 56 +++++++++++++++++++++++++------------------------- audio/sdlaudio.c | 2 +- audio/wavaudio.c | 2 +- 11 files changed, 85 insertions(+), 93 deletions(-) diff --git a/audio/alsaaudio.c b/audio/alsaaudio.c index 3652a7b5fa..92a96f8b2b 100644 --- a/audio/alsaaudio.c +++ b/audio/alsaaudio.c @@ -823,7 +823,7 @@ static int alsa_init_out(HWVoiceOut *hw, struct audsettings *as, audio_pcm_init_info (&hw->info, &obt_as); hw->samples = obt.samples; - alsa->pcm_buf = audio_calloc (AUDIO_FUNC, obt.samples, 1 << hw->info.shift); + alsa->pcm_buf = audio_calloc(__func__, obt.samples, 1 << hw->info.shift); if (!alsa->pcm_buf) { dolog ("Could not allocate DAC buffer (%d samples, each %d bytes)\n", hw->samples, 1 << hw->info.shift); @@ -934,7 +934,7 @@ static int alsa_init_in(HWVoiceIn *hw, struct audsettings *as, void *drv_opaque) audio_pcm_init_info (&hw->info, &obt_as); hw->samples = obt.samples; - alsa->pcm_buf = audio_calloc (AUDIO_FUNC, hw->samples, 1 << hw->info.shift); + alsa->pcm_buf = audio_calloc(__func__, hw->samples, 1 << hw->info.shift); if (!alsa->pcm_buf) { dolog ("Could not allocate ADC buffer (%d samples, each %d bytes)\n", hw->samples, 1 << hw->info.shift); diff --git a/audio/audio.c b/audio/audio.c index beafed209b..7658d2af66 100644 --- a/audio/audio.c +++ b/audio/audio.c @@ -424,12 +424,12 @@ static void audio_process_options (const char *prefix, const char qemu_prefix[] = "QEMU_"; size_t preflen, optlen; - if (audio_bug (AUDIO_FUNC, !prefix)) { + if (audio_bug(__func__, !prefix)) { dolog ("prefix = NULL\n"); return; } - if (audio_bug (AUDIO_FUNC, !opt)) { + if (audio_bug(__func__, !opt)) { dolog ("opt = NULL\n"); return; } @@ -792,7 +792,7 @@ static int audio_attach_capture (HWVoiceOut *hw) SWVoiceOut *sw; HWVoiceOut *hw_cap = &cap->hw; - sc = audio_calloc (AUDIO_FUNC, 1, sizeof (*sc)); + sc = audio_calloc(__func__, 1, sizeof(*sc)); if (!sc) { dolog ("Could not allocate soft capture voice (%zu bytes)\n", sizeof (*sc)); @@ -848,7 +848,7 @@ static int audio_pcm_hw_find_min_in (HWVoiceIn *hw) int audio_pcm_hw_get_live_in (HWVoiceIn *hw) { int live = hw->total_samples_captured - audio_pcm_hw_find_min_in (hw); - if (audio_bug (AUDIO_FUNC, live < 0 || live > hw->samples)) { + if (audio_bug(__func__, live < 0 || live > hw->samples)) { dolog ("live=%d hw->samples=%d\n", live, hw->samples); return 0; } @@ -886,7 +886,7 @@ static int audio_pcm_sw_get_rpos_in (SWVoiceIn *sw) int live = hw->total_samples_captured - sw->total_hw_samples_acquired; int rpos; - if (audio_bug (AUDIO_FUNC, live < 0 || live > hw->samples)) { + if (audio_bug(__func__, live < 0 || live > hw->samples)) { dolog ("live=%d hw->samples=%d\n", live, hw->samples); return 0; } @@ -909,7 +909,7 @@ int audio_pcm_sw_read (SWVoiceIn *sw, void *buf, int size) rpos = audio_pcm_sw_get_rpos_in (sw) % hw->samples; live = hw->total_samples_captured - sw->total_hw_samples_acquired; - if (audio_bug (AUDIO_FUNC, live < 0 || live > hw->samples)) { + if (audio_bug(__func__, live < 0 || live > hw->samples)) { dolog ("live_in=%d hw->samples=%d\n", live, hw->samples); return 0; } @@ -935,7 +935,7 @@ int audio_pcm_sw_read (SWVoiceIn *sw, void *buf, int size) } osamp = swlim; - if (audio_bug (AUDIO_FUNC, osamp < 0)) { + if (audio_bug(__func__, osamp < 0)) { dolog ("osamp=%d\n", osamp); return 0; } @@ -990,7 +990,7 @@ static int audio_pcm_hw_get_live_out (HWVoiceOut *hw, int *nb_live) if (nb_live1) { int live = smin; - if (audio_bug (AUDIO_FUNC, live < 0 || live > hw->samples)) { + if (audio_bug(__func__, live < 0 || live > hw->samples)) { dolog ("live=%d hw->samples=%d\n", live, hw->samples); return 0; } @@ -1014,7 +1014,7 @@ int audio_pcm_sw_write (SWVoiceOut *sw, void *buf, int size) hwsamples = sw->hw->samples; live = sw->total_hw_samples_mixed; - if (audio_bug (AUDIO_FUNC, live < 0 || live > hwsamples)){ + if (audio_bug(__func__, live < 0 || live > hwsamples)) { dolog ("live=%d hw->samples=%d\n", live, hwsamples); return 0; } @@ -1263,7 +1263,7 @@ static int audio_get_avail (SWVoiceIn *sw) } live = sw->hw->total_samples_captured - sw->total_hw_samples_acquired; - if (audio_bug (AUDIO_FUNC, live < 0 || live > sw->hw->samples)) { + if (audio_bug(__func__, live < 0 || live > sw->hw->samples)) { dolog ("live=%d sw->hw->samples=%d\n", live, sw->hw->samples); return 0; } @@ -1287,7 +1287,7 @@ static int audio_get_free (SWVoiceOut *sw) live = sw->total_hw_samples_mixed; - if (audio_bug (AUDIO_FUNC, live < 0 || live > sw->hw->samples)) { + if (audio_bug(__func__, live < 0 || live > sw->hw->samples)) { dolog ("live=%d sw->hw->samples=%d\n", live, sw->hw->samples); return 0; } @@ -1354,7 +1354,7 @@ static void audio_run_out (AudioState *s) live = 0; } - if (audio_bug (AUDIO_FUNC, live < 0 || live > hw->samples)) { + if (audio_bug(__func__, live < 0 || live > hw->samples)) { dolog ("live=%d hw->samples=%d\n", live, hw->samples); continue; } @@ -1389,7 +1389,7 @@ static void audio_run_out (AudioState *s) prev_rpos = hw->rpos; played = hw->pcm_ops->run_out (hw, live); replay_audio_out(&played); - if (audio_bug (AUDIO_FUNC, hw->rpos >= hw->samples)) { + if (audio_bug(__func__, hw->rpos >= hw->samples)) { dolog ("hw->rpos=%d hw->samples=%d played=%d\n", hw->rpos, hw->samples, played); hw->rpos = 0; @@ -1410,7 +1410,7 @@ static void audio_run_out (AudioState *s) continue; } - if (audio_bug (AUDIO_FUNC, played > sw->total_hw_samples_mixed)) { + if (audio_bug(__func__, played > sw->total_hw_samples_mixed)) { dolog ("played=%d sw->total_hw_samples_mixed=%d\n", played, sw->total_hw_samples_mixed); played = sw->total_hw_samples_mixed; @@ -1513,7 +1513,7 @@ static void audio_run_capture (AudioState *s) continue; } - if (audio_bug (AUDIO_FUNC, captured > sw->total_hw_samples_mixed)) { + if (audio_bug(__func__, captured > sw->total_hw_samples_mixed)) { dolog ("captured=%d sw->total_hw_samples_mixed=%d\n", captured, sw->total_hw_samples_mixed); captured = sw->total_hw_samples_mixed; @@ -1924,7 +1924,7 @@ CaptureVoiceOut *AUD_add_capture ( goto err0; } - cb = audio_calloc (AUDIO_FUNC, 1, sizeof (*cb)); + cb = audio_calloc(__func__, 1, sizeof(*cb)); if (!cb) { dolog ("Could not allocate capture callback information, size %zu\n", sizeof (*cb)); @@ -1942,7 +1942,7 @@ CaptureVoiceOut *AUD_add_capture ( HWVoiceOut *hw; CaptureVoiceOut *cap; - cap = audio_calloc (AUDIO_FUNC, 1, sizeof (*cap)); + cap = audio_calloc(__func__, 1, sizeof(*cap)); if (!cap) { dolog ("Could not allocate capture voice, size %zu\n", sizeof (*cap)); @@ -1955,8 +1955,8 @@ CaptureVoiceOut *AUD_add_capture ( /* XXX find a more elegant way */ hw->samples = 4096 * 4; - hw->mix_buf = audio_calloc (AUDIO_FUNC, hw->samples, - sizeof (struct st_sample)); + hw->mix_buf = audio_calloc(__func__, hw->samples, + sizeof(struct st_sample)); if (!hw->mix_buf) { dolog ("Could not allocate capture mix buffer (%d samples)\n", hw->samples); @@ -1965,7 +1965,7 @@ CaptureVoiceOut *AUD_add_capture ( audio_pcm_init_info (&hw->info, as); - cap->buf = audio_calloc (AUDIO_FUNC, hw->samples, 1 << hw->info.shift); + cap->buf = audio_calloc(__func__, hw->samples, 1 << hw->info.shift); if (!cap->buf) { dolog ("Could not allocate capture buffer " "(%d samples, each %d bytes)\n", diff --git a/audio/audio_int.h b/audio/audio_int.h index 543b1bd8d5..5b25da0a37 100644 --- a/audio/audio_int.h +++ b/audio/audio_int.h @@ -252,10 +252,4 @@ static inline int audio_ring_dist (int dst, int src, int len) #define AUDIO_STRINGIFY_(n) #n #define AUDIO_STRINGIFY(n) AUDIO_STRINGIFY_(n) -#if defined _MSC_VER || defined __GNUC__ -#define AUDIO_FUNC __func__ -#else -#define AUDIO_FUNC __FILE__ ":" AUDIO_STRINGIFY (__LINE__) -#endif - #endif /* QEMU_AUDIO_INT_H */ diff --git a/audio/audio_pt_int.c b/audio/audio_pt_int.c index 21ff9c5803..3fe56d8514 100644 --- a/audio/audio_pt_int.c +++ b/audio/audio_pt_int.c @@ -31,7 +31,7 @@ int audio_pt_init (struct audio_pt *p, void *(*func) (void *), err = sigfillset (&set); if (err) { - logerr (p, errno, "%s(%s): sigfillset failed", cap, AUDIO_FUNC); + logerr(p, errno, "%s(%s): sigfillset failed", cap, __func__); return -1; } @@ -57,8 +57,8 @@ int audio_pt_init (struct audio_pt *p, void *(*func) (void *), err2 = pthread_sigmask (SIG_SETMASK, &old_set, NULL); if (err2) { - logerr (p, err2, "%s(%s): pthread_sigmask (restore) failed", - cap, AUDIO_FUNC); + logerr(p, err2, "%s(%s): pthread_sigmask (restore) failed", + cap, __func__); /* We have failed to restore original signal mask, all bets are off, so terminate the process */ exit (EXIT_FAILURE); @@ -74,17 +74,17 @@ int audio_pt_init (struct audio_pt *p, void *(*func) (void *), err2: err2 = pthread_cond_destroy (&p->cond); if (err2) { - logerr (p, err2, "%s(%s): pthread_cond_destroy failed", cap, AUDIO_FUNC); + logerr(p, err2, "%s(%s): pthread_cond_destroy failed", cap, __func__); } err1: err2 = pthread_mutex_destroy (&p->mutex); if (err2) { - logerr (p, err2, "%s(%s): pthread_mutex_destroy failed", cap, AUDIO_FUNC); + logerr(p, err2, "%s(%s): pthread_mutex_destroy failed", cap, __func__); } err0: - logerr (p, err, "%s(%s): %s failed", cap, AUDIO_FUNC, efunc); + logerr(p, err, "%s(%s): %s failed", cap, __func__, efunc); return -1; } @@ -94,13 +94,13 @@ int audio_pt_fini (struct audio_pt *p, const char *cap) err = pthread_cond_destroy (&p->cond); if (err) { - logerr (p, err, "%s(%s): pthread_cond_destroy failed", cap, AUDIO_FUNC); + logerr(p, err, "%s(%s): pthread_cond_destroy failed", cap, __func__); ret = -1; } err = pthread_mutex_destroy (&p->mutex); if (err) { - logerr (p, err, "%s(%s): pthread_mutex_destroy failed", cap, AUDIO_FUNC); + logerr(p, err, "%s(%s): pthread_mutex_destroy failed", cap, __func__); ret = -1; } return ret; @@ -112,7 +112,7 @@ int audio_pt_lock (struct audio_pt *p, const char *cap) err = pthread_mutex_lock (&p->mutex); if (err) { - logerr (p, err, "%s(%s): pthread_mutex_lock failed", cap, AUDIO_FUNC); + logerr(p, err, "%s(%s): pthread_mutex_lock failed", cap, __func__); return -1; } return 0; @@ -124,7 +124,7 @@ int audio_pt_unlock (struct audio_pt *p, const char *cap) err = pthread_mutex_unlock (&p->mutex); if (err) { - logerr (p, err, "%s(%s): pthread_mutex_unlock failed", cap, AUDIO_FUNC); + logerr(p, err, "%s(%s): pthread_mutex_unlock failed", cap, __func__); return -1; } return 0; @@ -136,7 +136,7 @@ int audio_pt_wait (struct audio_pt *p, const char *cap) err = pthread_cond_wait (&p->cond, &p->mutex); if (err) { - logerr (p, err, "%s(%s): pthread_cond_wait failed", cap, AUDIO_FUNC); + logerr(p, err, "%s(%s): pthread_cond_wait failed", cap, __func__); return -1; } return 0; @@ -148,12 +148,12 @@ int audio_pt_unlock_and_signal (struct audio_pt *p, const char *cap) err = pthread_mutex_unlock (&p->mutex); if (err) { - logerr (p, err, "%s(%s): pthread_mutex_unlock failed", cap, AUDIO_FUNC); + logerr(p, err, "%s(%s): pthread_mutex_unlock failed", cap, __func__); return -1; } err = pthread_cond_signal (&p->cond); if (err) { - logerr (p, err, "%s(%s): pthread_cond_signal failed", cap, AUDIO_FUNC); + logerr(p, err, "%s(%s): pthread_cond_signal failed", cap, __func__); return -1; } return 0; @@ -166,7 +166,7 @@ int audio_pt_join (struct audio_pt *p, void **arg, const char *cap) err = pthread_join (p->thread, &ret); if (err) { - logerr (p, err, "%s(%s): pthread_join failed", cap, AUDIO_FUNC); + logerr(p, err, "%s(%s): pthread_join failed", cap, __func__); return -1; } *arg = ret; diff --git a/audio/audio_template.h b/audio/audio_template.h index 99b27b285e..7de227d2d1 100644 --- a/audio/audio_template.h +++ b/audio/audio_template.h @@ -57,13 +57,13 @@ static void glue (audio_init_nb_voices_, TYPE) (struct audio_driver *drv) glue (s->nb_hw_voices_, TYPE) = max_voices; } - if (audio_bug (AUDIO_FUNC, !voice_size && max_voices)) { + if (audio_bug(__func__, !voice_size && max_voices)) { dolog ("drv=`%s' voice_size=0 max_voices=%d\n", drv->name, max_voices); glue (s->nb_hw_voices_, TYPE) = 0; } - if (audio_bug (AUDIO_FUNC, voice_size && !max_voices)) { + if (audio_bug(__func__, voice_size && !max_voices)) { dolog ("drv=`%s' voice_size=%d max_voices=0\n", drv->name, voice_size); } @@ -77,7 +77,7 @@ static void glue (audio_pcm_hw_free_resources_, TYPE) (HW *hw) static int glue (audio_pcm_hw_alloc_resources_, TYPE) (HW *hw) { - HWBUF = audio_calloc (AUDIO_FUNC, hw->samples, sizeof (struct st_sample)); + HWBUF = audio_calloc(__func__, hw->samples, sizeof(struct st_sample)); if (!HWBUF) { dolog ("Could not allocate " NAME " buffer (%d samples)\n", hw->samples); @@ -105,7 +105,7 @@ static int glue (audio_pcm_sw_alloc_resources_, TYPE) (SW *sw) samples = ((int64_t) sw->hw->samples << 32) / sw->ratio; - sw->buf = audio_calloc (AUDIO_FUNC, samples, sizeof (struct st_sample)); + sw->buf = audio_calloc(__func__, samples, sizeof(struct st_sample)); if (!sw->buf) { dolog ("Could not allocate buffer for `%s' (%d samples)\n", SW_NAME (sw), samples); @@ -238,17 +238,17 @@ static HW *glue (audio_pcm_hw_add_new_, TYPE) (struct audsettings *as) return NULL; } - if (audio_bug (AUDIO_FUNC, !drv)) { + if (audio_bug(__func__, !drv)) { dolog ("No host audio driver\n"); return NULL; } - if (audio_bug (AUDIO_FUNC, !drv->pcm_ops)) { + if (audio_bug(__func__, !drv->pcm_ops)) { dolog ("Host audio driver without pcm_ops\n"); return NULL; } - hw = audio_calloc (AUDIO_FUNC, 1, glue (drv->voice_size_, TYPE)); + hw = audio_calloc(__func__, 1, glue(drv->voice_size_, TYPE)); if (!hw) { dolog ("Can not allocate voice `%s' size %d\n", drv->name, glue (drv->voice_size_, TYPE)); @@ -266,7 +266,7 @@ static HW *glue (audio_pcm_hw_add_new_, TYPE) (struct audsettings *as) goto err0; } - if (audio_bug (AUDIO_FUNC, hw->samples <= 0)) { + if (audio_bug(__func__, hw->samples <= 0)) { dolog ("hw->samples=%d\n", hw->samples); goto err1; } @@ -339,7 +339,7 @@ static SW *glue (audio_pcm_create_voice_pair_, TYPE) ( hw_as = *as; } - sw = audio_calloc (AUDIO_FUNC, 1, sizeof (*sw)); + sw = audio_calloc(__func__, 1, sizeof(*sw)); if (!sw) { dolog ("Could not allocate soft voice `%s' (%zu bytes)\n", sw_name ? sw_name : "unknown", sizeof (*sw)); @@ -379,7 +379,7 @@ static void glue (audio_close_, TYPE) (SW *sw) void glue (AUD_close_, TYPE) (QEMUSoundCard *card, SW *sw) { if (sw) { - if (audio_bug (AUDIO_FUNC, !card)) { + if (audio_bug(__func__, !card)) { dolog ("card=%p\n", card); return; } @@ -399,7 +399,7 @@ SW *glue (AUD_open_, TYPE) ( { AudioState *s = &glob_audio_state; - if (audio_bug (AUDIO_FUNC, !card || !name || !callback_fn || !as)) { + if (audio_bug(__func__, !card || !name || !callback_fn || !as)) { dolog ("card=%p name=%p callback_fn=%p as=%p\n", card, name, callback_fn, as); goto fail; @@ -408,12 +408,12 @@ SW *glue (AUD_open_, TYPE) ( ldebug ("open %s, freq %d, nchannels %d, fmt %d\n", name, as->freq, as->nchannels, as->fmt); - if (audio_bug (AUDIO_FUNC, audio_validate_settings (as))) { + if (audio_bug(__func__, audio_validate_settings(as))) { audio_print_settings (as); goto fail; } - if (audio_bug (AUDIO_FUNC, !s->drv)) { + if (audio_bug(__func__, !s->drv)) { dolog ("Can not open `%s' (no host audio driver)\n", name); goto fail; } diff --git a/audio/dsoundaudio.c b/audio/dsoundaudio.c index 516846eb80..bc39cb9b4d 100644 --- a/audio/dsoundaudio.c +++ b/audio/dsoundaudio.c @@ -543,7 +543,7 @@ static int dsound_run_out (HWVoiceOut *hw, int live) } } - if (audio_bug (AUDIO_FUNC, len < 0 || len > bufsize)) { + if (audio_bug(__func__, len < 0 || len > bufsize)) { dolog ("len=%d bufsize=%d old_pos=%ld ppos=%ld\n", len, bufsize, old_pos, ppos); return 0; diff --git a/audio/mixeng.c b/audio/mixeng.c index 0bf9b5360f..2ab22df2aa 100644 --- a/audio/mixeng.c +++ b/audio/mixeng.c @@ -344,7 +344,7 @@ struct rate { */ void *st_rate_start (int inrate, int outrate) { - struct rate *rate = audio_calloc (AUDIO_FUNC, 1, sizeof (*rate)); + struct rate *rate = audio_calloc(__func__, 1, sizeof(*rate)); if (!rate) { dolog ("Could not allocate resampler (%zu bytes)\n", sizeof (*rate)); diff --git a/audio/ossaudio.c b/audio/ossaudio.c index 0edd7ea5fe..a0428881c2 100644 --- a/audio/ossaudio.c +++ b/audio/ossaudio.c @@ -582,11 +582,9 @@ static int oss_init_out(HWVoiceOut *hw, struct audsettings *as, } if (!oss->mmapped) { - oss->pcm_buf = audio_calloc ( - AUDIO_FUNC, - hw->samples, - 1 << hw->info.shift - ); + oss->pcm_buf = audio_calloc(__func__, + hw->samples, + 1 << hw->info.shift); if (!oss->pcm_buf) { dolog ( "Could not allocate DAC buffer (%d samples, each %d bytes)\n", @@ -705,7 +703,7 @@ static int oss_init_in(HWVoiceIn *hw, struct audsettings *as, void *drv_opaque) } hw->samples = (obt.nfrags * obt.fragsize) >> hw->info.shift; - oss->pcm_buf = audio_calloc (AUDIO_FUNC, hw->samples, 1 << hw->info.shift); + oss->pcm_buf = audio_calloc(__func__, hw->samples, 1 << hw->info.shift); if (!oss->pcm_buf) { dolog ("Could not allocate ADC buffer (%d samples, each %d bytes)\n", hw->samples, 1 << hw->info.shift); diff --git a/audio/paaudio.c b/audio/paaudio.c index 65beb6f010..8cf19c51d0 100644 --- a/audio/paaudio.c +++ b/audio/paaudio.c @@ -206,7 +206,7 @@ static void *qpa_thread_out (void *arg) PAVoiceOut *pa = arg; HWVoiceOut *hw = &pa->hw; - if (audio_pt_lock (&pa->pt, AUDIO_FUNC)) { + if (audio_pt_lock(&pa->pt, __func__)) { return NULL; } @@ -222,7 +222,7 @@ static void *qpa_thread_out (void *arg) break; } - if (audio_pt_wait (&pa->pt, AUDIO_FUNC)) { + if (audio_pt_wait(&pa->pt, __func__)) { goto exit; } } @@ -230,7 +230,7 @@ static void *qpa_thread_out (void *arg) decr = to_mix = audio_MIN (pa->live, pa->g->conf.samples >> 2); rpos = pa->rpos; - if (audio_pt_unlock (&pa->pt, AUDIO_FUNC)) { + if (audio_pt_unlock(&pa->pt, __func__)) { return NULL; } @@ -251,7 +251,7 @@ static void *qpa_thread_out (void *arg) to_mix -= chunk; } - if (audio_pt_lock (&pa->pt, AUDIO_FUNC)) { + if (audio_pt_lock(&pa->pt, __func__)) { return NULL; } @@ -261,7 +261,7 @@ static void *qpa_thread_out (void *arg) } exit: - audio_pt_unlock (&pa->pt, AUDIO_FUNC); + audio_pt_unlock(&pa->pt, __func__); return NULL; } @@ -270,7 +270,7 @@ static int qpa_run_out (HWVoiceOut *hw, int live) int decr; PAVoiceOut *pa = (PAVoiceOut *) hw; - if (audio_pt_lock (&pa->pt, AUDIO_FUNC)) { + if (audio_pt_lock(&pa->pt, __func__)) { return 0; } @@ -279,10 +279,10 @@ static int qpa_run_out (HWVoiceOut *hw, int live) pa->live = live - decr; hw->rpos = pa->rpos; if (pa->live > 0) { - audio_pt_unlock_and_signal (&pa->pt, AUDIO_FUNC); + audio_pt_unlock_and_signal(&pa->pt, __func__); } else { - audio_pt_unlock (&pa->pt, AUDIO_FUNC); + audio_pt_unlock(&pa->pt, __func__); } return decr; } @@ -298,7 +298,7 @@ static void *qpa_thread_in (void *arg) PAVoiceIn *pa = arg; HWVoiceIn *hw = &pa->hw; - if (audio_pt_lock (&pa->pt, AUDIO_FUNC)) { + if (audio_pt_lock(&pa->pt, __func__)) { return NULL; } @@ -314,7 +314,7 @@ static void *qpa_thread_in (void *arg) break; } - if (audio_pt_wait (&pa->pt, AUDIO_FUNC)) { + if (audio_pt_wait(&pa->pt, __func__)) { goto exit; } } @@ -322,7 +322,7 @@ static void *qpa_thread_in (void *arg) incr = to_grab = audio_MIN (pa->dead, pa->g->conf.samples >> 2); wpos = pa->wpos; - if (audio_pt_unlock (&pa->pt, AUDIO_FUNC)) { + if (audio_pt_unlock(&pa->pt, __func__)) { return NULL; } @@ -342,7 +342,7 @@ static void *qpa_thread_in (void *arg) to_grab -= chunk; } - if (audio_pt_lock (&pa->pt, AUDIO_FUNC)) { + if (audio_pt_lock(&pa->pt, __func__)) { return NULL; } @@ -352,7 +352,7 @@ static void *qpa_thread_in (void *arg) } exit: - audio_pt_unlock (&pa->pt, AUDIO_FUNC); + audio_pt_unlock(&pa->pt, __func__); return NULL; } @@ -361,7 +361,7 @@ static int qpa_run_in (HWVoiceIn *hw) int live, incr, dead; PAVoiceIn *pa = (PAVoiceIn *) hw; - if (audio_pt_lock (&pa->pt, AUDIO_FUNC)) { + if (audio_pt_lock(&pa->pt, __func__)) { return 0; } @@ -372,10 +372,10 @@ static int qpa_run_in (HWVoiceIn *hw) pa->dead = dead - incr; hw->wpos = pa->wpos; if (pa->dead > 0) { - audio_pt_unlock_and_signal (&pa->pt, AUDIO_FUNC); + audio_pt_unlock_and_signal(&pa->pt, __func__); } else { - audio_pt_unlock (&pa->pt, AUDIO_FUNC); + audio_pt_unlock(&pa->pt, __func__); } return incr; } @@ -579,7 +579,7 @@ static int qpa_init_out(HWVoiceOut *hw, struct audsettings *as, audio_pcm_init_info (&hw->info, &obt_as); hw->samples = g->conf.samples; - pa->pcm_buf = audio_calloc (AUDIO_FUNC, hw->samples, 1 << hw->info.shift); + pa->pcm_buf = audio_calloc(__func__, hw->samples, 1 << hw->info.shift); pa->rpos = hw->rpos; if (!pa->pcm_buf) { dolog ("Could not allocate buffer (%d bytes)\n", @@ -587,7 +587,7 @@ static int qpa_init_out(HWVoiceOut *hw, struct audsettings *as, goto fail2; } - if (audio_pt_init (&pa->pt, qpa_thread_out, hw, AUDIO_CAP, AUDIO_FUNC)) { + if (audio_pt_init(&pa->pt, qpa_thread_out, hw, AUDIO_CAP, __func__)) { goto fail3; } @@ -636,7 +636,7 @@ static int qpa_init_in(HWVoiceIn *hw, struct audsettings *as, void *drv_opaque) audio_pcm_init_info (&hw->info, &obt_as); hw->samples = g->conf.samples; - pa->pcm_buf = audio_calloc (AUDIO_FUNC, hw->samples, 1 << hw->info.shift); + pa->pcm_buf = audio_calloc(__func__, hw->samples, 1 << hw->info.shift); pa->wpos = hw->wpos; if (!pa->pcm_buf) { dolog ("Could not allocate buffer (%d bytes)\n", @@ -644,7 +644,7 @@ static int qpa_init_in(HWVoiceIn *hw, struct audsettings *as, void *drv_opaque) goto fail2; } - if (audio_pt_init (&pa->pt, qpa_thread_in, hw, AUDIO_CAP, AUDIO_FUNC)) { + if (audio_pt_init(&pa->pt, qpa_thread_in, hw, AUDIO_CAP, __func__)) { goto fail3; } @@ -667,17 +667,17 @@ static void qpa_fini_out (HWVoiceOut *hw) void *ret; PAVoiceOut *pa = (PAVoiceOut *) hw; - audio_pt_lock (&pa->pt, AUDIO_FUNC); + audio_pt_lock(&pa->pt, __func__); pa->done = 1; - audio_pt_unlock_and_signal (&pa->pt, AUDIO_FUNC); - audio_pt_join (&pa->pt, &ret, AUDIO_FUNC); + audio_pt_unlock_and_signal(&pa->pt, __func__); + audio_pt_join(&pa->pt, &ret, __func__); if (pa->stream) { pa_stream_unref (pa->stream); pa->stream = NULL; } - audio_pt_fini (&pa->pt, AUDIO_FUNC); + audio_pt_fini(&pa->pt, __func__); g_free (pa->pcm_buf); pa->pcm_buf = NULL; } @@ -687,17 +687,17 @@ static void qpa_fini_in (HWVoiceIn *hw) void *ret; PAVoiceIn *pa = (PAVoiceIn *) hw; - audio_pt_lock (&pa->pt, AUDIO_FUNC); + audio_pt_lock(&pa->pt, __func__); pa->done = 1; - audio_pt_unlock_and_signal (&pa->pt, AUDIO_FUNC); - audio_pt_join (&pa->pt, &ret, AUDIO_FUNC); + audio_pt_unlock_and_signal(&pa->pt, __func__); + audio_pt_join(&pa->pt, &ret, __func__); if (pa->stream) { pa_stream_unref (pa->stream); pa->stream = NULL; } - audio_pt_fini (&pa->pt, AUDIO_FUNC); + audio_pt_fini(&pa->pt, __func__); g_free (pa->pcm_buf); pa->pcm_buf = NULL; } diff --git a/audio/sdlaudio.c b/audio/sdlaudio.c index e8d91d22af..e92135bd2f 100644 --- a/audio/sdlaudio.c +++ b/audio/sdlaudio.c @@ -277,7 +277,7 @@ static void sdl_callback (void *opaque, Uint8 *buf, int len) return; } - if (audio_bug (AUDIO_FUNC, sdl->live < 0 || sdl->live > hw->samples)) { + if (audio_bug(__func__, sdl->live < 0 || sdl->live > hw->samples)) { dolog ("sdl->live=%d hw->samples=%d\n", sdl->live, hw->samples); return; diff --git a/audio/wavaudio.c b/audio/wavaudio.c index 341eec3121..068a595732 100644 --- a/audio/wavaudio.c +++ b/audio/wavaudio.c @@ -139,7 +139,7 @@ static int wav_init_out(HWVoiceOut *hw, struct audsettings *as, audio_pcm_init_info (&hw->info, &wav_as); hw->samples = 1024; - wav->pcm_buf = audio_calloc (AUDIO_FUNC, hw->samples, 1 << hw->info.shift); + wav->pcm_buf = audio_calloc(__func__, hw->samples, 1 << hw->info.shift); if (!wav->pcm_buf) { dolog ("Could not allocate buffer (%d bytes)\n", hw->samples << hw->info.shift); From patchwork Thu Oct 19 16:15:50 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alistair Francis X-Patchwork-Id: 828202 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; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=xilinx.onmicrosoft.com header.i=@xilinx.onmicrosoft.com header.b="ExcADiy7"; 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 3yHvVV1yXwz9ryT for ; Fri, 20 Oct 2017 03:28:02 +1100 (AEDT) Received: from localhost ([::1]:50097 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e5Dfs-0001vI-9v for incoming@patchwork.ozlabs.org; Thu, 19 Oct 2017 12:28:00 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:55047) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e5DYK-0004Cy-Rp for qemu-devel@nongnu.org; Thu, 19 Oct 2017 12:20:16 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1e5DYF-0000w8-AU for qemu-devel@nongnu.org; Thu, 19 Oct 2017 12:20:10 -0400 Received: from mail-bl2nam02on0078.outbound.protection.outlook.com ([104.47.38.78]:35264 helo=NAM02-BL2-obe.outbound.protection.outlook.com) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1e5DY4-0000qk-Ka; Thu, 19 Oct 2017 12:19:56 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=xilinx.onmicrosoft.com; s=selector1-xilinx-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=qbmFgprExjBMNU8/uMp2eNM1Sj7b+v/tyGcpi0pjc1M=; b=ExcADiy7wZWTHOwHeJlK3mi9xeE7XgQNkcv/QuYyXjjE9lhA4Vld9GEyGe17YGA837hc9T+X/Q7TZ5az00ofrJlt+/hro+OrDsDqyQJq+ywqcB80Bm8ry6+v3+x5S2ZniFw9rBo07m5TPlhreghOA1RSXRRGgGykcA4IyPVVfaA= Received: from BY2PR02CA0111.namprd02.prod.outlook.com (10.163.44.165) by MWHPR02MB3278.namprd02.prod.outlook.com (10.164.187.138) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.156.4; Thu, 19 Oct 2017 16:19:52 +0000 Received: from CY1NAM02FT012.eop-nam02.prod.protection.outlook.com (2a01:111:f400:7e45::203) by BY2PR02CA0111.outlook.office365.com (2a01:111:e400:5261::37) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.77.7 via Frontend Transport; Thu, 19 Oct 2017 16:19:52 +0000 Authentication-Results: spf=pass (sender IP is 149.199.60.100) smtp.mailfrom=xilinx.com; nongnu.org; dkim=none (message not signed) header.d=none;nongnu.org; dmarc=bestguesspass action=none header.from=xilinx.com; Received-SPF: Pass (protection.outlook.com: domain of xilinx.com designates 149.199.60.100 as permitted sender) receiver=protection.outlook.com; client-ip=149.199.60.100; helo=xsj-pvapsmtpgw02; Received: from xsj-pvapsmtpgw02 (149.199.60.100) by CY1NAM02FT012.mail.protection.outlook.com (10.152.75.158) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.20.77.10 via Frontend Transport; Thu, 19 Oct 2017 16:19:48 +0000 Received: from unknown-38-66.xilinx.com ([149.199.38.66]:35227 helo=xsj-pvapsmtp01) by xsj-pvapsmtpgw02 with esmtp (Exim 4.63) (envelope-from ) id 1e5DXw-0007v2-9m; Thu, 19 Oct 2017 09:19:48 -0700 Received: from [127.0.0.1] (helo=localhost) by xsj-pvapsmtp01 with smtp (Exim 4.63) (envelope-from ) id 1e5DXw-0002R4-6o; Thu, 19 Oct 2017 09:19:48 -0700 Received: from xsj-pvapsmtp01 (mailman.xilinx.com [149.199.38.66]) by xsj-smtp-dlp2.xlnx.xilinx.com (8.13.8/8.13.1) with ESMTP id v9JGJhmh003103; Thu, 19 Oct 2017 09:19:44 -0700 Received: from [172.19.2.220] (helo=localhost.localdomain) by xsj-pvapsmtp01 with esmtp (Exim 4.63) (envelope-from ) id 1e5DXr-0002Qh-Nu; Thu, 19 Oct 2017 09:19:43 -0700 From: Alistair Francis To: Date: Thu, 19 Oct 2017 09:15:50 -0700 Message-ID: X-Mailer: git-send-email 2.11.0 In-Reply-To: References: X-RCIS-Action: ALLOW X-TM-AS-Product-Ver: IMSS-7.1.0.1224-8.1.0.1062-23404.005 X-TM-AS-User-Approved-Sender: Yes;Yes X-EOPAttributedMessage: 0 X-MS-Office365-Filtering-HT: Tenant X-Forefront-Antispam-Report: CIP:149.199.60.100; IPV:NLI; CTRY:US; EFV:NLI; SFV:NSPM; SFS:(10009020)(6009001)(346002)(39860400002)(376002)(2980300002)(438002)(199003)(189002)(2906002)(50226002)(63266004)(356003)(81166006)(8936002)(106466001)(4326008)(575784001)(316002)(36386004)(47776003)(2351001)(33646002)(54906003)(39060400002)(16586007)(189998001)(478600001)(36756003)(6916009)(6666003)(2950100002)(50466002)(5660300001)(48376002)(118296001)(50986999)(5003940100001)(305945005)(8676002)(81156014)(76176999)(106002)(9786002)(53946003)(77096006)(107986001)(5001870100001); DIR:OUT; SFP:1101; SCL:1; SRVR:MWHPR02MB3278; H:xsj-pvapsmtpgw02; FPR:; SPF:Pass; PTR:unknown-60-100.xilinx.com,xapps1.xilinx.com; A:1; MX:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; CY1NAM02FT012; 1:3sv1jZB6JSRscbHDUssDJbMREjFeAkJzYRkz0XmNHtqGZ+N2x+4kkKIRNJLZ+aux4LJtRUNe8QzUmyndHDt1J+Y7RwpA0dHzQSOmubzIdP7gizNt2NLyoJmbxIJCS+ew MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: f91e48e1-0fc6-4951-8ffe-08d5170d38ae X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001)(2017030254152)(8251501002)(2017052603199)(201703131423075)(201703031133081)(201702281549075); SRVR:MWHPR02MB3278; X-Microsoft-Exchange-Diagnostics: 1; MWHPR02MB3278; 3:PvwryKZqOb08NfWm5X2T07x1RhnBsTQysbmebIzCHQ8GdNq2D9JglUqLgXcPKmLzSCX5FEELSkITJT3MgtLLRLnaLjglYLdd3LZGySV8dIQKI4DqMp/8O2aI6nrCFRB40j+2/SJG0SYaP6m+ff6sj//NndeWDlsMtStihBYAgflNZ+s1+BEAMESITNljFEVfrHWLFdeHwWyFQaviITfWvvU50ftlR2iNiMwVJzlAMZ3G7OZmi/8T1XTzE8mxKpCw9/wufv2J6bhwFsHPMbRJo/TSeXbiZSU8YAQZqG8c2Q6mWEc4RQsmBUijiaOltg/6NlxNwSGO+Q7sbQkrT1saoC48D8zZjw05d6K6YGFTu04=; 25:BxDxR68jynPs8pAe3Nnk4fhE/Xn230K1HvukEG6WfEN1w7/eply7brs2K3uSQBq8E3rD6cIB/9Pck3mmxSR7phlXg4W+IEW27LDE8b3GzW5kbO41kE10S1gG06m+Pl26QXj+lk20viwoZzM+jVj9XFmFzWqVTh1pP6sEE4g6gqwJSUn+F5BxWJi0f/ZhxHfXvSnHzQxZ630P8LGcb7x/bXHXw8cVnuM3wmtU/a9hGszo3yoiHw1abqPygKMYSzCAkv1r5tr3GrcSMwvZ5OvN5jWbncy7RSPwj+QtQZjGROjRJNPMJOMCxi+QTn4TbqncPUkXn9zIXuHD2zWKlLs/hQ== X-MS-TrafficTypeDiagnostic: MWHPR02MB3278: X-Microsoft-Exchange-Diagnostics: 1; MWHPR02MB3278; 31:lgkM8qbT0ZiW0BZUS6VbtxTfEyHgx0BPCO3zpX+mFUI1O4GFKfCjsawaEarKC8MW6N7QLTWo9Qc5BAIBqv/JbAP5hi+w5SHZ0s1eRIjjfog7veRn+3DWVOCBDVqx4HoljFnIOKivZ0xNHcB7QKwetd4Oze1j9di+faMN6pi4ikgAUJI3r3Iv82SpBcmM/enXfB4FY430mkNAnPVoUaQqw6p+1Hap1y3ck4RT5RuknbQ=; 20:TU41rHD6vCDnYtkNFmeRKdDkfp9XzmcQt0mGCvwU8FiWdbbjXQjVf1uS5ENspV61mMx3LnPaCQKb5zUd39S29psHsafw56mI+0aQgGckeYcSNVpDTc3ulO196iM/6KNA3pApPExZUPe5X1YM7bntzk0vTMJTLALK+3IXHxvDEtGgNdRNZ7FUobqXEnbaG+ola4B78Jxt2QQ3ueCa20FtpzPfqlk5ifzXcOIQEVpy7kv7QRakNxAjbldAz2Y5pqKTfCvKpvRfQ5kDFcTg47scp6CSeW3TlHCb3pJw+0vYy6D6if+byfvYvcx9RDywGC39fVvyQmulMdi0NtDCgwyW2VkUAFh2lCyuwTkkWq7cU2tcd/GuZ0fzKM/FYIxDCI7r2B1Px20/Jq2HRsOwL6ZUqtHHWaamPlyDy4qioMdnPhCTj5mLII9hmLSRPS6DxbG7Intn8DvcPTYxRX3+Mom7lKnx6edDkLIMStv6pYFBRWNPwB4bNqApjJgP/uIgJULC X-Exchange-Antispam-Report-Test: UriScan:(788757137089)(192813158149592); X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(100000700101)(100105000095)(100000701101)(100105300095)(100000702101)(100105100095)(6040450)(2401047)(8121501046)(5005006)(100000703101)(100105400095)(93006095)(93004095)(10201501046)(3002001)(6055026)(6041248)(20161123558100)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123560025)(20161123564025)(20161123562025)(20161123555025)(6072148)(201708071742011)(100000704101)(100105200095)(100000705101)(100105500095); SRVR:MWHPR02MB3278; BCL:0; PCL:0; RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095); SRVR:MWHPR02MB3278; X-Microsoft-Exchange-Diagnostics: 1; MWHPR02MB3278; 4:bV/1cWYnghIE55C3WRghlwcQYZEfBk9W20s8si++d+sVAw+onTtUuLDnQS1iz++TriGZGxZ+K5mDusxS1Fs68/GibajWV7GwJXZcXVgSvs0GVmM8eRYP5Cooa2e1NXXM6xaJXwats1BUMHbYtXq24jbiPLVvNxDBkc2nhtFCqcCSIZPaN4mqJNNvz3jkYJugz6Xjh/brAR00cf2vs6trJZRfFn2VaGxEOWbV5NSFRBt0FxTBVYufU2CGGxX8RYj9zaYKOLe1DXkIBPV8gHVRxH5AN/rtqNnhbXfUFDHb9b2IMw1WLgixBMpRb1Rvw5zAYCqyUhJiGHlA8HotKywVSA== X-Forefront-PRVS: 0465429B7F X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; MWHPR02MB3278; 23:U2mVOUsqr2yfYEpso3wwBowq/jFN4hKJyZFsB1L3C?= nBGLVG1vcN8+E4x6c+043LAclJHv1zTRZva2jDQ1tlIpaC1XiqcCm5hNLx8ZtiGk/mr+LaOcdCbs4DSpYX5M7SwG75gxudwc2M+PL0Nbs+AJRCsfbRRztJCopwYQKePGjSrfjyAPrQB/7t/WN68dtRywb8ihQKqF7424CRZhYNyE8bphUUtg0fmDJt+R7X2ttvCC5v2y2q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U0XpdyvceqYvVGfqa0AapEnkQ+qPMSJJN9sp3hREnjBa1Pr4IBm3td7NKkbuS6pTE8rJaSLn7KS4kLGPQnyHEHQSOI0AB8EAiM1SWXRxAZHQIgFLvxtCDY/jmYtOAWSZAKzymbgao1OAUGgB4IHCXrKCLA4oCHug5Ow2Y425SdnbyWUS4rwZub9zw==; 5:YCOYup1yNO1dkiCqKnTrnuJbJ15V26CFbRnaRFQszU2LT32kK3BeFuAemsFSPKNSrhXCAREHH+0qmJoBR0M9nRerIkTicZgZY7zjzE25breFtdE0sABKDgy1LaDLlyGl62r2fwmJ7INePfqRT73DtQ==; 24:TbK0uSZtyNpMkWQ2//RdaN8VZ++Vr8qc8J8Kr/vpNbb03/rLOHzDLddGJxrPqKGiLT4r7x9v2o9dGqt2Q2oY+SW/Z/RPfxJKKKTh12hnE2E=; 7:uf5gWGFszKX8SDUQUz0fLkR+hP+wpE1LSJ7wiyo2QnSIstVD3jD8gVurYXXVY8ywMplJDBiQBPjqHw2DngOSQBEnt/AVmgiCmtT6CIgeO4qbfX0eMq+QvCpP34Jal5Ph6qkWcGwI1O2aOvbvjBfCg7mIitTN6Z/2Qja9OWyY2FzKgS67Jn71P7gsAIG+7ZRiP51BYqNcu3zlTaxe81EBTXQrEsYG2whQDTOTTp0z860= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: xilinx.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 19 Oct 2017 16:19:48.9208 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: f91e48e1-0fc6-4951-8ffe-08d5170d38ae X-MS-Exchange-CrossTenant-Id: 657af505-d5df-48d0-8300-c31994686c5c X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=657af505-d5df-48d0-8300-c31994686c5c; Ip=[149.199.60.100]; Helo=[xsj-pvapsmtpgw02] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: MWHPR02MB3278 X-detected-operating-system: by eggs.gnu.org: Windows 7 or 8 [fuzzy] X-Received-From: 104.47.38.78 Subject: [Qemu-devel] [PATCH v3 04/46] tests: Replace fprintf(stderr, "*\n" with error_report() 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: qemu-block@nongnu.org, "Michael S. Tsirkin" , armbru@redhat.com, "Dr. David Alan Gilbert" , Gerd Hoffmann , Igor Mammedov , alistair23@gmail.com, alistair.francis@xilinx.com Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" Replace a large number of the fprintf(stderr, "*\n" calls with error_report(). The functions were renamed with these commands and then compiler issues where manually fixed. find ./* -type f -exec sed -i \ 'N;N;N;N;N;N;N;N;N;N;N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2);|Ig}' \ {} + find ./* -type f -exec sed -i \ 'N;N;N;N;N;N;N;N;N;N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2);|Ig}' \ {} + find ./* -type f -exec sed -i \ 'N;N;N;N;N;N;N;N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2);|Ig}' \ {} + find ./* -type f -exec sed -i \ 'N;N;N;N;N;N;N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2);|Ig}' \ {} + find ./* -type f -exec sed -i \ 'N;N;N;N;N;N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2);|Ig}' \ {} + find ./* -type f -exec sed -i \ 'N;N;N;N;N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2);|Ig}' \ {} + find ./* -type f -exec sed -i \ 'N;N;N;N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2);|Ig}' \ {} + find ./* -type f -exec sed -i \ 'N;N;N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2);|Ig}' \ {} + find ./* -type f -exec sed -i \ 'N;N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2);|Ig}' \ {} + find ./* -type f -exec sed -i \ 'N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2);|Ig}' \ {} + find ./* -type f -exec sed -i \ 'N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2);|Ig}' \ {} + Some of the error_report()'s were manually kept as fprintf(stderr, ) to maintain standalone test cases. Signed-off-by: Alistair Francis Cc: "Michael S. Tsirkin" Cc: Igor Mammedov Cc: "Dr. David Alan Gilbert" Cc: Gerd Hoffmann Cc: qemu-block@nongnu.org --- V2: - Keep some of the fprintf() calls - Remove a file I accidently checked in tests/Makefile.include | 4 ++-- tests/ahci-test.c | 3 ++- tests/bios-tables-test.c | 5 +++-- tests/i440fx-test.c | 8 ++++---- tests/libqos/ahci.c | 10 +++++----- tests/libqos/libqos.c | 7 ++++--- tests/libqos/malloc.c | 13 ++++++------ tests/libqtest.c | 13 ++++++------ tests/migration/stress.c | 36 +++++++++++++++++----------------- tests/postcopy-test.c | 8 ++++---- tests/qemu-iotests/socket_scm_helper.c | 11 ++++++----- tests/rcutorture.c | 5 +++-- tests/tcg/linux-test.c | 2 +- tests/tcg/runcom.c | 6 +++--- tests/tcg/test-i386-fprem.c | 2 +- tests/tcg/test_path.c | 4 ++-- tests/test-hmp.c | 5 +++-- tests/test-rcu-list.c | 5 +++-- tests/usb-hcd-ehci-test.c | 2 +- tests/vhost-user-bridge.c | 28 +++++++++++++------------- 20 files changed, 93 insertions(+), 84 deletions(-) diff --git a/tests/Makefile.include b/tests/Makefile.include index 4ca15e6817..f24ea63ac3 100644 --- a/tests/Makefile.include +++ b/tests/Makefile.include @@ -618,7 +618,7 @@ tests/test-vmstate$(EXESUF): tests/test-vmstate.o \ $(test-io-obj-y) tests/test-timed-average$(EXESUF): tests/test-timed-average.o $(test-util-obj-y) tests/test-base64$(EXESUF): tests/test-base64.o $(test-util-obj-y) -tests/ptimer-test$(EXESUF): tests/ptimer-test.o tests/ptimer-test-stubs.o hw/core/ptimer.o +tests/ptimer-test$(EXESUF): tests/ptimer-test.o tests/ptimer-test-stubs.o hw/core/ptimer.o $(test-util-obj-y) tests/test-logging$(EXESUF): tests/test-logging.o $(test-util-obj-y) @@ -785,7 +785,7 @@ tests/postcopy-test$(EXESUF): tests/postcopy-test.o tests/vhost-user-test$(EXESUF): tests/vhost-user-test.o $(test-util-obj-y) \ $(qtest-obj-y) $(test-io-obj-y) $(libqos-virtio-obj-y) $(libqos-pc-obj-y) \ $(chardev-obj-y) -tests/qemu-iotests/socket_scm_helper$(EXESUF): tests/qemu-iotests/socket_scm_helper.o +tests/qemu-iotests/socket_scm_helper$(EXESUF): tests/qemu-iotests/socket_scm_helper.o $(test-util-obj-y) tests/test-qemu-opts$(EXESUF): tests/test-qemu-opts.o $(test-util-obj-y) tests/test-keyval$(EXESUF): tests/test-keyval.o $(test-util-obj-y) $(test-qapi-obj-y) tests/test-write-threshold$(EXESUF): tests/test-write-threshold.o $(test-block-obj-y) diff --git a/tests/ahci-test.c b/tests/ahci-test.c index cb84edc8fb..ac8a30ab8b 100644 --- a/tests/ahci-test.c +++ b/tests/ahci-test.c @@ -23,6 +23,7 @@ */ #include "qemu/osdep.h" +#include "qemu/error-report.h" #include #include "libqtest.h" @@ -1859,7 +1860,7 @@ int main(int argc, char **argv) ahci_pedantic = 1; break; default: - fprintf(stderr, "Unrecognized ahci_test option.\n"); + error_report("Unrecognized ahci_test option."); g_assert_not_reached(); } } diff --git a/tests/bios-tables-test.c b/tests/bios-tables-test.c index 564da45f65..0955c72a74 100644 --- a/tests/bios-tables-test.c +++ b/tests/bios-tables-test.c @@ -11,6 +11,7 @@ */ #include "qemu/osdep.h" +#include "qemu/error-report.h" #include #include "qemu-common.h" #include "hw/smbios/smbios.h" @@ -396,7 +397,7 @@ try_again: aml_file = g_strdup_printf("%s/%s/%.4s%s", data_dir, data->machine, (gchar *)&signature, ext); if (getenv("V")) { - fprintf(stderr, "\nLooking for expected file '%s'\n", aml_file); + error_report("Looking for expected file '%s'", aml_file); } if (g_file_test(aml_file, G_FILE_TEST_EXISTS)) { exp_sdt.aml_file = aml_file; @@ -408,7 +409,7 @@ try_again: } g_assert(exp_sdt.aml_file); if (getenv("V")) { - fprintf(stderr, "\nUsing expected file '%s'\n", aml_file); + error_report("Using expected file '%s'", aml_file); } ret = g_file_get_contents(aml_file, &exp_sdt.aml, &exp_sdt.aml_len, &error); diff --git a/tests/i440fx-test.c b/tests/i440fx-test.c index e9d05c87d1..75fb9742ce 100644 --- a/tests/i440fx-test.c +++ b/tests/i440fx-test.c @@ -13,7 +13,7 @@ */ #include "qemu/osdep.h" - +#include "qemu/error-report.h" #include "libqtest.h" #include "libqos/pci.h" #include "libqos/pci-pc.h" @@ -295,18 +295,18 @@ static char *create_blob_file(void) ret = -1; fd = g_file_open_tmp("blob_XXXXXX", &pathname, &error); if (fd == -1) { - fprintf(stderr, "unable to create blob file: %s\n", error->message); + error_report("unable to create blob file: %s", error->message); g_error_free(error); } else { if (ftruncate(fd, BLOB_SIZE) == -1) { - fprintf(stderr, "ftruncate(\"%s\", %zu): %s\n", pathname, + error_report("ftruncate(\"%s\", %zu): %s", pathname, BLOB_SIZE, strerror(errno)); } else { void *buf; buf = mmap(NULL, BLOB_SIZE, PROT_WRITE, MAP_SHARED, fd, 0); if (buf == MAP_FAILED) { - fprintf(stderr, "mmap(\"%s\", %zu): %s\n", pathname, BLOB_SIZE, + error_report("mmap(\"%s\", %zu): %s", pathname, BLOB_SIZE, strerror(errno)); } else { size_t i; diff --git a/tests/libqos/ahci.c b/tests/libqos/ahci.c index 13c0749582..286f5c3e64 100644 --- a/tests/libqos/ahci.c +++ b/tests/libqos/ahci.c @@ -23,7 +23,7 @@ */ #include "qemu/osdep.h" - +#include "qemu/error-report.h" #include "libqtest.h" #include "libqos/ahci.h" #include "libqos/pci-pc.h" @@ -985,9 +985,9 @@ static void ahci_atapi_command_set_offset(AHCICommand *cmd, uint64_t lba) default: /* SCSI doesn't have uniform packet formats, * so you have to add support for it manually. Sorry! */ - fprintf(stderr, "The Libqos AHCI driver does not support the " + error_report("The Libqos AHCI driver does not support the " "set_offset operation for ATAPI command 0x%02x, " - "please add support.\n", + "please add support.", cbd[0]); g_assert_not_reached(); } @@ -1060,8 +1060,8 @@ static void ahci_atapi_set_size(AHCICommand *cmd, uint64_t xbytes) default: /* SCSI doesn't have uniform packet formats, * so you have to add support for it manually. Sorry! */ - fprintf(stderr, "The Libqos AHCI driver does not support the set_size " - "operation for ATAPI command 0x%02x, please add support.\n", + error_report("The Libqos AHCI driver does not support the set_size " + "operation for ATAPI command 0x%02x, please add support.", cbd[0]); g_assert_not_reached(); } diff --git a/tests/libqos/libqos.c b/tests/libqos/libqos.c index 991bc1aec2..c84ffb6925 100644 --- a/tests/libqos/libqos.c +++ b/tests/libqos/libqos.c @@ -1,4 +1,5 @@ #include "qemu/osdep.h" +#include "qemu/error-report.h" #include #include "libqtest.h" @@ -155,7 +156,7 @@ void migrate(QOSState *from, QOSState *to, const char *uri) continue; } - fprintf(stderr, "Migration did not complete, status: %s\n", st); + error_report("Migration did not complete, status: %s", st); g_assert_not_reached(); } @@ -199,7 +200,7 @@ void mkimg(const char *file, const char *fmt, unsigned size_mb) fmt, file, size_mb); ret = g_spawn_command_line_sync(cli, &out, &out2, &rc, &err); if (err) { - fprintf(stderr, "%s\n", err->message); + error_report("%s", err->message); g_error_free(err); } g_assert(ret && !err); @@ -210,7 +211,7 @@ void mkimg(const char *file, const char *fmt, unsigned size_mb) * 0 is only possible if the program exited normally, so that should be * sufficient for our purposes on all platforms, here. */ if (rc) { - fprintf(stderr, "qemu-img returned status code %d\n", rc); + error_report("qemu-img returned status code %d", rc); } g_assert(!rc); diff --git a/tests/libqos/malloc.c b/tests/libqos/malloc.c index ac05874b0a..a655a25f1f 100644 --- a/tests/libqos/malloc.c +++ b/tests/libqos/malloc.c @@ -11,6 +11,7 @@ */ #include "qemu/osdep.h" +#include "qemu/error-report.h" #include "libqos/malloc.h" #include "qemu-common.h" #include "qemu/host-utils.h" @@ -193,7 +194,7 @@ static uint64_t mlist_alloc(QGuestAllocator *s, uint64_t size) node = mlist_find_space(s->free, size); if (!node) { - fprintf(stderr, "Out of guest memory.\n"); + error_report("Out of guest memory."); g_assert_not_reached(); } return mlist_fulfill(s, node, size); @@ -209,8 +210,8 @@ static void mlist_free(QGuestAllocator *s, uint64_t addr) node = mlist_find_key(s->used, addr); if (!node) { - fprintf(stderr, "Error: no record found for an allocation at " - "0x%016" PRIx64 ".\n", + error_report("Error: no record found for an allocation at " + "0x%016" PRIx64 ".", addr); g_assert_not_reached(); } @@ -234,8 +235,8 @@ void alloc_uninit(QGuestAllocator *allocator) /* Check for guest leaks, and destroy the list. */ QTAILQ_FOREACH_SAFE(node, allocator->used, MLIST_ENTNAME, tmp) { if (allocator->opts & (ALLOC_LEAK_WARN | ALLOC_LEAK_ASSERT)) { - fprintf(stderr, "guest malloc leak @ 0x%016" PRIx64 "; " - "size 0x%016" PRIx64 ".\n", + error_report("guest malloc leak @ 0x%016" PRIx64 "; " + "size 0x%016" PRIx64 ".", node->addr, node->size); } if (allocator->opts & (ALLOC_LEAK_ASSERT)) { @@ -251,7 +252,7 @@ void alloc_uninit(QGuestAllocator *allocator) if ((allocator->opts & mask) == mask) { if ((node->addr != allocator->start) || (node->size != allocator->end - allocator->start)) { - fprintf(stderr, "Free list is corrupted.\n"); + error_report("Free list is corrupted."); g_assert_not_reached(); } } diff --git a/tests/libqtest.c b/tests/libqtest.c index adf71188b6..936ace03c9 100644 --- a/tests/libqtest.c +++ b/tests/libqtest.c @@ -15,6 +15,7 @@ * */ #include "qemu/osdep.h" +#include "qemu/error-report.h" #include "libqtest.h" #include @@ -89,7 +90,7 @@ static int socket_accept(int sock) ret = accept(sock, (struct sockaddr *)&addr, &addrlen); } while (ret == -1 && errno == EINTR); if (ret == -1) { - fprintf(stderr, "%s failed: %s\n", __func__, strerror(errno)); + error_report("%s failed: %s", __func__, strerror(errno)); } close(sock); @@ -155,7 +156,7 @@ static const char *qtest_qemu_binary(void) qemu_bin = getenv("QTEST_QEMU_BINARY"); if (!qemu_bin) { - fprintf(stderr, "Environment variable QTEST_QEMU_BINARY required\n"); + error_report("Environment variable QTEST_QEMU_BINARY required"); exit(1); } @@ -312,7 +313,7 @@ static GString *qtest_recv_line(QTestState *s) } if (len == -1 || len == 0) { - fprintf(stderr, "Broken pipe\n"); + error_report("Broken pipe"); exit(1); } @@ -397,7 +398,7 @@ static void qmp_response(JSONMessageParser *parser, GQueue *tokens) obj = json_parser_parse(tokens, NULL); if (!obj) { - fprintf(stderr, "QMP JSON response parsing failed\n"); + error_report("QMP JSON response parsing failed"); exit(1); } @@ -423,7 +424,7 @@ QDict *qmp_fd_receive(int fd) } if (len == -1 || len == 0) { - fprintf(stderr, "Broken pipe\n"); + error_report("Broken pipe"); exit(1); } @@ -880,7 +881,7 @@ void qtest_bufread(QTestState *s, uint64_t addr, void *data, size_t size) g_base64_decode_inplace(args[1], &len); if (size != len) { - fprintf(stderr, "bufread: asked for %zu bytes but decoded %zu\n", + error_report("bufread: asked for %zu bytes but decoded %zu", size, len); len = MIN(len, size); } diff --git a/tests/migration/stress.c b/tests/migration/stress.c index cf8ce8b16d..49e1ff4555 100644 --- a/tests/migration/stress.c +++ b/tests/migration/stress.c @@ -47,7 +47,7 @@ static __attribute__((noreturn)) void exit_failure(void) if (getpid() == 1) { sync(); reboot(RB_POWER_OFF); - fprintf(stderr, "%s (%05d): ERROR: cannot reboot: %s\n", + error_report("%s (%05d): cannot reboot: %s", argv0, gettid(), strerror(errno)); abort(); } else { @@ -60,7 +60,7 @@ static __attribute__((noreturn)) void exit_success(void) if (getpid() == 1) { sync(); reboot(RB_POWER_OFF); - fprintf(stderr, "%s (%05d): ERROR: cannot reboot: %s\n", + error_report("%s (%05d): cannot reboot: %s", argv0, gettid(), strerror(errno)); abort(); } else { @@ -76,13 +76,13 @@ static int get_command_arg_str(const char *name, char *start, *end; if (fp == NULL) { - fprintf(stderr, "%s (%05d): ERROR: cannot open /proc/cmdline: %s\n", + error_report("%s (%05d): cannot open /proc/cmdline: %s", argv0, gettid(), strerror(errno)); return -1; } if (!fgets(line, sizeof line, fp)) { - fprintf(stderr, "%s (%05d): ERROR: cannot read /proc/cmdline: %s\n", + error_report("%s (%05d): cannot read /proc/cmdline: %s", argv0, gettid(), strerror(errno)); fclose(fp); return -1; @@ -96,8 +96,8 @@ static int get_command_arg_str(const char *name, start += strlen(name); if (*start != '=') { - fprintf(stderr, "%s (%05d): ERROR: no value provided for '%s' in /proc/cmdline\n", - argv0, gettid(), name); + error_report("%s (%05d): no value provided for '%s' in /proc/cmdline", + argv0, gettid(), name); } start++; @@ -106,8 +106,8 @@ static int get_command_arg_str(const char *name, end = strstr(start, "\n"); if (end == start) { - fprintf(stderr, "%s (%05d): ERROR: no value provided for '%s' in /proc/cmdline\n", - argv0, gettid(), name); + error_report("%s (%05d): no value provided for '%s' in /proc/cmdline", + argv0, gettid(), name); return -1; } @@ -132,7 +132,7 @@ static int get_command_arg_ull(const char *name, errno = 0; *val = strtoll(valstr, &end, 10); if (errno || *end) { - fprintf(stderr, "%s (%05d): ERROR: cannot parse %s value %s\n", + error_report("%s (%05d): cannot parse %s value %s", argv0, gettid(), name, valstr); free(valstr); return -1; @@ -148,13 +148,13 @@ static int random_bytes(char *buf, size_t len) fd = open("/dev/urandom", O_RDONLY); if (fd < 0) { - fprintf(stderr, "%s (%05d): ERROR: cannot open /dev/urandom: %s\n", + error_report("%s (%05d): cannot open /dev/urandom: %s", argv0, gettid(), strerror(errno)); return -1; } if (read(fd, buf, len) != len) { - fprintf(stderr, "%s (%05d): ERROR: cannot read /dev/urandom: %s\n", + error_report("%s (%05d): cannot read /dev/urandom: %s", argv0, gettid(), strerror(errno)); close(fd); return -1; @@ -187,12 +187,12 @@ static int stressone(unsigned long long ramsizeMB) unsigned long long before, after; if (!ram) { - fprintf(stderr, "%s (%05d): ERROR: cannot allocate %llu MB of RAM: %s\n", + error_report("%s (%05d): cannot allocate %llu MB of RAM: %s", argv0, gettid(), ramsizeMB, strerror(errno)); return -1; } if (!data) { - fprintf(stderr, "%s (%d): ERROR: cannot allocate %d bytes of RAM: %s\n", + error_report("%s (%d): cannot allocate %d bytes of RAM: %s", argv0, gettid(), PAGE_SIZE, strerror(errno)); free(ram); return -1; @@ -271,13 +271,13 @@ static int stress(unsigned long long ramsizeGB, int ncpus) static int mount_misc(const char *fstype, const char *dir) { if (mkdir(dir, 0755) < 0 && errno != EEXIST) { - fprintf(stderr, "%s (%05d): ERROR: cannot create %s: %s\n", + error_report("%s (%05d): cannot create %s: %s", argv0, gettid(), dir, strerror(errno)); return -1; } if (mount("none", dir, fstype, 0, NULL) < 0) { - fprintf(stderr, "%s (%05d): ERROR: cannot mount %s: %s\n", + error_report("%s (%05d): cannot mount %s: %s", argv0, gettid(), dir, strerror(errno)); return -1; } @@ -322,7 +322,7 @@ int main(int argc, char **argv) errno = 0; ramsizeGB = strtoll(optarg, &end, 10); if (errno != 0 || *end) { - fprintf(stderr, "%s (%05d): ERROR: Cannot parse RAM size %s\n", + error_report("%s (%05d): Cannot parse RAM size %s", argv0, gettid(), optarg); exit_failure(); } @@ -332,7 +332,7 @@ int main(int argc, char **argv) errno = 0; ncpus = strtoll(optarg, &end, 10); if (errno != 0 || *end) { - fprintf(stderr, "%s (%05d): ERROR: Cannot parse CPU count %s\n", + error_report("%s (%05d): Cannot parse CPU count %s", argv0, gettid(), optarg); exit_failure(); } @@ -340,7 +340,7 @@ int main(int argc, char **argv) case '?': case 'h': - fprintf(stderr, "%s: [--help][--ramsize GB][--cpus N]\n", argv0); + error_report("%s: [--help][--ramsize GB][--cpus N]", argv0); exit_failure(); } } diff --git a/tests/postcopy-test.c b/tests/postcopy-test.c index 8142f2ab90..32bb11ba82 100644 --- a/tests/postcopy-test.c +++ b/tests/postcopy-test.c @@ -11,7 +11,7 @@ */ #include "qemu/osdep.h" - +#include "qemu/error-report.h" #include "libqtest.h" #include "qemu/option.h" #include "qemu/range.h" @@ -214,7 +214,7 @@ static void wait_for_serial(const char *side) break; default: - fprintf(stderr, "Unexpected %d on %s serial\n", readvalue, side); + error_report("Unexpected %d on %s serial", readvalue, side); g_assert_not_reached(); } } while (true); @@ -333,9 +333,9 @@ static void check_guests_ram(void) */ hit_edge = true; } else { - fprintf(stderr, "Memory content inconsistency at %x" + error_report("Memory content inconsistency at %x" " first_byte = %x last_byte = %x current = %x" - " hit_edge = %x\n", + " hit_edge = %x", address, first_byte, last_byte, b, hit_edge); bad = true; } diff --git a/tests/qemu-iotests/socket_scm_helper.c b/tests/qemu-iotests/socket_scm_helper.c index eb76d31aa9..7785da953a 100644 --- a/tests/qemu-iotests/socket_scm_helper.c +++ b/tests/qemu-iotests/socket_scm_helper.c @@ -11,6 +11,7 @@ */ #include "qemu/osdep.h" +#include "qemu/error-report.h" #include #include @@ -53,7 +54,7 @@ static int send_fd(int fd, int fd_to_send) } while (ret < 0 && errno == EINTR); if (ret < 0) { - fprintf(stderr, "Failed to send msg, reason: %s\n", strerror(errno)); + error_report("Failed to send msg, reason: %s", strerror(errno)); } return ret; @@ -69,14 +70,14 @@ static int get_fd_num(const char *fd_str, bool silent) sock = strtol(fd_str, &err, 10); if (errno) { if (!silent) { - fprintf(stderr, "Failed in strtol for socket fd, reason: %s\n", + error_report("Failed in strtol for socket fd, reason: %s", strerror(errno)); } return -1; } if (!*fd_str || *err || sock < 0) { if (!silent) { - fprintf(stderr, "bad numerical value for socket fd '%s'\n", fd_str); + error_report("bad numerical value for socket fd '%s'", fd_str); } return -1; } @@ -96,7 +97,7 @@ int main(int argc, char **argv, char **envp) #ifdef SOCKET_SCM_DEBUG int i; for (i = 0; i < argc; i++) { - fprintf(stderr, "Parameter %d: %s\n", i, argv[i]); + error_report("Parameter %d: %s", i, argv[i]); } #endif @@ -120,7 +121,7 @@ int main(int argc, char **argv, char **envp) is supposed to fork and exec this program. */ fd = open(argv[2], O_RDONLY); if (fd < 0) { - fprintf(stderr, "Failed to open file '%s'\n", argv[2]); + error_report("Failed to open file '%s'", argv[2]); return EXIT_FAILURE; } } diff --git a/tests/rcutorture.c b/tests/rcutorture.c index 4002ecf123..21d2c76d0b 100644 --- a/tests/rcutorture.c +++ b/tests/rcutorture.c @@ -61,6 +61,7 @@ */ #include "qemu/osdep.h" +#include "qemu/error-report.h" #include "qemu/atomic.h" #include "qemu/rcu.h" #include "qemu/thread.h" @@ -86,7 +87,7 @@ static int n_threads; static void create_thread(void *(*func)(void *)) { if (n_threads >= NR_THREADS) { - fprintf(stderr, "Thread limit of %d exceeded!\n", NR_THREADS); + error_report("Thread limit of %d exceeded!", NR_THREADS); exit(-1); } qemu_thread_create(&threads[n_threads], "test", func, &data[n_threads], @@ -417,7 +418,7 @@ static void gtest_stress_10_5(void) static void usage(int argc, char *argv[]) { - fprintf(stderr, "Usage: %s [nreaders [ perf | stress ] ]\n", argv[0]); + error_report("Usage: %s [nreaders [ perf | stress ] ]", argv[0]); exit(-1); } diff --git a/tests/tcg/linux-test.c b/tests/tcg/linux-test.c index 5070d31446..76c9059073 100644 --- a/tests/tcg/linux-test.c +++ b/tests/tcg/linux-test.c @@ -51,7 +51,7 @@ void error1(const char *filename, int line, const char *fmt, ...) va_start(ap, fmt); fprintf(stderr, "%s:%d: ", filename, line); vfprintf(stderr, fmt, ap); - fprintf(stderr, "\n"); + error_report(""); va_end(ap); exit(1); } diff --git a/tests/tcg/runcom.c b/tests/tcg/runcom.c index d60342bfc6..7acf0239c8 100644 --- a/tests/tcg/runcom.c +++ b/tests/tcg/runcom.c @@ -61,7 +61,7 @@ void dump_regs(struct vm86_regs *r) #ifdef SIGTEST void alarm_handler(int sig) { - fprintf(stderr, "alarm signal=%d\n", sig); + error_report("alarm signal=%d", sig); alarm(1); } #endif @@ -172,7 +172,7 @@ int main(int argc, char **argv) break; default: unknown_int: - fprintf(stderr, "unsupported int 0x%02x\n", int_num); + error_report("unsupported int 0x%02x", int_num); dump_regs(&ctx.regs); // exit(1); } @@ -184,7 +184,7 @@ int main(int argc, char **argv) case VM86_STI: break; default: - fprintf(stderr, "unhandled vm86 return code (0x%x)\n", ret); + error_report("unhandled vm86 return code (0x%x)", ret); dump_regs(&ctx.regs); exit(1); } diff --git a/tests/tcg/test-i386-fprem.c b/tests/tcg/test-i386-fprem.c index 1a71623204..7c3d37d07a 100644 --- a/tests/tcg/test-i386-fprem.c +++ b/tests/tcg/test-i386-fprem.c @@ -340,7 +340,7 @@ static void test_fprem_pairs(void) } } - fprintf(stderr, "test-i386-fprem: tested %llu cases\n", count); + error_report("test-i386-fprem: tested %llu cases", count); } int main(int argc, char **argv) diff --git a/tests/tcg/test_path.c b/tests/tcg/test_path.c index 1c29bce263..d543bb76ef 100644 --- a/tests/tcg/test_path.c +++ b/tests/tcg/test_path.c @@ -150,8 +150,8 @@ int main(int argc, char *argv[]) ret = do_test(); cleanup(); if (ret) { - fprintf(stderr, "test_path: failed on line %i\n", ret); - return 1; + error_report("test_path: failed on line %i", ret); + return 1; } return 0; } diff --git a/tests/test-hmp.c b/tests/test-hmp.c index 5677fbf775..ff86220814 100644 --- a/tests/test-hmp.c +++ b/tests/test-hmp.c @@ -15,6 +15,7 @@ */ #include "qemu/osdep.h" +#include "qemu/error-report.h" #include "libqtest.h" static int verbose; @@ -79,7 +80,7 @@ static void test_commands(void) for (i = 0; hmp_cmds[i] != NULL; i++) { if (verbose) { - fprintf(stderr, "\t%s\n", hmp_cmds[i]); + error_report("\t%s", hmp_cmds[i]); } response = hmp("%s", hmp_cmds[i]); g_free(response); @@ -102,7 +103,7 @@ static void test_info_commands(void) *endp = '\0'; /* Now run the info command */ if (verbose) { - fprintf(stderr, "\t%s\n", info); + error_report("\t%s", info); } resp = hmp("%s", info); g_free(resp); diff --git a/tests/test-rcu-list.c b/tests/test-rcu-list.c index 1514d7ec97..00a03de370 100644 --- a/tests/test-rcu-list.c +++ b/tests/test-rcu-list.c @@ -21,6 +21,7 @@ */ #include "qemu/osdep.h" +#include "qemu/error-report.h" #include "qemu/atomic.h" #include "qemu/rcu.h" #include "qemu/thread.h" @@ -64,7 +65,7 @@ static int select_random_el(int max) static void create_thread(void *(*func)(void *)) { if (n_threads >= NR_THREADS) { - fprintf(stderr, "Thread limit of %d exceeded!\n", NR_THREADS); + error_report("Thread limit of %d exceeded!", NR_THREADS); exit(-1); } qemu_thread_create(&threads[n_threads], "test", func, &data[n_threads], @@ -255,7 +256,7 @@ static void rcu_qtest(const char *test, int duration, int nreaders) static void usage(int argc, char *argv[]) { - fprintf(stderr, "Usage: %s duration nreaders\n", argv[0]); + error_report("Usage: %s duration nreaders", argv[0]); exit(-1); } diff --git a/tests/usb-hcd-ehci-test.c b/tests/usb-hcd-ehci-test.c index 944eb1c088..1e7ef842e5 100644 --- a/tests/usb-hcd-ehci-test.c +++ b/tests/usb-hcd-ehci-test.c @@ -42,7 +42,7 @@ static void ehci_port_test(struct qhc *hc, int port, uint32_t expect) uint16_t mask = ~(PORTSC_CSC | PORTSC_PEDC | PORTSC_OCC); #if 0 - fprintf(stderr, "%s: %d, have 0x%08x, want 0x%08x\n", + error_report("%s: %d, have 0x%08x, want 0x%08x", __func__, port, value & mask, expect & mask); #endif g_assert((value & mask) == (expect & mask)); diff --git a/tests/vhost-user-bridge.c b/tests/vhost-user-bridge.c index d820033a72..31a884e0da 100644 --- a/tests/vhost-user-bridge.c +++ b/tests/vhost-user-bridge.c @@ -181,7 +181,7 @@ vubr_handle_tx(VuDev *dev, int qidx) out_num = elem->out_num; out_sg = elem->out_sg; if (out_num < 1) { - fprintf(stderr, "virtio-net header not in first element\n"); + error_report("virtio-net header not in first element"); break; } if (VHOST_USER_BRIDGE_DEBUG) { @@ -294,7 +294,7 @@ vubr_backend_recv_cb(int sock, void *ctx) } if (elem->in_num < 1) { - fprintf(stderr, "virtio-net contains no in buffers\n"); + error_report("virtio-net contains no in buffers"); break; } @@ -364,7 +364,7 @@ vubr_receive_cb(int sock, void *ctx) VubrDev *vubr = (VubrDev *)ctx; if (!vu_dispatch(&vubr->vudev)) { - fprintf(stderr, "Error while dispatching\n"); + error_report("Error while dispatching"); } } @@ -461,7 +461,7 @@ vubr_panic(VuDev *dev, const char *msg) { VubrDev *vubr = container_of(dev, VubrDev, vudev); - fprintf(stderr, "PANIC: %s\n", msg); + error_report("PANIC: %s", msg); dispatcher_remove(&vubr->dispatcher, dev->sock); vubr->quit = 1; @@ -562,14 +562,14 @@ vubr_set_host(struct sockaddr_in *saddr, const char *host) { if (isdigit(host[0])) { if (!inet_aton(host, &saddr->sin_addr)) { - fprintf(stderr, "inet_aton() failed.\n"); + error_report("inet_aton() failed."); exit(1); } } else { struct hostent *he = gethostbyname(host); if (!he) { - fprintf(stderr, "gethostbyname() failed.\n"); + error_report("gethostbyname() failed."); exit(1); } saddr->sin_addr = *(struct in_addr *)he->h_addr; @@ -590,13 +590,13 @@ vubr_backend_udp_setup(VubrDev *dev, lport = strtol(local_port, (char **)&r, 0); if (r == local_port) { - fprintf(stderr, "lport parsing failed.\n"); + error_report("lport parsing failed."); exit(1); } rport = strtol(remote_port, (char **)&r, 0); if (r == remote_port) { - fprintf(stderr, "rport parsing failed.\n"); + error_report("rport parsing failed."); exit(1); } @@ -714,15 +714,15 @@ main(int argc, char *argv[]) return 0; out: - fprintf(stderr, "Usage: %s ", argv[0]); - fprintf(stderr, "[-c] [-u ud_socket_path] [-l lhost:lport] [-r rhost:rport]\n"); - fprintf(stderr, "\t-u path to unix doman socket. default: %s\n", + error_report("Usage: %s ", argv[0]); + error_report("[-c] [-u ud_socket_path] [-l lhost:lport] [-r rhost:rport]"); + error_report("\t-u path to unix doman socket. default: %s", DEFAULT_UD_SOCKET); - fprintf(stderr, "\t-l local host and port. default: %s:%s\n", + fprintf(stderr, "\t-l local host and port. default: %s:%s", DEFAULT_LHOST, DEFAULT_LPORT); - fprintf(stderr, "\t-r remote host and port. default: %s:%s\n", + error_report("\t-r remote host and port. default: %s:%s", DEFAULT_RHOST, DEFAULT_RPORT); - fprintf(stderr, "\t-c client mode\n"); + error_report("\t-c client mode"); return 1; } From patchwork Thu Oct 19 16:15:54 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Alistair Francis X-Patchwork-Id: 828201 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; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=xilinx.onmicrosoft.com header.i=@xilinx.onmicrosoft.com header.b="KhW/waQJ"; 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 3yHvTH6pzBz9ryT for ; Fri, 20 Oct 2017 03:26:59 +1100 (AEDT) Received: from localhost ([::1]:50096 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e5Der-00012o-Ua for incoming@patchwork.ozlabs.org; Thu, 19 Oct 2017 12:26:58 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:55024) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e5DYH-0004AM-7g for qemu-devel@nongnu.org; Thu, 19 Oct 2017 12:20:14 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1e5DY8-0000sx-PS for qemu-devel@nongnu.org; Thu, 19 Oct 2017 12:20:09 -0400 Received: from mail-by2nam03on0053.outbound.protection.outlook.com ([104.47.42.53]:60416 helo=NAM03-BY2-obe.outbound.protection.outlook.com) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1e5DY1-0000pL-JK; Thu, 19 Oct 2017 12:19:54 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=xilinx.onmicrosoft.com; s=selector1-xilinx-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=fhgYYOR6d2p0s1BGiI8l9ZAqtp4Rd2lwqkLSZp1GUnE=; b=KhW/waQJettJjBC6Oxh4VjVmVxg6QidKP6zeitAabdPzuIz0Ag58t9pjRwY/56FTUDBQRBP7jIEV+cKGcHo5JaoM3BiDlKGC18I5vFmj68NM+qi/CDCIrUhpNTTour/yCMEj+yrE6ehzMdKHb4jqD7cUf3h973QXV0cBsiZBMmk= Received: from BY2PR02CA0003.namprd02.prod.outlook.com (10.163.44.141) by CY1PR02MB1335.namprd02.prod.outlook.com (10.161.170.26) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.77.7; Thu, 19 Oct 2017 16:19:49 +0000 Received: from CY1NAM02FT022.eop-nam02.prod.protection.outlook.com (2a01:111:f400:7e45::204) by BY2PR02CA0003.outlook.office365.com (2a01:111:e400:5261::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.156.4 via Frontend Transport; Thu, 19 Oct 2017 16:19:49 +0000 Authentication-Results: spf=pass (sender IP is 149.199.60.83) smtp.mailfrom=xilinx.com; nongnu.org; dkim=none (message not signed) header.d=none;nongnu.org; dmarc=bestguesspass action=none header.from=xilinx.com; Received-SPF: Pass (protection.outlook.com: domain of xilinx.com designates 149.199.60.83 as permitted sender) receiver=protection.outlook.com; client-ip=149.199.60.83; helo=xsj-pvapsmtpgw01; Received: from xsj-pvapsmtpgw01 (149.199.60.83) by CY1NAM02FT022.mail.protection.outlook.com (10.152.75.185) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.20.77.10 via Frontend Transport; Thu, 19 Oct 2017 16:19:48 +0000 Received: from unknown-38-66.xilinx.com ([149.199.38.66] helo=xsj-pvapsmtp01) by xsj-pvapsmtpgw01 with esmtp (Exim 4.63) (envelope-from ) id 1e5DXw-0008UI-4t; Thu, 19 Oct 2017 09:19:48 -0700 Received: from [127.0.0.1] (helo=localhost) by xsj-pvapsmtp01 with smtp (Exim 4.63) (envelope-from ) id 1e5DXw-0002R4-1p; Thu, 19 Oct 2017 09:19:48 -0700 Received: from xsj-pvapsmtp01 (xsj-smtp1.xilinx.com [149.199.38.66]) by xsj-smtp-dlp2.xlnx.xilinx.com (8.13.8/8.13.1) with ESMTP id v9JGJlRW003107; Thu, 19 Oct 2017 09:19:47 -0700 Received: from [172.19.2.220] (helo=localhost.localdomain) by xsj-pvapsmtp01 with esmtp (Exim 4.63) (envelope-from ) id 1e5DXu-0002Qz-Rq; Thu, 19 Oct 2017 09:19:46 -0700 From: Alistair Francis To: Date: Thu, 19 Oct 2017 09:15:54 -0700 Message-ID: <40f44a01e122c59d5cb32c53dd2653e15145296f.1508390588.git.alistair.francis@xilinx.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: References: MIME-Version: 1.0 X-RCIS-Action: ALLOW X-TM-AS-Product-Ver: IMSS-7.1.0.1224-8.1.0.1062-23404.005 X-TM-AS-User-Approved-Sender: Yes;Yes X-EOPAttributedMessage: 0 X-MS-Office365-Filtering-HT: Tenant X-Forefront-Antispam-Report: CIP:149.199.60.83; IPV:NLI; CTRY:US; EFV:NLI; SFV:NSPM; SFS:(10009020)(6009001)(39860400002)(346002)(376002)(2980300002)(438002)(199003)(189002)(81166006)(106002)(50466002)(2906002)(6916009)(36386004)(118296001)(2870700001)(8936002)(77096006)(47776003)(5820100001)(4326008)(50986999)(63266004)(76176999)(6666003)(5890100001)(39060400002)(23676002)(5660300001)(8676002)(2351001)(54906003)(81156014)(106466001)(33646002)(478600001)(305945005)(2950100002)(316002)(189998001)(50226002)(356003)(575784001)(9786002)(36756003)(107986001); DIR:OUT; SFP:1101; SCL:1; SRVR:CY1PR02MB1335; H:xsj-pvapsmtpgw01; FPR:; SPF:Pass; PTR:unknown-60-83.xilinx.com; A:1; MX:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; CY1NAM02FT022; 1:TH3AkOKJiAyU/sRjeAjc4MayKajHH0wSdzEVlWYZ5ZyyyyFayi97WPDjozmabYI+qEhXo1zFMMCHmxqDeYY5Qc1DsF0LvyPcjTaLQBr0sY1ojHA8W9DUea63YTRVIP4/ X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 67127f40-8787-414f-6164-08d5170d3868 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001)(2017030254168)(8251501002)(4534016)(4602075)(4627075)(201703031133081)(201702281549075)(2017052603199)(201703131423091); SRVR:CY1PR02MB1335; X-Microsoft-Exchange-Diagnostics: 1; CY1PR02MB1335; 3:5WcdAQNr2y8M8ZduXMGMQBqqrFL2WA3kk3Ghp7la0ksiRgGWe5VR5p+4IlTChGWeG1J4hZdgNjkexN1DCirYhZoIc4EvkgC8oJeVpIK/h7ev4t5V/rvnxzDfK+RqEaI8SB8+LBj7+aASMwnrPw5GcpeCXNKP8I4i/FbFfiGOk0Lsv9D7gwRpNVaEzL94vu8h0b6jzrENX934MSt+vrrs1TH+iw2jXusoIAZUy34yLEEPWImi90P9YaYqUMOqg2HVRWSV/JjsUqfBIqGtiVzRufzbVQFnQ/5fLiD7B6/Ro2SM5D/yifaB0QnblhQsxY1NeiLjGBJGM03RvKKqahahnJXvN3DjQeO4Kg6wET86fEQ=; 25:wcP9gdcHj7b2s4CuPPmoVzPrv7ZBYfmM4X6iqLBSEC709pTiz4uHvBV1XMCdQ55sqAliaSDelZOoWR3rpTtv9Oitb0NRGqe7qVpmsraJH8d3gyqzgyPPBF4t7Y7Z4meQ8+3AviMgHZdYg9r0Rv+Rbol7VnNM7PtGIF6ZAsxsH+MxjggTCyfNuctBPmkOnq/raX3Yp4PDb9KMv395WVEVRhXPL1Af9pftjuTSxWjvYTXmSS+kfWQ4twxf3iISs/LahbJuZmvqLuxpNBcf2NaTjqYTcfZ+6PBMRPVicqZCvRurWRTzGhzZNnAT0ALxvWktZeW4AQ2FO5n904AbrkRF4A== X-MS-TrafficTypeDiagnostic: CY1PR02MB1335: X-Microsoft-Exchange-Diagnostics: 1; CY1PR02MB1335; 31:7g/b7kBSh2TVmZRvdqfLnzfChEjtQsy6exd8hq02WvHVukDZ4A8ViRy+mEWlZWXckXLMIo4zOp6CePygk2IoxPL+T1Tt7zSzqk/foc0Wd/mxUYomkpnVw5jMdatlrximk6AmtpLxIEz4zjA79NMJPAYUE7vejwzzIa0rKtlWxW4WiJgSbSNRClsWBKosBDAMHBXMfAvA5n0f734F9Oeomdms3pbePmF0s0UT23GCASg=; 20:yNLNONQZ+7R0Oupb5qaoQePrkiuWeMSEbapMzxVvnWeHA6hv0HABmDcnpBKz0qBAhm0PAPHCGHxYDaVCGgsl0kDwoY/ygiTb7R2lxK4oyrwW0rMueCRC6qY/PRGKke0yXhf/sZQsj5pKK7uKVZHm093Xr7gtHUxaCeQokXCMsU3EIKyyAbZO6a5wcoyJIG9ONjepAqd7PEEFcTrtwsbazwPJqu+Pk41cw+kuRbLJycZalppTJTFAXq6uelNxC21ruFNeverdjyK6OzXa4zIdOIIhcnCMWhxPwW2++Ed4ipLKOIx9y4cV4Jk0c3SJjek9VgTVDAQMB+HbxPRQu1MuKboPRcXpw/nEkH5BsYtcz/vtmJvwRKtQpfAOMME+cb3JE7ltwM5Ct395eeybc8XQhOlZyROTteGGfHsbljLTO4dzfyzppshsatZw0oJpwL127c+0OgLP+UaolC/Rc+cyYXkOk1hquwDDB1gd7L5uoNvOIaDKXPQ28SPBz36MTH8A X-Exchange-Antispam-Report-Test: UriScan:(788757137089)(192813158149592); X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(100000700101)(100105000095)(100000701101)(100105300095)(100000702101)(100105100095)(6040450)(2401047)(5005006)(8121501046)(93006095)(93004095)(100000703101)(100105400095)(3002001)(10201501046)(6055026)(6041248)(20161123560025)(20161123564025)(20161123558100)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123562025)(20161123555025)(6072148)(201708071742011)(100000704101)(100105200095)(100000705101)(100105500095); SRVR:CY1PR02MB1335; BCL:0; PCL:0; RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095); SRVR:CY1PR02MB1335; X-Microsoft-Exchange-Diagnostics: 1; CY1PR02MB1335; 4:PL6/Kf6dNkYipAN8HqOmQiRVkCM1fTWAfqVAjUy7YVab+ywq4ZtUzZsUm5bBM3B0WKnvkPNHNlQ7rwRKpeQ2iMm/iA/ZkR9RExByrhl+oWTh8M+WUccG4vB+GPcC8xFWeoXKDbyyfedjwV8RdM8rGUA5grbQhQ2C8o0j3tYxFaLHV5aaN0bSrLsT0xNdy85JSOCz9eFXF2QM5frKMQLUaA43+qmpbrQ75HLaTl2TPqXVqfTFjq+xeGAwZ/dmzbsNwHjvw/uLJd3zyjBImlOUCRs5n0hC6I+ZBVHCP6AQA0QWQhurRDwSXJSRcV+97TROeCBDChVDiVY2d9Oq7WgcIA== X-Forefront-PRVS: 0465429B7F X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; CY1PR02MB1335; 23:BfxdsVPBzuYUF94DPXBcuixzydKOa5bYRxpaxzJhj?= pKdBdg27TRp5S5rBjJcKzvncSbrZhE7zyWjHTt7yhVFqnYpJigleMF0OG3FBZrM/+vocPWNkdVIGj9uzFd5Q3GECiSQkP1TznP232oj0qzzZV1Fw33gXyY5lDFKsu52VrE13xKvIiZqBWuHKCiCGmYduOQlU7/k0IN7AyzZ3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SHNscesf3EE7wAXSH4OshzWCj1+itsjST/Oe7m5a/OIU5OuCo+YRjWggQU8cvydYxSqFFXLFFo5b6H7LVxfJsTNlB6pQp+u9mXN1SLqdHp/q5/FY8npNnd6rWI/yFPagxFCsQRsLEYSo3y+6L3UtrgeJ1LYoz/vOFuM2AIuNaVborbXp2hTWYWUXDr3FOICB2Jn+cBIoEY+/MZA==; 5:SqrrLMBo7c6Vp3Hw8Gl9+To5liFjny1a/R1hy71hgVlGexWBWfgEOFkhoj2pYn5RHNYOP6V4sUoBQaBT6QFMYFbJsfBTDGez/NVY/H8EAGxog5IoRYCYVfE/7oKmrwviQrkvhFEpGjgp9l1c6I7/Wg==; 24:8z5jmO6SD0x91gK1z49p7WH0gwoO0yI/QKRl7Df0K/xWDCiLduJiX26IX4cCtkPTPZuxuWD28BMZqJf7U7WxktJC2V3s6KIGNC5u3ioE3iQ=; 7:PAAxOMsnPYxTA/9SiQci5IelyxcpAaiDCjUkY1QygV83Tk3ZOcmIBQZT5qGnwYVbYvj9wQ46MTOCtDJzB4CbdFnkCnT/9dKQ0qKTB07T0zF7p1BbiDuPH/xHmWzwXqrcb4zQ/T1uFv7in8kAcYYogvOzDgneKqQzAkHTfxHGJKsBPwIEWihElCnXhzcm8c9ZsIREvKbH+rRc6s6gE/hH9NAqrnk9wuumgbOZjGAU284= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: xilinx.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 19 Oct 2017 16:19:48.6796 (UTC) X-MS-Exchange-CrossTenant-Id: 657af505-d5df-48d0-8300-c31994686c5c X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=657af505-d5df-48d0-8300-c31994686c5c; Ip=[149.199.60.83]; Helo=[xsj-pvapsmtpgw01] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY1PR02MB1335 X-detected-operating-system: by eggs.gnu.org: Windows 7 or 8 [fuzzy] X-Received-From: 104.47.42.53 Subject: [Qemu-devel] [PATCH v3 05/46] hw/arm: Replace fprintf(stderr, "*\n" with error_report() 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: alistair23@gmail.com, qemu-arm@nongnu.org, armbru@redhat.com, alistair.francis@xilinx.com Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" Replace a large number of the fprintf(stderr, "*\n" calls with error_report(). The functions were renamed with these commands and then compiler issues where manually fixed. find ./* -type f -exec sed -i \ 'N;N;N;N;N;N;N;N;N;N;N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2);|Ig}' \ {} + find ./* -type f -exec sed -i \ 'N;N;N;N;N;N;N;N;N;N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2);|Ig}' \ {} + find ./* -type f -exec sed -i \ 'N;N;N;N;N;N;N;N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2);|Ig}' \ {} + find ./* -type f -exec sed -i \ 'N;N;N;N;N;N;N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2);|Ig}' \ {} + find ./* -type f -exec sed -i \ 'N;N;N;N;N;N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2);|Ig}' \ {} + find ./* -type f -exec sed -i \ 'N;N;N;N;N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2);|Ig}' \ {} + find ./* -type f -exec sed -i \ 'N;N;N;N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2);|Ig}' \ {} + find ./* -type f -exec sed -i \ 'N;N;N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2);|Ig}' \ {} + find ./* -type f -exec sed -i \ 'N;N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2);|Ig}' \ {} + find ./* -type f -exec sed -i \ 'N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2);|Ig}' \ {} + find ./* -type f -exec sed -i \ 'N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2);|Ig}' \ {} + Some lines where then manually tweaked to pass checkpatch. The 'qemu: ' prefix was manually removed from the hw/arm/boot.c file. Signed-off-by: Alistair Francis Cc: qemu-arm@nongnu.org Reviewed-by: Philippe Mathieu-Daudé --- V3: - Remoave 'qemu: ' prefix V2: - Split hw patch into individual directories hw/arm/armv7m.c | 2 +- hw/arm/boot.c | 37 ++++++++++++++++++------------------- hw/arm/gumstix.c | 13 +++++++------ hw/arm/mainstone.c | 7 ++++--- hw/arm/musicpal.c | 2 +- hw/arm/omap1.c | 5 +++-- hw/arm/omap2.c | 23 ++++++++++++----------- hw/arm/omap_sx1.c | 6 +++--- hw/arm/palm.c | 10 +++++----- hw/arm/pxa2xx.c | 7 ++++--- hw/arm/stellaris.c | 3 ++- hw/arm/tosa.c | 17 +++++++++-------- hw/arm/versatilepb.c | 2 +- hw/arm/vexpress.c | 8 ++++---- hw/arm/z2.c | 6 +++--- 15 files changed, 77 insertions(+), 71 deletions(-) diff --git a/hw/arm/armv7m.c b/hw/arm/armv7m.c index bb2dfc942b..56770a7048 100644 --- a/hw/arm/armv7m.c +++ b/hw/arm/armv7m.c @@ -278,7 +278,7 @@ void armv7m_load_kernel(ARMCPU *cpu, const char *kernel_filename, int mem_size) #endif if (!kernel_filename && !qtest_enabled()) { - fprintf(stderr, "Guest image must be specified (using -kernel)\n"); + error_report("Guest image must be specified (using -kernel)"); exit(1); } diff --git a/hw/arm/boot.c b/hw/arm/boot.c index c2720c8046..6e6b8c0c6a 100644 --- a/hw/arm/boot.c +++ b/hw/arm/boot.c @@ -8,6 +8,7 @@ */ #include "qemu/osdep.h" +#include "qemu/error-report.h" #include "qapi/error.h" #include #include "hw/hw.h" @@ -418,13 +419,13 @@ static int load_dtb(hwaddr addr, const struct arm_boot_info *binfo, char *filename; filename = qemu_find_file(QEMU_FILE_TYPE_BIOS, binfo->dtb_filename); if (!filename) { - fprintf(stderr, "Couldn't open dtb file %s\n", binfo->dtb_filename); + error_report("Couldn't open dtb file %s", binfo->dtb_filename); goto fail; } fdt = load_device_tree(filename, &size); if (!fdt) { - fprintf(stderr, "Couldn't open dtb file %s\n", filename); + error_report("Couldn't open dtb file %s", filename); g_free(filename); goto fail; } @@ -432,7 +433,7 @@ static int load_dtb(hwaddr addr, const struct arm_boot_info *binfo, } else { fdt = binfo->get_dtb(binfo, &size); if (!fdt) { - fprintf(stderr, "Board was unable to create a dtb blob\n"); + error_report("Board was unable to create a dtb blob"); goto fail; } } @@ -451,7 +452,7 @@ static int load_dtb(hwaddr addr, const struct arm_boot_info *binfo, scells = qemu_fdt_getprop_cell(fdt, "/", "#size-cells", NULL, &error_fatal); if (acells == 0 || scells == 0) { - fprintf(stderr, "dtb file invalid (#address-cells or #size-cells 0)\n"); + error_report("dtb file invalid (#address-cells or #size-cells 0)"); goto fail; } @@ -459,8 +460,7 @@ static int load_dtb(hwaddr addr, const struct arm_boot_info *binfo, /* This is user error so deserves a friendlier error message * than the failure of setprop_sized_cells would provide */ - fprintf(stderr, "qemu: dtb file not compatible with " - "RAM size > 4GB\n"); + error_report("dtb file not compatible with RAM size > 4GB"); goto fail; } @@ -480,7 +480,7 @@ static int load_dtb(hwaddr addr, const struct arm_boot_info *binfo, acells, mem_base, scells, mem_len); if (rc < 0) { - fprintf(stderr, "couldn't set %s/reg for node %d\n", nodename, + error_report("couldn't set %s/reg for node %d", nodename, i); goto fail; } @@ -505,7 +505,7 @@ static int load_dtb(hwaddr addr, const struct arm_boot_info *binfo, acells, binfo->loader_start, scells, binfo->ram_size); if (rc < 0) { - fprintf(stderr, "couldn't set /memory/reg\n"); + error_report("couldn't set /memory/reg"); goto fail; } } @@ -519,7 +519,7 @@ static int load_dtb(hwaddr addr, const struct arm_boot_info *binfo, rc = qemu_fdt_setprop_string(fdt, "/chosen", "bootargs", binfo->kernel_cmdline); if (rc < 0) { - fprintf(stderr, "couldn't set /chosen/bootargs\n"); + error_report("couldn't set /chosen/bootargs"); goto fail; } } @@ -528,14 +528,14 @@ static int load_dtb(hwaddr addr, const struct arm_boot_info *binfo, rc = qemu_fdt_setprop_cell(fdt, "/chosen", "linux,initrd-start", binfo->initrd_start); if (rc < 0) { - fprintf(stderr, "couldn't set /chosen/linux,initrd-start\n"); + error_report("couldn't set /chosen/linux,initrd-start"); goto fail; } rc = qemu_fdt_setprop_cell(fdt, "/chosen", "linux,initrd-end", binfo->initrd_start + binfo->initrd_size); if (rc < 0) { - fprintf(stderr, "couldn't set /chosen/linux,initrd-end\n"); + error_report("couldn't set /chosen/linux,initrd-end"); goto fail; } } @@ -690,7 +690,7 @@ static void load_image_to_fw_cfg(FWCfgState *fw_cfg, uint16_t size_key, gsize length; if (!g_file_get_contents(image_name, &contents, &length, NULL)) { - fprintf(stderr, "failed to load \"%s\"\n", image_name); + error_report("failed to load \"%s\"", image_name); exit(1); } size = length; @@ -956,8 +956,7 @@ static void arm_load_kernel_notify(Notifier *notifier, void *data) is_linux = 1; } if (kernel_size < 0) { - fprintf(stderr, "qemu: could not load kernel '%s'\n", - info->kernel_filename); + error_report("could not load kernel '%s'", info->kernel_filename); exit(1); } info->entry = entry; @@ -976,8 +975,8 @@ static void arm_load_kernel_notify(Notifier *notifier, void *data) info->initrd_start); } if (initrd_size < 0) { - fprintf(stderr, "qemu: could not load initrd '%s'\n", - info->initrd_filename); + error_report("could not load initrd '%s'", + info->initrd_filename); exit(1); } } else { @@ -1021,9 +1020,9 @@ static void arm_load_kernel_notify(Notifier *notifier, void *data) } else { fixupcontext[FIXUP_ARGPTR] = info->loader_start + KERNEL_ARGS_ADDR; if (info->ram_size >= (1ULL << 32)) { - fprintf(stderr, "qemu: RAM size must be less than 4GB to boot" - " Linux kernel using ATAGS (try passing a device tree" - " using -dtb)\n"); + error_report("RAM size must be less than 4GB to boot" + " Linux kernel using ATAGS (try passing a device tree" + " using -dtb)"); exit(1); } } diff --git a/hw/arm/gumstix.c b/hw/arm/gumstix.c index bba9e9f57a..8f11b03066 100644 --- a/hw/arm/gumstix.c +++ b/hw/arm/gumstix.c @@ -35,6 +35,7 @@ */ #include "qemu/osdep.h" +#include "qemu/error-report.h" #include "hw/hw.h" #include "hw/arm/pxa.h" #include "net/net.h" @@ -62,8 +63,8 @@ static void connex_init(MachineState *machine) dinfo = drive_get(IF_PFLASH, 0, 0); if (!dinfo && !qtest_enabled()) { - fprintf(stderr, "A flash image must be given with the " - "'pflash' parameter\n"); + error_report("A flash image must be given with the " + "'pflash' parameter"); exit(1); } @@ -76,7 +77,7 @@ static void connex_init(MachineState *machine) dinfo ? blk_by_legacy_dinfo(dinfo) : NULL, sector_len, connex_rom / sector_len, 2, 0, 0, 0, 0, be)) { - fprintf(stderr, "qemu: Error registering flash memory.\n"); + error_report("Error registering flash memory."); exit(1); } @@ -99,8 +100,8 @@ static void verdex_init(MachineState *machine) dinfo = drive_get(IF_PFLASH, 0, 0); if (!dinfo && !qtest_enabled()) { - fprintf(stderr, "A flash image must be given with the " - "'pflash' parameter\n"); + error_report("A flash image must be given with the " + "'pflash' parameter"); exit(1); } @@ -113,7 +114,7 @@ static void verdex_init(MachineState *machine) dinfo ? blk_by_legacy_dinfo(dinfo) : NULL, sector_len, verdex_rom / sector_len, 2, 0, 0, 0, 0, be)) { - fprintf(stderr, "qemu: Error registering flash memory.\n"); + error_report("Error registering flash memory."); exit(1); } diff --git a/hw/arm/mainstone.c b/hw/arm/mainstone.c index d07972a966..189febf8b7 100644 --- a/hw/arm/mainstone.c +++ b/hw/arm/mainstone.c @@ -12,6 +12,7 @@ * GNU GPL, version 2 or (at your option) any later version. */ #include "qemu/osdep.h" +#include "qemu/error-report.h" #include "qapi/error.h" #include "hw/hw.h" #include "hw/arm/pxa.h" @@ -143,8 +144,8 @@ static void mainstone_common_init(MemoryRegion *address_space_mem, if (qtest_enabled()) { break; } - fprintf(stderr, "Two flash images must be given with the " - "'pflash' parameter\n"); + error_report("Two flash images must be given with the " + "'pflash' parameter"); exit(1); } @@ -154,7 +155,7 @@ static void mainstone_common_init(MemoryRegion *address_space_mem, blk_by_legacy_dinfo(dinfo), sector_len, MAINSTONE_FLASH / sector_len, 4, 0, 0, 0, 0, be)) { - fprintf(stderr, "qemu: Error registering flash memory.\n"); + error_report("Error registering flash memory."); exit(1); } } diff --git a/hw/arm/musicpal.c b/hw/arm/musicpal.c index b648770882..06127a873d 100644 --- a/hw/arm/musicpal.c +++ b/hw/arm/musicpal.c @@ -1626,7 +1626,7 @@ static void musicpal_init(MachineState *machine) flash_size = blk_getlength(blk); if (flash_size != 8*1024*1024 && flash_size != 16*1024*1024 && flash_size != 32*1024*1024) { - fprintf(stderr, "Invalid flash image size\n"); + error_report("Invalid flash image size"); exit(1); } diff --git a/hw/arm/omap1.c b/hw/arm/omap1.c index 92e58f09c8..b3a23a83d1 100644 --- a/hw/arm/omap1.c +++ b/hw/arm/omap1.c @@ -18,6 +18,7 @@ */ #include "qemu/osdep.h" +#include "qemu/error-report.h" #include "qapi/error.h" #include "qemu-common.h" #include "cpu.h" @@ -2313,7 +2314,7 @@ void omap_uwire_attach(struct omap_uwire_s *s, uWireSlave *slave, int chipselect) { if (chipselect < 0 || chipselect > 3) { - fprintf(stderr, "%s: Bad chipselect %i\n", __func__, chipselect); + error_report("%s: Bad chipselect %i", __func__, chipselect); exit(-1); } @@ -3987,7 +3988,7 @@ struct omap_mpu_state_s *omap310_mpu_init(MemoryRegion *system_memory, dinfo = drive_get(IF_SD, 0, 0); if (!dinfo) { - fprintf(stderr, "qemu: missing SecureDigital device\n"); + error_report("missing SecureDigital device"); exit(1); } s->mmc = omap_mmc_init(0xfffb7800, system_memory, diff --git a/hw/arm/omap2.c b/hw/arm/omap2.c index b53878b8b9..3a1d995d6a 100644 --- a/hw/arm/omap2.c +++ b/hw/arm/omap2.c @@ -19,6 +19,7 @@ */ #include "qemu/osdep.h" +#include "qemu/error-report.h" #include "qapi/error.h" #include "qemu-common.h" #include "cpu.h" @@ -1311,8 +1312,8 @@ static void omap_prcm_apll_update(struct omap_prcm_s *s) /* TODO: update clocks */ if (mode[0] == 1 || mode[0] == 2 || mode[1] == 1 || mode[1] == 2) - fprintf(stderr, "%s: bad EN_54M_PLL or bad EN_96M_PLL\n", - __func__); + error_report("%s: bad EN_54M_PLL or bad EN_96M_PLL", + __func__); } static void omap_prcm_dpll_update(struct omap_prcm_s *s) @@ -1331,7 +1332,7 @@ static void omap_prcm_dpll_update(struct omap_prcm_s *s) s->dpll_lock = 0; switch (mode) { case 0: - fprintf(stderr, "%s: bad EN_DPLL\n", __func__); + error_report("%s: bad EN_DPLL", __func__); break; case 1: /* Low-power bypass mode (Default) */ case 2: /* Fast-relock bypass mode */ @@ -1358,7 +1359,7 @@ static void omap_prcm_dpll_update(struct omap_prcm_s *s) omap_clk_reparent(core, dpll_x2); break; case 3: - fprintf(stderr, "%s: bad CORE_CLK_SRC\n", __func__); + error_report("%s: bad CORE_CLK_SRC", __func__); break; } } @@ -1627,8 +1628,8 @@ static void omap_prcm_write(void *opaque, hwaddr addr, case 0x500: /* CM_CLKEN_PLL */ if (value & 0xffffff30) - fprintf(stderr, "%s: write 0s in CM_CLKEN_PLL for " - "future compatibility\n", __func__); + error_report("%s: write 0s in CM_CLKEN_PLL for " + "future compatibility", __func__); if ((s->clken[9] ^ value) & 0xcc) { s->clken[9] &= ~0xcc; s->clken[9] |= value & 0xcc; @@ -1646,8 +1647,8 @@ static void omap_prcm_write(void *opaque, hwaddr addr, break; case 0x540: /* CM_CLKSEL1_PLL */ if (value & 0xfc4000d7) - fprintf(stderr, "%s: write 0s in CM_CLKSEL1_PLL for " - "future compatibility\n", __func__); + error_report("%s: write 0s in CM_CLKSEL1_PLL for " + "future compatibility", __func__); if ((s->clksel[5] ^ value) & 0x003fff00) { s->clksel[5] = value & 0x03bfff28; omap_prcm_dpll_update(s); @@ -1658,8 +1659,8 @@ static void omap_prcm_write(void *opaque, hwaddr addr, break; case 0x544: /* CM_CLKSEL2_PLL */ if (value & ~3) - fprintf(stderr, "%s: write 0s in CM_CLKSEL2_PLL[31:2] for " - "future compatibility\n", __func__); + error_report("%s: write 0s in CM_CLKSEL2_PLL[31:2] for " + "future compatibility", __func__); if (s->clksel[6] != (value & 3)) { s->clksel[6] = value & 3; omap_prcm_dpll_update(s); @@ -2486,7 +2487,7 @@ struct omap_mpu_state_s *omap2420_mpu_init(MemoryRegion *sysmem, dinfo = drive_get(IF_SD, 0, 0); if (!dinfo) { - fprintf(stderr, "qemu: missing SecureDigital device\n"); + error_report("missing SecureDigital device"); exit(1); } s->mmc = omap2_mmc_init(omap_l4tao(s->l4, 9), diff --git a/hw/arm/omap_sx1.c b/hw/arm/omap_sx1.c index 9a14270795..e510465137 100644 --- a/hw/arm/omap_sx1.c +++ b/hw/arm/omap_sx1.c @@ -158,7 +158,7 @@ static void sx1_init(MachineState *machine, const int version) blk_by_legacy_dinfo(dinfo), sector_size, flash_size / sector_size, 4, 0, 0, 0, 0, be)) { - fprintf(stderr, "qemu: Error registering flash memory %d.\n", + error_report("Error registering flash memory %d.", fl_idx); } fl_idx++; @@ -182,7 +182,7 @@ static void sx1_init(MachineState *machine, const int version) blk_by_legacy_dinfo(dinfo), sector_size, flash1_size / sector_size, 4, 0, 0, 0, 0, be)) { - fprintf(stderr, "qemu: Error registering flash memory %d.\n", + error_report("Error registering flash memory %d.", fl_idx); } fl_idx++; @@ -194,7 +194,7 @@ static void sx1_init(MachineState *machine, const int version) } if (!machine->kernel_filename && !fl_idx && !qtest_enabled()) { - fprintf(stderr, "Kernel or Flash image must be specified\n"); + error_report("Kernel or Flash image must be specified"); exit(1); } diff --git a/hw/arm/palm.c b/hw/arm/palm.c index 285f43709d..7f3637041a 100644 --- a/hw/arm/palm.c +++ b/hw/arm/palm.c @@ -233,8 +233,8 @@ static void palmte_init(MachineState *machine) if (nb_option_roms) { rom_size = get_image_size(option_rom[0].name); if (rom_size > flash_size) { - fprintf(stderr, "%s: ROM image too big (%x > %x)\n", - __func__, rom_size, flash_size); + error_report("%s: ROM image too big (%x > %x)", + __func__, rom_size, flash_size); rom_size = 0; } if (rom_size > 0) { @@ -243,13 +243,13 @@ static void palmte_init(MachineState *machine) rom_loaded = 1; } if (rom_size < 0) { - fprintf(stderr, "%s: error loading '%s'\n", - __func__, option_rom[0].name); + error_report("%s: error loading '%s'", + __func__, option_rom[0].name); } } if (!rom_loaded && !kernel_filename && !qtest_enabled()) { - fprintf(stderr, "Kernel or ROM image must be specified\n"); + fprintf(stderr, "Kernel or ROM image must be specified"); exit(1); } diff --git a/hw/arm/pxa2xx.c b/hw/arm/pxa2xx.c index db860c238e..0386a0d8bf 100644 --- a/hw/arm/pxa2xx.c +++ b/hw/arm/pxa2xx.c @@ -8,6 +8,7 @@ */ #include "qemu/osdep.h" +#include "qemu/error-report.h" #include "qapi/error.h" #include "qemu-common.h" #include "cpu.h" @@ -2062,7 +2063,7 @@ PXA2xxState *pxa270_init(MemoryRegion *address_space, s = g_new0(PXA2xxState, 1); if (strncmp(cpu_type, "pxa27", 5)) { - fprintf(stderr, "Machine requires a PXA27x processor.\n"); + error_report("Machine requires a PXA27x processor."); exit(1); } @@ -2095,7 +2096,7 @@ PXA2xxState *pxa270_init(MemoryRegion *address_space, dinfo = drive_get(IF_SD, 0, 0); if (!dinfo) { - fprintf(stderr, "qemu: missing SecureDigital device\n"); + error_report("missing SecureDigital device"); exit(1); } s->mmc = pxa2xx_mmci_init(address_space, 0x41100000, @@ -2220,7 +2221,7 @@ PXA2xxState *pxa255_init(MemoryRegion *address_space, unsigned int sdram_size) dinfo = drive_get(IF_SD, 0, 0); if (!dinfo) { - fprintf(stderr, "qemu: missing SecureDigital device\n"); + error_report("missing SecureDigital device"); exit(1); } s->mmc = pxa2xx_mmci_init(address_space, 0x41100000, diff --git a/hw/arm/stellaris.c b/hw/arm/stellaris.c index de7c0fc4a6..f6f295b363 100644 --- a/hw/arm/stellaris.c +++ b/hw/arm/stellaris.c @@ -8,6 +8,7 @@ */ #include "qemu/osdep.h" +#include "qemu/error-report.h" #include "qapi/error.h" #include "hw/sysbus.h" #include "hw/ssi/ssi.h" @@ -559,7 +560,7 @@ static void ssys_write(void *opaque, hwaddr offset, case 0x040: /* SRCR0 */ case 0x044: /* SRCR1 */ case 0x048: /* SRCR2 */ - fprintf(stderr, "Peripheral reset not implemented\n"); + error_report("Peripheral reset not implemented"); break; case 0x054: /* IMC */ s->int_mask = value & 0x7f; diff --git a/hw/arm/tosa.c b/hw/arm/tosa.c index a55b1a369c..a069c95f1c 100644 --- a/hw/arm/tosa.c +++ b/hw/arm/tosa.c @@ -12,6 +12,7 @@ */ #include "qemu/osdep.h" +#include "qemu/error-report.h" #include "qapi/error.h" #include "hw/hw.h" #include "hw/arm/pxa.h" @@ -70,19 +71,19 @@ static void tosa_out_switch(void *opaque, int line, int level) { switch (line) { case 0: - fprintf(stderr, "blue LED %s.\n", level ? "on" : "off"); + error_report("blue LED %s.", level ? "on" : "off"); break; case 1: - fprintf(stderr, "green LED %s.\n", level ? "on" : "off"); + error_report("green LED %s.", level ? "on" : "off"); break; case 2: - fprintf(stderr, "amber LED %s.\n", level ? "on" : "off"); + error_report("amber LED %s.", level ? "on" : "off"); break; case 3: - fprintf(stderr, "wlan LED %s.\n", level ? "on" : "off"); + fprintf(stderr, "wlan LED %s.", level ? "on" : "off"); break; default: - fprintf(stderr, "Uhandled out event: %d = %d\n", line, level); + fprintf(stderr, "Uhandled out event: %d = %d", line, level); break; } } @@ -133,7 +134,7 @@ static void tosa_gpio_setup(PXA2xxState *cpu, static uint32_t tosa_ssp_tansfer(SSISlave *dev, uint32_t value) { - fprintf(stderr, "TG: %d %02x\n", value >> 5, value & 0x1f); + error_report("TG: %d %02x", value >> 5, value & 0x1f); return 0; } @@ -159,13 +160,13 @@ static int tosa_dac_send(I2CSlave *i2c, uint8_t data) s->buf[s->len] = data; if (s->len ++ > 2) { #ifdef VERBOSE - fprintf(stderr, "%s: message too long (%i bytes)\n", __func__, s->len); + error_report("%s: message too long (%i bytes)", __func__, s->len); #endif return 1; } if (s->len == 2) { - fprintf(stderr, "dac: channel %d value 0x%02x\n", + error_report("dac: channel %d value 0x%02x", s->buf[0], s->buf[1]); } diff --git a/hw/arm/versatilepb.c b/hw/arm/versatilepb.c index 418792cd02..56f9d60bed 100644 --- a/hw/arm/versatilepb.c +++ b/hw/arm/versatilepb.c @@ -364,7 +364,7 @@ static void versatile_init(MachineState *machine, int board_id) VERSATILE_FLASH_SECT_SIZE, VERSATILE_FLASH_SIZE / VERSATILE_FLASH_SECT_SIZE, 4, 0x0089, 0x0018, 0x0000, 0x0, 0)) { - fprintf(stderr, "qemu: Error registering flash memory.\n"); + error_report("Error registering flash memory."); } versatile_binfo.ram_size = machine->ram_size; diff --git a/hw/arm/vexpress.c b/hw/arm/vexpress.c index efb5a29475..508629dfe9 100644 --- a/hw/arm/vexpress.c +++ b/hw/arm/vexpress.c @@ -266,7 +266,7 @@ static void a9_daughterboard_init(const VexpressMachineState *vms, if (ram_size > 0x40000000) { /* 1GB is the maximum the address space permits */ - fprintf(stderr, "vexpress-a9: cannot model more than 1GB RAM\n"); + error_report("vexpress-a9: cannot model more than 1GB RAM"); exit(1); } @@ -355,7 +355,7 @@ static void a15_daughterboard_init(const VexpressMachineState *vms, */ uint64_t rsz = ram_size; if (rsz > (30ULL * 1024 * 1024 * 1024)) { - fprintf(stderr, "vexpress-a15: cannot model more than 30GB RAM\n"); + error_report("vexpress-a15: cannot model more than 30GB RAM"); exit(1); } } @@ -640,7 +640,7 @@ static void vexpress_common_init(MachineState *machine) pflash0 = ve_pflash_cfi01_register(map[VE_NORFLASH0], "vexpress.flash0", dinfo); if (!pflash0) { - fprintf(stderr, "vexpress: error registering flash 0.\n"); + error_report("vexpress: error registering flash 0."); exit(1); } @@ -655,7 +655,7 @@ static void vexpress_common_init(MachineState *machine) dinfo = drive_get_next(IF_PFLASH); if (!ve_pflash_cfi01_register(map[VE_NORFLASH1], "vexpress.flash1", dinfo)) { - fprintf(stderr, "vexpress: error registering flash 1.\n"); + error_report("vexpress: error registering flash 1."); exit(1); } diff --git a/hw/arm/z2.c b/hw/arm/z2.c index 60561c7b7c..ee59142667 100644 --- a/hw/arm/z2.c +++ b/hw/arm/z2.c @@ -319,8 +319,8 @@ static void z2_init(MachineState *machine) #endif dinfo = drive_get(IF_PFLASH, 0, 0); if (!dinfo && !qtest_enabled()) { - fprintf(stderr, "Flash image must be given with the " - "'pflash' parameter\n"); + error_report("Flash image must be given with the " + "'pflash' parameter"); exit(1); } @@ -329,7 +329,7 @@ static void z2_init(MachineState *machine) dinfo ? blk_by_legacy_dinfo(dinfo) : NULL, sector_len, Z2_FLASH_SIZE / sector_len, 4, 0, 0, 0, 0, be)) { - fprintf(stderr, "qemu: Error registering flash memory.\n"); + error_report("Error registering flash memory."); exit(1); } From patchwork Thu Oct 19 16:15:57 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alistair Francis X-Patchwork-Id: 828198 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; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=xilinx.onmicrosoft.com header.i=@xilinx.onmicrosoft.com header.b="v0meH65g"; 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 3yHvRM6Br3z9t7p for ; Fri, 20 Oct 2017 03:25:19 +1100 (AEDT) Received: from localhost ([::1]:50080 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e5DdF-00081a-Qe for incoming@patchwork.ozlabs.org; Thu, 19 Oct 2017 12:25:17 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:55076) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e5DYK-0004D1-Ry for qemu-devel@nongnu.org; Thu, 19 Oct 2017 12:20:16 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1e5DYI-0000xs-IS for qemu-devel@nongnu.org; Thu, 19 Oct 2017 12:20:12 -0400 Received: from mail-sn1nam01on0076.outbound.protection.outlook.com ([104.47.32.76]:51566 helo=NAM01-SN1-obe.outbound.protection.outlook.com) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1e5DYB-0000u4-MP; Thu, 19 Oct 2017 12:20:03 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=xilinx.onmicrosoft.com; s=selector1-xilinx-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=6BI1KhONe9jnK/tpq+YceOJJPNARyK4QJxvsKOv5u4Q=; b=v0meH65gjvg75PBXxNPyhRAb5wCWT/F6MTCQJvLaRceXIG49zSVl9psD55NazgtD1NhFY1KF5pPToqYbnwWxP0zA1xxtPLih3uIJegoAh5x/iM/pLk8pb1pyYOx65pqcsQizLESW+sER8F7+gdLCENAHDc2tD2d14xk/iZhbwv4= Received: from SN4PR0201CA0023.namprd02.prod.outlook.com (10.161.238.161) by BY2PR02MB1330.namprd02.prod.outlook.com (10.162.79.25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.77.7; Thu, 19 Oct 2017 16:20:00 +0000 Received: from CY1NAM02FT021.eop-nam02.prod.protection.outlook.com (2a01:111:f400:7e45::204) by SN4PR0201CA0023.outlook.office365.com (2603:10b6:803:2b::33) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.77.7 via Frontend Transport; Thu, 19 Oct 2017 16:20:00 +0000 Authentication-Results: spf=pass (sender IP is 149.199.60.100) smtp.mailfrom=xilinx.com; nongnu.org; dkim=none (message not signed) header.d=none;nongnu.org; dmarc=bestguesspass action=none header.from=xilinx.com; Received-SPF: Pass (protection.outlook.com: domain of xilinx.com designates 149.199.60.100 as permitted sender) receiver=protection.outlook.com; client-ip=149.199.60.100; helo=xsj-pvapsmtpgw02; Received: from xsj-pvapsmtpgw02 (149.199.60.100) by CY1NAM02FT021.mail.protection.outlook.com (10.152.75.187) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.20.77.10 via Frontend Transport; Thu, 19 Oct 2017 16:19:59 +0000 Received: from unknown-38-66.xilinx.com ([149.199.38.66]:35343 helo=xsj-pvapsmtp01) by xsj-pvapsmtpgw02 with esmtp (Exim 4.63) (envelope-from ) id 1e5DY6-0007vG-PX; Thu, 19 Oct 2017 09:19:58 -0700 Received: from [127.0.0.1] (helo=localhost) by xsj-pvapsmtp01 with smtp (Exim 4.63) (envelope-from ) id 1e5DY6-0002SQ-LU; Thu, 19 Oct 2017 09:19:58 -0700 Received: from xsj-pvapsmtp01 (smtp2.xilinx.com [149.199.38.66]) by xsj-smtp-dlp1.xlnx.xilinx.com (8.13.8/8.13.1) with ESMTP id v9JGJou2017279; Thu, 19 Oct 2017 09:19:50 -0700 Received: from [172.19.2.220] (helo=localhost.localdomain) by xsj-pvapsmtp01 with esmtp (Exim 4.63) (envelope-from ) id 1e5DXy-0002Rb-01; Thu, 19 Oct 2017 09:19:50 -0700 From: Alistair Francis To: Date: Thu, 19 Oct 2017 09:15:57 -0700 Message-ID: X-Mailer: git-send-email 2.11.0 In-Reply-To: References: X-RCIS-Action: ALLOW X-TM-AS-Product-Ver: IMSS-7.1.0.1224-8.1.0.1062-23404.005 X-TM-AS-User-Approved-Sender: Yes;Yes X-EOPAttributedMessage: 0 X-MS-Office365-Filtering-HT: Tenant X-Forefront-Antispam-Report: CIP:149.199.60.100; IPV:NLI; CTRY:US; EFV:NLI; SFV:NSPM; SFS:(10009020)(6009001)(346002)(39860400002)(376002)(2980300002)(438002)(189002)(199003)(2950100002)(189998001)(5660300001)(81166006)(54906003)(8676002)(6916009)(8936002)(33646002)(118296001)(50226002)(478600001)(77096006)(106002)(81156014)(356003)(16586007)(36386004)(2906002)(2351001)(305945005)(4326008)(5003940100001)(316002)(63266004)(36756003)(50466002)(9786002)(76176999)(47776003)(575784001)(48376002)(39060400002)(50986999)(106466001)(107986001)(5001870100001); DIR:OUT; SFP:1101; SCL:1; SRVR:BY2PR02MB1330; H:xsj-pvapsmtpgw02; FPR:; SPF:Pass; PTR:xapps1.xilinx.com,unknown-60-100.xilinx.com; MX:1; A:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; CY1NAM02FT021; 1:1e500ELSnVOcgdNiUKLB5HUIL91Vb3xVOIaM1om5fm+WCvn9vQ6flB3kWxbmW32EJ99qW0v7Jy4Wo/f8rGPIUeMJYeryelajoRyhkKhhWyCUlq6WBNu7hKUSTtQjr9X1 MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 37bcfc2a-8c68-4752-57ac-08d5170d3eb7 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001)(2017030254152)(8251501002)(2017052603199)(201703131423075)(201703031133081)(201702281549075); SRVR:BY2PR02MB1330; X-Microsoft-Exchange-Diagnostics: 1; BY2PR02MB1330; 3:79vnj6iYGVmfEmsrt3PXPZwjDh1TsIvcxUlKjasighAar+hW4VJYrX9FpIyHiTtNIJBp0tZn7nhKpiBPQCdsPEC1xpPnMX9LKCRPqybs74EP2IVlLUd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WABi5nnmWsl6pSwAuWPrPVVMVWwscEn1DGzCh7s75vkhxIjy7aYR4zFu7Amdyoxpu1AljO5HmQJdqcKnTc58pEo8sGG05FWLBHoPB3bMiuUxLO4nurntBeQqNpU8RkiYw+VqFVQ9LM5JMR3XP8qDxPl/z22/7OIHw2KFqYVLTB3S2uI+JM+vctTStsIHf+V5OPdPfIMsRvUXY0Ma12EaSUIiDHoPnRguHUKFvCPzEFb7Jw0BCr+cHgqF3Rx89xL9EH8RJLhBa14LWFWeVjVmN7hZhh3z0oXm6ObmY89nKgY5bKT8PN3UskmSie9guWh6TqAvKO X-Exchange-Antispam-Report-Test: UriScan:(788757137089)(192813158149592); X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(100000700101)(100105000095)(100000701101)(100105300095)(100000702101)(100105100095)(6040450)(2401047)(5005006)(8121501046)(10201501046)(3002001)(100000703101)(100105400095)(93006095)(93004095)(6055026)(6041248)(20161123558100)(20161123562025)(20161123560025)(20161123564025)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123555025)(6072148)(201708071742011)(100000704101)(100105200095)(100000705101)(100105500095); SRVR:BY2PR02MB1330; BCL:0; PCL:0; RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095); SRVR:BY2PR02MB1330; X-Microsoft-Exchange-Diagnostics: 1; BY2PR02MB1330; 4:pcNAPwIfyogJ4MzxEMhJCR1KCz5TrnTbolK3J1ZYJPIVMKJFyLQhD1Sdv/Exb6Xn//+xrKssVCSZIHNeqtBXBFeVO81e91pCuFpjcS3IPmQyGNRXmgYKoJQHtsVS2i5MYyScnC9h47SzZBVBAnI2rllWKIGMVlvFMGpabuMEI38fImOTXt8nJo2/xiFKFGjtNo1D87S45P92Ohz1WVGFMpfc9A2pllJK4InMNQCIiVcBQDwCX3nth4J3WfIuZo4E9Jlfkwh/kBWTN112YmnUc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Y= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: xilinx.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 19 Oct 2017 16:19:59.3259 (UTC) X-MS-Exchange-CrossTenant-Id: 657af505-d5df-48d0-8300-c31994686c5c X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=657af505-d5df-48d0-8300-c31994686c5c; Ip=[149.199.60.100]; Helo=[xsj-pvapsmtpgw02] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BY2PR02MB1330 X-detected-operating-system: by eggs.gnu.org: Windows 7 or 8 [fuzzy] X-Received-From: 104.47.32.76 Subject: [Qemu-devel] [PATCH v3 06/46] hw/block: Replace fprintf(stderr, "*\n" with error_report() 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: alistair23@gmail.com, armbru@redhat.com, qemu-block@nongnu.org, alistair.francis@xilinx.com Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" Replace a large number of the fprintf(stderr, "*\n" calls with error_report(). The functions were renamed with these commands and then compiler issues where manually fixed. find ./* -type f -exec sed -i \ 'N;N;N;N;N;N;N;N;N;N;N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2);|Ig}' \ {} + find ./* -type f -exec sed -i \ 'N;N;N;N;N;N;N;N;N;N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2);|Ig}' \ {} + find ./* -type f -exec sed -i \ 'N;N;N;N;N;N;N;N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2);|Ig}' \ {} + find ./* -type f -exec sed -i \ 'N;N;N;N;N;N;N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2);|Ig}' \ {} + find ./* -type f -exec sed -i \ 'N;N;N;N;N;N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2);|Ig}' \ {} + find ./* -type f -exec sed -i \ 'N;N;N;N;N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2);|Ig}' \ {} + find ./* -type f -exec sed -i \ 'N;N;N;N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2);|Ig}' \ {} + find ./* -type f -exec sed -i \ 'N;N;N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2);|Ig}' \ {} + find ./* -type f -exec sed -i \ 'N;N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2);|Ig}' \ {} + find ./* -type f -exec sed -i \ 'N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2);|Ig}' \ {} + find ./* -type f -exec sed -i \ 'N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2);|Ig}' \ {} + Some lines where then manually tweaked to pass checkpatch. Signed-off-by: Alistair Francis Cc: qemu-block@nongnu.org --- V2: - Split hw patch into individual directories hw/block/dataplane/virtio-blk.c | 6 +++--- hw/block/onenand.c | 8 ++++---- hw/block/tc58128.c | 44 +++++++++++++++++++---------------------- 3 files changed, 27 insertions(+), 31 deletions(-) diff --git a/hw/block/dataplane/virtio-blk.c b/hw/block/dataplane/virtio-blk.c index 5556f0e64e..69dfd49191 100644 --- a/hw/block/dataplane/virtio-blk.c +++ b/hw/block/dataplane/virtio-blk.c @@ -178,8 +178,8 @@ int virtio_blk_data_plane_start(VirtIODevice *vdev) /* Set up guest notifier (irq) */ r = k->set_guest_notifiers(qbus->parent, nvqs, true); if (r != 0) { - fprintf(stderr, "virtio-blk failed to set guest notifier (%d), " - "ensure -enable-kvm is set\n", r); + error_report("virtio-blk failed to set guest notifier (%d), " + "ensure -enable-kvm is set", r); goto fail_guest_notifiers; } @@ -187,7 +187,7 @@ int virtio_blk_data_plane_start(VirtIODevice *vdev) for (i = 0; i < nvqs; i++) { r = virtio_bus_set_host_notifier(VIRTIO_BUS(qbus), i, true); if (r != 0) { - fprintf(stderr, "virtio-blk failed to set host notifier (%d)\n", r); + error_report("virtio-blk failed to set host notifier (%d)", r); while (i--) { virtio_bus_set_host_notifier(VIRTIO_BUS(qbus), i, false); } diff --git a/hw/block/onenand.c b/hw/block/onenand.c index ed77f859e9..9591e9e82c 100644 --- a/hw/block/onenand.c +++ b/hw/block/onenand.c @@ -596,7 +596,7 @@ static void onenand_command(OneNANDState *s) default: s->status |= ONEN_ERR_CMD; s->intstatus |= ONEN_INT; - fprintf(stderr, "%s: unknown OneNAND command %x\n", + error_report("%s: unknown OneNAND command %x", __func__, s->command); } @@ -663,7 +663,7 @@ static uint64_t onenand_read(void *opaque, hwaddr addr, return 0x0000; } - fprintf(stderr, "%s: unknown OneNAND register %x\n", + error_report("%s: unknown OneNAND register %x", __func__, offset); return 0; } @@ -708,7 +708,7 @@ static void onenand_write(void *opaque, hwaddr addr, break; default: - fprintf(stderr, "%s: unknown OneNAND boot command %"PRIx64"\n", + error_report("%s: unknown OneNAND boot command %"PRIx64"", __func__, value); } break; @@ -759,7 +759,7 @@ static void onenand_write(void *opaque, hwaddr addr, break; default: - fprintf(stderr, "%s: unknown OneNAND register %x\n", + error_report("%s: unknown OneNAND register %x", __func__, offset); } } diff --git a/hw/block/tc58128.c b/hw/block/tc58128.c index 1d9f7ee000..d274c9aafe 100644 --- a/hw/block/tc58128.c +++ b/hw/block/tc58128.c @@ -50,8 +50,8 @@ static void init_dev(tc58128_dev * dev, const char *filename) dev->flash_contents[1] = (blocks >> 8) & 0xff; dev->flash_contents[2] = (blocks >> 16) & 0xff; dev->flash_contents[3] = (blocks >> 24) & 0xff; - fprintf(stderr, "loaded %d bytes for %s into flash\n", ret, - filename); + error_report("loaded %d bytes for %s into flash", ret, + filename); } } } @@ -60,26 +60,26 @@ static void handle_command(tc58128_dev * dev, uint8_t command) { switch (command) { case 0xff: - fprintf(stderr, "reset flash device\n"); - dev->state = WAIT; - break; + error_report("reset flash device"); + dev->state = WAIT; + break; case 0x00: - fprintf(stderr, "read mode 1\n"); - dev->state = READ1; - dev->address_cycle = 0; - break; + error_report("read mode 1"); + dev->state = READ1; + dev->address_cycle = 0; + break; case 0x01: - fprintf(stderr, "read mode 2\n"); - dev->state = READ2; - dev->address_cycle = 0; - break; + error_report("read mode 2"); + dev->state = READ2; + dev->address_cycle = 0; + break; case 0x50: - fprintf(stderr, "read mode 3\n"); - dev->state = READ3; - dev->address_cycle = 0; - break; + error_report("read mode 3"); + dev->state = READ3; + dev->address_cycle = 0; + break; default: - fprintf(stderr, "unknown flash command 0x%02x\n", command); + error_report("unknown flash command 0x%02x", command); abort(); } } @@ -103,8 +103,8 @@ static void handle_address(tc58128_dev * dev, uint8_t data) break; case 2: dev->address += data * 528; - fprintf(stderr, "address pointer in flash: 0x%08x\n", - dev->address); + error_report("address pointer in flash: 0x%08x", + dev->address); break; default: /* Invalid data */ @@ -119,10 +119,6 @@ static void handle_address(tc58128_dev * dev, uint8_t data) static uint8_t handle_read(tc58128_dev * dev) { -#if 0 - if (dev->address % 0x100000 == 0) - fprintf(stderr, "reading flash at address 0x%08x\n", dev->address); -#endif return dev->flash_contents[dev->address++]; } From patchwork Thu Oct 19 16:16:00 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alistair Francis X-Patchwork-Id: 828194 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; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=xilinx.onmicrosoft.com header.i=@xilinx.onmicrosoft.com header.b="irmVLjVy"; 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 3yHvLn0RwZz9t4P for ; Fri, 20 Oct 2017 03:21:21 +1100 (AEDT) Received: from localhost ([::1]:50066 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e5DZP-0004Vl-4P for incoming@patchwork.ozlabs.org; Thu, 19 Oct 2017 12:21:19 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:54990) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e5DYE-00048F-Rq for qemu-devel@nongnu.org; Thu, 19 Oct 2017 12:20:10 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1e5DYB-0000uI-IP for qemu-devel@nongnu.org; Thu, 19 Oct 2017 12:20:06 -0400 Received: from mail-cys01nam02on0063.outbound.protection.outlook.com ([104.47.37.63]:40877 helo=NAM02-CY1-obe.outbound.protection.outlook.com) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1e5DYB-0000tn-7t for qemu-devel@nongnu.org; Thu, 19 Oct 2017 12:20:03 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=xilinx.onmicrosoft.com; s=selector1-xilinx-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=HoY6gd95g5BFqiycgEkMSKrAacn56Tf7gkIN2O4FYDI=; b=irmVLjVykWo83t+qiCU5IBltXRPN9WpToggKHbz7IxRR11T0v3V1UMxbiYxO1zNqOz73xBgB4d9VnLvtCft0eNCOOjoPfkz2tiFiUIScNRdskQNFAYMMEysfMhXCCBh71dqe00sz32lZBKT8EcIyT4UorrVJbtf4Bu0hN5keF+g= Received: from CY4PR02CA0003.namprd02.prod.outlook.com (2603:10b6:903:18::13) by DM2PR02MB1338.namprd02.prod.outlook.com (2a01:111:e400:50c8::25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.77.7; Thu, 19 Oct 2017 16:19:59 +0000 Received: from CY1NAM02FT037.eop-nam02.prod.protection.outlook.com (2a01:111:f400:7e45::205) by CY4PR02CA0003.outlook.office365.com (2603:10b6:903:18::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.77.21 via Frontend Transport; Thu, 19 Oct 2017 16:19:59 +0000 Authentication-Results: spf=pass (sender IP is 149.199.60.100) smtp.mailfrom=xilinx.com; redhat.com; dkim=none (message not signed) header.d=none;redhat.com; dmarc=bestguesspass action=none header.from=xilinx.com; Received-SPF: Pass (protection.outlook.com: domain of xilinx.com designates 149.199.60.100 as permitted sender) receiver=protection.outlook.com; client-ip=149.199.60.100; helo=xsj-pvapsmtpgw02; Received: from xsj-pvapsmtpgw02 (149.199.60.100) by CY1NAM02FT037.mail.protection.outlook.com (10.152.75.77) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.20.77.10 via Frontend Transport; Thu, 19 Oct 2017 16:19:59 +0000 Received: from unknown-38-66.xilinx.com ([149.199.38.66]:35344 helo=xsj-pvapsmtp01) by xsj-pvapsmtpgw02 with esmtp (Exim 4.63) (envelope-from ) id 1e5DY6-0007vI-Q5; Thu, 19 Oct 2017 09:19:58 -0700 Received: from [127.0.0.1] (helo=localhost) by xsj-pvapsmtp01 with smtp (Exim 4.63) (envelope-from ) id 1e5DY6-0002SQ-N7; Thu, 19 Oct 2017 09:19:58 -0700 Received: from xsj-pvapsmtp01 (smtp.xilinx.com [149.199.38.66]) by xsj-smtp-dlp1.xlnx.xilinx.com (8.13.8/8.13.1) with ESMTP id v9JGJrmg017290; Thu, 19 Oct 2017 09:19:53 -0700 Received: from [172.19.2.220] (helo=localhost.localdomain) by xsj-pvapsmtp01 with esmtp (Exim 4.63) (envelope-from ) id 1e5DY1-0002Rn-0D; Thu, 19 Oct 2017 09:19:53 -0700 From: Alistair Francis To: Date: Thu, 19 Oct 2017 09:16:00 -0700 Message-ID: <2494b7b45d817fbc7e461b4f8af72ee2dc4285e7.1508390588.git.alistair.francis@xilinx.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: References: X-RCIS-Action: ALLOW X-TM-AS-Product-Ver: IMSS-7.1.0.1224-8.1.0.1062-23404.005 X-TM-AS-User-Approved-Sender: Yes;Yes X-EOPAttributedMessage: 0 X-MS-Office365-Filtering-HT: Tenant X-Forefront-Antispam-Report: CIP:149.199.60.100; IPV:NLI; CTRY:US; EFV:NLI; SFV:NSPM; SFS:(10009020)(6009001)(376002)(39860400002)(346002)(2980300002)(438002)(199003)(189002)(50226002)(50466002)(8676002)(356003)(9786002)(76176999)(106466001)(81156014)(81166006)(47776003)(39060400002)(33646002)(36756003)(50986999)(551934003)(305945005)(48376002)(118296001)(4326008)(63266004)(2351001)(6916009)(575784001)(106002)(2906002)(16586007)(36386004)(8936002)(316002)(5660300001)(54906003)(478600001)(2950100002)(5003940100001)(6666003)(189998001)(77096006)(107986001)(5001870100001); DIR:OUT; SFP:1101; SCL:1; SRVR:DM2PR02MB1338; H:xsj-pvapsmtpgw02; FPR:; SPF:Pass; PTR:unknown-60-100.xilinx.com,xapps1.xilinx.com; A:1; MX:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; CY1NAM02FT037; 1:imOtJ0fXRfL8yRHq/ILvUlrLwBUFnkjxHoybRlpJMclPnV9to3BhcmIVVsV/cgvF7zPaoIP/6X8TkC1gd0cEtssHxAp5z/Mev7ymWX7Kqu0bnXKPI5dgbgsDtkQGl4Th MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: db2aee09-89ed-42ef-9244-08d5170d3ec1 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001)(2017030254152)(8251501002)(2017052603199)(201703131423075)(201703031133081)(201702281549075); SRVR:DM2PR02MB1338; X-Microsoft-Exchange-Diagnostics: 1; DM2PR02MB1338; 3:KlVTmPx3S2vIopESpnKWlCZAf5T5sHbygYT5RwdbGGB1htcU0m24+yRxk/CtHruMMxqenLK2sfLX1FfraW1e46ovpah7b/wKM+8cmls4KcUwiXl5rCDlUzzz01JlM3RY1LqKvLCLctl0p5GiRVVGjh2lPyO8nWGiwojE+06+PElJRCSuse8uXd/oyFwsvpT8BKwbASNHBfOYyxgTZug2Xey2pdB2EQ/hvNXk5UWssAULg+X96GKuEki1d0qIGj2k3NCztoBtUSz2A8p9CZV77zkdxbYkQ73968Hbu1aqEOsQVK5QSPGrB8cH0C5cif59thKGcTDXtPqiwCLz0VUuseMHtm0SvEY8rqFUGALXiwk=; 25:/sWpEg6kh0UVxPc/ohfKsH8jhsuL2M3LoiGaFPP+7WmQDoZxsptvx6IKh1rcLACyDKP1huHYCVTIZexmdo3Ov7/b5oFRATPCfNE7XupwLfyz45Ijt1ctpSltkBhR+hGj8fQcioXcrnyHpdtS5pxqXt2tBdXfgcAdmrwzs2naVrJNbVg7CvKmWuOfYewk1ewF4jWloXNNesBd5sqDBHpmDVDCTLsxWSB1BWyMkWKh5pPBcbUEqqsTuE/Tds+JqA9XTY0V0XJobOtGUiVwTa4Uu4O7o/i3X7JPXwEhV6GaOL/ymRKzfNtwr1ZLZAqnQ1F8I4SoHtIO4SJp9b/ZQKEzbA== X-MS-TrafficTypeDiagnostic: DM2PR02MB1338: X-Microsoft-Exchange-Diagnostics: 1; DM2PR02MB1338; 31:z8FrEHOIKKyfCsxd61aoZbN3ENHKAZXfEWB8vaZgRuoyt9SMsK46uJzx+7tAtM47XxDEO+//ivh0iEwFVWMd62n82MduWryV5okPgAEC+VqlvKNiebt5paYOhqyKVvAxRYBAVtExV8boZz1wpof9W7exTDLdc+wbSu3p35sSJXdMGQleyPfBbnL2siX6vILbWR8nKC9wlSPbHXvwWXDhzaPQQSSnGIi4ytKFFA09J9g=; 20:roLxjbmNbXrJrxyM/sYk4OAgIia7ILs+6p4+F3mPHCnYEXq4b5o+N51GH4koDumxI8jBDgYRl1m58m+0cNb7SF2Pb5eE5m2QMS8qI3olZMJMY9ExpPU7Hf8Ri+Ryt5wG+cYlNOdiNV9LcYsolnIGoEHqXvZYwtL0uEhMaUDRQ2h4Tbp1ys7QPN0ilx2M//2kmE1JT4kozd1RbocV5Pk0Dy8bU96t1biikL8f9lChBqIrNmKNHvbBPAqjdnNAARkxv4hdfolGIe0nB8L47vJ7Sjnzu3ps4dRe8ltLc7pWXCx8uiYnR0M1KEVTjKUPKBADIrc7ofpU5e9suv1ryErqIpFqr6iTC2gfbrk+h/MUBV6AyDx/LvOJVnZLl7rsLJxX/P85/3LJXtdme5jAbSOexHRoS0DaX1OP6GXKrXvhN81/eGHhC7W5odl89sdDEuFm4Fx7Y8ikcnm4xVIlVDg674ZwTz5984yf1I8kecM/JZ8KJM2d7VyFigMR/TC8vhDn X-Exchange-Antispam-Report-Test: UriScan:(788757137089)(192813158149592); X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(100000700101)(100105000095)(100000701101)(100105300095)(100000702101)(100105100095)(6040450)(2401047)(5005006)(8121501046)(3002001)(100000703101)(100105400095)(10201501046)(93006095)(93004095)(6055026)(6041248)(20161123555025)(20161123560025)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123558100)(20161123564025)(20161123562025)(6072148)(201708071742011)(100000704101)(100105200095)(100000705101)(100105500095); SRVR:DM2PR02MB1338; BCL:0; PCL:0; RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095); SRVR:DM2PR02MB1338; X-Microsoft-Exchange-Diagnostics: 1; DM2PR02MB1338; 4:GCo4cgLqxFWwE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MkR5dYbu5UyceOD0=; 7:L3YXE13OQUH2K0MFXSi9YwC6NFnuEDvSKCnnRXFXLsvXuXlCWBKcq42A1UdmgtKCsPWN7BPonX9ZcQUi7wJaKIyNowaOdnCWeogi/LQaGSvsK+7N0oClLsEKLf9CSbwCZ9Musk1u7IJwcnAVwTxf7W1QBmk5SDrSAXfMytQUuUNxv8CmNTJYNfZkVfTW9Fy8kgvdufENDo5bUOhucakta9DKLIm9dRAW3A2moOOpNbE= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: xilinx.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 19 Oct 2017 16:19:59.3773 (UTC) X-MS-Exchange-CrossTenant-Id: 657af505-d5df-48d0-8300-c31994686c5c X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=657af505-d5df-48d0-8300-c31994686c5c; Ip=[149.199.60.100]; Helo=[xsj-pvapsmtpgw02] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM2PR02MB1338 X-detected-operating-system: by eggs.gnu.org: Windows 7 or 8 [fuzzy] X-Received-From: 104.47.37.63 Subject: [Qemu-devel] [PATCH v3 07/46] hw/bt: Replace fprintf(stderr, "*\n" with error_report() 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: alistair23@gmail.com, armbru@redhat.com, alistair.francis@xilinx.com Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" Replace a large number of the fprintf(stderr, "*\n" calls with error_report(). The functions were renamed with these commands and then compiler issues where manually fixed. find ./* -type f -exec sed -i \ 'N;N;N;N;N;N;N;N;N;N;N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2);|Ig}' \ {} + find ./* -type f -exec sed -i \ 'N;N;N;N;N;N;N;N;N;N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2);|Ig}' \ {} + find ./* -type f -exec sed -i \ 'N;N;N;N;N;N;N;N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2);|Ig}' \ {} + find ./* -type f -exec sed -i \ 'N;N;N;N;N;N;N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2);|Ig}' \ {} + find ./* -type f -exec sed -i \ 'N;N;N;N;N;N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2);|Ig}' \ {} + find ./* -type f -exec sed -i \ 'N;N;N;N;N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2);|Ig}' \ {} + find ./* -type f -exec sed -i \ 'N;N;N;N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2);|Ig}' \ {} + find ./* -type f -exec sed -i \ 'N;N;N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2);|Ig}' \ {} + find ./* -type f -exec sed -i \ 'N;N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2);|Ig}' \ {} + find ./* -type f -exec sed -i \ 'N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2);|Ig}' \ {} + find ./* -type f -exec sed -i \ 'N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2);|Ig}' \ {} + Some lines where then manually tweaked to pass checkpatch. Signed-off-by: Alistair Francis --- V2: - Split hw patch into individual directories hw/bt/core.c | 15 +++++++-------- hw/bt/hci-csr.c | 21 +++++++++++---------- hw/bt/hci.c | 40 ++++++++++++++++++---------------------- hw/bt/hid.c | 2 +- hw/bt/l2cap.c | 47 ++++++++++++++++++++++++----------------------- hw/bt/sdp.c | 7 ++++--- 6 files changed, 65 insertions(+), 67 deletions(-) diff --git a/hw/bt/core.c b/hw/bt/core.c index c1806b71a3..e588eae6d2 100644 --- a/hw/bt/core.c +++ b/hw/bt/core.c @@ -18,6 +18,7 @@ */ #include "qemu/osdep.h" +#include "qemu/error-report.h" #include "qemu-common.h" #include "sysemu/bt.h" #include "hw/bt.h" @@ -31,24 +32,22 @@ static void bt_dummy_lmp_mode_change(struct bt_link_s *link) static void bt_dummy_lmp_connection_complete(struct bt_link_s *link) { if (link->slave->reject_reason) - fprintf(stderr, "%s: stray LMP_not_accepted received, fixme\n", - __func__); + error_report("%s: stray LMP_not_accepted received, fixme", __func__); else - fprintf(stderr, "%s: stray LMP_accepted received, fixme\n", - __func__); + error_report("%s: stray LMP_accepted received, fixme", __func__); exit(-1); } static void bt_dummy_lmp_disconnect_master(struct bt_link_s *link) { - fprintf(stderr, "%s: stray LMP_detach received, fixme\n", __func__); + fprintf(stderr, "%s: stray LMP_detach received, fixme", __func__); exit(-1); } static void bt_dummy_lmp_acl_resp(struct bt_link_s *link, const uint8_t *data, int start, int len) { - fprintf(stderr, "%s: stray ACL response PDU, fixme\n", __func__); + error_report("%s: stray ACL response PDU, fixme", __func__); exit(-1); } @@ -113,8 +112,8 @@ void bt_device_done(struct bt_device_s *dev) while (*p && *p != dev) p = &(*p)->next; if (*p != dev) { - fprintf(stderr, "%s: bad bt device \"%s\"\n", __func__, - dev->lmp_name ?: "(null)"); + error_report("%s: bad bt device \"%s\"", __func__, + dev->lmp_name ?: "(null)"); exit(-1); } diff --git a/hw/bt/hci-csr.c b/hw/bt/hci-csr.c index ac067b81f6..0341ded50c 100644 --- a/hw/bt/hci-csr.c +++ b/hw/bt/hci-csr.c @@ -19,6 +19,7 @@ */ #include "qemu/osdep.h" +#include "qemu/error-report.h" #include "qemu-common.h" #include "chardev/char-serial.h" #include "qemu/timer.h" @@ -111,14 +112,14 @@ static uint8_t *csrhci_out_packet(struct csrhci_s *s, int len) if (off < FIFO_LEN) { if (off + len > FIFO_LEN && (s->out_size = off + len) > FIFO_LEN * 2) { - fprintf(stderr, "%s: can't alloc %i bytes\n", __func__, len); + error_report("%s: can't alloc %i bytes", __func__, len); exit(-1); } return s->outfifo + off; } if (s->out_len > s->out_size) { - fprintf(stderr, "%s: can't alloc %i bytes\n", __func__, len); + error_report("%s: can't alloc %i bytes", __func__, len); exit(-1); } @@ -168,10 +169,10 @@ static void csrhci_in_packet_vendor(struct csrhci_s *s, int ocf, s->bd_addr.b[5] = data[offset + 2]; s->hci->bdaddr_set(s->hci, s->bd_addr.b); - fprintf(stderr, "%s: bd_address loaded from firmware: " - "%02x:%02x:%02x:%02x:%02x:%02x\n", __func__, - s->bd_addr.b[0], s->bd_addr.b[1], s->bd_addr.b[2], - s->bd_addr.b[3], s->bd_addr.b[4], s->bd_addr.b[5]); + error_report("%s: bd_address loaded from firmware: " + "%02x:%02x:%02x:%02x:%02x:%02x", __func__, + s->bd_addr.b[0], s->bd_addr.b[1], s->bd_addr.b[2], + s->bd_addr.b[3], s->bd_addr.b[4], s->bd_addr.b[5]); } rpkt = csrhci_out_packet_event(s, EVT_VENDOR, 11); @@ -181,7 +182,7 @@ static void csrhci_in_packet_vendor(struct csrhci_s *s, int ocf, break; default: - fprintf(stderr, "%s: got a bad CMD packet\n", __func__); + error_report("%s: got a bad CMD packet", __func__); return; } @@ -226,7 +227,7 @@ static void csrhci_in_packet(struct csrhci_s *s, uint8_t *pkt) case H4_NEG_PKT: if (s->in_hdr != sizeof(csrhci_neg_packet) || memcmp(pkt - 1, csrhci_neg_packet, s->in_hdr)) { - fprintf(stderr, "%s: got a bad NEG packet\n", __func__); + error_report("%s: got a bad NEG packet", __func__); return; } pkt += 2; @@ -241,7 +242,7 @@ static void csrhci_in_packet(struct csrhci_s *s, uint8_t *pkt) case H4_ALIVE_PKT: if (s->in_hdr != 4 || pkt[1] != 0x55 || pkt[2] != 0x00) { - fprintf(stderr, "%s: got a bad ALIVE packet\n", __func__); + error_report("%s: got a bad ALIVE packet", __func__); return; } @@ -254,7 +255,7 @@ static void csrhci_in_packet(struct csrhci_s *s, uint8_t *pkt) default: bad_pkt: /* TODO: error out */ - fprintf(stderr, "%s: got a bad packet\n", __func__); + error_report("%s: got a bad packet", __func__); break; } diff --git a/hw/bt/hci.c b/hw/bt/hci.c index df05f07887..c6b2cc1d48 100644 --- a/hw/bt/hci.c +++ b/hw/bt/hci.c @@ -19,6 +19,7 @@ */ #include "qemu/osdep.h" +#include "qemu/error-report.h" #include "qapi/error.h" #include "qemu-common.h" #include "qemu/timer.h" @@ -457,8 +458,7 @@ static inline uint8_t *bt_hci_event_start(struct bt_hci_s *hci, int mask_byte; if (len > 255) { - fprintf(stderr, "%s: HCI event params too long (%ib)\n", - __func__, len); + error_report("%s: HCI event params too long (%ib)", __func__, len); exit(-1); } @@ -589,8 +589,8 @@ static void bt_hci_inquiry_result(struct bt_hci_s *hci, bt_hci_inquiry_result_with_rssi(hci, slave); return; default: - fprintf(stderr, "%s: bad inquiry mode %02x\n", __func__, - hci->lm.inquiry_mode); + error_report("%s: bad inquiry mode %02x", __func__, + hci->lm.inquiry_mode); exit(-1); } } @@ -1971,8 +1971,7 @@ static void bt_submit_hci(struct HCIInfo *info, break; short_hci: - fprintf(stderr, "%s: HCI packet too short (%iB)\n", - __func__, length); + error_report("%s: HCI packet too short (%iB)", __func__, length); bt_hci_event_status(hci, HCI_INVALID_PARAMETERS); break; } @@ -1991,8 +1990,8 @@ static inline void bt_hci_lmp_acl_data(struct bt_hci_s *hci, uint16_t handle, /* TODO: avoid memcpy'ing */ if (len + HCI_ACL_HDR_SIZE > sizeof(hci->acl_buf)) { - fprintf(stderr, "%s: can't take ACL packets %i bytes long\n", - __func__, len); + error_report("%s: can't take ACL packets %i bytes long", + __func__, len); return; } memcpy(hci->acl_buf + HCI_ACL_HDR_SIZE, data, len); @@ -2029,8 +2028,7 @@ static void bt_submit_acl(struct HCIInfo *info, struct bt_link_s *link; if (length < HCI_ACL_HDR_SIZE) { - fprintf(stderr, "%s: ACL packet too short (%iB)\n", - __func__, length); + error_report("%s: ACL packet too short (%iB)", __func__, length); return; } @@ -2041,16 +2039,15 @@ static void bt_submit_acl(struct HCIInfo *info, length -= HCI_ACL_HDR_SIZE; if (bt_hci_handle_bad(hci, handle)) { - fprintf(stderr, "%s: invalid ACL handle %03x\n", - __func__, handle); + error_report("%s: invalid ACL handle %03x", __func__, handle); /* TODO: signal an error */ return; } handle &= ~HCI_HANDLE_OFFSET; if (datalen > length) { - fprintf(stderr, "%s: ACL packet too short (%iB < %iB)\n", - __func__, length, datalen); + error_report("%s: ACL packet too short (%iB < %iB)", + __func__, length, datalen); return; } @@ -2060,8 +2057,8 @@ static void bt_submit_acl(struct HCIInfo *info, if (!hci->asb_handle) hci->asb_handle = handle; else if (handle != hci->asb_handle) { - fprintf(stderr, "%s: Bad handle %03x in Active Slave Broadcast\n", - __func__, handle); + error_report("%s: Bad handle %03x in Active Slave Broadcast", + __func__, handle); /* TODO: signal an error */ return; } @@ -2073,7 +2070,7 @@ static void bt_submit_acl(struct HCIInfo *info, if (!hci->psb_handle) hci->psb_handle = handle; else if (handle != hci->psb_handle) { - fprintf(stderr, "%s: Bad handle %03x in Parked Slave Broadcast\n", + error_report("%s: Bad handle %03x in Parked Slave Broadcast", __func__, handle); /* TODO: signal an error */ return; @@ -2105,14 +2102,13 @@ static void bt_submit_sco(struct HCIInfo *info, length -= 3; if (bt_hci_handle_bad(hci, handle)) { - fprintf(stderr, "%s: invalid SCO handle %03x\n", - __func__, handle); + error_report("%s: invalid SCO handle %03x", __func__, handle); return; } if (datalen > length) { - fprintf(stderr, "%s: SCO packet too short (%iB < %iB)\n", - __func__, length, datalen); + error_report("%s: SCO packet too short (%iB < %iB)", + __func__, length, datalen); return; } @@ -2223,7 +2219,7 @@ struct HCIInfo *hci_init(const char *str) return bt_new_hci(vlan); } - fprintf(stderr, "qemu: Unknown bluetooth HCI `%s'.\n", str); + error_report("Unknown bluetooth HCI `%s'.", str); return 0; } diff --git a/hw/bt/hid.c b/hw/bt/hid.c index 09d17322e4..056291f9b5 100644 --- a/hw/bt/hid.c +++ b/hw/bt/hid.c @@ -419,7 +419,7 @@ static void bt_hid_interrupt_sdu(void *opaque, const uint8_t *data, int len) return; bad: - fprintf(stderr, "%s: bad transaction on Interrupt channel.\n", + error_report("%s: bad transaction on Interrupt channel.", __func__); } diff --git a/hw/bt/l2cap.c b/hw/bt/l2cap.c index 3e53dd082d..9cf27f0df6 100644 --- a/hw/bt/l2cap.c +++ b/hw/bt/l2cap.c @@ -18,6 +18,7 @@ */ #include "qemu/osdep.h" +#include "qemu/error-report.h" #include "qemu-common.h" #include "qemu/timer.h" #include "qemu/bswap.h" @@ -467,8 +468,8 @@ static void l2cap_channel_close(struct l2cap_instance_s *l2cap, if (likely(ch)) { if (ch->remote_cid != source_cid) { - fprintf(stderr, "%s: Ignoring a Disconnection Request with the " - "invalid SCID %04x.\n", __func__, source_cid); + error_report("%s: Ignoring a Disconnection Request with the " + "invalid SCID %04x.", __func__, source_cid); return; } @@ -790,7 +791,7 @@ static void l2cap_command(struct l2cap_instance_s *l2cap, int code, int id, #if 0 /* TODO: do the IDs really have to be in sequence? */ if (!id || (id != l2cap->last_id && id != l2cap->next_id)) { - fprintf(stderr, "%s: out of sequence command packet ignored.\n", + error_report("%s: out of sequence command packet ignored.", __func__); return; } @@ -813,9 +814,9 @@ static void l2cap_command(struct l2cap_instance_s *l2cap, int code, int id, } /* We never issue commands other than Command Reject currently. */ - fprintf(stderr, "%s: stray Command Reject (%02x, %04x) " - "packet, ignoring.\n", __func__, id, - le16_to_cpu(((l2cap_cmd_rej *) params)->reason)); + error_report("%s: stray Command Reject (%02x, %04x) " + "packet, ignoring.", __func__, id, + le16_to_cpu(((l2cap_cmd_rej *) params)->reason)); break; case L2CAP_CONN_REQ: @@ -836,8 +837,8 @@ static void l2cap_command(struct l2cap_instance_s *l2cap, int code, int id, } /* We never issue Connection Requests currently. TODO */ - fprintf(stderr, "%s: unexpected Connection Response (%02x) " - "packet, ignoring.\n", __func__, id); + error_report("%s: unexpected Connection Response (%02x) " + "packet, ignoring.", __func__, id); break; case L2CAP_CONF_REQ: @@ -865,8 +866,8 @@ static void l2cap_command(struct l2cap_instance_s *l2cap, int code, int id, le16_to_cpu(((l2cap_conf_rsp *) params)->scid), ((l2cap_conf_rsp *) params)->data, len - L2CAP_CONF_RSP_SIZE(0))) - fprintf(stderr, "%s: unexpected Configure Response (%02x) " - "packet, ignoring.\n", __func__, id); + error_report("%s: unexpected Configure Response (%02x) " + "packet, ignoring.", __func__, id); break; case L2CAP_DISCONN_REQ: @@ -887,8 +888,8 @@ static void l2cap_command(struct l2cap_instance_s *l2cap, int code, int id, } /* We never issue Disconnection Requests currently. TODO */ - fprintf(stderr, "%s: unexpected Disconnection Response (%02x) " - "packet, ignoring.\n", __func__, id); + error_report("%s: unexpected Disconnection Response (%02x) " + "packet, ignoring.", __func__, id); break; case L2CAP_ECHO_REQ: @@ -897,8 +898,8 @@ static void l2cap_command(struct l2cap_instance_s *l2cap, int code, int id, case L2CAP_ECHO_RSP: /* We never issue Echo Requests currently. TODO */ - fprintf(stderr, "%s: unexpected Echo Response (%02x) " - "packet, ignoring.\n", __func__, id); + error_report("%s: unexpected Echo Response (%02x) " + "packet, ignoring.", __func__, id); break; case L2CAP_INFO_REQ: @@ -917,8 +918,8 @@ static void l2cap_command(struct l2cap_instance_s *l2cap, int code, int id, } /* We never issue Information Requests currently. TODO */ - fprintf(stderr, "%s: unexpected Information Response (%02x) " - "packet, ignoring.\n", __func__, id); + error_report("%s: unexpected Information Response (%02x) " + "packet, ignoring.", __func__, id); break; default: @@ -1066,8 +1067,8 @@ static void l2cap_frame_in(struct l2cap_instance_s *l2cap, uint16_t len = le16_to_cpu(frame->len); if (unlikely(cid >= L2CAP_CID_MAX || !l2cap->cid[cid])) { - fprintf(stderr, "%s: frame addressed to a non-existent L2CAP " - "channel %04x received.\n", __func__, cid); + error_report("%s: frame addressed to a non-existent L2CAP " + "channel %04x received.", __func__, cid); return; } @@ -1128,9 +1129,9 @@ static uint8_t *l2cap_bframe_out(struct bt_l2cap_conn_params_s *parm, int len) struct l2cap_chan_s *chan = (struct l2cap_chan_s *) parm; if (len > chan->params.remote_mtu) { - fprintf(stderr, "%s: B-Frame for CID %04x longer than %i octets.\n", - __func__, - chan->remote_cid, chan->params.remote_mtu); + error_report("%s: B-Frame for CID %04x longer than %i octets.", + __func__, + chan->remote_cid, chan->params.remote_mtu); exit(-1); } @@ -1353,8 +1354,8 @@ void bt_l2cap_psm_register(struct bt_l2cap_device_s *dev, int psm, int min_mtu, struct bt_l2cap_psm_s *new_psm = l2cap_psm(dev, psm); if (new_psm) { - fprintf(stderr, "%s: PSM %04x already registered for device `%s'.\n", - __func__, psm, dev->device.lmp_name); + error_report("%s: PSM %04x already registered for device `%s'.", + __func__, psm, dev->device.lmp_name); exit(-1); } diff --git a/hw/bt/sdp.c b/hw/bt/sdp.c index 7c0d38b504..f4aba9d74f 100644 --- a/hw/bt/sdp.c +++ b/hw/bt/sdp.c @@ -18,6 +18,7 @@ */ #include "qemu/osdep.h" +#include "qemu/error-report.h" #include "qemu-common.h" #include "qemu/host-utils.h" #include "hw/bt.h" @@ -506,7 +507,7 @@ static void bt_l2cap_sdp_sdu_in(void *opaque, const uint8_t *data, int len) int rsp_len = 0; if (len < 5) { - fprintf(stderr, "%s: short SDP PDU (%iB).\n", __func__, len); + error_report("%s: short SDP PDU (%iB).", __func__, len); return; } @@ -517,7 +518,7 @@ static void bt_l2cap_sdp_sdu_in(void *opaque, const uint8_t *data, int len) len -= 5; if (len != plen) { - fprintf(stderr, "%s: wrong SDP PDU length (%iB != %iB).\n", + error_report("%s: wrong SDP PDU length (%iB != %iB).", __func__, plen, len); err = SDP_INVALID_PDU_SIZE; goto respond; @@ -544,7 +545,7 @@ static void bt_l2cap_sdp_sdu_in(void *opaque, const uint8_t *data, int len) case SDP_SVC_SEARCH_RSP: case SDP_SVC_SEARCH_ATTR_RSP: default: - fprintf(stderr, "%s: unexpected SDP PDU ID %02x.\n", + error_report("%s: unexpected SDP PDU ID %02x.", __func__, pdu_id); err = SDP_INVALID_SYNTAX; break; From patchwork Thu Oct 19 16:16:03 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alistair Francis X-Patchwork-Id: 828193 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; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=xilinx.onmicrosoft.com header.i=@xilinx.onmicrosoft.com header.b="kXe0+bwH"; 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 3yHvLY3Lnrz9t4P for ; Fri, 20 Oct 2017 03:21:09 +1100 (AEDT) Received: from localhost ([::1]:50064 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e5DZD-0004IG-F1 for incoming@patchwork.ozlabs.org; Thu, 19 Oct 2017 12:21:07 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:54991) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e5DYE-00048G-Rr for qemu-devel@nongnu.org; Thu, 19 Oct 2017 12:20:08 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1e5DYB-0000uN-IZ for qemu-devel@nongnu.org; Thu, 19 Oct 2017 12:20:06 -0400 Received: from mail-bn3nam01on0080.outbound.protection.outlook.com ([104.47.33.80]:65476 helo=NAM01-BN3-obe.outbound.protection.outlook.com) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1e5DYB-0000tw-C1 for qemu-devel@nongnu.org; Thu, 19 Oct 2017 12:20:03 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=xilinx.onmicrosoft.com; s=selector1-xilinx-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=zLYCKcAJzCfWdKpczN2Qj5oRKyI2V5zeW+g+WqPm2Ss=; b=kXe0+bwHF36g8ow3eTHARCud10LwearSS1Kd1nSlc90rFbHBD/UjEztyyz3cdNXsDx12J8VEZtddtgZNswx/7WzgMpxAYF66w76ONXVcO1RjR8fITnuzO06Gp42s3FGYgh9xgewhDdL71uL+VNcL9fw9urA6RCTiD6l/W4ug6kY= Received: from CY4PR02CA0012.namprd02.prod.outlook.com (10.169.188.22) by BY2PR02MB1332.namprd02.prod.outlook.com (10.162.79.27) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.77.7; Thu, 19 Oct 2017 16:19:59 +0000 Received: from CY1NAM02FT037.eop-nam02.prod.protection.outlook.com (2a01:111:f400:7e45::209) by CY4PR02CA0012.outlook.office365.com (2603:10b6:903:18::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.77.21 via Frontend Transport; Thu, 19 Oct 2017 16:19:59 +0000 Authentication-Results: spf=pass (sender IP is 149.199.60.83) smtp.mailfrom=xilinx.com; redhat.com; dkim=none (message not signed) header.d=none;redhat.com; dmarc=bestguesspass action=none header.from=xilinx.com; Received-SPF: Pass (protection.outlook.com: domain of xilinx.com designates 149.199.60.83 as permitted sender) receiver=protection.outlook.com; client-ip=149.199.60.83; helo=xsj-pvapsmtpgw01; Received: from xsj-pvapsmtpgw01 (149.199.60.83) by CY1NAM02FT037.mail.protection.outlook.com (10.152.75.77) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.20.77.10 via Frontend Transport; Thu, 19 Oct 2017 16:19:59 +0000 Received: from unknown-38-66.xilinx.com ([149.199.38.66] helo=xsj-pvapsmtp01) by xsj-pvapsmtpgw01 with esmtp (Exim 4.63) (envelope-from ) id 1e5DY6-0008Ua-Jn; Thu, 19 Oct 2017 09:19:58 -0700 Received: from [127.0.0.1] (helo=localhost) by xsj-pvapsmtp01 with smtp (Exim 4.63) (envelope-from ) id 1e5DY6-0002SQ-Ey; Thu, 19 Oct 2017 09:19:58 -0700 Received: from xsj-pvapsmtp01 (xsj-smtp.xilinx.com [149.199.38.66]) by xsj-smtp-dlp2.xlnx.xilinx.com (8.13.8/8.13.1) with ESMTP id v9JGJuKv003123; Thu, 19 Oct 2017 09:19:56 -0700 Received: from [172.19.2.220] (helo=localhost.localdomain) by xsj-pvapsmtp01 with esmtp (Exim 4.63) (envelope-from ) id 1e5DY4-0002S6-6z; Thu, 19 Oct 2017 09:19:56 -0700 From: Alistair Francis To: Date: Thu, 19 Oct 2017 09:16:03 -0700 Message-ID: <136f534d6337e148924913a06c43b2e06fcebb4c.1508390588.git.alistair.francis@xilinx.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: References: X-RCIS-Action: ALLOW X-TM-AS-Product-Ver: IMSS-7.1.0.1224-8.1.0.1062-23404.005 X-TM-AS-User-Approved-Sender: Yes;Yes X-EOPAttributedMessage: 0 X-MS-Office365-Filtering-HT: Tenant X-Forefront-Antispam-Report: CIP:149.199.60.83; IPV:NLI; CTRY:US; EFV:NLI; SFV:NSPM; SFS:(10009020)(6009001)(376002)(346002)(39860400002)(2980300002)(438002)(199003)(189002)(76176999)(48376002)(356003)(106466001)(81156014)(2906002)(77096006)(39060400002)(106002)(36756003)(63266004)(6666003)(50466002)(81166006)(16586007)(54906003)(8936002)(8676002)(5003940100001)(4326008)(478600001)(6916009)(118296001)(47776003)(316002)(50986999)(5660300001)(33646002)(50226002)(2950100002)(189998001)(2351001)(9786002)(36386004)(305945005)(107986001); DIR:OUT; SFP:1101; SCL:1; SRVR:BY2PR02MB1332; H:xsj-pvapsmtpgw01; FPR:; SPF:Pass; PTR:unknown-60-83.xilinx.com; A:1; MX:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; CY1NAM02FT037; 1:iijRnS6L9z+OACdSLyTbJXEGhFZofCpfw2AfgfvCEs/LgRzOzlFIx8aEFM87GadRIBasCF+iJBxR2nObId7wJYdQjVQCquGvFd6Npw/+FSjjcycCgmMYvCEN8Eva85bK MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 615f9d91-8ed3-42b5-9378-08d5170d3ea2 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001)(2017030254168)(8251501002)(4534016)(4602075)(4627075)(201703031133081)(201702281549075)(2017052603199)(201703131423091); SRVR:BY2PR02MB1332; X-Microsoft-Exchange-Diagnostics: 1; BY2PR02MB1332; 3:AwsX7ONumXPuBlHiMg98MkxBo7c2/UAIXPGkYNj4YMqUFPBTCZO0O9q+v40+b+7WHTMkPuf4xpEoEcUmCpdpldnelYmlrBTRLydqhuRtRNPKodrjXWWp6N9Vy+UGW7eRIc5JeYB6lTbZx8+ymUiCsO8axOaSYgGGOgu8Gpig8y8uGGdTGzVcEQTME/B0bHHSYG+DtOycyJSknJXC/OkIC3WmpzOllZwDjgwSMFAOfiq5wb6QHtQnwBAJTH049II3AMMSSB1tBfzKv+NXlyBfjZaIIGKIbWzD/yq4F0OwZYUnethPQFrV7eyxiRameXRWZhLbzH5Shqm69z2cJ9uoz5rkpJsFatnT9EyGsNPJLQ0=; 25:144gy/TI6UpqRBPfjmu5t2jv/p+XuLiOvWfJprBkJVze6Ag0A8ODJthRN5B1p3ElrDpirGHFW3/JPzOF1d16mAigFE0RD8knhb7AU4sq9RyjJdwrZL7KEXtuVyav+H/w8slMZ5uTHoTWWcmMzZHxU0nkl7LSma2nzC0nPhGvX1qmkULpvZkJstZpPL9aAkj1AykIBBF0jg7G5cdPhSoAzXjJwbk5Vb/jZhooHoE+P7yf71wTjFEmV/BCuM32OJaNJgtEii2PoeAkwnGRAFMw1zn1xWYp92Mtbb3rJVhqWdFOLqVTNQQ8QaFSm/JME+NXvKNR410gm4vsdhBudC+N/g== X-MS-TrafficTypeDiagnostic: BY2PR02MB1332: X-Microsoft-Exchange-Diagnostics: 1; BY2PR02MB1332; 31:1Z9tmUHuSgYCZgMD8T7y0Wvkgm6bi44Iz2jP0tPj3qQsvwALQYjBw8c6FbGFf9tFmA1ce0jKsoX7fJc2WPjeW0tC9OZ5lIUhxbRnlGBHLWjsbbdcTlaLscMoleuKjq0Wmbic/0cGmjpABhOnShgKKJe/0pDgtBi0o1dcB0nW4tWNtDN2hHmLMrkQxwfZeo7V0YQEM5xMMVI9VOSTohnB/8uB+DwlshxzxYcmWvUZBbM=; 20:QDzkE9ryI82OBHoHBLEBr9c90ncOeHbqR1BLoL7saJRRjRWZO/aK73qf0z2hEeKC4W11eIZhCwyKO1P5RlvsknqjEEWNALZtx8YU6FFc8yj0dzlLxfzUwA2XxZxkfOnerhDUBsBN7PnerUTChXUSPdlfymy42vTalXGzc7C9EzWez6Up+NzKzIEjVcaTU7nVUEnQ/b1A0Vmdxoyf6JjuOw0oaohWDHa+tYwlBiRBVfcPK17O5Rq54JaX6BLisNMW0Ebt+E88zXVmQV97lwC1DwQaL6dpeKH5SpEIK6BU9fQt4myFQPXRszvmNpPfJR1p7ZSEYMQhoJ02kg0XwoqbZpfEjoDbaonwooYnu39DTV/tlnzFXcwQ9K5ap3Qw01o3nmvez1j6U+EvvseS8ZqMmVffy/MB+mdKkLhA7J2kOcwXDjoTnegYK1SR3Er+kcyVli6jJjtvIHqu0qLJdYioSMYHQ0QCHy2vqOE6XtULuZJ6NlP5SqFKSWJcnxnLc2K7 X-Exchange-Antispam-Report-Test: UriScan:(788757137089)(192813158149592); X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(100000700101)(100105000095)(100000701101)(100105300095)(100000702101)(100105100095)(6040450)(2401047)(8121501046)(5005006)(100000703101)(100105400095)(93006095)(93004095)(10201501046)(3002001)(6055026)(6041248)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123558100)(20161123564025)(20161123562025)(20161123560025)(20161123555025)(6072148)(201708071742011)(100000704101)(100105200095)(100000705101)(100105500095); SRVR:BY2PR02MB1332; BCL:0; PCL:0; RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095); SRVR:BY2PR02MB1332; X-Microsoft-Exchange-Diagnostics: 1; BY2PR02MB1332; 4:hX6xLFQLFquNUmji3BG1spxO3ckMiEEiqHIPGV66JHzht6J+NGjmKuZsaK4rTQuhQWIftxTaREugrURp+lPwhIaIKJ1nROFFUyxBbgoa9htqCDBuq+h0ad+AEfUjiG9w5Uy9O/HRcrOgeUolMLsJFwJEY4ENq8ZUABofjyrEB/cXS/1+zPDjE2NbGbNc3qLfaOYgexSpZcUiq8x69/0ASuH3o0Ca6w5p8+UaXYaPvUmDrBxyKg3C5mZ+mbLHxxl2kh1D5yumPpdNCv8CprHZ89tLkU0ayhyFNjxUv5Jhl11+Gg0UFssWeGUoK843t23e3owOBdYpl0wWQymnZU6nhA== X-Forefront-PRVS: 0465429B7F X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; BY2PR02MB1332; 23:UazGG4mtuuwo8UuhN/JKzRxb8ClQbVkfkqxYdSp5U?= c5NyeM2X3CEetnWynRKlUUwWhDWn9Q85iCF2mYN9NHtyN4i/c5quCVQqjtU2KCC13aSDRBRNbfNJcPhCsqflGj3ZT1HLfIO92J8pk0GhcABuryzt+2LKafuoJDKBxZHfCl3eCGjHm5GMG6AHhFC5O6pmcz4cG7seUIevLG8uG21150jBJ3iW5pS6U49bfJPDQqS5dcpnIE0DCwsf1cfhb68f1lKyDOzF+hFnSlogKkynDBgqtbwWehDFnpYH+eiUPvf6S7uX98naSq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vJG+2sBI+cfxjclcEVat2zdy0iGW63cG8u69HuddKioQxQYQUVMZeHkg==; 5:pkQ4zGkcc+k3A6Mq3GCDbbqRTS1j56yMroUr1ZnBEw/ju8SQRN0RZOl9NmL/xnricV/zohF6Me7yVbibP1Jv2TTxH0J3iOh2jRN/ptb34ShUgnPrSKIjWXl33Z0wD4+fQzrTRlfjh9xAgsP6gL6TiA==; 24:vjdCkoN2gwbth+igi+EztHXEhYTvnj0CkaN8jO/TdaLKtLe73hfLIbp/kARBDKgFohv+OuCuNthMJ/lzLpfUo17fJsnl9XtxO86huxGe4xs=; 7:IUjUViuBiKiU8UH6lkD6C2OQ14RxgTOLkbUfKbFBRdEnd81iSHIZyQHsGrgRrjqyC8FaSaUeB+fXcnT3Mw2qMpvLPIlrFi9uLOAjc8BecBiM6wAYI+4gjNDVBtpx8gY5GfCq9OMbTEYbBiNccXs/K1DglRzaVqlNX2IVwHRMakbqaGo0n2URJtURTDjCDQ/MIHjToNvn3nGMlkc/rd96R5WI37SjqO6kOh7QeDs0t4Y= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: xilinx.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 19 Oct 2017 16:19:59.2055 (UTC) X-MS-Exchange-CrossTenant-Id: 657af505-d5df-48d0-8300-c31994686c5c X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=657af505-d5df-48d0-8300-c31994686c5c; Ip=[149.199.60.83]; Helo=[xsj-pvapsmtpgw01] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BY2PR02MB1332 X-detected-operating-system: by eggs.gnu.org: Windows 7 or 8 [fuzzy] X-Received-From: 104.47.33.80 Subject: [Qemu-devel] [PATCH v3 08/46] hw/char: Replace fprintf(stderr, "*\n" with error_report() 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: alistair23@gmail.com, Paolo Bonzini , armbru@redhat.com, alistair.francis@xilinx.com Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" Replace a large number of the fprintf(stderr, "*\n" calls with error_report(). The functions were renamed with these commands and then compiler issues where manually fixed. find ./* -type f -exec sed -i \ 'N;N;N;N;N;N;N;N;N;N;N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2);|Ig}' \ {} + find ./* -type f -exec sed -i \ 'N;N;N;N;N;N;N;N;N;N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2);|Ig}' \ {} + find ./* -type f -exec sed -i \ 'N;N;N;N;N;N;N;N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2);|Ig}' \ {} + find ./* -type f -exec sed -i \ 'N;N;N;N;N;N;N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2);|Ig}' \ {} + find ./* -type f -exec sed -i \ 'N;N;N;N;N;N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2);|Ig}' \ {} + find ./* -type f -exec sed -i \ 'N;N;N;N;N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2);|Ig}' \ {} + find ./* -type f -exec sed -i \ 'N;N;N;N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2);|Ig}' \ {} + find ./* -type f -exec sed -i \ 'N;N;N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2);|Ig}' \ {} + find ./* -type f -exec sed -i \ 'N;N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2);|Ig}' \ {} + find ./* -type f -exec sed -i \ 'N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2);|Ig}' \ {} + find ./* -type f -exec sed -i \ 'N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2);|Ig}' \ {} + Some lines where then manually tweaked to pass checkpatch. Signed-off-by: Alistair Francis Cc: Paolo Bonzini --- V2: - Split hw patch into individual directories hw/char/mcf_uart.c | 5 +++-- hw/char/sh_serial.c | 9 +++++---- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/hw/char/mcf_uart.c b/hw/char/mcf_uart.c index 56fa402b58..14cb051be9 100644 --- a/hw/char/mcf_uart.c +++ b/hw/char/mcf_uart.c @@ -6,6 +6,7 @@ * This code is licensed under the GPL */ #include "qemu/osdep.h" +#include "qemu/error-report.h" #include "hw/hw.h" #include "hw/sysbus.h" #include "hw/m68k/mcf.h" @@ -174,7 +175,7 @@ static void mcf_do_command(mcf_uart_state *s, uint8_t cmd) mcf_uart_do_tx(s); break; case 3: /* Reserved. */ - fprintf(stderr, "mcf_uart: Bad TX command\n"); + error_report("mcf_uart: Bad TX command"); break; } @@ -189,7 +190,7 @@ static void mcf_do_command(mcf_uart_state *s, uint8_t cmd) s->rx_enabled = 0; break; case 3: /* Reserved. */ - fprintf(stderr, "mcf_uart: Bad RX command\n"); + error_report("mcf_uart: Bad RX command"); break; } } diff --git a/hw/char/sh_serial.c b/hw/char/sh_serial.c index 835b5378a0..7bb3f3c70b 100644 --- a/hw/char/sh_serial.c +++ b/hw/char/sh_serial.c @@ -25,6 +25,7 @@ * THE SOFTWARE. */ #include "qemu/osdep.h" +#include "qemu/error-report.h" #include "hw/hw.h" #include "hw/sh4/sh.h" #include "chardev/char-fe.h" @@ -190,8 +191,8 @@ static void sh_serial_write(void *opaque, hwaddr offs, } } - fprintf(stderr, "sh_serial: unsupported write to 0x%02" - HWADDR_PRIx "\n", offs); + error_report("sh_serial: unsupported write to 0x%02" + HWADDR_PRIx "", offs); abort(); } @@ -290,8 +291,8 @@ static uint64_t sh_serial_read(void *opaque, hwaddr offs, #endif if (ret & ~((1 << 16) - 1)) { - fprintf(stderr, "sh_serial: unsupported read from 0x%02" - HWADDR_PRIx "\n", offs); + error_report("sh_serial: unsupported read from 0x%02" + HWADDR_PRIx "", offs); abort(); } From patchwork Thu Oct 19 16:16:06 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Alistair Francis X-Patchwork-Id: 828212 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; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=xilinx.onmicrosoft.com header.i=@xilinx.onmicrosoft.com header.b="iL3sERn8"; 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 3yHvbZ4W8Sz9t6m for ; Fri, 20 Oct 2017 03:32:26 +1100 (AEDT) Received: from localhost ([::1]:50122 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e5Dk8-000614-LT for incoming@patchwork.ozlabs.org; Thu, 19 Oct 2017 12:32:24 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:55172) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e5DYQ-0004Nx-TM for qemu-devel@nongnu.org; Thu, 19 Oct 2017 12:20:28 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1e5DYN-00014Z-Al for qemu-devel@nongnu.org; Thu, 19 Oct 2017 12:20:18 -0400 Received: from mail-co1nam03on0064.outbound.protection.outlook.com ([104.47.40.64]:26851 helo=NAM03-CO1-obe.outbound.protection.outlook.com) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1e5DYM-00011w-GC for qemu-devel@nongnu.org; Thu, 19 Oct 2017 12:20:14 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=xilinx.onmicrosoft.com; s=selector1-xilinx-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=LWHCZYpqCwgFlXiOffbHw3MdKghzOzH8fJVoXiw7hlI=; b=iL3sERn8tcd6JnmZV9r1Ygri+5/8hjxoVQgp0OOdDw5K5sWNnH6xpJ/laFp2c9TZFDdNgB7k3fJGJWTIXJ2e5rAr4JVzXUl4hNXQ1a3CLRVucFQ1JS7FroxY3O8WRK7vFLmDyUh+yxl6kTAOdYM7oPSRdgdfdkfhcyMTCwI6O7E= Received: from BN6PR02CA0078.namprd02.prod.outlook.com (10.161.158.19) by CY4PR02MB3383.namprd02.prod.outlook.com (10.165.89.154) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.77.7; Thu, 19 Oct 2017 16:20:11 +0000 Received: from CY1NAM02FT019.eop-nam02.prod.protection.outlook.com (2a01:111:f400:7e45::207) by BN6PR02CA0078.outlook.office365.com (2603:10b6:405:60::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.156.4 via Frontend Transport; Thu, 19 Oct 2017 16:20:10 +0000 Authentication-Results: spf=pass (sender IP is 149.199.60.83) smtp.mailfrom=xilinx.com; redhat.com; dkim=none (message not signed) header.d=none;redhat.com; dmarc=bestguesspass action=none header.from=xilinx.com; Received-SPF: Pass (protection.outlook.com: domain of xilinx.com designates 149.199.60.83 as permitted sender) receiver=protection.outlook.com; client-ip=149.199.60.83; helo=xsj-pvapsmtpgw01; Received: from xsj-pvapsmtpgw01 (149.199.60.83) by CY1NAM02FT019.mail.protection.outlook.com (10.152.75.177) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.20.77.10 via Frontend Transport; Thu, 19 Oct 2017 16:20:09 +0000 Received: from unknown-38-66.xilinx.com ([149.199.38.66] helo=xsj-pvapsmtp01) by xsj-pvapsmtpgw01 with esmtp (Exim 4.63) (envelope-from ) id 1e5DYG-0008Uv-Un; Thu, 19 Oct 2017 09:20:08 -0700 Received: from [127.0.0.1] (helo=localhost) by xsj-pvapsmtp01 with smtp (Exim 4.63) (envelope-from ) id 1e5DYG-0002ja-QZ; Thu, 19 Oct 2017 09:20:08 -0700 Received: from xsj-pvapsmtp01 (xsj-mail.xilinx.com [149.199.38.66]) by xsj-smtp-dlp1.xlnx.xilinx.com (8.13.8/8.13.1) with ESMTP id v9JGJxjQ017298; Thu, 19 Oct 2017 09:19:59 -0700 Received: from [172.19.2.220] (helo=localhost.localdomain) by xsj-pvapsmtp01 with esmtp (Exim 4.63) (envelope-from ) id 1e5DY7-0002Sl-E7; Thu, 19 Oct 2017 09:19:59 -0700 From: Alistair Francis To: Date: Thu, 19 Oct 2017 09:16:06 -0700 Message-ID: <10f2a6ab34ec0ea3e8365613f8731702c8d758d3.1508390588.git.alistair.francis@xilinx.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: References: MIME-Version: 1.0 X-RCIS-Action: ALLOW X-TM-AS-Product-Ver: IMSS-7.1.0.1224-8.1.0.1062-23404.005 X-TM-AS-User-Approved-Sender: Yes;Yes X-EOPAttributedMessage: 0 X-MS-Office365-Filtering-HT: Tenant X-Forefront-Antispam-Report: CIP:149.199.60.83; IPV:NLI; CTRY:US; EFV:NLI; SFV:NSPM; SFS:(10009020)(6009001)(39860400002)(346002)(376002)(2980300002)(438002)(189002)(199003)(478600001)(4326008)(81166006)(81156014)(63266004)(39060400002)(8676002)(23676002)(305945005)(189998001)(118296001)(356003)(6666003)(47776003)(50226002)(5820100001)(36386004)(9786002)(36756003)(2351001)(2906002)(106466001)(33646002)(77096006)(50986999)(316002)(2870700001)(106002)(2950100002)(50466002)(5660300001)(6916009)(54906003)(76176999)(8936002)(107986001); DIR:OUT; SFP:1101; SCL:1; SRVR:CY4PR02MB3383; H:xsj-pvapsmtpgw01; FPR:; SPF:Pass; PTR:unknown-60-83.xilinx.com; MX:1; A:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; CY1NAM02FT019; 1:G1j4ZI0OyMw6D2u/bXFyybrGo15nVV8VXmPKHetdYI7vHsYEDMS2J6muHh2jXLyIGeh6FWW4tzAy2WHH4srE7gkFmm7I/zpMLOxWS2335vQucv2TslKkXtUBYxqYoEkK X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: acdc11d3-43ef-4fc1-febb-08d5170d44f0 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001)(2017030254152)(8251501002)(2017052603199)(201703131423075)(201703031133081)(201702281549075); SRVR:CY4PR02MB3383; X-Microsoft-Exchange-Diagnostics: 1; CY4PR02MB3383; 3:E2j8RIIVS5I4n6GvEO24bctjKPZv241cdqt8qz1iJXUhEvucS4OtvCKUW65UCWYY6nZrMxxuzzoeASQkt6iJQgdrP1lgIWTM4MZTYOnk0UXYJxv151Fl92c0a2dgYJxhPhYlaYVrBXvajYvz2zgUozoFHyj9Y3ZGzYU1nP3jQCAF+y8fUpDDUtaKTWobu/lOwkGqZ6IC1uuBseZWTZLEjvwh7EG7/Y5NCyst/Ur/jVz3MPAI0GZxH8B5xdmjJGfi7eX/Tm7r0Pq7sA7YEhuHVbrDzgfCZ7CPxx8K+m5brCbhbs2lx6jSCBzZ/YO8Grbh3DaLeZG3VfIycE/IDJZdtncgKXSVfRTYsa6kospTsYk=; 25:jbIS1y6mxiM1eA840GDoLGikCrn4u3irWgIknIL/Z8oUxE+/roig70HyX5bZchE/1eAxKphr3r3SfcoiPZabpzXStwSDP67QGpumtEHosWlGsRozVKfhwR1dFY4ztRxcAjSf3HMa+UBb25hmxeu1LgLPuNbYKW+RSOBaGXscf6c/ZZnsGdIl3fGM7oz1Ei64gsOk1MUYzPdbNuH2cIjGwnNQ5l10acjTGom2sjOIgCnJD4bXpGoZceNQiNXnNGhutr2qx+JB2Rc0yA2o2t/QqCEZkuZPpS7qTqE3uWtAHl92ZEF3fsXxi5REw2bN1CBPEiwp6h4wwPqGR2/NiM3T+A== X-MS-TrafficTypeDiagnostic: CY4PR02MB3383: X-Microsoft-Exchange-Diagnostics: 1; CY4PR02MB3383; 31:o1yMrI33/wt3wetkCf/7n95Kyye5f7SY1hB14Q+Sc86RNXVTgcgDbvV8DtPsopMv1i0rZ3z27H+7p4ZOJpkWyLod9Onm/TzBkt4DSVx76NlpBmEnqqxKPZw9TRdICpzD472FV4m2X5z9x7A9nVbmdvZ2Jb8Z0T33nPajM/+33JOTtRWKnmHS7lP9ZfgQSc38mPqC0rUpz6IqqhMYjsP2xHil5bjfIKgdG1ItjDtMxfI=; 20:5uP8Jb7mNbTo5k2sYcMMFL8GVQUFYRy0r5H5EOCb1ni04rW1vzitT5rz7gXnWmiIfSNDRvRyj8S7xAD+a0K7ci4g8ak2SzWQWf115F2UwI2+/tFZ8osMf9J5UNL+CA2xp/2tbOgOlFvWbMBZG1l6GfKKtsGWwmBYtbbKPZDu+XZuYbGGDLNurpabmBNb6D3SM0iCYaYnAeJQXXfL6sfL2+PWpacsHl2YeEfEA2cwcq0y9wCD/VkRgqy7VRK1UpfXcfmcXw+FB1HKIXlyoD6AL6FTeh04OXAIG7UyRfBbtEExghWNbJs0KdkNqo+2rD5LuQv8ogvIG3EfClgUNYCSrnBIYUwsFV5PzVpfl08qPy9vgPq9184ca3jCuIqok/+Kz0fxPwARPDFy6muc/AjhGAj/a2Pr5uxh0WpI8Sbj53fQkCO2BXwel+LZuiejunAtz+H6jkhyCQ7LW4dIi1Rd76OWMPnppDxHTDbzrzdpt/IDvkd2N2Jtknv1AtoSW7Vq X-Exchange-Antispam-Report-Test: UriScan:(788757137089)(192813158149592); X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(100000700101)(100105000095)(100000701101)(100105300095)(100000702101)(100105100095)(6040450)(2401047)(5005006)(8121501046)(10201501046)(93006095)(93004095)(100000703101)(100105400095)(3002001)(6055026)(6041248)(20161123558100)(20161123560025)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123564025)(20161123555025)(20161123562025)(6072148)(201708071742011)(100000704101)(100105200095)(100000705101)(100105500095); SRVR:CY4PR02MB3383; BCL:0; PCL:0; RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095); SRVR:CY4PR02MB3383; X-Microsoft-Exchange-Diagnostics: 1; CY4PR02MB3383; 4:XbWuXyFOAY/+5DinExSK/NVRCJyq8Hhwh90zaAPxd5wv4/7Ry9lhp7h3DgZI/1nJZkRNo8Zhle+9CmuUvFBABvu8aOaXlxe51OY6fJm/61UlMdKphfeGqhinKQjqK+wmabNNDO0JyO9jQEfG9m4a50vwOIxsvlxXvRdJyI0Ch+bSqZHmZ4lKc7I5aSDaJusB4NnsTxcwzRfbKgnqV94ztuIyidJoM3BZFpoGGCo26Oh47An5YgmYPhPaTWQyRshHX+Tmk5dtp9LCKhdYpRH4MxW6EhxVnTYkiZqkR1Uvw82QTc652kkJBr8XTOZJK7uMH4L5F3etJIEf1OzofwzTdQ== X-Forefront-PRVS: 0465429B7F X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; CY4PR02MB3383; 23:7PjdOsuXMVNXaOv45/UO6I4yBL8bVk5hlgyjgtybt?= tUKe6rXpMpviiKNgObNft6wer+hgjTeIP49Dr3/QrPvyymlc+JrpQIL38p37CpfEHQdlu9ewU7q75k2/HXvbi7/E7E3+aAsQ9yrYWp8qX7zLCSeY31mPFfumL/llg6NWKGMcca+YpqWiy9t2i1QnyW1CWiihYF7Lg67siJM9VkKTRV5+uW9DQIW3IScVcFJVnI+6YkCNEFNIazpox4wSyq+d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5M0eqavk1vTJ/CQyO/yMWATq/eef3fAvcWp85SN7upQRCX26rYNTWGH1mhiGWiJmNEbcS9H6pf/JeBmV1rr0cS+UJADE16ztUxqGBp92JER6LbY7b1uow==; 5:QaW08O7VmaA1IHzNXeEhuOEkRwKYg7bSuHsvZz1f6MkUEIoBv8v3K9CGIgJMUEwB25jbG4OIVP6qMPA72YABOE1b0iSGTjlbwQuxJKgxUQ47o2KqfU37ndlxWwcvLaF8zyu4e8ZAHVVa3d45okSM2Q==; 24:9aCnP2yoz+7HVcvMTug2z6kr9gTxqRGrnXesf4tbE6XH96HPnZMw/fyg/RzhNG5DxTSFF02rkKSdhpc8Z15U2ZGIAFb86OyEcNqPt0SuW9o=; 7:079XdFqTixN84d9uTlHjis8qiWggRC0ejh0uonX0/wRvXwcZ87YfDRuK4HFV6rdW7qlVvvbj3JSKsoWOC4zGNnrMvQskDytESsPbmCg45vHuQpvzWzwSG6MY2iqOvmRFod3jVXY9snsDPxEMPDGhtPhlwi5IbQvNZciVI7SsKIbe7Hy4PUCfuZ9E/Q1GI5FWND8Ef3asQF0WjD4/vVTtpxddxmfxfHFMq1IhVWJZcaI= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: xilinx.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 19 Oct 2017 16:20:09.7857 (UTC) X-MS-Exchange-CrossTenant-Id: 657af505-d5df-48d0-8300-c31994686c5c X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=657af505-d5df-48d0-8300-c31994686c5c; Ip=[149.199.60.83]; Helo=[xsj-pvapsmtpgw01] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY4PR02MB3383 X-detected-operating-system: by eggs.gnu.org: Windows 7 or 8 [fuzzy] X-Received-From: 104.47.40.64 Subject: [Qemu-devel] [PATCH v3 09/46] hw/core: Replace fprintf(stderr, "*\n" with error_report() 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: alistair23@gmail.com, "Michael S. Tsirkin" , armbru@redhat.com, Paolo Bonzini , alistair.francis@xilinx.com Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" Replace a large number of the fprintf(stderr, "*\n" calls with error_report(). The functions were renamed with these commands and then compiler issues where manually fixed. find ./* -type f -exec sed -i \ 'N;N;N;N;N;N;N;N;N;N;N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2);|Ig}' \ {} + find ./* -type f -exec sed -i \ 'N;N;N;N;N;N;N;N;N;N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2);|Ig}' \ {} + find ./* -type f -exec sed -i \ 'N;N;N;N;N;N;N;N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2);|Ig}' \ {} + find ./* -type f -exec sed -i \ 'N;N;N;N;N;N;N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2);|Ig}' \ {} + find ./* -type f -exec sed -i \ 'N;N;N;N;N;N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2);|Ig}' \ {} + find ./* -type f -exec sed -i \ 'N;N;N;N;N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2);|Ig}' \ {} + find ./* -type f -exec sed -i \ 'N;N;N;N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2);|Ig}' \ {} + find ./* -type f -exec sed -i \ 'N;N;N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2);|Ig}' \ {} + find ./* -type f -exec sed -i \ 'N;N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2);|Ig}' \ {} + find ./* -type f -exec sed -i \ 'N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2);|Ig}' \ {} + find ./* -type f -exec sed -i \ 'N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2);|Ig}' \ {} + Some lines where then manually tweaked to pass checkpatch. Signed-off-by: Alistair Francis Cc: "Michael S. Tsirkin" Cc: Paolo Bonzini Reviewed-by: Philippe Mathieu-Daudé --- V3: - Fix white space error V2: - Split hw patch into individual directories hw/core/loader.c | 43 ++++++++++++++++++++++--------------------- hw/core/ptimer.c | 7 ++++--- 2 files changed, 26 insertions(+), 24 deletions(-) diff --git a/hw/core/loader.c b/hw/core/loader.c index 91669d65aa..75f3d4301c 100644 --- a/hw/core/loader.c +++ b/hw/core/loader.c @@ -43,6 +43,7 @@ */ #include "qemu/osdep.h" +#include "qemu/error-report.h" #include "qapi/error.h" #include "hw/hw.h" #include "disas/disas.h" @@ -82,8 +83,8 @@ int load_image(const char *filename, uint8_t *addr) return -1; size = lseek(fd, 0, SEEK_END); if (size == -1) { - fprintf(stderr, "file %-20s: get size error: %s\n", - filename, strerror(errno)); + error_report("file %-20s: get size error: %s", + filename, strerror(errno)); close(fd); return -1; } @@ -623,8 +624,8 @@ static int load_uboot_image(const char *filename, hwaddr *ep, hwaddr *loadaddr, goto out; if (hdr->ih_type != image_type) { - fprintf(stderr, "Wrong image type %d, expected %d\n", hdr->ih_type, - image_type); + error_report("Wrong image type %d, expected %d", hdr->ih_type, + image_type); goto out; } @@ -670,14 +671,14 @@ static int load_uboot_image(const char *filename, hwaddr *ep, hwaddr *loadaddr, address = *loadaddr; break; default: - fprintf(stderr, "Unsupported u-boot image type %d\n", hdr->ih_type); + error_report("Unsupported u-boot image type %d", hdr->ih_type); goto out; } data = g_malloc(hdr->ih_size); if (read(fd, data, hdr->ih_size) != hdr->ih_size) { - fprintf(stderr, "Error reading file\n"); + error_report("Error reading file"); goto out; } @@ -693,7 +694,7 @@ static int load_uboot_image(const char *filename, hwaddr *ep, hwaddr *loadaddr, bytes = gunzip(data, max_bytes, compressed_data, hdr->ih_size); g_free(compressed_data); if (bytes < 0) { - fprintf(stderr, "Unable to decompress gzipped image!\n"); + error_report("Unable to decompress gzipped image!"); goto out; } hdr->ih_size = bytes; @@ -763,8 +764,8 @@ int load_image_gzipped_buffer(const char *filename, uint64_t max_sz, data = g_malloc(max_sz); bytes = gunzip(data, max_sz, compressed_data, len); if (bytes < 0) { - fprintf(stderr, "%s: unable to decompress gzipped kernel file\n", - filename); + error_report("%s: unable to decompress gzipped kernel file", + filename); goto out; } @@ -893,8 +894,8 @@ int rom_add_file(const char *file, const char *fw_dir, char devpath[100]; if (as && mr) { - fprintf(stderr, "Specifying an Address Space and Memory Region is " \ - "not valid when loading a rom\n"); + error_report("Specifying an Address Space and Memory Region is " \ + "not valid when loading a rom"); /* We haven't allocated anything so we don't need any cleanup */ return -1; } @@ -909,8 +910,8 @@ int rom_add_file(const char *file, const char *fw_dir, fd = open(rom->path, O_RDONLY | O_BINARY); if (fd == -1) { - fprintf(stderr, "Could not open option rom '%s': %s\n", - rom->path, strerror(errno)); + error_report("Could not open option rom '%s': %s", + rom->path, strerror(errno)); goto err; } @@ -921,8 +922,8 @@ int rom_add_file(const char *file, const char *fw_dir, rom->addr = addr; rom->romsize = lseek(fd, 0, SEEK_END); if (rom->romsize == -1) { - fprintf(stderr, "rom: file %-20s: get size error: %s\n", - rom->name, strerror(errno)); + error_report("rom: file %-20s: get size error: %s", + rom->name, strerror(errno)); goto err; } @@ -931,8 +932,8 @@ int rom_add_file(const char *file, const char *fw_dir, lseek(fd, 0, SEEK_SET); rc = read(fd, rom->data, rom->datasize); if (rc != rom->datasize) { - fprintf(stderr, "rom: file %-20s: read error: rc=%d (expected %zd)\n", - rom->name, rc, rom->datasize); + error_report("rom: file %-20s: read error: rc=%d (expected %zd)", + rom->name, rc, rom->datasize); goto err; } close(fd); @@ -1105,10 +1106,10 @@ int rom_check_and_register_reset(void) continue; } if ((addr > rom->addr) && (as == rom->as)) { - fprintf(stderr, "rom: requested regions overlap " - "(rom %s. free=0x" TARGET_FMT_plx - ", addr=0x" TARGET_FMT_plx ")\n", - rom->name, addr, rom->addr); + error_report("rom: requested regions overlap " + "(rom %s. free=0x" TARGET_FMT_plx + ", addr=0x" TARGET_FMT_plx ")", + rom->name, addr, rom->addr); return -1; } addr = rom->addr; diff --git a/hw/core/ptimer.c b/hw/core/ptimer.c index 7221c68a98..514e177de2 100644 --- a/hw/core/ptimer.c +++ b/hw/core/ptimer.c @@ -6,6 +6,7 @@ * This code is licensed under the GNU LGPL. */ #include "qemu/osdep.h" +#include "qemu/error-report.h" #include "hw/hw.h" #include "qemu/timer.h" #include "hw/ptimer.h" @@ -56,7 +57,7 @@ static void ptimer_reload(ptimer_state *s, int delta_adjust) if (s->period == 0) { if (!qtest_enabled()) { - fprintf(stderr, "Timer with period zero, disabling\n"); + error_report("Timer with period zero, disabling"); } timer_del(s->timer); s->enabled = 0; @@ -89,7 +90,7 @@ static void ptimer_reload(ptimer_state *s, int delta_adjust) if (delta == 0) { if (!qtest_enabled()) { - fprintf(stderr, "Timer with delta zero, disabling\n"); + error_report("Timer with delta zero, disabling"); } timer_del(s->timer); s->enabled = 0; @@ -263,7 +264,7 @@ void ptimer_run(ptimer_state *s, int oneshot) if (was_disabled && s->period == 0) { if (!qtest_enabled()) { - fprintf(stderr, "Timer with period zero, disabling\n"); + error_report("Timer with period zero, disabling"); } return; } From patchwork Thu Oct 19 16:16:09 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Alistair Francis X-Patchwork-Id: 828209 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; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=xilinx.onmicrosoft.com header.i=@xilinx.onmicrosoft.com header.b="SZGUmwx2"; 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 3yHvXN5z1tz9ryT for ; Fri, 20 Oct 2017 03:29:40 +1100 (AEDT) Received: from localhost ([::1]:50107 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e5DhS-0003hT-Si for incoming@patchwork.ozlabs.org; Thu, 19 Oct 2017 12:29:38 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:55157) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e5DYP-0004LX-Dt for qemu-devel@nongnu.org; Thu, 19 Oct 2017 12:20:23 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1e5DYL-000120-Lv for qemu-devel@nongnu.org; Thu, 19 Oct 2017 12:20:17 -0400 Received: from mail-cys01nam02on0087.outbound.protection.outlook.com ([104.47.37.87]:5500 helo=NAM02-CY1-obe.outbound.protection.outlook.com) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1e5DYL-00011O-Ce for qemu-devel@nongnu.org; Thu, 19 Oct 2017 12:20:13 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=xilinx.onmicrosoft.com; s=selector1-xilinx-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=bkza3t6CbneSAW/zQ8qs888E2Clr6KKg9Rnuyo4/JW4=; b=SZGUmwx2IZRelEV47SuiRw10kSG6QQL+kRETx0tXusRe2nL+nlLkEW5OXMzGmgNTp1kuraev1iMN2AoFQmTKGQDUjE7OsF2DYW4VGZNNCAk4IbK6KJiI0dc/E8W8PTLlqZH0RM/FkqAvZTfw+lQXil4b6Iwp5L9ZUg+sj5SLSX0= Received: from SN4PR0201CA0001.namprd02.prod.outlook.com (10.161.238.139) by BN6PR02MB3379.namprd02.prod.outlook.com (10.161.153.10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.77.7; Thu, 19 Oct 2017 16:20:10 +0000 Received: from BL2NAM02FT008.eop-nam02.prod.protection.outlook.com (2a01:111:f400:7e46::207) by SN4PR0201CA0001.outlook.office365.com (2603:10b6:803:2b::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.77.21 via Frontend Transport; Thu, 19 Oct 2017 16:20:10 +0000 Authentication-Results: spf=pass (sender IP is 149.199.60.100) smtp.mailfrom=xilinx.com; redhat.com; dkim=none (message not signed) header.d=none;redhat.com; dmarc=bestguesspass action=none header.from=xilinx.com; Received-SPF: Pass (protection.outlook.com: domain of xilinx.com designates 149.199.60.100 as permitted sender) receiver=protection.outlook.com; client-ip=149.199.60.100; helo=xsj-pvapsmtpgw02; Received: from xsj-pvapsmtpgw02 (149.199.60.100) by BL2NAM02FT008.mail.protection.outlook.com (10.152.76.162) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.20.77.10 via Frontend Transport; Thu, 19 Oct 2017 16:20:10 +0000 Received: from unknown-38-66.xilinx.com ([149.199.38.66]:36732 helo=xsj-pvapsmtp01) by xsj-pvapsmtpgw02 with esmtp (Exim 4.63) (envelope-from ) id 1e5DYH-0007vh-Dn; Thu, 19 Oct 2017 09:20:09 -0700 Received: from [127.0.0.1] (helo=localhost) by xsj-pvapsmtp01 with smtp (Exim 4.63) (envelope-from ) id 1e5DYH-0002ja-21; Thu, 19 Oct 2017 09:20:09 -0700 Received: from xsj-pvapsmtp01 (smtp.xilinx.com [149.199.38.66]) by xsj-smtp-dlp2.xlnx.xilinx.com (8.13.8/8.13.1) with ESMTP id v9JGK2im003246; Thu, 19 Oct 2017 09:20:03 -0700 Received: from [172.19.2.220] (helo=localhost.localdomain) by xsj-pvapsmtp01 with esmtp (Exim 4.63) (envelope-from ) id 1e5DYA-0002Wz-NZ; Thu, 19 Oct 2017 09:20:02 -0700 From: Alistair Francis To: Date: Thu, 19 Oct 2017 09:16:09 -0700 Message-ID: X-Mailer: git-send-email 2.11.0 In-Reply-To: References: X-RCIS-Action: ALLOW X-TM-AS-Product-Ver: IMSS-7.1.0.1224-8.1.0.1062-23404.005 X-TM-AS-User-Approved-Sender: Yes;Yes X-EOPAttributedMessage: 0 X-MS-Office365-Filtering-HT: Tenant X-Forefront-Antispam-Report: CIP:149.199.60.100; IPV:NLI; CTRY:US; EFV:NLI; SFV:NSPM; SFS:(10009020)(6009001)(376002)(346002)(39860400002)(2980300002)(438002)(199003)(189002)(81166006)(47776003)(36756003)(48376002)(33646002)(39060400002)(2351001)(36386004)(8936002)(106466001)(189998001)(4326008)(81156014)(106002)(575784001)(5003940100001)(8676002)(16586007)(77096006)(2950100002)(54906003)(50226002)(305945005)(118296001)(2906002)(6916009)(63266004)(478600001)(76176999)(316002)(5660300001)(9786002)(356003)(50466002)(50986999)(107986001)(5001870100001); DIR:OUT; SFP:1101; SCL:1; SRVR:BN6PR02MB3379; H:xsj-pvapsmtpgw02; FPR:; SPF:Pass; PTR:xapps1.xilinx.com,unknown-60-100.xilinx.com; A:1; MX:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BL2NAM02FT008; 1:EI0smY17Fr3xt/jtlwdvhyfLcdqLWUhBdKDGlxJ16hFziCNvx1DUadELyKUmFqCtL2qO4cHNNv+261uw/mfp0YXpiLcHGQ5QPz8x0iV1rhPbUoXyEae7G73BHSWENeh9 MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 18280317-a8ee-4223-2df1-08d5170d4522 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001)(2017030254168)(8251501002)(4534016)(4602075)(4627075)(201703031133081)(201702281549075)(2017052603199)(201703131423091); SRVR:BN6PR02MB3379; X-Microsoft-Exchange-Diagnostics: 1; BN6PR02MB3379; 3:Ih5a7Ld4jw83lrFUQdg2XtKFVC6MzzlZrce1GoxZlRvo4cHaUKqV50DzPZNVD3YXN1JBpt1YM95oTBYJFq3BlKHrBVn36OaukBNZ1us9PiHKESzzx8cY6xCnQLqPKWbS23FavIq08voOB+dmDYlflj6CG59L4l3W3VNK+iGMeyYKL9T/BigVBC0N/ddOZCSszPJGZPJoyFAzKL7h2eIPS9WqdxHERk9Q0n71nWWB6wVj0IL4uEb+SzEAApd6BXgYV2aQTLQvO/zOdt8XoR46wbJuWG38B4Jqs0ffXTZIEZ9Qjh9JomqBdDUHD75CjIl18OGm7Qk7EMXpZeOC2Or1X1PTcJ04v8O3KO5Glb33GUk=; 25:W43cD8EEOfCaSOrqkCsZl0BXmKvGM75fdDknPw9fOPectaac1+vXTBRE3M+PQuY1FSnCiTS8mM7cn80bGweflCcFOPfAiaty1xEsslUU/+zl0aECu/gWDmUBAMscockudkddCj7wBLOtoLIffeqzZrRLKSe1TNPjbKWHtzLCAj0K+vkzdFAw8cYapUxqCIMFavs0Pipc02OY7QRcQKlfGvkptzHZEVgw2w27/sxhrCqvWrO3gRozjwf6lrN7jWkCrKBAI6cEVHHpRjs4I1ByYHNJQ6Mdkbzru54n2sJHIhYxdLHJ4XeNJPDYCqKvdVx7xTVRi8QTK9qjmZUybvuIfw== X-MS-TrafficTypeDiagnostic: BN6PR02MB3379: X-Microsoft-Exchange-Diagnostics: 1; BN6PR02MB3379; 31:LSwNkjEIYB3BeDwiE8bclhxm4AG51CUnSX/e0APQTIwemLdv2Tn+n70S4xGN2LzRyVb+IF88kP18dMuBU/YMy7AflKLpyqv9xLfsdMmN8RfPv9JZdZR3dg+4BJljRSpla0O9xEFvCxRETVDniaBo84UXtVbx7Zn11rKvx1DvhuwRdS+4nAY37DYlqbUNL1UO4O263sl9WnyVoUBcCtAhUDf2fjlbjjnA4vZI5ahFM7Q=; 20:Yjdiq2hdkD8N0czVLT7Fflz/wEb6sNfkz87K+sJ4Nn2FbxxzKI9wiUUTjy9Yrgbo4lZKeJrWlP0fNPye//sfW8Gp+7oAIFMTBAX01mFo18e9BcM8xWyadG/myFf6GmhoAuKmS7+iDj3rFb6lzYQmgCL9D2yv8l61/Mzkp4G4nrYRhCYUApY58bO/h2cOxZzA4o6Jr9vPWSVQt73DokQge90+gQK4JY1ZRpA6o+hzj/n7DP/qd3iB/v/VA9FBwwtamI7Wo+WYCvv5MeQEdeLnX2no92fRQTUk/cEdNO0pMIZ0Fa8VNNu6odMF93CD1UOJzu16LZ+xsKlXbKqGgvS1ihIgTCbkuwMayZz9M/P9YE9UWjgGj9f+s/3HgN1mwWWTj62KhglOEmYgXvj8v1OZMyVPJ9hC2T7MXXvTO+5uEyqHWgxUxZu8XtoTsH7QLEtQhVftgipE4u/fRfRbqoEz9x9OrYY/4H/rbArF4DO3VMzvU86xMfHCMc0ciEACkKJT X-Exchange-Antispam-Report-Test: UriScan:(788757137089)(192813158149592); X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(100000700101)(100105000095)(100000701101)(100105300095)(100000702101)(100105100095)(6040450)(2401047)(5005006)(8121501046)(100000703101)(100105400095)(10201501046)(3002001)(93006095)(93004095)(6055026)(6041248)(20161123560025)(20161123564025)(20161123562025)(20161123558100)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123555025)(6072148)(201708071742011)(100000704101)(100105200095)(100000705101)(100105500095); SRVR:BN6PR02MB3379; BCL:0; PCL:0; RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095); SRVR:BN6PR02MB3379; X-Microsoft-Exchange-Diagnostics: 1; BN6PR02MB3379; 4:7aqT2BBbAWIHqDppSGkPccf4hFe2Mvqb6VYimDUELDVQDgHteRqjIpsHwyT0z5uf8eIowO6L1fVCYHjrsAsBIimDGh5MwtU+RMhuqSTwSEydrCnPTpaxPdtQrzIbSsN+mVF4FVADN/xl1zD2oG9u1EZNul+XZoAWcIJlXGZg50pEo0v5jPwwYzBnptMO4itjMIQkPsbKrTWXSfVVQstmy82+h3HBIcy70GCXiCoStU1c5t2ViUE5lHTGHGvpO802TfB1JEeWxcgBllpBZA7D55uoWze6E1JDqazxTvf/vjV7aWXxICy77tQHelfs6DXezakoVamujSgDu2kTflhVUQ== X-Forefront-PRVS: 0465429B7F X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; BN6PR02MB3379; 23:38yzbilj6WwwdLnrDxHuXLuHC0Kllm0UjsMSqZ/lE?= D4KvFzC5eHKMYDqsF1cwTa/Vq41/x31nuMsVguZrcsUASQe9Ya6I+H+pjWUk5ATz+k62itRlBkkukhAVkLpW89UW50axFOCnDOwE1HtTsRO+2ad9Idlee1OBz64t937rIbqyTgV1KJeWWElXjlpT23xESYIiC6+VisU28Tif5UFtO8runawa/8/4H5TaPJafczvBBH/N/8HQZ99OKaTYdeJyrLCsmQztcqA/efVKUJs0EZBbedYoOLFMsJU6Cl4DMYMbos+8Iy7BsthhCBkNJQlwEZNZ7YMbAb/dbQ1qYHDzay7DtgMfLwLUbdEInWr2e9G1zwnCRa2Oma9lErz5dScn7owmqLgnivzTuWxKlPbEWulqjFMlVtVjE+TW0xrk580gRElv8mPf8Zzbeok4zxfCB2EkKnmfFJLzP6QMQ1aP+xNRMOT6186TTKQaD8LgXbStHyYXIqaoLBeE4uqvH+gHvNVpkCj0WxMpG2x56w3qd12e3EpGaJvFYb7mWmSWIZcFXzChsGT4gQFd08uv2gwdcqgIb9EbRn039jG3EZ6NlXo7MbWZWncQxmgoy7gh/xfGYvs1/ZW19Y8T7ZP2CneHaMnBKaEQ/cR/y6zu6qNBDSqHUtiIzpHjpsjPzovdu8hQ9bJNq16K/E29w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AwVjoLZReJjP6hXelvpF+sDnyk/f8jRFksfkDmQndPUInIElVRbl4mUHwHDWQ0wtwPH4oazFYcfWaBVm0CkP7XZRl6+ykeolf9oDn6y/ExHJjDMKNSY7h9mvj/V3D+xlxvgVp+iXiA7z0bkAJiTcT+ewKEjXQfkYuDS/ejzlEmi+UZRkYH8gkJCrQ6PRu9iCOyep7Sy0ZtVuP6jwF0NE5qjaLBvEDIHWgvaaqLg= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: xilinx.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 19 Oct 2017 16:20:10.2174 (UTC) X-MS-Exchange-CrossTenant-Id: 657af505-d5df-48d0-8300-c31994686c5c X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=657af505-d5df-48d0-8300-c31994686c5c; Ip=[149.199.60.100]; Helo=[xsj-pvapsmtpgw02] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN6PR02MB3379 X-detected-operating-system: by eggs.gnu.org: Windows 7 or 8 [fuzzy] X-Received-From: 104.47.37.87 Subject: [Qemu-devel] [PATCH v3 10/46] hw/cris: Replace fprintf(stderr, "*\n" with error_report() 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: alistair23@gmail.com, armbru@redhat.com, alistair.francis@xilinx.com Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" Replace a large number of the fprintf(stderr, "*\n" calls with error_report(). The functions were renamed with these commands and then compiler issues where manually fixed. find ./* -type f -exec sed -i \ 'N;N;N;N;N;N;N;N;N;N;N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2);|Ig}' \ {} + find ./* -type f -exec sed -i \ 'N;N;N;N;N;N;N;N;N;N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2);|Ig}' \ {} + find ./* -type f -exec sed -i \ 'N;N;N;N;N;N;N;N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2);|Ig}' \ {} + find ./* -type f -exec sed -i \ 'N;N;N;N;N;N;N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2);|Ig}' \ {} + find ./* -type f -exec sed -i \ 'N;N;N;N;N;N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2);|Ig}' \ {} + find ./* -type f -exec sed -i \ 'N;N;N;N;N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2);|Ig}' \ {} + find ./* -type f -exec sed -i \ 'N;N;N;N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2);|Ig}' \ {} + find ./* -type f -exec sed -i \ 'N;N;N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2);|Ig}' \ {} + find ./* -type f -exec sed -i \ 'N;N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2);|Ig}' \ {} + find ./* -type f -exec sed -i \ 'N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2);|Ig}' \ {} + find ./* -type f -exec sed -i \ 'N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2);|Ig}' \ {} + Some lines where then manually tweaked to pass checkpatch. Signed-off-by: Alistair Francis "Edgar E. Iglesias" Reviewed-by: Philippe Mathieu-Daudé --- V2: - Split hw patch into individual directories hw/cris/axis_dev88.c | 3 ++- hw/cris/boot.c | 6 +++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/hw/cris/axis_dev88.c b/hw/cris/axis_dev88.c index 5eb552bce2..d121836b69 100644 --- a/hw/cris/axis_dev88.c +++ b/hw/cris/axis_dev88.c @@ -23,6 +23,7 @@ */ #include "qemu/osdep.h" +#include "qemu/error-report.h" #include "qapi/error.h" #include "qemu-common.h" #include "cpu.h" @@ -349,7 +350,7 @@ void axisdev88_init(MachineState *machine) li.cmdline = kernel_cmdline; cris_load_image(cpu, &li); } else if (!qtest_enabled()) { - fprintf(stderr, "Kernel image must be specified\n"); + error_report("Kernel image must be specified"); exit(1); } } diff --git a/hw/cris/boot.c b/hw/cris/boot.c index f896ed7f86..fda0a039b8 100644 --- a/hw/cris/boot.c +++ b/hw/cris/boot.c @@ -23,6 +23,7 @@ */ #include "qemu/osdep.h" +#include "qemu/error-report.h" #include "qemu-common.h" #include "cpu.h" #include "hw/hw.h" @@ -86,14 +87,13 @@ void cris_load_image(CRISCPU *cpu, struct cris_load_info *li) } if (image_size < 0) { - fprintf(stderr, "qemu: could not load kernel '%s'\n", - li->image_filename); + error_report("could not load kernel '%s'", li->image_filename); exit(1); } if (li->cmdline && (kcmdline_len = strlen(li->cmdline))) { if (kcmdline_len > 256) { - fprintf(stderr, "Too long CRIS kernel cmdline (max 256)\n"); + error_report("Too long CRIS kernel cmdline (max 256)"); exit(1); } pstrcpy_targphys("cmdline", 0x40000000, 256, li->cmdline); From patchwork Thu Oct 19 16:16:13 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alistair Francis X-Patchwork-Id: 828224 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; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=xilinx.onmicrosoft.com header.i=@xilinx.onmicrosoft.com header.b="M9oNkvaU"; 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 3yHvlZ0Wl4z9t6m for ; Fri, 20 Oct 2017 03:39:22 +1100 (AEDT) Received: from localhost ([::1]:50151 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e5Dqq-000303-2u for incoming@patchwork.ozlabs.org; Thu, 19 Oct 2017 12:39:20 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:55280) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e5DYZ-0004T4-C1 for qemu-devel@nongnu.org; Thu, 19 Oct 2017 12:20:30 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1e5DYV-0001C8-TG for qemu-devel@nongnu.org; Thu, 19 Oct 2017 12:20:27 -0400 Received: from mail-bl2nam02on0075.outbound.protection.outlook.com ([104.47.38.75]:21680 helo=NAM02-BL2-obe.outbound.protection.outlook.com) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1e5DYV-0001Bb-Dq for qemu-devel@nongnu.org; Thu, 19 Oct 2017 12:20:23 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=xilinx.onmicrosoft.com; s=selector1-xilinx-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=GetIGSqgqp0mAtSAXzjIBLAgvr3r92nJ/Oudmeg47IU=; b=M9oNkvaUt3REHLY3Ofrc31jk9B+K0t2iF3kmC0WQO5y5XpcSEb6tMbmB0DhQcPXts7qPnt5+hGGgrVcRhbfvJsGh3eWJTPSZm+j+n/3PovC1M/oXVjth9Ym1IIpmPjbsMNi/GJ2yMYE4tKBEnc0SMHDClj5p+6eAlHBJptI/K4E= Received: from SN4PR0201CA0056.namprd02.prod.outlook.com (10.171.31.146) by DM5PR02MB3385.namprd02.prod.outlook.com (10.164.152.161) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.77.7; Thu, 19 Oct 2017 16:20:21 +0000 Received: from CY1NAM02FT062.eop-nam02.prod.protection.outlook.com (2a01:111:f400:7e45::205) by SN4PR0201CA0056.outlook.office365.com (2603:10b6:803:20::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.77.21 via Frontend Transport; Thu, 19 Oct 2017 16:20:20 +0000 Authentication-Results: spf=pass (sender IP is 149.199.60.100) smtp.mailfrom=xilinx.com; redhat.com; dkim=none (message not signed) header.d=none;redhat.com; dmarc=bestguesspass action=none header.from=xilinx.com; Received-SPF: Pass (protection.outlook.com: domain of xilinx.com designates 149.199.60.100 as permitted sender) receiver=protection.outlook.com; client-ip=149.199.60.100; helo=xsj-pvapsmtpgw02; Received: from xsj-pvapsmtpgw02 (149.199.60.100) by CY1NAM02FT062.mail.protection.outlook.com (10.152.75.60) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.20.77.10 via Frontend Transport; Thu, 19 Oct 2017 16:20:20 +0000 Received: from unknown-38-66.xilinx.com ([149.199.38.66]:37662 helo=xsj-pvapsmtp01) by xsj-pvapsmtpgw02 with esmtp (Exim 4.63) (envelope-from ) id 1e5DYR-0007vv-Gs; Thu, 19 Oct 2017 09:20:19 -0700 Received: from [127.0.0.1] (helo=localhost) by xsj-pvapsmtp01 with smtp (Exim 4.63) (envelope-from ) id 1e5DYR-0002va-Dh; Thu, 19 Oct 2017 09:20:19 -0700 Received: from xsj-pvapsmtp01 (xsj-pvapsmtp01.xilinx.com [149.199.38.66]) by xsj-smtp-dlp2.xlnx.xilinx.com (8.13.8/8.13.1) with ESMTP id v9JGK7tx004267; Thu, 19 Oct 2017 09:20:08 -0700 Received: from [172.19.2.220] (helo=localhost.localdomain) by xsj-pvapsmtp01 with esmtp (Exim 4.63) (envelope-from ) id 1e5DYE-0002fl-F7; Thu, 19 Oct 2017 09:20:06 -0700 From: Alistair Francis To: Date: Thu, 19 Oct 2017 09:16:13 -0700 Message-ID: <1015bbb1bde09b5ace893ecc1a7a839b977f42fc.1508390588.git.alistair.francis@xilinx.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: References: X-RCIS-Action: ALLOW X-TM-AS-Product-Ver: IMSS-7.1.0.1224-8.1.0.1062-23404.005 X-TM-AS-User-Approved-Sender: Yes;Yes X-EOPAttributedMessage: 0 X-MS-Office365-Filtering-HT: Tenant X-Forefront-Antispam-Report: CIP:149.199.60.100; IPV:NLI; CTRY:US; EFV:NLI; SFV:NSPM; SFS:(10009020)(6009001)(346002)(39860400002)(376002)(2980300002)(438002)(189002)(199003)(8936002)(33646002)(106466001)(36756003)(5003940100001)(36386004)(5660300001)(189998001)(4326008)(118296001)(81166006)(47776003)(8676002)(81156014)(63266004)(16586007)(9786002)(2351001)(356003)(106002)(316002)(6916009)(77096006)(575784001)(50226002)(50986999)(2950100002)(48376002)(76176999)(54906003)(2906002)(478600001)(6666003)(305945005)(39060400002)(50466002)(21314002)(107986001)(5001870100001); DIR:OUT; SFP:1101; SCL:1; SRVR:DM5PR02MB3385; H:xsj-pvapsmtpgw02; FPR:; SPF:Pass; PTR:xapps1.xilinx.com,unknown-60-100.xilinx.com; MX:1; A:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; CY1NAM02FT062; 1:c/r60vkjaKq2A9VqtLhWUpw+h/iApUb4+v8PleEpmmAIDDb5Ab0m2vfgjD6sRsQnRxTW5im1QuPwLeLaSWw7epZ8MyjSUtPSUh9L82DxwnvuHoEFeFShVATCEzCI9G6f MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 6e0596aa-e774-41c2-b4f8-08d5170d4b1b X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001)(2017030254152)(8251501002)(2017052603199)(201703131423075)(201703031133081)(201702281549075); SRVR:DM5PR02MB3385; X-Microsoft-Exchange-Diagnostics: 1; DM5PR02MB3385; 3:43GjLSQHb0BCDQ1yYLJiVMnpkrYOf0xl127BdM9x4OfyW+NJDq34tnx1FSzcCh3U5994FWd3pcKR/a3Ab1vSd0JyQUPO0XeSqFaIJcO3UeXIuRl/w1ilN1a6Unxpj1GKcBqzP9qhFh4dBz7gGaloRC+cK5PXkUjeZbzNVEBv++/dJsYf30tRb8qqm30jwg6/J2ftg0jvJTlHrqWIJM92h6Vpl1+ImFAzPgxnAxMfRPjTa1qqUo90WEKu737S64GDRhBaWNlcZNF7L7CZOvTI10aIDfZ6sD1vdMzg8SyavzKOAO1TIPHjTnbMKAgSGeiRTU15kEiyswFYMFqfvbneZV/WvTds4I8GlOZr41n2u10=; 25:pUQ9xVYAUqljoq3NHbENCMOEtlSCJP1WdXDLrsS5btHq54EjFcpL2LFYmj+dR2rTOTSAOOX227OUXIZ7/b7Bytkcqq9A8l3kChMLfB5wz0ww1SQSqUb5FkXN0hQsdgFFCOs0hIhxY25gD4ZVaGo6tLxlKn0zHF19bJZQEe3h1jIk7ELUekXYjo5oDaG4jxob/P1rq2HPbe0ptRVRV5p2abNseb53e4HvDcgl8CIpYLv3t7IZkcQXHRngSyqMhW3jSLC5Ja6ljkgWYCsLQc9R16+ySXYfg+HgtEiyErFC4MQIm7J1Rat5nleJwudlhuUr3ZwsLK6w5xDwS4e2mv5HZA== X-MS-TrafficTypeDiagnostic: DM5PR02MB3385: X-Microsoft-Exchange-Diagnostics: 1; DM5PR02MB3385; 31:E3pJGi2oNHeBblZbLM6bBZXzJg6Ct52QVCFG1/WX1rve400KlXIRlJ6NlreepaOfbk+Z984BBmRIZFMd5+oqUKbOOa4DzFLLloUUgaLTPAJbj2i0ldKDLxw4jy3v8WB1k3DCHHvGEeh3p2P6viObeAcVQW60a++8KjTEIxvi25qOkFPvgmhLPgPx/TlxOY1bsDs6SS+Q6cLcvj73jlx6dOtaj5NEkOw55dALVNAeHNM=; 20:DJkEDNY2/cmAic4bmGrTz/WibmMTYFHvkc2SZZf58elcEqwsg+HythTFV1oTQ4K6CeUrUUKfkxB0Xs33oa1btiYb+QCsha0hXTy0T0qJ4Hhziz2FZCmmNK5QSuUMK2+WA3zL8JLKcEA9LubSelvpdD3scqmu8Q+S2NX7/MkcSr/ZoV3Mgna5A8rbDc7EwB3t4TVgVyR5D9Yymv6dvji2UsiQxQkF5hHuaWK5LmG5s7na/ywchE3nEPYlRjHVpanycRHQZ/yDTo4IKIgf14ZNCDdR/rsdOfBlJvFqFuVeSMHDxfgVW9ycReUlyjHRHhjhl2+21bYCPx3zduwOUMT7AqnwJjpYKGi1vkxXPpOB4koJvz0a5HunRGRKbCyqaLSTNakAI53G3gLvktWKYy3HX2wkQ5/BeEQjv+li6vVs4xuw9/I0vV9XXPb2kg83eRuK85+hJgHnEm+Y6P5Hh2O0mR+UCAneqFvuD7vJx6/JorocFg6cgEPFfy+LBdiqRiwE X-Exchange-Antispam-Report-Test: UriScan:(158342451672863)(788757137089)(192813158149592); X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(100000700101)(100105000095)(100000701101)(100105300095)(100000702101)(100105100095)(6040450)(2401047)(8121501046)(5005006)(3002001)(93006095)(93004095)(100000703101)(100105400095)(10201501046)(6055026)(6041248)(20161123558100)(20161123555025)(20161123560025)(20161123564025)(20161123562025)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(6072148)(201708071742011)(100000704101)(100105200095)(100000705101)(100105500095); SRVR:DM5PR02MB3385; BCL:0; PCL:0; RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095); SRVR:DM5PR02MB3385; X-Microsoft-Exchange-Diagnostics: 1; DM5PR02MB3385; 4:+A0ch8cP+eUDfRDFJhmmTeU3Usmj3o/DKenr9UhL9DLq2c/qFg5aImP/fx/V1YvR3hPQruCcbn2LUjV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/g6CQ=; 7:Atf+7+/eeKQ/rG0fB5Nsj6gX1dEvKtHVIE1cE/RlCilj895Vsdr2rgL8kweD7ymiHoyzPrOXqPV3hPwcyL5ZtF0H0wSFK5ay4gxPYf9BezIFWylshkwkZCQBOaAukAtKao2mUr8OsRCu8SUBXUHRDyPgYQ+FJb/zjcHSTJ+M+p8p0WDYDB3adbrXZsfM7R5TeSynuuPetvCxy72PUL32CV3manwJgcwQxYbVmGpJUrw= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: xilinx.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 19 Oct 2017 16:20:20.0851 (UTC) X-MS-Exchange-CrossTenant-Id: 657af505-d5df-48d0-8300-c31994686c5c X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=657af505-d5df-48d0-8300-c31994686c5c; Ip=[149.199.60.100]; Helo=[xsj-pvapsmtpgw02] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM5PR02MB3385 X-detected-operating-system: by eggs.gnu.org: Windows 7 or 8 [fuzzy] X-Received-From: 104.47.38.75 Subject: [Qemu-devel] [PATCH v3 11/46] hw/display: Replace fprintf(stderr, "*\n" with error_report() 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: alistair23@gmail.com, armbru@redhat.com, alistair.francis@xilinx.com Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" Replace a large number of the fprintf(stderr, "*\n" calls with error_report(). The functions were renamed with these commands and then compiler issues where manually fixed. find ./* -type f -exec sed -i \ 'N;N;N;N;N;N;N;N;N;N;N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2);|Ig}' \ {} + find ./* -type f -exec sed -i \ 'N;N;N;N;N;N;N;N;N;N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2);|Ig}' \ {} + find ./* -type f -exec sed -i \ 'N;N;N;N;N;N;N;N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2);|Ig}' \ {} + find ./* -type f -exec sed -i \ 'N;N;N;N;N;N;N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2);|Ig}' \ {} + find ./* -type f -exec sed -i \ 'N;N;N;N;N;N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2);|Ig}' \ {} + find ./* -type f -exec sed -i \ 'N;N;N;N;N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2);|Ig}' \ {} + find ./* -type f -exec sed -i \ 'N;N;N;N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2);|Ig}' \ {} + find ./* -type f -exec sed -i \ 'N;N;N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2);|Ig}' \ {} + find ./* -type f -exec sed -i \ 'N;N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2);|Ig}' \ {} + find ./* -type f -exec sed -i \ 'N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2);|Ig}' \ {} + find ./* -type f -exec sed -i \ 'N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2);|Ig}' \ {} + Some lines where then manually tweaked to pass checkpatch. Signed-off-by: Alistair Francis --- V2: - Split hw patch into individual directories hw/display/blizzard.c | 20 ++++++++++---------- hw/display/omap_dss.c | 14 +++++++------- hw/display/pl110.c | 2 +- hw/display/pxa2xx_lcd.c | 2 +- hw/display/qxl-render.c | 7 +++---- hw/display/qxl.c | 10 +++++----- hw/display/tc6393xb.c | 36 ++++++++++++++++++++---------------- hw/display/virtio-gpu-3d.c | 4 ++-- hw/display/vmware_vga.c | 22 +++++++++++----------- 9 files changed, 60 insertions(+), 57 deletions(-) diff --git a/hw/display/blizzard.c b/hw/display/blizzard.c index 291abe6fca..0d12e078c4 100644 --- a/hw/display/blizzard.c +++ b/hw/display/blizzard.c @@ -474,7 +474,7 @@ static uint16_t blizzard_reg_read(void *opaque, uint8_t reg) return s->gpio_pdown; default: - fprintf(stderr, "%s: unknown register %02x\n", __func__, reg); + error_report("%s: unknown register %02x", __func__, reg); return 0; } } @@ -501,7 +501,7 @@ static void blizzard_reg_write(void *opaque, uint8_t reg, uint16_t value) case 0x0c: /* PLL Mode Control 0 */ s->pll_mode = value & 0x77; if ((value & 3) == 0 || (value & 3) == 3) - fprintf(stderr, "%s: wrong PLL Control bits (%i)\n", + error_report("%s: wrong PLL Control bits (%i)", __func__, value & 3); break; @@ -541,7 +541,7 @@ static void blizzard_reg_write(void *opaque, uint8_t reg, uint16_t value) case 0x28: /* LCD Panel Configuration */ s->lcd_config = value & 0xff; if (value & (1 << 7)) - fprintf(stderr, "%s: data swap not supported!\n", __func__); + error_report("%s: data swap not supported!", __func__); break; case 0x2a: /* LCD Horizontal Display Width */ @@ -585,7 +585,7 @@ static void blizzard_reg_write(void *opaque, uint8_t reg, uint16_t value) case 0x40: /* High-speed Serial Interface Tx Configuration Port 1 */ s->hssi_config[1] = value; if (((value >> 4) & 3) == 3) - fprintf(stderr, "%s: Illegal active-data-links value\n", + error_report("%s: Illegal active-data-links value", __func__); break; case 0x42: /* High-speed Serial Interface Tx Mode */ @@ -641,7 +641,7 @@ static void blizzard_reg_write(void *opaque, uint8_t reg, uint16_t value) s->enable = value & 1; s->blank = (value >> 1) & 1; if (value & (1 << 4)) - fprintf(stderr, "%s: Macrovision enable attempt!\n", __func__); + error_report("%s: Macrovision enable attempt!", __func__); break; case 0x6a: /* Special Effects */ @@ -717,7 +717,7 @@ static void blizzard_reg_write(void *opaque, uint8_t reg, uint16_t value) s->iformat = value & 0xf; s->bpp = blizzard_iformat_bpp[s->iformat]; if (!s->bpp) - fprintf(stderr, "%s: Illegal or unsupported input format %x\n", + error_report("%s: Illegal or unsupported input format %x", __func__, s->iformat); break; case 0x8e: /* Data Source Select */ @@ -729,7 +729,7 @@ static void blizzard_reg_write(void *opaque, uint8_t reg, uint16_t value) s->iy[1] != s->oy[1])) || !((s->ix[1] - s->ix[0]) & (s->iy[1] - s->iy[0]) & (s->ox[1] - s->ox[0]) & (s->oy[1] - s->oy[0]) & 1)) - fprintf(stderr, "%s: Illegal input/output window positions\n", + error_report("%s: Illegal input/output window positions", __func__); blizzard_transfer_setup(s); @@ -783,8 +783,8 @@ static void blizzard_reg_write(void *opaque, uint8_t reg, uint16_t value) case 0xe6: /* Power-save */ s->pm = value & 0x83; if (value & s->mode & 1) - fprintf(stderr, "%s: The display must be disabled before entering " - "Standby Mode\n", __func__); + error_report("%s: The display must be disabled before entering " + "Standby Mode", __func__); break; case 0xe8: /* Non-display Period Control / Status */ s->status = value & 0x1b; @@ -815,7 +815,7 @@ static void blizzard_reg_write(void *opaque, uint8_t reg, uint16_t value) break; default: - fprintf(stderr, "%s: unknown register %02x\n", __func__, reg); + error_report("%s: unknown register %02x", __func__, reg); break; } } diff --git a/hw/display/omap_dss.c b/hw/display/omap_dss.c index 601f178fdd..52d6e753d3 100644 --- a/hw/display/omap_dss.c +++ b/hw/display/omap_dss.c @@ -406,10 +406,10 @@ static void omap_disc_write(void *opaque, hwaddr addr, s->lcd.enable = (value >> 0) & 1; if (value & (1 << 12)) /* OVERLAY_OPTIMIZATION */ if (!((s->dispc.l[1].attr | s->dispc.l[2].attr) & 1)) { - fprintf(stderr, "%s: Overlay Optimization when no overlay " - "region effectively exists leads to " - "unpredictable behaviour!\n", __func__); - } + error_report("%s: Overlay Optimization when no overlay " + "region effectively exists leads to " + "unpredictable behaviour!", __func__); + } if (value & (1 << 6)) { /* GODIGITAL */ /* XXX: Shadowed fields are: * s->dispc.config @@ -525,8 +525,8 @@ static void omap_disc_write(void *opaque, hwaddr addr, case 0x0a0: /* DISPC_GFX_ATTRIBUTES */ s->dispc.l[0].attr = value & 0x7ff; if (value & (3 << 9)) - fprintf(stderr, "%s: Big-endian pixel format not supported\n", - __func__); + error_report("%s: Big-endian pixel format not supported", + __func__); s->dispc.l[0].enable = value & 1; s->dispc.l[0].bpp = (value >> 1) & 0xf; s->dispc.invalidate = 1; @@ -617,7 +617,7 @@ static void omap_rfbi_transfer_start(struct omap_dss_s *s) if (s->rfbi.control & (1 << 1)) { /* BYPASS */ /* TODO: in non-Bypass mode we probably need to just assert the * DRQ and wait for DMA to write the pixels. */ - fprintf(stderr, "%s: Bypass mode unimplemented\n", __func__); + error_report("%s: Bypass mode unimplemented", __func__); return; } diff --git a/hw/display/pl110.c b/hw/display/pl110.c index 8c7dcc6f0a..b8b7903d36 100644 --- a/hw/display/pl110.c +++ b/hw/display/pl110.c @@ -174,7 +174,7 @@ static void pl110_update_display(void *opaque) dest_width = 4; break; default: - fprintf(stderr, "pl110: Bad color depth\n"); + error_report("pl110: Bad color depth"); exit(1); } if (s->cr & PL110_CR_BGR) diff --git a/hw/display/pxa2xx_lcd.c b/hw/display/pxa2xx_lcd.c index b83f80753a..ae3a365849 100644 --- a/hw/display/pxa2xx_lcd.c +++ b/hw/display/pxa2xx_lcd.c @@ -1050,7 +1050,7 @@ PXA2xxLCDState *pxa2xx_lcdc_init(MemoryRegion *sysmem, s->dest_width = 4; break; default: - fprintf(stderr, "%s: Bad color depth\n", __func__); + error_report("%s: Bad color depth", __func__); exit(1); } diff --git a/hw/display/qxl-render.c b/hw/display/qxl-render.c index e7ac4f8789..0cd07028a4 100644 --- a/hw/display/qxl-render.c +++ b/hw/display/qxl-render.c @@ -78,7 +78,7 @@ void qxl_render_resize(PCIQXLDevice *qxl) qxl->guest_primary.bits_pp = 32; break; default: - fprintf(stderr, "%s: unhandled format: %x\n", __func__, + error_report("%s: unhandled format: %x", __func__, qxl->guest_primary.surface.format); qxl->guest_primary.bytes_pp = 4; qxl->guest_primary.bits_pp = 32; @@ -247,7 +247,7 @@ static QEMUCursor *qxl_cursor(PCIQXLDevice *qxl, QXLCursor *cursor, } break; default: - fprintf(stderr, "%s: not implemented: type %d\n", + error_report("%s: not implemented: type %d", __func__, cursor->header.type); goto fail; } @@ -275,9 +275,8 @@ int qxl_render_cursor(PCIQXLDevice *qxl, QXLCommandExt *ext) } if (qxl->debug > 1 && cmd->type != QXL_CURSOR_MOVE) { - fprintf(stderr, "%s", __func__); + error_report("%s", __func__); qxl_log_cmd_cursor(qxl, cmd, ext->group_id); - fprintf(stderr, "\n"); } switch (cmd->type) { case QXL_CURSOR_SET: diff --git a/hw/display/qxl.c b/hw/display/qxl.c index 99365c3e8f..2e3ae5b90c 100644 --- a/hw/display/qxl.c +++ b/hw/display/qxl.c @@ -875,7 +875,7 @@ static void interface_notify_update(QXLInstance *sin, uint32_t update_id) * Probably was at some earlier version that is prior to git start (2009), * and is still guest trigerrable. */ - fprintf(stderr, "%s: deprecated\n", __func__); + error_report("%s: deprecated", __func__); } /* called from spice server thread context only */ @@ -905,7 +905,7 @@ static void interface_async_complete_io(PCIQXLDevice *qxl, QXLCookie *cookie) trace_qxl_interface_async_complete_io(qxl->id, current_async, cookie); if (!cookie) { - fprintf(stderr, "qxl: %s: error, cookie is NULL\n", __func__); + error_report("qxl: %s: error, cookie is NULL", __func__); return; } if (cookie && current_async != cookie->io) { @@ -930,7 +930,7 @@ static void interface_async_complete_io(PCIQXLDevice *qxl, QXLCookie *cookie) qxl_spice_destroy_surface_wait_complete(qxl, cookie->u.surface_id); break; default: - fprintf(stderr, "qxl: %s: unexpected current_async %d\n", __func__, + error_report("qxl: %s: unexpected current_async %d", __func__, current_async); } qxl_send_events(qxl, QXL_INTERRUPT_IO_CMD); @@ -998,7 +998,7 @@ static void interface_async_complete(QXLInstance *sin, uint64_t cookie_token) case QXL_COOKIE_TYPE_POST_LOAD_MONITORS_CONFIG: break; default: - fprintf(stderr, "qxl: %s: unexpected cookie type %d\n", + error_report("qxl: %s: unexpected cookie type %d", __func__, cookie->type); g_free(cookie); } @@ -1875,7 +1875,7 @@ static void qxl_send_events(PCIQXLDevice *d, uint32_t events) trace_qxl_send_events(d->id, events); if (!qemu_spice_display_is_running(&d->ssd)) { /* spice-server tracks guest running state and should not do this */ - fprintf(stderr, "%s: spice-server bug: guest stopped, ignoring\n", + error_report("%s: spice-server bug: guest stopped, ignoring", __func__); trace_qxl_send_events_vm_stopped(d->id, events); return; diff --git a/hw/display/tc6393xb.c b/hw/display/tc6393xb.c index 79f161740a..8b708a858b 100644 --- a/hw/display/tc6393xb.c +++ b/hw/display/tc6393xb.c @@ -159,7 +159,7 @@ void tc6393xb_gpio_out_set(TC6393xbState *s, int line, qemu_irq handler) { if (line >= TC6393XB_GPIOS) { - fprintf(stderr, "TC6393xb: no GPIO pin %d\n", line); + error_report("TC6393xb: no GPIO pin %d", line); return; } @@ -190,7 +190,7 @@ static void tc6393xb_l3v(void *opaque, int line, int level) { TC6393xbState *s = opaque; s->blank = !level; - fprintf(stderr, "L3V: %d\n", level); + error_report("L3V: %d", level); } static void tc6393xb_sub_irq(void *opaque, int line, int level) { @@ -257,7 +257,7 @@ static uint32_t tc6393xb_scr_readb(TC6393xbState *s, hwaddr addr) SCR_REG_B(CONFIG); SCR_REG_B(DEBUG); } - fprintf(stderr, "tc6393xb_scr: unhandled read at %08x\n", (uint32_t) addr); + error_report("tc6393xb_scr: unhandled read at %08x", (uint32_t) addr); return 0; } #undef SCR_REG_B @@ -318,8 +318,8 @@ static void tc6393xb_scr_writeb(TC6393xbState *s, hwaddr addr, uint32_t value) SCR_REG_B(CONFIG); SCR_REG_B(DEBUG); } - fprintf(stderr, "tc6393xb_scr: unhandled write at %08x: %02x\n", - (uint32_t) addr, value & 0xff); + error_report("tc6393xb_scr: unhandled write at %08x: %02x", + (uint32_t) addr, value & 0xff); } #undef SCR_REG_B #undef SCR_REG_W @@ -341,7 +341,7 @@ static uint32_t tc6393xb_nand_cfg_readb(TC6393xbState *s, hwaddr addr) { case NAND_CFG_BASE + 3: return s->nand_phys >> (addr - NAND_CFG_BASE); } - fprintf(stderr, "tc6393xb_nand_cfg: unhandled read at %08x\n", (uint32_t) addr); + error_report("tc6393xb_nand_cfg: unhandled read at %08x", (uint32_t) addr); return 0; } static void tc6393xb_nand_cfg_writeb(TC6393xbState *s, hwaddr addr, uint32_t value) { @@ -357,7 +357,7 @@ static void tc6393xb_nand_cfg_writeb(TC6393xbState *s, hwaddr addr, uint32_t val s->nand_phys |= (value & 0xff) << ((addr - NAND_CFG_BASE) * 8); return; } - fprintf(stderr, "tc6393xb_nand_cfg: unhandled write at %08x: %02x\n", + error_report("tc6393xb_nand_cfg: unhandled write at %08x: %02x", (uint32_t) addr, value & 0xff); } @@ -377,12 +377,14 @@ static uint32_t tc6393xb_nand_readb(TC6393xbState *s, hwaddr addr) { case NAND_IMR: return s->nand.imr; } - fprintf(stderr, "tc6393xb_nand: unhandled read at %08x\n", (uint32_t) addr); + error_report("tc6393xb_nand: unhandled read at %08x", (uint32_t) addr); return 0; } -static void tc6393xb_nand_writeb(TC6393xbState *s, hwaddr addr, uint32_t value) { -// fprintf(stderr, "tc6393xb_nand: write at %08x: %02x\n", -// (uint32_t) addr, value & 0xff); +static void tc6393xb_nand_writeb(TC6393xbState *s, hwaddr addr, uint32_t value) +{ + /* error_report("tc6393xb_nand: write at %08x: %02x", + * (uint32_t) addr, value & 0xff); + */ switch (addr) { case NAND_DATA + 0: case NAND_DATA + 1: @@ -420,7 +422,7 @@ static void tc6393xb_nand_writeb(TC6393xbState *s, hwaddr addr, uint32_t value) tc6393xb_nand_irq(s); return; } - fprintf(stderr, "tc6393xb_nand: unhandled write at %08x: %02x\n", + error_report("tc6393xb_nand: unhandled write at %08x: %02x", (uint32_t) addr, value & 0xff); } @@ -522,13 +524,15 @@ static uint64_t tc6393xb_readb(void *opaque, hwaddr addr, }; if ((addr &~0xff) == s->nand_phys && s->nand_enable) { -// return tc6393xb_nand_readb(s, addr & 0xff); + /* return tc6393xb_nand_readb(s, addr & 0xff); */ uint8_t d = tc6393xb_nand_readb(s, addr & 0xff); -// fprintf(stderr, "tc6393xb_nand: read at %08x: %02hhx\n", (uint32_t) addr, d); + /* error_report("tc6393xb_nand: read at %08x: %02hhx", + * (uint32_t) addr, d); + */ return d; } -// fprintf(stderr, "tc6393xb: unhandled read at %08x\n", (uint32_t) addr); + /* error_report("tc6393xb: unhandled read at %08x", (uint32_t) addr); */ return 0; } @@ -548,7 +552,7 @@ static void tc6393xb_writeb(void *opaque, hwaddr addr, if ((addr &~0xff) == s->nand_phys && s->nand_enable) tc6393xb_nand_writeb(s, addr & 0xff, value); else - fprintf(stderr, "tc6393xb: unhandled write at %08x: %02x\n", + error_report("tc6393xb: unhandled write at %08x: %02x", (uint32_t) addr, (int)value & 0xff); } diff --git a/hw/display/virtio-gpu-3d.c b/hw/display/virtio-gpu-3d.c index 8c106a662d..88bc1c84a6 100644 --- a/hw/display/virtio-gpu-3d.c +++ b/hw/display/virtio-gpu-3d.c @@ -473,7 +473,7 @@ void virtio_gpu_virgl_process_cmd(VirtIOGPU *g, return; } if (cmd->error) { - fprintf(stderr, "%s: ctrl 0x%x, error 0x%x\n", __func__, + error_report("%s: ctrl 0x%x, error 0x%x", __func__, cmd->cmd_hdr.type, cmd->error); virtio_gpu_ctrl_response_nodata(g, cmd, cmd->error); return; @@ -556,7 +556,7 @@ static void virtio_gpu_print_stats(void *opaque) VirtIOGPU *g = opaque; if (g->stats.requests) { - fprintf(stderr, "stats: vq req %4d, %3d -- 3D %4d (%5d)\n", + error_report("stats: vq req %4d, %3d -- 3D %4d (%5d)", g->stats.requests, g->stats.max_inflight, g->stats.req_3d, diff --git a/hw/display/vmware_vga.c b/hw/display/vmware_vga.c index cdc3fed6ca..a8a2b470bc 100644 --- a/hw/display/vmware_vga.c +++ b/hw/display/vmware_vga.c @@ -293,45 +293,45 @@ static inline bool vmsvga_verify_rect(DisplaySurface *surface, int x, int y, int w, int h) { if (x < 0) { - fprintf(stderr, "%s: x was < 0 (%d)\n", name, x); + error_report("%s: x was < 0 (%d)", name, x); return false; } if (x > SVGA_MAX_WIDTH) { - fprintf(stderr, "%s: x was > %d (%d)\n", name, SVGA_MAX_WIDTH, x); + error_report("%s: x was > %d (%d)", name, SVGA_MAX_WIDTH, x); return false; } if (w < 0) { - fprintf(stderr, "%s: w was < 0 (%d)\n", name, w); + error_report("%s: w was < 0 (%d)", name, w); return false; } if (w > SVGA_MAX_WIDTH) { - fprintf(stderr, "%s: w was > %d (%d)\n", name, SVGA_MAX_WIDTH, w); + error_report("%s: w was > %d (%d)", name, SVGA_MAX_WIDTH, w); return false; } if (x + w > surface_width(surface)) { - fprintf(stderr, "%s: width was > %d (x: %d, w: %d)\n", + error_report("%s: width was > %d (x: %d, w: %d)", name, surface_width(surface), x, w); return false; } if (y < 0) { - fprintf(stderr, "%s: y was < 0 (%d)\n", name, y); + error_report("%s: y was < 0 (%d)", name, y); return false; } if (y > SVGA_MAX_HEIGHT) { - fprintf(stderr, "%s: y was > %d (%d)\n", name, SVGA_MAX_HEIGHT, y); + error_report("%s: y was > %d (%d)", name, SVGA_MAX_HEIGHT, y); return false; } if (h < 0) { - fprintf(stderr, "%s: h was < 0 (%d)\n", name, h); + error_report("%s: h was < 0 (%d)", name, h); return false; } if (h > SVGA_MAX_HEIGHT) { - fprintf(stderr, "%s: h was > %d (%d)\n", name, SVGA_MAX_HEIGHT, h); + error_report("%s: h was > %d (%d)", name, SVGA_MAX_HEIGHT, h); return false; } if (y + h > surface_height(surface)) { - fprintf(stderr, "%s: update height > %d (y: %d, h: %d)\n", + error_report("%s: update height > %d (y: %d, h: %d)", name, surface_height(surface), y, h); return false; } @@ -529,7 +529,7 @@ static inline void vmsvga_cursor_define(struct vmsvga_state_s *s, #endif break; default: - fprintf(stderr, "%s: unhandled bpp %d, using fallback cursor\n", + error_report("%s: unhandled bpp %d, using fallback cursor", __func__, c->bpp); cursor_put(qc); qc = cursor_builtin_left_ptr(); From patchwork Thu Oct 19 16:16:17 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alistair Francis X-Patchwork-Id: 828220 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; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=xilinx.onmicrosoft.com header.i=@xilinx.onmicrosoft.com header.b="J5bSFBOl"; 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 3yHvh86VbLz9t7p for ; Fri, 20 Oct 2017 03:36:24 +1100 (AEDT) Received: from localhost ([::1]:50141 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e5Dny-0000eD-Ql for incoming@patchwork.ozlabs.org; Thu, 19 Oct 2017 12:36:22 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:55278) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e5DYZ-0004T3-AK for qemu-devel@nongnu.org; Thu, 19 Oct 2017 12:20:29 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1e5DYV-0001CM-VW for qemu-devel@nongnu.org; Thu, 19 Oct 2017 12:20:27 -0400 Received: from mail-bn3nam01on0088.outbound.protection.outlook.com ([104.47.33.88]:3743 helo=NAM01-BN3-obe.outbound.protection.outlook.com) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1e5DYV-0001Bf-J7 for qemu-devel@nongnu.org; Thu, 19 Oct 2017 12:20:23 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=xilinx.onmicrosoft.com; s=selector1-xilinx-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=S0bz4HsrZXXN4P75In/lrEMhyjKxazKcUqnFhYS4iNk=; b=J5bSFBOlStmC5dFRKklCTUKdFPBOPDt6Ewq5gd7PiOs4zVZvo7DcCr+GHfLIkrebhEljEQUCDJ9QytxZYNFkARgo3SsMEW4QLhLC30N27+RcadjSJA4bIAu7xJV9i4CYHBuCPqqCcZ4+uvL/N4rdCZm0V3nEkAFO94/THni7lAU= Received: from CY4PR02CA0033.namprd02.prod.outlook.com (10.175.57.147) by CY1PR02MB1334.namprd02.prod.outlook.com (10.161.170.25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.77.7; Thu, 19 Oct 2017 16:20:20 +0000 Received: from CY1NAM02FT060.eop-nam02.prod.protection.outlook.com (2a01:111:f400:7e45::208) by CY4PR02CA0033.outlook.office365.com (2603:10b6:903:117::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.77.21 via Frontend Transport; Thu, 19 Oct 2017 16:20:20 +0000 Authentication-Results: spf=pass (sender IP is 149.199.60.83) smtp.mailfrom=xilinx.com; redhat.com; dkim=none (message not signed) header.d=none;redhat.com; dmarc=bestguesspass action=none header.from=xilinx.com; Received-SPF: Pass (protection.outlook.com: domain of xilinx.com designates 149.199.60.83 as permitted sender) receiver=protection.outlook.com; client-ip=149.199.60.83; helo=xsj-pvapsmtpgw01; Received: from xsj-pvapsmtpgw01 (149.199.60.83) by CY1NAM02FT060.mail.protection.outlook.com (10.152.74.252) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.20.77.10 via Frontend Transport; Thu, 19 Oct 2017 16:20:20 +0000 Received: from unknown-38-66.xilinx.com ([149.199.38.66] helo=xsj-pvapsmtp01) by xsj-pvapsmtpgw01 with esmtp (Exim 4.63) (envelope-from ) id 1e5DYR-0008V4-DK; Thu, 19 Oct 2017 09:20:19 -0700 Received: from [127.0.0.1] (helo=localhost) by xsj-pvapsmtp01 with smtp (Exim 4.63) (envelope-from ) id 1e5DYR-0002va-Ad; Thu, 19 Oct 2017 09:20:19 -0700 Received: from xsj-pvapsmtp01 (smtp3.xilinx.com [149.199.38.66]) by xsj-smtp-dlp2.xlnx.xilinx.com (8.13.8/8.13.1) with ESMTP id v9JGKAEK005210; Thu, 19 Oct 2017 09:20:10 -0700 Received: from [172.19.2.220] (helo=localhost.localdomain) by xsj-pvapsmtp01 with esmtp (Exim 4.63) (envelope-from ) id 1e5DYH-0002lp-V0; Thu, 19 Oct 2017 09:20:10 -0700 From: Alistair Francis To: Date: Thu, 19 Oct 2017 09:16:17 -0700 Message-ID: X-Mailer: git-send-email 2.11.0 In-Reply-To: References: X-RCIS-Action: ALLOW X-TM-AS-Product-Ver: IMSS-7.1.0.1224-8.1.0.1062-23404.005 X-TM-AS-User-Approved-Sender: Yes;Yes X-EOPAttributedMessage: 0 X-MS-Office365-Filtering-HT: Tenant X-Forefront-Antispam-Report: CIP:149.199.60.83; IPV:NLI; CTRY:US; EFV:NLI; SFV:NSPM; SFS:(10009020)(6009001)(376002)(39860400002)(346002)(2980300002)(438002)(199003)(189002)(81166006)(54906003)(4326008)(2950100002)(50226002)(478600001)(6306002)(47776003)(16586007)(106002)(316002)(6916009)(39060400002)(77096006)(5003940100001)(2351001)(81156014)(8936002)(106466001)(36756003)(33646002)(8676002)(63266004)(5660300001)(76176999)(50986999)(36386004)(50466002)(2906002)(9786002)(305945005)(118296001)(189998001)(356003)(48376002)(107986001)(21314002); DIR:OUT; SFP:1101; SCL:1; SRVR:CY1PR02MB1334; H:xsj-pvapsmtpgw01; FPR:; SPF:Pass; PTR:unknown-60-83.xilinx.com; A:1; MX:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; CY1NAM02FT060; 1:1f8bzRAHudlzSj4Xcm5Bbq/JAuFVZjmSYZJSJpOlPegi+h8R++Uo6uXSXnrrIjm1qOOOfg2ax6TMINkOWk7/h4KG9wRGV7mkcILpsgzVamuL3Rk9TQ3eoP+vCyt55tC6 MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: d8fa0843-b84e-422e-dff3-08d5170d4b14 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001)(2017030254152)(8251501002)(2017052603199)(201703131423075)(201703031133081)(201702281549075); SRVR:CY1PR02MB1334; X-Microsoft-Exchange-Diagnostics: 1; CY1PR02MB1334; 3:70D6SlPVv8wgHuPCrtYI3O5Z9i+a21O9V+DaHlYsam3mTwafxnSlfH6/IKhPFP2qRjQGhczoclap6GBWleHsK0YyeHR3w/OnxQ/6ch57oYKb0GOyHgqrySldvAiBU70nMGWaSCxPci7Mvdxoek0Y6dBp3e2Lqf0zkkmaOjaTVifVhHBjSLx0sbJ/QBjT7tu/vxkgrw+YryE8g+JF1rr6e2+f3tv6v6C9F9hc1hnVSdOyqJR/YT+d6LW3VAGGEjjaDoueys7IyfBMmVUclobYnI1RkGNFj0ms+4Hf6UYn8R0I9l5DWgJAliYOB/oPFeLMBDMgNGI/OAfRSR5Bqaq7ypzrv2jFSNm4LfDgG2yUCpA=; 25:mRvpgqRnpDTq0gvxWMXihG2zrifPvNwl7ChqHC49Cl7Wwj+C29hEcjaYm8/L2jcWaA/ma8eF1kPtYY34ckm77gZ504d/Elrw2kdqvLYcRopgf8wsGx1epu/lOYcf2RYOpW8Qrryu4dZyOfkBLQ+EqVwN2qURMznRLGBsLJUa0LNSX6jQHhw6b6ZCaOd7FIRuu4wmI2eHpqtnernlCkZ/CsF558L4izZCJUcvRfSKxJkBRYzEDUjXRX16CrC2p5dcpI/wupM+HjhykEP2FFw/ELHJa/pi65gUZG7aADq97wXQ4nBS9k/24P2QqCqdttW7YGRhRBvGks62ph0S/uousQ== X-MS-TrafficTypeDiagnostic: CY1PR02MB1334: X-Microsoft-Exchange-Diagnostics: 1; CY1PR02MB1334; 31:7lJJtjQizJmQIpxK1bVaRE4tjsUOrYppr1xson5aODDsNN2bd4hTTJ3vHdzwB33inBbm8yu5ubrTG4gnWHw2JkL2V+ZDxacz+gYsuVtBZh4wTjeSgevLKW3ikbPquAdCG9m7oFfJm3SHDFutO9iGHD59nKf1tAkUV4yr8G/4UJ5G8aODDTffR0diLIU4WXUsPrBNd2zES9mFhQCRL5WgtbgaDbqcDZwOkahwe0WHzsg=; 20:IIepGAbV+VsbxH/DPPyzPeVx4AaNm4mm8ryLFapekkXPONQxdGn43yXwOrbf6fPu7qywQRaVgWevOewS/PK0DFlU8HRmIPhMtGR4QNgCL6EzOGvZsVXLlitdhI+85l8Zz5rrgHOpA+0B7zr7JjrcWhcMgE9lGfgZLBY1i4dd/zWqoRm16Xb+PBGqZWMIz5EzBcIq242fFbGHTN04HwcmPKK19Vb1SBnEFccPHrL+CK81uU8BRXzjI7hIaxHDrANsfFkw2Heki0ZzgUeEaiyQfXw+rOQqYNXQ6sWYEv2Q2zuLHY34F/6JdGihQAZSfMFCOelwaz8+NyfrJlNXzK3dtjcwSjGKo6HO3fdJtPg3axcsRMSzZidG4AngkcDB0DisZZv3kd4qf8mMJzMf1pRU3LpHO5zbockkK40EJNS3tC9iKBPfQQcQxDF8pTAoJ//v2MC2FCwEG5h6DJvqCr020Kva5RuPNpSBqNaDn4NTSZOHSl8jnLgEIraNGcyeziYT X-Exchange-Antispam-Report-Test: UriScan:(250305191791016)(22074186197030)(788757137089)(192813158149592); X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(100000700101)(100105000095)(100000701101)(100105300095)(100000702101)(100105100095)(6040450)(2401047)(8121501046)(5005006)(93006095)(93004095)(10201501046)(100000703101)(100105400095)(3002001)(6055026)(6041248)(20161123555025)(20161123560025)(20161123564025)(20161123558100)(20161123562025)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(6072148)(201708071742011)(100000704101)(100105200095)(100000705101)(100105500095); SRVR:CY1PR02MB1334; BCL:0; PCL:0; RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095); SRVR:CY1PR02MB1334; X-Microsoft-Exchange-Diagnostics: 1; CY1PR02MB1334; 4:G8yzfNhJONhv4rZYAYJHYuZ98IUR07w9MSkJzjU6Cb3yGX/Rh46hXD9XAV2NZ1P38+Twypb9J/uHYcS+xeVDBp6I3bchHic9I05CxaVl2DrZ9PP4u0MKwBIokmEnAzXnwB8ReD1aym9VbpGAtoh3ZNTzVVMRcdlvWOO0smdR7iisqIGuz9AfJvRJ275vDYlMVLtokrfRCNLBC7xV64tZqqXvQyOfY+/kGyJvJcIVUlU2pTmq+lIrLfw/zy0HCGhi+0wfBhAjvtG+0C4Lp2IajEGIHaCKGpxP0tQZwmB30CEzPj219Zfcu/L9HUHbSrCTTvMDRrAER6Vcb6joFGO7BMxJDKaNiDHH9tbtkS0j8+SPSaYTUW19efiZDFRKpds5CmsKz5nJofddzz29jOlE4Q== X-Forefront-PRVS: 0465429B7F X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; CY1PR02MB1334; 23:pjfHz5kpPVMx2j3KPfIxlTaQqVqKWxDzjfJ0w3CNr?= rj2NhA/QzazjWAsZjQAw4LWlCPRlvncxwFfV8Xr6nazJiLoc7GGOQ3SnHR+5iSuqr2mZ2yloP4hvnoravpaHSj9BPikx2BBP4xMu3Y2vcUFk67vUMpaJCd2LBKtXeIsXCTc/CFOKebaYP1GOeXEMEtRdA/t2+FL0qNQEtIc/NpyHbN4b+tfKH6M8GDFMIseTLNoauGdOeo0r2Rurj6nNRvJjOctlG2+aQ3G2FUit7K6UDeUMzqq1mmLbri7PLPIPTztIDXe6uJA+5pPGCehmzVp+kY96l53gBWqIcFD5pHhJi6ESX8++LVlKzxmWYdM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ey71VMHzaNjhr8Zv+O3Vww==; 5:nwTrkxUuWWMQ4NjmwumbDw9zLquko1rgYbaNfiHA6g6ud6HxOjwWfK9rJi+lEt4G2T34DTTEzAjuIUWMv6j1pA4H+2cyOZdfOG8O0vFJPd8qfdnUX621fUsQ26QdEgEiiYhl3mii8JQucaGF9avW6Q==; 24:c7dH9+uNnEUuRYYLCzz1+xM0UQI7dra46ReXiX5PCvdSzWmGRkf1YRR/EklufsTHUM+EcubN6RsJRkZks1V/QuhqTc8oKkbpR3dff7BLgq0=; 7:5umCBnePm8LAWBBaQ2fBlpzDLsSzN7R6ua7QJ12Nci7ISdyR+5zqcP46hMejP8TReWJuSQP7cOOaJTm4OZ68A/9YDd5yhT/H4Tgu3AsW/LNUxB7ZNjktWpHmvWEkulIoV48Y1E4xPHuwDTMitl+piDMsGtNCTQTBsBN0j+bU4sKJNUspGtLJC/IplTPUjvT42UnVhaeh6ey6hJVr4aNrXNBE6s4tb+4vElKBkvaeq5k= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: xilinx.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 19 Oct 2017 16:20:20.1184 (UTC) X-MS-Exchange-CrossTenant-Id: 657af505-d5df-48d0-8300-c31994686c5c X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=657af505-d5df-48d0-8300-c31994686c5c; Ip=[149.199.60.83]; Helo=[xsj-pvapsmtpgw01] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY1PR02MB1334 X-detected-operating-system: by eggs.gnu.org: Windows 7 or 8 [fuzzy] X-Received-From: 104.47.33.88 Subject: [Qemu-devel] [PATCH v3 12/46] hw/dma: Replace fprintf(stderr, "*\n" with error_report() 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: alistair23@gmail.com, armbru@redhat.com, alistair.francis@xilinx.com Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" Replace a large number of the fprintf(stderr, "*\n" calls with error_report(). The functions were renamed with these commands and then compiler issues where manually fixed. find ./* -type f -exec sed -i \ 'N;N;N;N;N;N;N;N;N;N;N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2);|Ig}' \ {} + find ./* -type f -exec sed -i \ 'N;N;N;N;N;N;N;N;N;N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2);|Ig}' \ {} + find ./* -type f -exec sed -i \ 'N;N;N;N;N;N;N;N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2);|Ig}' \ {} + find ./* -type f -exec sed -i \ 'N;N;N;N;N;N;N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2);|Ig}' \ {} + find ./* -type f -exec sed -i \ 'N;N;N;N;N;N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2);|Ig}' \ {} + find ./* -type f -exec sed -i \ 'N;N;N;N;N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2);|Ig}' \ {} + find ./* -type f -exec sed -i \ 'N;N;N;N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2);|Ig}' \ {} + find ./* -type f -exec sed -i \ 'N;N;N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2);|Ig}' \ {} + find ./* -type f -exec sed -i \ 'N;N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2);|Ig}' \ {} + find ./* -type f -exec sed -i \ 'N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2);|Ig}' \ {} + find ./* -type f -exec sed -i \ 'N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2);|Ig}' \ {} + Some lines where then manually tweaked to pass checkpatch. Signed-off-by: Alistair Francis --- V3: - Remove ""s V2: - Split hw patch into individual directories hw/dma/omap_dma.c | 26 ++++++++++++++------------ hw/dma/soc_dma.c | 36 ++++++++++++++++++------------------ 2 files changed, 32 insertions(+), 30 deletions(-) diff --git a/hw/dma/omap_dma.c b/hw/dma/omap_dma.c index abd18c67ea..5d7fe06d98 100644 --- a/hw/dma/omap_dma.c +++ b/hw/dma/omap_dma.c @@ -18,6 +18,7 @@ * with this program; if not, see . */ #include "qemu/osdep.h" +#include "qemu/error-report.h" #include "qemu-common.h" #include "qemu/timer.h" #include "hw/arm/omap.h" @@ -1898,13 +1899,13 @@ static void omap_dma4_write(void *opaque, hwaddr addr, omap_dma_reset(s->dma); s->ocp = value & 0x3321; if (((s->ocp >> 12) & 3) == 3) /* MIDLEMODE */ - fprintf(stderr, "%s: invalid DMA power mode\n", __func__); + error_report("%s: invalid DMA power mode", __func__); return; case 0x78: /* DMA4_GCR */ s->gcr = value & 0x00ff00ff; if ((value & 0xff) == 0x00) /* MAX_CHANNEL_FIFO_DEPTH */ - fprintf(stderr, "%s: wrong FIFO depth in GCR\n", __func__); + error_report("%s: wrong FIFO depth in GCR", __func__); return; case 0x80 ... 0xfff: @@ -1934,8 +1935,8 @@ static void omap_dma4_write(void *opaque, hwaddr addr, ch->buf_disable = (value >> 25) & 1; ch->src_sync = (value >> 24) & 1; /* XXX For CamDMA must be 1 */ if (ch->buf_disable && !ch->src_sync) - fprintf(stderr, "%s: Buffering disable is not allowed in " - "destination synchronised mode\n", __func__); + error_report("%s: Buffering disable is not allowed in " + "destination synchronised mode", __func__); ch->prefetch = (value >> 23) & 1; ch->bs = (value >> 18) & 1; ch->transparent_copy = (value >> 17) & 1; @@ -1946,8 +1947,8 @@ static void omap_dma4_write(void *opaque, hwaddr addr, ch->priority = (value & 0x0040) >> 6; ch->fs = (value & 0x0020) >> 5; if (ch->fs && ch->bs && ch->mode[0] && ch->mode[1]) - fprintf(stderr, "%s: For a packet transfer at least one port " - "must be constant-addressed\n", __func__); + error_report("%s: For a packet transfer at least one port " + "must be constant-addressed", __func__); ch->sync = (value & 0x001f) | ((value >> 14) & 0x0060); /* XXX must be 0x01 for CamDMA */ @@ -1977,8 +1978,8 @@ static void omap_dma4_write(void *opaque, hwaddr addr, ch->endian[1] =(value >> 19) & 1; ch->endian_lock[1] =(value >> 18) & 1; if (ch->endian[0] != ch->endian[1]) - fprintf(stderr, "%s: DMA endianness conversion enable attempt\n", - __func__); + error_report("%s: DMA endianness conversion enable attempt", + __func__); ch->write_mode = (value >> 16) & 3; ch->burst[1] = (value & 0xc000) >> 14; ch->pack[1] = (value & 0x2000) >> 13; @@ -1986,12 +1987,13 @@ static void omap_dma4_write(void *opaque, hwaddr addr, ch->burst[0] = (value & 0x0180) >> 7; ch->pack[0] = (value & 0x0040) >> 6; ch->translate[0] = (value & 0x003c) >> 2; - if (ch->translate[0] | ch->translate[1]) - fprintf(stderr, "%s: bad MReqAddressTranslate sideband signal\n", - __func__); + if (ch->translate[0] | ch->translate[1]) { + error_report("%s: bad MReqAddressTranslate sideband signal", + __func__); + } ch->data_type = 1 << (value & 3); if ((value & 3) == 3) { - printf("%s: bad data_type for DMA channel\n", __func__); + error_report("%s: bad data_type for DMA channel", __func__); ch->data_type >>= 1; } break; diff --git a/hw/dma/soc_dma.c b/hw/dma/soc_dma.c index 9bb499bf9c..45516241c6 100644 --- a/hw/dma/soc_dma.c +++ b/hw/dma/soc_dma.c @@ -18,6 +18,7 @@ * with this program; if not, see . */ #include "qemu/osdep.h" +#include "qemu/error-report.h" #include "qemu-common.h" #include "qemu/timer.h" #include "hw/arm/soc_dma.h" @@ -270,11 +271,11 @@ void soc_dma_port_add_fifo(struct soc_dma_s *soc, hwaddr virt_base, if (entry->type == soc_dma_port_mem) { if (entry->addr <= virt_base && entry->addr + entry->u.mem.size > virt_base) { - fprintf(stderr, "%s: FIFO at %"PRIx64 - " collides with RAM region at %"PRIx64 - "-%"PRIx64 "\n", __func__, - virt_base, entry->addr, - (entry->addr + entry->u.mem.size)); + error_report("%s: FIFO at %"PRIx64 + " collides with RAM region at %"PRIx64 + "-%"PRIx64, __func__, + virt_base, entry->addr, + (entry->addr + entry->u.mem.size)); exit(-1); } @@ -284,9 +285,9 @@ void soc_dma_port_add_fifo(struct soc_dma_s *soc, hwaddr virt_base, while (entry < dma->memmap + dma->memmap_size && entry->addr <= virt_base) { if (entry->addr == virt_base && entry->u.fifo.out == out) { - fprintf(stderr, "%s: FIFO at %"PRIx64 - " collides FIFO at %"PRIx64 "\n", - __func__, virt_base, entry->addr); + error_report("%s: FIFO at %"PRIx64 + " collides FIFO at %"PRIx64, + __func__, virt_base, entry->addr); exit(-1); } @@ -321,11 +322,11 @@ void soc_dma_port_add_mem(struct soc_dma_s *soc, uint8_t *phys_base, if ((entry->addr >= virt_base && entry->addr < virt_base + size) || (entry->addr <= virt_base && entry->addr + entry->u.mem.size > virt_base)) { - fprintf(stderr, "%s: RAM at %"PRIx64 "-%"PRIx64 - " collides with RAM region at %"PRIx64 - "-%"PRIx64 "\n", __func__, - virt_base, virt_base + size, - entry->addr, entry->addr + entry->u.mem.size); + error_report("%s: RAM at %"PRIx64 "-%"PRIx64 + " collides with RAM region at %"PRIx64 + "-%"PRIx64, __func__, + virt_base, virt_base + size, + entry->addr, entry->addr + entry->u.mem.size); exit(-1); } @@ -334,11 +335,10 @@ void soc_dma_port_add_mem(struct soc_dma_s *soc, uint8_t *phys_base, } else { if (entry->addr >= virt_base && entry->addr < virt_base + size) { - fprintf(stderr, "%s: RAM at %"PRIx64 "-%"PRIx64 - " collides with FIFO at %"PRIx64 - "\n", __func__, - virt_base, virt_base + size, - entry->addr); + error_report("%s: RAM at %"PRIx64 "-%"PRIx64 + " collides with FIFO at %"PRIx64, + __func__, virt_base, virt_base + size, + entry->addr); exit(-1); } From patchwork Thu Oct 19 16:16:20 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alistair Francis X-Patchwork-Id: 828211 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; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=xilinx.onmicrosoft.com header.i=@xilinx.onmicrosoft.com header.b="XuDQgpFS"; 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 3yHvYj3xSpz9ryT for ; Fri, 20 Oct 2017 03:30:49 +1100 (AEDT) Received: from localhost ([::1]:50112 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e5DiZ-0004cs-JG for incoming@patchwork.ozlabs.org; Thu, 19 Oct 2017 12:30:47 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:55283) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e5DYZ-0004T5-HW for qemu-devel@nongnu.org; Thu, 19 Oct 2017 12:20:30 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1e5DYV-0001Bo-Kk for qemu-devel@nongnu.org; Thu, 19 Oct 2017 12:20:27 -0400 Received: from mail-sn1nam02on0053.outbound.protection.outlook.com ([104.47.36.53]:55424 helo=NAM02-SN1-obe.outbound.protection.outlook.com) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1e5DYV-0001BN-38 for qemu-devel@nongnu.org; Thu, 19 Oct 2017 12:20:23 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=xilinx.onmicrosoft.com; s=selector1-xilinx-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=5F8odTOKyd4EAlqWedXzc173xTgLRPPUD2z9h6Hx3OE=; b=XuDQgpFSeUgsmfwhuPLcGpS5RmYMVGsplXuo0sYIC7FrsHisHIgF2A9GT8y/RX9bAd/wPEW8ygvrPFbS3Kmti9Rbey8NFq8PrcioUrBqLcR66HoYD7z9H7n1I3VkXZIw5vaVUOptPtaRMlEHCgWNK9dQ62vXXFkMHhB7ZSty978= Received: from SN4PR0201CA0067.namprd02.prod.outlook.com (10.171.31.157) by CY4PR02MB3384.namprd02.prod.outlook.com (10.165.89.155) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.77.7; Thu, 19 Oct 2017 16:20:20 +0000 Received: from CY1NAM02FT039.eop-nam02.prod.protection.outlook.com (2a01:111:f400:7e45::208) by SN4PR0201CA0067.outlook.office365.com (2603:10b6:803:20::29) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.156.4 via Frontend Transport; Thu, 19 Oct 2017 16:20:20 +0000 Authentication-Results: spf=pass (sender IP is 149.199.60.100) smtp.mailfrom=xilinx.com; redhat.com; dkim=none (message not signed) header.d=none;redhat.com; dmarc=bestguesspass action=none header.from=xilinx.com; Received-SPF: Pass (protection.outlook.com: domain of xilinx.com designates 149.199.60.100 as permitted sender) receiver=protection.outlook.com; client-ip=149.199.60.100; helo=xsj-pvapsmtpgw02; Received: from xsj-pvapsmtpgw02 (149.199.60.100) by CY1NAM02FT039.mail.protection.outlook.com (10.152.75.140) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.20.77.10 via Frontend Transport; Thu, 19 Oct 2017 16:20:20 +0000 Received: from unknown-38-66.xilinx.com ([149.199.38.66]:37659 helo=xsj-pvapsmtp01) by xsj-pvapsmtpgw02 with esmtp (Exim 4.63) (envelope-from ) id 1e5DYR-0007vt-F4; Thu, 19 Oct 2017 09:20:19 -0700 Received: from [127.0.0.1] (helo=localhost) by xsj-pvapsmtp01 with smtp (Exim 4.63) (envelope-from ) id 1e5DYR-0002va-C8; Thu, 19 Oct 2017 09:20:19 -0700 Received: from xsj-pvapsmtp01 (maildrop.xilinx.com [149.199.38.66]) by xsj-smtp-dlp2.xlnx.xilinx.com (8.13.8/8.13.1) with ESMTP id v9JGKEJd006432; Thu, 19 Oct 2017 09:20:14 -0700 Received: from [172.19.2.220] (helo=localhost.localdomain) by xsj-pvapsmtp01 with esmtp (Exim 4.63) (envelope-from ) id 1e5DYM-0002sT-Df; Thu, 19 Oct 2017 09:20:14 -0700 From: Alistair Francis To: Date: Thu, 19 Oct 2017 09:16:20 -0700 Message-ID: X-Mailer: git-send-email 2.11.0 In-Reply-To: References: X-RCIS-Action: ALLOW X-TM-AS-Product-Ver: IMSS-7.1.0.1224-8.1.0.1062-23404.005 X-TM-AS-User-Approved-Sender: Yes;Yes X-EOPAttributedMessage: 0 X-MS-Office365-Filtering-HT: Tenant X-Forefront-Antispam-Report: CIP:149.199.60.100; IPV:NLI; CTRY:US; EFV:NLI; SFV:NSPM; SFS:(10009020)(6009001)(39860400002)(346002)(376002)(2980300002)(438002)(189002)(199003)(39060400002)(106002)(305945005)(8676002)(81156014)(81166006)(356003)(76176999)(50986999)(6916009)(5660300001)(4326008)(2950100002)(5003940100001)(2351001)(2906002)(478600001)(106466001)(47776003)(33646002)(63266004)(6666003)(77096006)(50226002)(36756003)(316002)(9786002)(36386004)(118296001)(189998001)(48376002)(54906003)(50466002)(8936002)(16586007)(107986001)(5001870100001); DIR:OUT; SFP:1101; SCL:1; SRVR:CY4PR02MB3384; H:xsj-pvapsmtpgw02; FPR:; SPF:Pass; PTR:unknown-60-100.xilinx.com,xapps1.xilinx.com; MX:1; A:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; CY1NAM02FT039; 1:NmQbPv9wi0YzpY4THRrL+iqeHXX78fM9SMTgEGiKiAPJuQoo2Xae+iGPVYZF9BylQgYbzp8RzOQ/w4HOCQyPcc0Aw0BTjxRHIplVOqKOLL/x7dWV5IZlky/YX2UmDp4F MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 9c7bdfbe-8e01-4e3a-6b53-08d5170d4b20 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001)(2017030254152)(8251501002)(2017052603199)(201703131423075)(201703031133081)(201702281549075); SRVR:CY4PR02MB3384; X-Microsoft-Exchange-Diagnostics: 1; CY4PR02MB3384; 3:iTPgePBs7pGKxiKFJE1e+/HM2p+cFYDvUazylquJzOvBWMkuBUpEAq/rLk71SD9fFimiFTIFdeJELaMItdMrpsyFPE3cEHTYmhc3whOsRO1yJbcfeEU92AhwEF8Ag5s4l+PNy/QRB9ij+NPmlnotHIRfAyLvd+fNNKdhhqb7EOumlADD4l53D922xiTkDGO853WatKBwiLVKo+sLJM7g7ZCvlohdY/VgujuGJUAPqsY2uuf3c59hn/PYhBXGvqzjL4rYqPaQdHmUxInhHfTlsck+VPPl8Sco5EoSWmy8zf7uFgsRLl4d5COtXwQGc+A1kkrG8pqBkk3LPuneFvfCeXbCXwH7VY/pXu2SvuvmTSA=; 25:KhiePkLVKhDJX9R6YLUepVCxAkXVEw6MUV+vxxZiy+Tp8LVdRevQ0NT9npf2GyswNZL9dhHoTNPsTK+ryhGAnf52iAQFdm38U9ziZZS2Q5ATQjGvywjLhA1qJYLUq4HESYpiXbqxPQN9qxdxDXdOhOR/zmzBtunEKyeJZThHmjFC+y8hLE5e/Oa7baybbwQyOEMNauOn1MpnfTYFgRHgxdW+sHBH79gbmYmN+v5VnLhoHdEuD7MuZShDstJCD99r8+ooXBg6h6YZdCQSHd8hSzsnORAKo4PHuzMSTt/7ucNZOP0ITS1rprxEuoBQ7O2zboPT3NL0h8oNi8u4Q8lnZA== X-MS-TrafficTypeDiagnostic: CY4PR02MB3384: X-Microsoft-Exchange-Diagnostics: 1; CY4PR02MB3384; 31:f6W/H3buAUjXEhRyuHgeZoPRB1CTlg6UHD+e9EHN+yWQ0uE9KA0NmPHf8+SCIfM0EFogqAx90JxcFbUFm7LnaE4/LtWVWjoGN9Q1C7CMzTslVu5bSozY4mDWrx6bfTnfBatP1mGqCq4SyL3RlKp03Fl/BH/oKLeGor7bxZaH+CeFyE7iA01H4/7a27SmNt2QPRIGB+SZorWmBUyWh3xxU8niel82CzKpCPOXnjF/q+E=; 20:F6ebN+AXkKFFcpPMJTOj6gSKbTebWKQBEc7ChgwJLt77vX/ij0QDiXnwaRsMeZutLS+wWwS6h9Is2YRu+YTwo2Vg/uQBW0DU3XKn9OVxxyzn+6OvjklEKyIZKHyd8vl3bfqOwSEXwCyOWa+FYgR2qpveJAuIVXFQkfZpYWq+8Qw+xCtmy+odLsctEW41U9QIxPNBtkL7FQGe1ZHC040ujCFzyF5KFFULW9wMgj2iBdXy+5CUxH+6jI7ZgdQsALrGXQOSBPYmVcvEsioitlc5CAqgg6a3u8s7lX0gDqJ4eRcW2mL6Pc3+nox66/nE8xUzqZxz6ZDDGez+2hh0MdH3/hoRcGHdAvcVwaymiXESbm4VpN/JcUtPY1N0PBZwDMvQ+BfQCEWj13ArskFQjUuBhDligg+AA/oNHUCxZq04nJjfX3z7Xr0XFxUejr568FCxjOUsWWayCaEq9iR5xk/p6IB+66ubGXRRJJOl2HsCbJyfkZrP+gfVAgd/F3jAEhpT X-Exchange-Antispam-Report-Test: UriScan:(788757137089)(192813158149592); X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(100000700101)(100105000095)(100000701101)(100105300095)(100000702101)(100105100095)(6040450)(2401047)(5005006)(8121501046)(10201501046)(93006095)(93004095)(100000703101)(100105400095)(3002001)(6055026)(6041248)(20161123562025)(20161123558100)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123555025)(20161123560025)(20161123564025)(6072148)(201708071742011)(100000704101)(100105200095)(100000705101)(100105500095); SRVR:CY4PR02MB3384; BCL:0; PCL:0; RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095); SRVR:CY4PR02MB3384; X-Microsoft-Exchange-Diagnostics: 1; CY4PR02MB3384; 4:Nh8qHxTEnmhP/zQfyqNHwUNnAAPi8a8MEJVCCe+aSn8MZbNC/tLlbd44tJFgqnKhr7Gis8Pk5DVpFRbzgX3El3FE24wWj1sF24lUFkHpC5xKbMawnIJb8yBVleOi/XMahL6Z1HtGEWRmGGfKCXlZ7JtZOp4XNpjIncs8/FweIroB30lfjTCY0gB+w6MZF0S2gtrs7jZWWLTF2kT88TzyPQAHkw3RgE/y6TexePbADLDpK3PHFa8QIm1tmAFokLtMVvN4DbftaYEeSuMGfV0DP4deaQmfTnRY210eKUsiq6LTsXQ0aaruxyP4H3UJDQk9TfEmE9mYRy3REQR7CDLxeQ== X-Forefront-PRVS: 0465429B7F X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; CY4PR02MB3384; 23:KspjawVLprAzxNM2t4uscPvcFz2VV4y7mq138a2+h?= FRfAkX+lnobdP99fhb0CySqntMCeekq6XTJV0SNxyBISdMcciNJLE/XU8IfFB8aLb698h7BT/j8riZbHxWo1sJ4ffoYiV1VYaVZylYYYcVExxLuDA6TgX+rg/ASlFaXcB0TvMkpXGDHKEaOPKBg2w+TebSNgAP+qGYrzEJlBz3FK9s2M3q/26MGDQOf6wS1Wse9CcD5/a8b5qckniGPj+Js7Vevlku9fPH+6JUquyfNhG25ay3Rg4LBlKMzJoUbxgVzGpIfnBOQcDQx6k9X12NTHUGAtmoIFqp6gndHWqs48BIRD+qn/MhUzHOOVCjgGkcHNY2p0Uq9/8+Uv6PeqE5II5CYGqVbgdJ6Hz6yodcHZhJ7kfSDGmVna1VqdU222LQrUhVa2Iq7mb8J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Ldnm858rzE6FY5/O8Tf4h9AZ6SvK4CBww4RAdb6urMSSTXW8NMeRezmwBB6qT88tC0yHNy8Ns8m6VLQfZgwUmXTA8yPObO/A==; 24:2hL/nHu17CmKMBIigs2Ig1kkD9xRWpDPARFIqQOJ0d/b5N16pdH3dJl93M3T+BaXQ0I/kuxVQO2HQ/4+IQvq7fXwIVXylhvRQBtrq4kzFYU=; 7:AKhKOf61/gmb7sDodYAHEYP5v2STfCZ3OGlpuF6nZRhLq38a8M0L8p9YEJx+VI2O2a4nF8q3Nmb1LZ80OUHWLZuUgRityQ9IBoWJ36zAAfvFEYSBZsL6MDookW6iCkV8gczTooUp0KJ8/6CPm0fU1nXTwaqKLWTuWI50X2jOncBX8VSaLnspC3v+sJQODX3VOxrhPiXAcL1VtRg2iTkmxzKqBpkVdlRBe/yoTVtDokI= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: xilinx.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 19 Oct 2017 16:20:20.2566 (UTC) X-MS-Exchange-CrossTenant-Id: 657af505-d5df-48d0-8300-c31994686c5c X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=657af505-d5df-48d0-8300-c31994686c5c; Ip=[149.199.60.100]; Helo=[xsj-pvapsmtpgw02] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY4PR02MB3384 X-detected-operating-system: by eggs.gnu.org: Windows 7 or 8 [fuzzy] X-Received-From: 104.47.36.53 Subject: [Qemu-devel] [PATCH v3 13/46] hw/gpio: Replace fprintf(stderr, "*\n" with error_report() 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: alistair23@gmail.com, armbru@redhat.com, alistair.francis@xilinx.com Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" Replace a large number of the fprintf(stderr, "*\n" calls with error_report(). The functions were renamed with these commands and then compiler issues where manually fixed. find ./* -type f -exec sed -i \ 'N;N;N;N;N;N;N;N;N;N;N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2);|Ig}' \ {} + find ./* -type f -exec sed -i \ 'N;N;N;N;N;N;N;N;N;N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2);|Ig}' \ {} + find ./* -type f -exec sed -i \ 'N;N;N;N;N;N;N;N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2);|Ig}' \ {} + find ./* -type f -exec sed -i \ 'N;N;N;N;N;N;N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2);|Ig}' \ {} + find ./* -type f -exec sed -i \ 'N;N;N;N;N;N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2);|Ig}' \ {} + find ./* -type f -exec sed -i \ 'N;N;N;N;N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2);|Ig}' \ {} + find ./* -type f -exec sed -i \ 'N;N;N;N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2);|Ig}' \ {} + find ./* -type f -exec sed -i \ 'N;N;N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2);|Ig}' \ {} + find ./* -type f -exec sed -i \ 'N;N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2);|Ig}' \ {} + find ./* -type f -exec sed -i \ 'N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2);|Ig}' \ {} + find ./* -type f -exec sed -i \ 'N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2);|Ig}' \ {} + Some lines where then manually tweaked to pass checkpatch. Signed-off-by: Alistair Francis --- V2: - Split hw patch into individual directories hw/gpio/omap_gpio.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/gpio/omap_gpio.c b/hw/gpio/omap_gpio.c index 08472193b5..57aa2e54f5 100644 --- a/hw/gpio/omap_gpio.c +++ b/hw/gpio/omap_gpio.c @@ -399,7 +399,7 @@ static void omap2_gpio_module_write(void *opaque, hwaddr addr, case 0x10: /* GPIO_SYSCONFIG */ if (((value >> 3) & 3) == 3) - fprintf(stderr, "%s: bad IDLEMODE value\n", __func__); + error_report("%s: bad IDLEMODE value", __func__); if (value & 2) omap2_gpio_module_reset(s); s->config[0] = value & 0x1d; From patchwork Thu Oct 19 16:16:24 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Alistair Francis X-Patchwork-Id: 828196 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; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=xilinx.onmicrosoft.com header.i=@xilinx.onmicrosoft.com header.b="mn4NkUeY"; 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 3yHvPg6L6Gz9t4P for ; Fri, 20 Oct 2017 03:23:51 +1100 (AEDT) Received: from localhost ([::1]:50075 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e5Dbq-0006jN-05 for incoming@patchwork.ozlabs.org; Thu, 19 Oct 2017 12:23:50 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:55275) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e5DYZ-0004T2-6Q for qemu-devel@nongnu.org; Thu, 19 Oct 2017 12:20:28 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1e5DYV-0001CH-Ut for qemu-devel@nongnu.org; Thu, 19 Oct 2017 12:20:27 -0400 Received: from mail-co1nam03on0052.outbound.protection.outlook.com ([104.47.40.52]:54656 helo=NAM03-CO1-obe.outbound.protection.outlook.com) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1e5DYV-0001BY-HP for qemu-devel@nongnu.org; Thu, 19 Oct 2017 12:20:23 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=xilinx.onmicrosoft.com; s=selector1-xilinx-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=0k997gTeJRJB9FW+XCkDt33zfI3eSrWKxj/qyah8FNI=; b=mn4NkUeYfFjYNfB6BtYvkh5BsTyqZX72vx5yjo6i6VZ4uTVPh+oD2/ksHxSuuCRQ+aijdtHGmpywMdokliNNrFhZ7VgVcnrlrwRBzoHqWUnO/iD63+M5adqVLAXdl2mPj3b3CgHkiuK7KXLyVGaw0Ud7JLJh9FKHoWpysxY9AyI= Received: from SN4PR0201CA0017.namprd02.prod.outlook.com (2603:10b6:803:2b::27) by DM2PR02MB1339.namprd02.prod.outlook.com (2a01:111:e400:50c8::26) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.77.7; Thu, 19 Oct 2017 16:20:20 +0000 Received: from CY1NAM02FT028.eop-nam02.prod.protection.outlook.com (2a01:111:f400:7e45::200) by SN4PR0201CA0017.outlook.office365.com (2603:10b6:803:2b::27) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.156.4 via Frontend Transport; Thu, 19 Oct 2017 16:20:20 +0000 Authentication-Results: spf=pass (sender IP is 149.199.60.83) smtp.mailfrom=xilinx.com; redhat.com; dkim=none (message not signed) header.d=none;redhat.com; dmarc=bestguesspass action=none header.from=xilinx.com; Received-SPF: Pass (protection.outlook.com: domain of xilinx.com designates 149.199.60.83 as permitted sender) receiver=protection.outlook.com; client-ip=149.199.60.83; helo=xsj-pvapsmtpgw01; Received: from xsj-pvapsmtpgw01 (149.199.60.83) by CY1NAM02FT028.mail.protection.outlook.com (10.152.75.132) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.20.77.10 via Frontend Transport; Thu, 19 Oct 2017 16:20:20 +0000 Received: from unknown-38-66.xilinx.com ([149.199.38.66] helo=xsj-pvapsmtp01) by xsj-pvapsmtpgw01 with esmtp (Exim 4.63) (envelope-from ) id 1e5DYR-0008V3-Cm; Thu, 19 Oct 2017 09:20:19 -0700 Received: from [127.0.0.1] (helo=localhost) by xsj-pvapsmtp01 with smtp (Exim 4.63) (envelope-from ) id 1e5DYR-0002va-93; Thu, 19 Oct 2017 09:20:19 -0700 Received: from xsj-pvapsmtp01 (mailhub.xilinx.com [149.199.38.66]) by xsj-smtp-dlp2.xlnx.xilinx.com (8.13.8/8.13.1) with ESMTP id v9JGKHRC006572; Thu, 19 Oct 2017 09:20:17 -0700 Received: from [172.19.2.220] (helo=localhost.localdomain) by xsj-pvapsmtp01 with esmtp (Exim 4.63) (envelope-from ) id 1e5DYP-0002vD-Oj; Thu, 19 Oct 2017 09:20:17 -0700 From: Alistair Francis To: Date: Thu, 19 Oct 2017 09:16:24 -0700 Message-ID: <2725be8415eb76313ed3b83a2b1971d3ae879aa3.1508390588.git.alistair.francis@xilinx.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: References: MIME-Version: 1.0 X-RCIS-Action: ALLOW X-TM-AS-Product-Ver: IMSS-7.1.0.1224-8.1.0.1062-23404.005 X-TM-AS-User-Approved-Sender: Yes;Yes X-EOPAttributedMessage: 0 X-MS-Office365-Filtering-HT: Tenant X-Forefront-Antispam-Report: CIP:149.199.60.83; IPV:NLI; CTRY:US; EFV:NLI; SFV:NSPM; SFS:(10009020)(6009001)(346002)(39860400002)(376002)(2980300002)(438002)(189002)(199003)(4326008)(47776003)(8676002)(81156014)(8936002)(36386004)(81166006)(36756003)(63266004)(305945005)(76176999)(5820100001)(2351001)(50986999)(77096006)(356003)(316002)(54906003)(6666003)(33646002)(106466001)(189998001)(118296001)(50226002)(23676002)(39060400002)(2950100002)(9786002)(50466002)(6916009)(5660300001)(106002)(478600001)(2906002)(2870700001)(107986001); DIR:OUT; SFP:1101; SCL:1; SRVR:DM2PR02MB1339; H:xsj-pvapsmtpgw01; FPR:; SPF:Pass; PTR:unknown-60-83.xilinx.com; MX:1; A:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; CY1NAM02FT028; 1:FtzU36GPpN9UElftg1otOdLBRpzdcymbAt8PEpYsoX4kCIXgrAE8Y3WJtvAfbuOO2uR2izLPERsXCTZFK/qiLdKhfcdQp+15Vs+nkuvUK4WPN0JOnWU1n7bnAjpE02oM X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 23ccaabe-cf75-4a70-df07-08d5170d4b09 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001)(2017030254168)(8251501002)(4534016)(4602075)(4627075)(201703031133081)(201702281549075)(2017052603199)(201703131423091); SRVR:DM2PR02MB1339; X-Microsoft-Exchange-Diagnostics: 1; DM2PR02MB1339; 3:lIsQl55Aal1laAKG5dixjz1m8AIw6E7BvcPHWmubiEdx6Ua0uAY/LqflQyMor2PutFLSKtSWzRRC4d06sV7ciL/15LPz2XltasABMlQzJ3veECs9HDg7IVDazgKJrYBOcqx9Y+ZbB0wiAFjCTwBf8BmFnkcYcOmnh09rXhOCQyw70djPs9nf5vyCFWYmXxA8Ri2OvI/+YWu8oQXhQSY/6cs+eUqwKxxJm0O8BDMaBC6WvWRqAIJ/qGheTiUo4RQpcyDGQN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AIv9z+KJWd0+Cg7uzmo2mRZMRZ0p+WfuUVNBPM7x20YEFpqi7Tnrt4yTF81V/VJxZH32mWilFPA8X1N4NpJSYz/y+Dzfj3nA6Bsrj7xvRnp+0Ux1lJLipr0Mbp2TGpCzyrzdM9MOauXlF/yx4RpDhP9Qhi/1F8fKvfszcGoPxbiJjRpjxU6gnD2k3dWyegh X-Exchange-Antispam-Report-Test: UriScan:(788757137089)(192813158149592); X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(100000700101)(100105000095)(100000701101)(100105300095)(100000702101)(100105100095)(6040450)(2401047)(5005006)(8121501046)(100000703101)(100105400095)(93006095)(93004095)(3002001)(10201501046)(6055026)(6041248)(20161123560025)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123555025)(20161123564025)(20161123562025)(20161123558100)(6072148)(201708071742011)(100000704101)(100105200095)(100000705101)(100105500095); SRVR:DM2PR02MB1339; BCL:0; PCL:0; RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095); SRVR:DM2PR02MB1339; X-Microsoft-Exchange-Diagnostics: 1; DM2PR02MB1339; 4:EryWouHcGXxM87q53oqr8I8VrMAcJhh1DovMmqZqtXwmDgFn8W0dkF/JThdjeHERwwjz6KK+JSb+FyDtR0nzw/aBYCYD743anCKN64mz5c9vBpdlM/7IG4crUYWG1vRk7EqydlruxJDTJMJhxJK/zp+UKfXqj3wZyd8+8sN5GFKHnut6ZbFGqH1OsSqVoSKQrrEUwzugdogUlJOhnEj+8s4B70T/r+nx16+7+PlUid9wmQ/mOHte72/wBCtUpFfw+PrFW1KLpyF87XExqmma4iPsMzxedjxASfkDcQeulfITLrci6MnFPmy5yfwwB1YZysa4UhzQT/fdB2SobZWYWQ== X-Forefront-PRVS: 0465429B7F X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; DM2PR02MB1339; 23:nPq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B1339; 6:emk1TvJuU/+MmFdAG07HUl6glFIYI+2VIMlaD9Dxcz1iepr7Bu0BxAe6ez0sXFJSyrtdNCYosKwOdRzKWKr4TKNAlth8vmjKsiPGEXZVz+08B3aV9VgZNX3dEwbFAiOi2H9lP5GF16rDauB0h6SIe7UUh3FuXFZE/e3q3b6JQTskC3eh7mCqqF/4x0gg6kO0xYJnDh+RvkEFZNOCarV6q2PI8jeWRpxGBY/fMkfpXz1j2o5hYhGxDYWcDRGhvcLPcXwL4XppsbEUQFYUz4MxSgF8tc9fefVOxTMn3/nuPiLBCJmdRDV8myLWev2yjvk6JGQmHjMVXM0R4BCMgZuFKw==; 5:XvK157FXrjYVL4lqhDUW7/UgWNk0yeoQMi79bqYZQUiIE2IvZ7I85vqjlnLZmXTG4xi/dC39i1iq6EO16YV2TR6r6NVCL/yiVr2H33tkCMPuCK+83g6c8iYvan6YEDASp8QWwCt/5PzIofa0UUTJTA==; 24:Hn7rfIabsawNRkBkuae3e2Fvm78GEbDvdlOlcqIFUBpTnhRCnPTqCS7ZfuCABh68DKUTIQmHmUOYEcpqCg1Xi7illlghvC3BtaPLD1GbrWA=; 7:EJQLv5FBx2m4i6dnuXhIdh8MLYRLzuqi/DZNG/8Ofa8vnr10KpvmUsGEW2fYuNz5KXCWyfCwgHJuxQzlFVkco2/OcnDTxSx0qF8WcNal4gSUnAGE6faWjCaBC7mlVM+ZpkBCq80dgX9p4KTNQBzmhZzZoDHFobP9wKUrqrr8MsRLcyQfAUT85HS4aIGJWK1a45b4ZkHqj+i5EPt4Qu7enmJh56Utd4Aov8dLSGMs6Gg= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: xilinx.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 19 Oct 2017 16:20:20.0776 (UTC) X-MS-Exchange-CrossTenant-Id: 657af505-d5df-48d0-8300-c31994686c5c X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=657af505-d5df-48d0-8300-c31994686c5c; Ip=[149.199.60.83]; Helo=[xsj-pvapsmtpgw01] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM2PR02MB1339 X-detected-operating-system: by eggs.gnu.org: Windows 7 or 8 [fuzzy] X-Received-From: 104.47.40.52 Subject: [Qemu-devel] [PATCH v3 14/46] hw/i2c: Replace fprintf(stderr, "*\n" with error_report() 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: alistair23@gmail.com, armbru@redhat.com, alistair.francis@xilinx.com Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" Replace a large number of the fprintf(stderr, "*\n" calls with error_report(). The functions were renamed with these commands and then compiler issues where manually fixed. find ./* -type f -exec sed -i \ 'N;N;N;N;N;N;N;N;N;N;N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2);|Ig}' \ {} + find ./* -type f -exec sed -i \ 'N;N;N;N;N;N;N;N;N;N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2);|Ig}' \ {} + find ./* -type f -exec sed -i \ 'N;N;N;N;N;N;N;N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2);|Ig}' \ {} + find ./* -type f -exec sed -i \ 'N;N;N;N;N;N;N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2);|Ig}' \ {} + find ./* -type f -exec sed -i \ 'N;N;N;N;N;N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2);|Ig}' \ {} + find ./* -type f -exec sed -i \ 'N;N;N;N;N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2);|Ig}' \ {} + find ./* -type f -exec sed -i \ 'N;N;N;N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2);|Ig}' \ {} + find ./* -type f -exec sed -i \ 'N;N;N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2);|Ig}' \ {} + find ./* -type f -exec sed -i \ 'N;N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2);|Ig}' \ {} + find ./* -type f -exec sed -i \ 'N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2);|Ig}' \ {} + find ./* -type f -exec sed -i \ 'N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2);|Ig}' \ {} + Some lines where then manually tweaked to pass checkpatch. A "I^2C" was manually replaced with "i2c" in hw/i2c/omap_i2c.c. Signed-off-by: Alistair Francis Reviewed-by: Philippe Mathieu-Daudé --- V3: - Replace "I&2C" V2: - Split hw patch into individual directories hw/i2c/omap_i2c.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/hw/i2c/omap_i2c.c b/hw/i2c/omap_i2c.c index 26e3e5ebf6..e9da7f9f51 100644 --- a/hw/i2c/omap_i2c.c +++ b/hw/i2c/omap_i2c.c @@ -340,13 +340,13 @@ static void omap_i2c_write(void *opaque, hwaddr addr, break; } if ((value & (1 << 15)) && !(value & (1 << 10))) { /* MST */ - fprintf(stderr, "%s: I^2C slave mode not supported\n", - __func__); + error_report("%s: i2c slave mode not supported", + __func__); break; } if ((value & (1 << 15)) && value & (1 << 8)) { /* XA */ - fprintf(stderr, "%s: 10-bit addressing mode not supported\n", - __func__); + error_report("%s: 10-bit addressing mode not supported", + __func__); break; } if ((value & (1 << 15)) && value & (1 << 0)) { /* STT */ @@ -393,7 +393,7 @@ static void omap_i2c_write(void *opaque, hwaddr addr, omap_i2c_interrupts_update(s); } if (value & (1 << 15)) /* ST_EN */ - fprintf(stderr, "%s: System Test not supported\n", __func__); + error_report("%s: System Test not supported", __func__); break; default: From patchwork Thu Oct 19 16:16:32 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Alistair Francis X-Patchwork-Id: 828200 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; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=xilinx.onmicrosoft.com header.i=@xilinx.onmicrosoft.com header.b="vmvI35bn"; 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 3yHvT13XG2z9t6K for ; Fri, 20 Oct 2017 03:26:45 +1100 (AEDT) Received: from localhost ([::1]:50093 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e5Ded-0000rJ-GF for incoming@patchwork.ozlabs.org; Thu, 19 Oct 2017 12:26:43 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:55421) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e5DYl-0004gC-Vh for qemu-devel@nongnu.org; Thu, 19 Oct 2017 12:20:43 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1e5DYk-0001Nd-RA for qemu-devel@nongnu.org; Thu, 19 Oct 2017 12:20:39 -0400 Received: from mail-sn1nam01on0055.outbound.protection.outlook.com ([104.47.32.55]:28935 helo=NAM01-SN1-obe.outbound.protection.outlook.com) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1e5DYf-0001GE-Qd; Thu, 19 Oct 2017 12:20:34 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=xilinx.onmicrosoft.com; s=selector1-xilinx-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=Fm2gVa9rCj2sRRORDcrGJc2eNwvrJqXUR8YaPLZYRiQ=; b=vmvI35bnPD1S/eQvsTflmy1Uukg10DgrzAbyLjEwJChjue1f7SY/2K3jgHncWtYaCiQbh5BuIyfKuGOv42sSyOw6ef2kTo767P6v8ESvrtLVL99Wqr/lyUYg2Wxyk4CYxhJFee41Gy39HzA7oEI2m3g2Ntgb02LloZIogkx0w8A= Received: from SN4PR0201CA0009.namprd02.prod.outlook.com (2603:10b6:803:2b::19) by DM2PR02MB1338.namprd02.prod.outlook.com (2a01:111:e400:50c8::25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.77.7; Thu, 19 Oct 2017 16:20:31 +0000 Received: from BL2NAM02FT028.eop-nam02.prod.protection.outlook.com (2a01:111:f400:7e46::204) by SN4PR0201CA0009.outlook.office365.com (2603:10b6:803:2b::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.156.4 via Frontend Transport; Thu, 19 Oct 2017 16:20:31 +0000 Authentication-Results: spf=pass (sender IP is 149.199.60.83) smtp.mailfrom=xilinx.com; nongnu.org; dkim=none (message not signed) header.d=none;nongnu.org; dmarc=bestguesspass action=none header.from=xilinx.com; Received-SPF: Pass (protection.outlook.com: domain of xilinx.com designates 149.199.60.83 as permitted sender) receiver=protection.outlook.com; client-ip=149.199.60.83; helo=xsj-pvapsmtpgw01; Received: from xsj-pvapsmtpgw01 (149.199.60.83) by BL2NAM02FT028.mail.protection.outlook.com (10.152.77.165) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.20.77.10 via Frontend Transport; Thu, 19 Oct 2017 16:20:30 +0000 Received: from unknown-38-66.xilinx.com ([149.199.38.66] helo=xsj-pvapsmtp01) by xsj-pvapsmtpgw01 with esmtp (Exim 4.63) (envelope-from ) id 1e5DYb-0008VR-Ue; Thu, 19 Oct 2017 09:20:29 -0700 Received: from [127.0.0.1] (helo=localhost) by xsj-pvapsmtp01 with smtp (Exim 4.63) (envelope-from ) id 1e5DYb-0002xd-Ri; Thu, 19 Oct 2017 09:20:29 -0700 Received: from xsj-pvapsmtp01 (smtp2.xilinx.com [149.199.38.66]) by xsj-smtp-dlp1.xlnx.xilinx.com (8.13.8/8.13.1) with ESMTP id v9JGKPDi017852; Thu, 19 Oct 2017 09:20:25 -0700 Received: from [172.19.2.220] (helo=localhost.localdomain) by xsj-pvapsmtp01 with esmtp (Exim 4.63) (envelope-from ) id 1e5DYX-0002x6-Eb; Thu, 19 Oct 2017 09:20:25 -0700 From: Alistair Francis To: Date: Thu, 19 Oct 2017 09:16:32 -0700 Message-ID: X-Mailer: git-send-email 2.11.0 In-Reply-To: References: X-RCIS-Action: ALLOW X-TM-AS-Product-Ver: IMSS-7.1.0.1224-8.1.0.1062-23404.005 X-TM-AS-User-Approved-Sender: Yes;Yes X-EOPAttributedMessage: 0 X-MS-Office365-Filtering-HT: Tenant X-Forefront-Antispam-Report: CIP:149.199.60.83; IPV:NLI; CTRY:US; EFV:NLI; SFV:NSPM; SFS:(10009020)(6009001)(376002)(39860400002)(346002)(2980300002)(438002)(199003)(189002)(50226002)(50466002)(8676002)(356003)(9786002)(76176999)(106466001)(81156014)(81166006)(47776003)(39060400002)(33646002)(36756003)(50986999)(305945005)(48376002)(118296001)(4326008)(63266004)(2351001)(6916009)(106002)(2906002)(16586007)(36386004)(8936002)(316002)(5660300001)(54906003)(478600001)(2950100002)(5003940100001)(6666003)(189998001)(77096006)(107986001); DIR:OUT; SFP:1101; SCL:1; SRVR:DM2PR02MB1338; H:xsj-pvapsmtpgw01; FPR:; SPF:Pass; PTR:unknown-60-83.xilinx.com; A:1; MX:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BL2NAM02FT028; 1:Daar5AkzxwCfpWkNY3GYTjGewYIrIYJw9khVCqC0mk6BkGaceTN8u6H3I4f8uosWiFAdf4pwsllG+cd40eDq/VAxhWD5bcAhk8lQ6mvOyIh8yduPuE4hk4/TrNypH8KU MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 565ceae5-8f8b-4216-20b1-08d5170d5150 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001)(2017030254152)(8251501002)(2017052603199)(201703131423075)(201703031133081)(201702281549075); SRVR:DM2PR02MB1338; X-Microsoft-Exchange-Diagnostics: 1; DM2PR02MB1338; 3:uZW7Wk9buOMP9ZRVxqtNeaThI6rw4rJGXQskmcFnUkvAE77nzXmHdhsvtJhLw6JwJRBuPRlqlUcNQDHUPPr8+vFkhVtRrYrsd0NxX/K1xqmMTQPl5Qbs50vsr2ueytMhRnmD6LDel3YrCCTaEw+MTjejSoCNPZ8Zij4G7b5/wcYJqJQQhkYxGU1gtQY7moJH/R4y+tgRyxEc14i8CVfHuZ7aou4fC9AnCOxC/utkaortQS/k56JVv9ioddpdAeCJW+5zfFE9HePeA6aMMQ3KUwaHSdq3MokmiLPkP4M6ehtsRAa9nPwvjbVZojJwTjjWRUMrgHc0fZWFJf3rSpY7WDe+xePFiB3ba1fYifL7m3U=; 25:7FFY5cgPwgxoTROrPuSVHX7mmQcnLEQNyVPPJR7Z9BAWE5t3PNbhabpJUZV+aKQ+vNFYGu697KJqdbgN/zD2mxtZpHD0VcmH/ZCxdb2245T0oz1drOwC/cm7HAjmwUXF3sbW8ZFAJhyFGTQRFcYAW3qOufbudRk0Yoft7z2jKrKLTAa3RcTK0hGM5Cc6CkYqmN2g0zm0A2mnEGKaD450bJeC6VL8DX0RjC5DISGGFwFtX1LGRh3cD87Zz3iywCKqY9jEeKchG3SiLoctPQ5QvlQnubibxF1L6yajaV1Xt24K5MQeg122I7ILiOslF9aaFjxhKq4VmlqF/FQJnSal2w== X-MS-TrafficTypeDiagnostic: DM2PR02MB1338: X-Microsoft-Exchange-Diagnostics: 1; DM2PR02MB1338; 31:NBZc0lyf7WgVxCoAj8QxYjNKZzsOvRDIcJz8T0lnvE2ic5xMmQ2dNy99KrUJzg0iuT5BvcedJ7ptVy8wgdoLAh6NHa/Stz7vWQIjmq2MQBh5HGVZvKQ0FiHyuvOiCuyv3Wr3BN1+pdzHhSevgvs7ExQNdsTwBOG+tXGKwo6UmnlPHFrmYRNUlwmbpMGNnJ4h24KInRskdrCG1vHJpWnSWwi38S5i0M8PhTYDu70SEVI=; 20:2WB7sFhsar0ZI/nYTmZVnrP4uXo70ekAYV6D0HLCVO5u/35E1fvz8ci21fVERWH0idf1ZlA7hdWl4QMWO1ebc1KzQF/IZXtuO51AEexfv+sa4IPoHBopOMXqexE4XR6cbtU6IrNB6EQvGJ/eJreyh/RLuZdUwzO55ZM49i2zrhLjRpgDZx475+97s0/AOMQuIMC2QMGDlJwNQjoFKlGva0n4GwJ2lcw9x4k3FLKoPfLkNY2sWqDsSyfdZzoC08LiZ80i/t2AnKM/4zdIY9mT14r9ZDHM6d/ZVtwpjdeIQNxR3QJcWmPWUAqE65J+Gae93Ha7g0+DFAif3v5CQW2AIOn5QAdTGKbxq8+gw2ol4bg+y5Dbp+dmEVfcSJJbElLL79Y1zL+Kw9YSzTYsV5god0f3ty2/jPAN3s9D7WbMoRZmdl2VHKIgLu9yg+hUwOlFynDumIEOJa3M+H5H9J6hef62vZmV7l+8clZB+7qhpa5tvDCN1wc79cfRqZqdVZro X-Exchange-Antispam-Report-Test: UriScan:(788757137089)(192813158149592); X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(100000700101)(100105000095)(100000701101)(100105300095)(100000702101)(100105100095)(6040450)(2401047)(5005006)(8121501046)(3002001)(100000703101)(100105400095)(10201501046)(93006095)(93004095)(6055026)(6041248)(20161123555025)(20161123560025)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123558100)(20161123564025)(20161123562025)(6072148)(201708071742011)(100000704101)(100105200095)(100000705101)(100105500095); SRVR:DM2PR02MB1338; BCL:0; PCL:0; RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095); SRVR:DM2PR02MB1338; X-Microsoft-Exchange-Diagnostics: 1; DM2PR02MB1338; 4:0D6+UBlgmxrtPLTHXqGVc3QpyExxF4TkH24NMSIpnEnxGxOWAb89fUR97zKe+LE0GC8M/jxASz/zLOmj4wdKImdixJ+b/HpyS+4laVRJnod71HoDZUVVLw7GIshzX9OaIba81gVNHceKUTs2fui07xgP2skLEmdoCtd6kmw135bio90+uTqLLrDz56Q9nk1CbpcsoaaewYgSOZLz5XeMDW+ExxZ/QeP6kTnZ1YiRkBLiTcz5x3s109AygVjNUa6AK4aq8kzelMRAoyYC2hNbjDQW/4MVjoI7CM+DCs6f3dgqOaq5xVyRtCMSAviMoF4bQEqNQe+SQgabznlTDX4Q5w== X-Forefront-PRVS: 0465429B7F X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; DM2PR02MB1338; 23:Z9ykHUf6qedQB4Hgyq6pvi7GkX/j54TL4i7fwe22/?= F0DPfaSMo3FDH3SY/h1+ri4G0AqwEIRgvTWxt5dKqw4bwCDewaSCpJCZJAmt+PKHrxSN/D5OFs5o0LmqwZV8/pNF/VukzFTxhY7Xv+EVsLc8lHOdP6rXC68py6RGWiIH322Sd+y9MN+BpHtd3105wm8ED5utwcRrBl/9OEs0q5o86ZedYc0xFKFdaKL1C5Ez6lG4TW6qCfSyIVj7RgwmpMbnVfKrjlrBs9L7ppVxQa1aw8aabzUtfqt0sfcaqwWaq0JsTLHzBwGWoujHy1AgW6IwVTFUt5vdWsqJyH3s8uEDdbFIHibgr10qPUqPNe7rrsMKC2tQg2GJfCadB/iB9XGHPP5zUFxQGCKfXkbM/W9720wL6PtgmLDJys3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XsGjj4dzF70OPGnt7QXvMDK10ZV1HH7tD4caEj20UFlPvIG7XacVVfyCKEefGNUO0b62r6DYvDJM/lyDfJ2SPvBpU8r566mlElBRsodCl+2T792jfWZfomuQ==; 24:mtx6nrE7zgbacbLbsSMwIrzEM38XV8exVmt0f8WtGUc3K9T6zkuFT6pOCfrc6Hqfv4P7mywgMkONfnmxQIVh5jUfV50SzOmC79Ll1JjXP3M=; 7:gqahyoBjpq1zQ6tiETyb9QI05NCwxCmG17x78lzw6SUgzrUpjBlodvyYZcfp8OLSf50y4Io3/9ueV+oqAAwnT+nNAhURoooPrnkAik568Oml1qiYf8PwXnYQRal0rVGOUtYutHFpVOeon6e1LFikTFz+0mVWj3v3uUL0iUfvfO9idiYsccrCpmjNkCyQ81UGQMc40xdHfFYD0HRZ1Dxn4wWAGNE5mL+iqGJbiKCvVlg= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: xilinx.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 19 Oct 2017 16:20:30.6512 (UTC) X-MS-Exchange-CrossTenant-Id: 657af505-d5df-48d0-8300-c31994686c5c X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=657af505-d5df-48d0-8300-c31994686c5c; Ip=[149.199.60.83]; Helo=[xsj-pvapsmtpgw01] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM2PR02MB1338 X-detected-operating-system: by eggs.gnu.org: Windows 7 or 8 [fuzzy] X-Received-From: 104.47.32.55 Subject: [Qemu-devel] [PATCH v3 16/46] hw/ide: Replace fprintf(stderr, "*\n" with error_report() 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: alistair23@gmail.com, armbru@redhat.com, qemu-block@nongnu.org, alistair.francis@xilinx.com Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" Replace a large number of the fprintf(stderr, "*\n" calls with error_report(). The functions were renamed with these commands and then compiler issues where manually fixed. find ./* -type f -exec sed -i \ 'N;N;N;N;N;N;N;N;N;N;N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2);|Ig}' \ {} + find ./* -type f -exec sed -i \ 'N;N;N;N;N;N;N;N;N;N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2);|Ig}' \ {} + find ./* -type f -exec sed -i \ 'N;N;N;N;N;N;N;N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2);|Ig}' \ {} + find ./* -type f -exec sed -i \ 'N;N;N;N;N;N;N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2);|Ig}' \ {} + find ./* -type f -exec sed -i \ 'N;N;N;N;N;N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2);|Ig}' \ {} + find ./* -type f -exec sed -i \ 'N;N;N;N;N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2);|Ig}' \ {} + find ./* -type f -exec sed -i \ 'N;N;N;N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2);|Ig}' \ {} + find ./* -type f -exec sed -i \ 'N;N;N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2);|Ig}' \ {} + find ./* -type f -exec sed -i \ 'N;N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2);|Ig}' \ {} + find ./* -type f -exec sed -i \ 'N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2);|Ig}' \ {} + find ./* -type f -exec sed -i \ 'N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2);|Ig}' \ {} + Some lines where then manually tweaked to pass checkpatch. Signed-off-by: Alistair Francis Cc: qemu-block@nongnu.org Reviewed-by: Philippe Mathieu-Daudé Acked-by: John Snow --- V2: - Split hw patch into individual directories hw/ide/ahci.c | 6 +++--- hw/ide/core.c | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/hw/ide/ahci.c b/hw/ide/ahci.c index c25e293d88..2ed015285a 100644 --- a/hw/ide/ahci.c +++ b/hw/ide/ahci.c @@ -410,8 +410,8 @@ static void ahci_mem_write(void *opaque, hwaddr addr, /* Only aligned reads are allowed on AHCI */ if (addr & 3) { - fprintf(stderr, "ahci: Mis-aligned write to addr 0x" - TARGET_FMT_plx "\n", addr); + error_report("ahci: Mis-aligned write to addr 0x" + TARGET_FMT_plx "", addr); return; } @@ -1053,7 +1053,7 @@ static void process_ncq_command(AHCIState *s, int port, uint8_t *cmd_fis, g_assert(is_ncq(ncq_fis->command)); if (ncq_tfs->used) { /* error - already in use */ - fprintf(stderr, "%s: tag %d already used\n", __func__, tag); + error_report("%s: tag %d already used", __func__, tag); return; } diff --git a/hw/ide/core.c b/hw/ide/core.c index 5f1cd3b91f..0ea34f62ba 100644 --- a/hw/ide/core.c +++ b/hw/ide/core.c @@ -2762,7 +2762,7 @@ static int ide_drive_pio_pre_save(void *opaque) idx = transfer_end_table_idx(s->end_transfer_func); if (idx == -1) { - fprintf(stderr, "%s: invalid end_transfer_func for DRQ_STAT\n", + error_report("%s: invalid end_transfer_func for DRQ_STAT", __func__); s->end_transfer_fn_idx = 2; } else { From patchwork Thu Oct 19 16:16:35 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alistair Francis X-Patchwork-Id: 828235 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; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=xilinx.onmicrosoft.com header.i=@xilinx.onmicrosoft.com header.b="FyQrv6Oc"; 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 3yHvsy3Gs7z9tX7 for ; Fri, 20 Oct 2017 03:44:54 +1100 (AEDT) Received: from localhost ([::1]:50181 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e5DwC-0007li-FW for incoming@patchwork.ozlabs.org; Thu, 19 Oct 2017 12:44:52 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:55506) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e5DYt-0004nS-DY for qemu-devel@nongnu.org; Thu, 19 Oct 2017 12:20:50 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1e5DYq-0001S1-4Z for qemu-devel@nongnu.org; Thu, 19 Oct 2017 12:20:47 -0400 Received: from mail-cys01nam02on0089.outbound.protection.outlook.com ([104.47.37.89]:33267 helo=NAM02-CY1-obe.outbound.protection.outlook.com) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1e5DYp-0001RR-PC for qemu-devel@nongnu.org; Thu, 19 Oct 2017 12:20:44 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=xilinx.onmicrosoft.com; s=selector1-xilinx-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=Pqp49SyAWtBltEbCkHH1B+itFCvPoDgT02g3shhXk9c=; b=FyQrv6OcnkL7fCEtRKo7rADaL5v4WJJK6KCFgnAmKCZ24NVzSpK7hp3fV7Kjbd+jmMGpNb4ChGaW16m8OphD8Bpv9ouHAoIDuejSRfdLV5LLcwLcoAhf4QPBSV1/Tz5grAxmSbvzeGXCecF3T2PizaRCLz1Y8LMMT9TgU9lEYA8= Received: from SN4PR0201CA0022.namprd02.prod.outlook.com (10.161.238.160) by BN6PR02MB3379.namprd02.prod.outlook.com (10.161.153.10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.77.7; Thu, 19 Oct 2017 16:20:41 +0000 Received: from CY1NAM02FT023.eop-nam02.prod.protection.outlook.com (2a01:111:f400:7e45::203) by SN4PR0201CA0022.outlook.office365.com (2603:10b6:803:2b::32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.77.7 via Frontend Transport; Thu, 19 Oct 2017 16:20:41 +0000 Authentication-Results: spf=pass (sender IP is 149.199.60.83) smtp.mailfrom=xilinx.com; redhat.com; dkim=none (message not signed) header.d=none;redhat.com; dmarc=bestguesspass action=none header.from=xilinx.com; Received-SPF: Pass (protection.outlook.com: domain of xilinx.com designates 149.199.60.83 as permitted sender) receiver=protection.outlook.com; client-ip=149.199.60.83; helo=xsj-pvapsmtpgw01; Received: from xsj-pvapsmtpgw01 (149.199.60.83) by CY1NAM02FT023.mail.protection.outlook.com (10.152.74.237) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.20.77.10 via Frontend Transport; Thu, 19 Oct 2017 16:20:40 +0000 Received: from unknown-38-66.xilinx.com ([149.199.38.66] helo=xsj-pvapsmtp01) by xsj-pvapsmtpgw01 with esmtp (Exim 4.63) (envelope-from ) id 1e5DYm-0008Vi-6b; Thu, 19 Oct 2017 09:20:40 -0700 Received: from [127.0.0.1] (helo=localhost) by xsj-pvapsmtp01 with smtp (Exim 4.63) (envelope-from ) id 1e5DYm-0002zV-3j; Thu, 19 Oct 2017 09:20:40 -0700 Received: from xsj-pvapsmtp01 (smtp.xilinx.com [149.199.38.66]) by xsj-smtp-dlp2.xlnx.xilinx.com (8.13.8/8.13.1) with ESMTP id v9JGKT1s006657; Thu, 19 Oct 2017 09:20:29 -0700 Received: from [172.19.2.220] (helo=localhost.localdomain) by xsj-pvapsmtp01 with esmtp (Exim 4.63) (envelope-from ) id 1e5DYa-0002xQ-Sd; Thu, 19 Oct 2017 09:20:28 -0700 From: Alistair Francis To: Date: Thu, 19 Oct 2017 09:16:35 -0700 Message-ID: X-Mailer: git-send-email 2.11.0 In-Reply-To: References: X-RCIS-Action: ALLOW X-TM-AS-Product-Ver: IMSS-7.1.0.1224-8.1.0.1062-23404.005 X-TM-AS-User-Approved-Sender: Yes;Yes X-EOPAttributedMessage: 0 X-MS-Office365-Filtering-HT: Tenant X-Forefront-Antispam-Report: CIP:149.199.60.83; IPV:NLI; CTRY:US; EFV:NLI; SFV:NSPM; SFS:(10009020)(6009001)(376002)(346002)(39860400002)(2980300002)(438002)(199003)(189002)(81166006)(47776003)(36756003)(48376002)(33646002)(39060400002)(2351001)(36386004)(8936002)(106466001)(189998001)(4326008)(81156014)(106002)(575784001)(5003940100001)(8676002)(16586007)(77096006)(2950100002)(54906003)(50226002)(305945005)(118296001)(2906002)(6916009)(63266004)(478600001)(76176999)(316002)(5660300001)(9786002)(356003)(6666003)(50466002)(50986999)(107986001); DIR:OUT; SFP:1101; SCL:1; SRVR:BN6PR02MB3379; H:xsj-pvapsmtpgw01; FPR:; SPF:Pass; PTR:unknown-60-83.xilinx.com; A:1; MX:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; CY1NAM02FT023; 1:yq/V88aXu2+qooOmA+pN1ly9EhqRbEdO7TYUs8r5NRzYfYwg/m4cSj2SqVzj7Ls43HdSCkEuU0sEu9bmRUP3zij/yplt94I3YZ1mmq8RmT5rpRyB8Tj3WVA8GqMwTAhc MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 7aea4536-0224-4850-e0cf-08d5170d5772 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001)(2017030254168)(8251501002)(4534016)(4602075)(4627075)(201703031133081)(201702281549075)(2017052603199)(201703131423091); SRVR:BN6PR02MB3379; X-Microsoft-Exchange-Diagnostics: 1; BN6PR02MB3379; 3:NMGFqo6gbTp4EfwuhE7m9RDPW9gf92Yq/FwLCMve5ExzGDl9Zdugx7Othxtfss4mWz4Zo8NHAX+gyrdmSsGz656UVhifi9nBKkbuWm2OzKYMEVjkfD3k2poDdqoRCRZUDiRYYXYnDAT8BW2IzAr2T1F8cboZa5BZHaI+ILqo45L4+JilO4Ffe+aDjX7kJTBooR2nBeBd/y/LZ8by7vVdkrIHOHZVza7dZIc75zEcDqu4w0u/n2LyrQuqoJEWM4gNul7ld/fznaWVoZm1jrrcrP8XfA2OwByZs2z7HHiaLmYXB1zoLyS5Y6nY26uhidCm0Al5LsLAwkp/bpClvMoWFe2WvUODwxWbwy9Ru74WlNA=; 25:Aiipv7m8ySqT1tJHQ3eZr8zTu9YdhIaDccC1G+6dY3DAysfWmU3W3XLBb9o93toEqMG9DfY6fas65fUVlNctWOJ/4ngwwZHWZeJOyFb6ucOIkt9tKBFHWtNSq9YLkel3RV9SIyjhlTkhY2J5MKIsnSpVNq9i/aE5g+SZ9k0RWh0v8nPmu2Bdb7oAvpDJLTTfUry2J2gZPlV1XmNzRAFuT1tbGG6/aYwvq0a8olFGq3coX+qVio13emyXSSCESO6gESnKVQF9ooy5+076ZTSYbAT5vB1ls8QmUjqORzqg6VFgdfFE9OKc0IAAgq3x9H2el+MBzqXLdQs3Uu/3ZlCMdQ== X-MS-TrafficTypeDiagnostic: BN6PR02MB3379: X-Microsoft-Exchange-Diagnostics: 1; BN6PR02MB3379; 31:PFXWUccMmQW5LS/IBrcfUGqa8WgSFSgrtcIiEKr2BLbvAFQKdBz5U4WDM0rmSC6G0gMrY5t4v0ErxkLM6zrC5XJYGjk6EkHh8r3PM4OsxH+zvIC5f4yfNoDF5Jd4za3C3RTGTcsmweAIYYJYMmCxQaGul0YHV94+qlNGuEWEnDtKs7WWuvDogFWRQHwA/gs6L2ti1V0eKHbFhax54Bv94JZaxHC2H/TQ2BRPo2BDr0I=; 20:LUw9Zl1o7A12VLaYBItL/X0+E8BoDcIAJ+LoHOLNR6zr/g36fMrh7qkZ3SaUMz/3C4sgB6BUhDYcj69nz67n+OhKXLLv6Y/2p4IvJTAVCBK7Yey8Wsr6M9pPHfBOEFOSXE/7FXbsSz/LdZSxvquenbfgdSaowuJ+UWcn2B7UeNFZT4ZFbgqmvCoKB3W9/l7ABRqHCrZW1eMJzXIwxRyMinchurFcouBu+EN8CLsixCjrpZikmfIjXZH89QC9kDS8NN645Sbapps+NBtj1O1xES47F+whDi+qNizmfnDdrrS1VveDT6qoUovnL6Zr3Vn+G3kPP9KXpG34evWxdxpxE0HRIEfscwNuET3DE9oq5HRVbOONgo1/4anDkgW5+uZC6S5wVJCZf6UkUGC/P8Ha7mWpJO7gkC7qakjfAz3SXx3E2N16iwXijrvyaNkxXt3fRW+RzkcbIMvbsHH5z1FSypjaTxEZOwl6KKloG8znqsgmg5zrLjie+1jVR6aDDxnc X-Exchange-Antispam-Report-Test: UriScan:(788757137089)(192813158149592); X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(100000700101)(100105000095)(100000701101)(100105300095)(100000702101)(100105100095)(6040450)(2401047)(5005006)(8121501046)(100000703101)(100105400095)(10201501046)(3002001)(93006095)(93004095)(6055026)(6041248)(20161123560025)(20161123564025)(20161123562025)(20161123558100)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123555025)(6072148)(201708071742011)(100000704101)(100105200095)(100000705101)(100105500095); SRVR:BN6PR02MB3379; BCL:0; PCL:0; RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095); SRVR:BN6PR02MB3379; X-Microsoft-Exchange-Diagnostics: 1; BN6PR02M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ENfdVXnmQ=; 7:eHsdU4Ra3GjDzqTGnu3W0qZIfsYDeNc9L8vJjHYe3tG71z0ePyh2JGDbRdYXRSAbPmBxmCKN5E4CT3XMiZf0qtPl8Gtg3P36hk5HEQUBYJF/VB74G5D3/EJBnCd0pttWdNdcsEGDZZj91YHVOA2HfOvs4BCM2iWZfol0R+jWzcLylJGehZhoWFwzls1VNMJrlJ63pY+ydEfsUPdb+uzwWTCy3i/ze0TNHgoHx2PHTNY= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: xilinx.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 19 Oct 2017 16:20:40.7578 (UTC) X-MS-Exchange-CrossTenant-Id: 657af505-d5df-48d0-8300-c31994686c5c X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=657af505-d5df-48d0-8300-c31994686c5c; Ip=[149.199.60.83]; Helo=[xsj-pvapsmtpgw01] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN6PR02MB3379 X-detected-operating-system: by eggs.gnu.org: Windows 7 or 8 [fuzzy] X-Received-From: 104.47.37.89 Subject: [Qemu-devel] [PATCH v3 17/46] hw/input: Replace fprintf(stderr, "*\n" with error_report() 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: alistair23@gmail.com, "Michael S. Tsirkin" , Gerd Hoffmann , armbru@redhat.com, alistair.francis@xilinx.com Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" Replace a large number of the fprintf(stderr, "*\n" calls with error_report(). The functions were renamed with these commands and then compiler issues where manually fixed. find ./* -type f -exec sed -i \ 'N;N;N;N;N;N;N;N;N;N;N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2);|Ig}' \ {} + find ./* -type f -exec sed -i \ 'N;N;N;N;N;N;N;N;N;N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2);|Ig}' \ {} + find ./* -type f -exec sed -i \ 'N;N;N;N;N;N;N;N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2);|Ig}' \ {} + find ./* -type f -exec sed -i \ 'N;N;N;N;N;N;N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2);|Ig}' \ {} + find ./* -type f -exec sed -i \ 'N;N;N;N;N;N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2);|Ig}' \ {} + find ./* -type f -exec sed -i \ 'N;N;N;N;N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2);|Ig}' \ {} + find ./* -type f -exec sed -i \ 'N;N;N;N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2);|Ig}' \ {} + find ./* -type f -exec sed -i \ 'N;N;N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2);|Ig}' \ {} + find ./* -type f -exec sed -i \ 'N;N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2);|Ig}' \ {} + find ./* -type f -exec sed -i \ 'N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2);|Ig}' \ {} + find ./* -type f -exec sed -i \ 'N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2);|Ig}' \ {} + Some lines where then manually tweaked to pass checkpatch. Signed-off-by: Alistair Francis Cc: "Michael S. Tsirkin" Cc: Gerd Hoffmann --- V2: - Split hw patch into individual directories hw/input/lm832x.c | 6 ++-- hw/input/pckbd.c | 3 +- hw/input/pxa2xx_keypad.c | 2 +- hw/input/tsc2005.c | 17 +++++------ hw/input/tsc210x.c | 72 ++++++++++++++++++++++----------------------- hw/input/virtio-input-hid.c | 14 ++++----- hw/input/virtio-input.c | 5 ++-- 7 files changed, 60 insertions(+), 59 deletions(-) diff --git a/hw/input/lm832x.c b/hw/input/lm832x.c index d39953126b..caeeda47f2 100644 --- a/hw/input/lm832x.c +++ b/hw/input/lm832x.c @@ -239,7 +239,7 @@ static uint8_t lm_kbd_read(LM823KbdState *s, int reg, int byte) default: lm_kbd_error(s, ERR_CMDUNK); - fprintf(stderr, "%s: unknown command %02x\n", __func__, reg); + error_report("%s: unknown command %02x", __func__, reg); return 0x00; } @@ -330,7 +330,7 @@ static void lm_kbd_write(LM823KbdState *s, int reg, int byte, uint8_t value) s->reg = LM832x_GENERAL_ERROR; if ((value & 3) && (value & 3) != 3) { lm_kbd_error(s, ERR_BADPAR); - fprintf(stderr, "%s: invalid clock setting in RCPWM\n", + error_report("%s: invalid clock setting in RCPWM", __func__); } /* TODO: Validate that the command is only issued once */ @@ -378,7 +378,7 @@ static void lm_kbd_write(LM823KbdState *s, int reg, int byte, uint8_t value) break; default: lm_kbd_error(s, ERR_CMDUNK); - fprintf(stderr, "%s: unknown command %02x\n", __func__, reg); + error_report("%s: unknown command %02x", __func__, reg); break; } } diff --git a/hw/input/pckbd.c b/hw/input/pckbd.c index c479f827b6..6fb5c4dbaa 100644 --- a/hw/input/pckbd.c +++ b/hw/input/pckbd.c @@ -22,6 +22,7 @@ * THE SOFTWARE. */ #include "qemu/osdep.h" +#include "qemu/error-report.h" #include "hw/hw.h" #include "hw/isa/isa.h" #include "hw/i386/pc.h" @@ -307,7 +308,7 @@ static void kbd_write_command(void *opaque, hwaddr addr, /* ignore that */ break; default: - fprintf(stderr, "qemu: unsupported keyboard cmd=0x%02x\n", (int)val); + error_report("unsupported keyboard cmd=0x%02x", (int)val); break; } } diff --git a/hw/input/pxa2xx_keypad.c b/hw/input/pxa2xx_keypad.c index 93db9ed25b..0a594c30fc 100644 --- a/hw/input/pxa2xx_keypad.c +++ b/hw/input/pxa2xx_keypad.c @@ -326,7 +326,7 @@ void pxa27x_register_keypad(PXA2xxKeyPadState *kp, const struct keymap *map, int size) { if(!map || size < 0x80) { - fprintf(stderr, "%s - No PXA keypad map defined\n", __func__); + error_report("%s - No PXA keypad map defined", __func__); exit(-1); } diff --git a/hw/input/tsc2005.c b/hw/input/tsc2005.c index 7990954b6c..f5057e8eeb 100644 --- a/hw/input/tsc2005.c +++ b/hw/input/tsc2005.c @@ -200,17 +200,17 @@ static void tsc2005_write(TSC2005State *s, int reg, uint16_t data) s->host_mode = (data >> 15) != 0; if (s->enabled != !(data & 0x4000)) { s->enabled = !(data & 0x4000); - fprintf(stderr, "%s: touchscreen sense %sabled\n", - __func__, s->enabled ? "en" : "dis"); + error_report("%s: touchscreen sense %sabled", + __func__, s->enabled ? "en" : "dis"); if (s->busy && !s->enabled) timer_del(s->timer); s->busy = s->busy && s->enabled; } s->nextprecision = (data >> 13) & 1; s->timing[0] = data & 0x1fff; - if ((s->timing[0] >> 11) == 3) - fprintf(stderr, "%s: illegal conversion clock setting\n", - __func__); + if ((s->timing[0] >> 11) == 3) { + error_report("%s: illegal conversion clock setting", __func__); + } break; case 0xd: /* CFR1 */ s->timing[1] = data & 0xf07; @@ -221,8 +221,7 @@ static void tsc2005_write(TSC2005State *s, int reg, uint16_t data) break; default: - fprintf(stderr, "%s: write into read-only register %x\n", - __func__, reg); + error_report("%s: write into read-only register %x", __func__, reg); } } @@ -337,8 +336,8 @@ static uint8_t tsc2005_txrx_word(void *opaque, uint8_t value) s->nextprecision = (value >> 2) & 1; if (s->enabled != !(value & 1)) { s->enabled = !(value & 1); - fprintf(stderr, "%s: touchscreen sense %sabled\n", - __func__, s->enabled ? "en" : "dis"); + error_report("%s: touchscreen sense %sabled", + __func__, s->enabled ? "en" : "dis"); if (s->busy && !s->enabled) timer_del(s->timer); s->busy = s->busy && s->enabled; diff --git a/hw/input/tsc210x.c b/hw/input/tsc210x.c index 1cad57f644..65c7569723 100644 --- a/hw/input/tsc210x.c +++ b/hw/input/tsc210x.c @@ -396,8 +396,8 @@ static uint16_t tsc2102_data_register_read(TSC210xState *s, int reg) default: #ifdef TSC_VERBOSE - fprintf(stderr, "tsc2102_data_register_read: " - "no such register: 0x%02x\n", reg); + error_report("tsc2102_data_register_read: " + "no such register: 0x%02x", reg); #endif return 0xffff; } @@ -447,8 +447,8 @@ static uint16_t tsc2102_control_register_read( default: bad_reg: #ifdef TSC_VERBOSE - fprintf(stderr, "tsc2102_control_register_read: " - "no such register: 0x%02x\n", reg); + error_report("tsc2102_control_register_read: " + "no such register: 0x%02x", reg); #endif return 0xffff; } @@ -528,8 +528,8 @@ static uint16_t tsc2102_audio_register_read(TSC210xState *s, int reg) default: #ifdef TSC_VERBOSE - fprintf(stderr, "tsc2102_audio_register_read: " - "no such register: 0x%02x\n", reg); + error_report("tsc2102_audio_register_read: " + "no such register: 0x%02x", reg); #endif return 0xffff; } @@ -553,8 +553,8 @@ static void tsc2102_data_register_write( default: #ifdef TSC_VERBOSE - fprintf(stderr, "tsc2102_data_register_write: " - "no such register: 0x%02x\n", reg); + error_report("tsc2102_data_register_write: " + "no such register: 0x%02x", reg); #endif } } @@ -606,8 +606,8 @@ static void tsc2102_control_register_write( tsc210x_reset(s); #ifdef TSC_VERBOSE } else { - fprintf(stderr, "tsc2102_control_register_write: " - "wrong value written into RESET\n"); + error_report("tsc2102_control_register_write: " + "wrong value written into RESET"); #endif } return; @@ -616,8 +616,8 @@ static void tsc2102_control_register_write( s->timing = value & 0x3f; #ifdef TSC_VERBOSE if (value & ~0x3f) - fprintf(stderr, "tsc2102_control_register_write: " - "wrong value written into CONFIG\n"); + error_report("tsc2102_control_register_write: " + "wrong value written into CONFIG"); #endif return; @@ -637,8 +637,8 @@ static void tsc2102_control_register_write( default: bad_reg: #ifdef TSC_VERBOSE - fprintf(stderr, "tsc2102_control_register_write: " - "no such register: 0x%02x\n", reg); + error_report("tsc2102_control_register_write: " + "no such register: 0x%02x", reg); #endif } } @@ -651,8 +651,8 @@ static void tsc2102_audio_register_write( s->audio_ctrl1 = value & 0x0f3f; #ifdef TSC_VERBOSE if ((value & ~0x0f3f) || ((value & 7) != ((value >> 3) & 7))) - fprintf(stderr, "tsc2102_audio_register_write: " - "wrong value written into Audio 1\n"); + error_report("tsc2102_audio_register_write: " + "wrong value written into Audio 1"); #endif tsc2102_audio_rate_update(s); tsc2102_audio_output_update(s); @@ -661,8 +661,8 @@ static void tsc2102_audio_register_write( case 0x01: #ifdef TSC_VERBOSE if (value != 0xff00) - fprintf(stderr, "tsc2102_audio_register_write: " - "wrong value written into reg 0x01\n"); + error_report("tsc2102_audio_register_write: " + "wrong value written into reg 0x01"); #endif return; @@ -674,8 +674,8 @@ static void tsc2102_audio_register_write( case 0x03: #ifdef TSC_VERBOSE if (value != 0x8b00) - fprintf(stderr, "tsc2102_audio_register_write: " - "wrong value written into reg 0x03\n"); + error_report("tsc2102_audio_register_write: " + "wrong value written into reg 0x03"); #endif return; @@ -683,8 +683,8 @@ static void tsc2102_audio_register_write( s->audio_ctrl2 = value & 0xf7f2; #ifdef TSC_VERBOSE if (value & ~0xf7fd) - fprintf(stderr, "tsc2102_audio_register_write: " - "wrong value written into Audio 2\n"); + error_report("tsc2102_audio_register_write: " + "wrong value written into Audio 2"); #endif return; @@ -695,8 +695,8 @@ static void tsc2102_audio_register_write( s->dac_power = value & 0x9543; #ifdef TSC_VERBOSE if ((value & ~0x9543) != 0x2aa0) - fprintf(stderr, "tsc2102_audio_register_write: " - "wrong value written into Power\n"); + error_report("tsc2102_audio_register_write: " + "wrong value written into Power"); #endif tsc2102_audio_rate_update(s); tsc2102_audio_output_update(s); @@ -707,8 +707,8 @@ static void tsc2102_audio_register_write( s->audio_ctrl3 |= value & 0xf800; #ifdef TSC_VERBOSE if (value & ~0xf8c7) - fprintf(stderr, "tsc2102_audio_register_write: " - "wrong value written into Audio 3\n"); + error_report("tsc2102_audio_register_write: " + "wrong value written into Audio 3"); #endif tsc2102_audio_output_update(s); return; @@ -740,8 +740,8 @@ static void tsc2102_audio_register_write( s->pll[0] = value & 0xfffc; #ifdef TSC_VERBOSE if (value & ~0xfffc) - fprintf(stderr, "tsc2102_audio_register_write: " - "wrong value written into PLL 1\n"); + error_report("tsc2102_audio_register_write: " + "wrong value written into PLL 1"); #endif return; @@ -749,8 +749,8 @@ static void tsc2102_audio_register_write( s->pll[1] = value & 0xfffc; #ifdef TSC_VERBOSE if (value & ~0xfffc) - fprintf(stderr, "tsc2102_audio_register_write: " - "wrong value written into PLL 2\n"); + error_report("tsc2102_audio_register_write: " + "wrong value written into PLL 2"); #endif return; @@ -758,15 +758,15 @@ static void tsc2102_audio_register_write( s->softstep = !(value & 0x4000); #ifdef TSC_VERBOSE if (value & ~0x4000) - fprintf(stderr, "tsc2102_audio_register_write: " - "wrong value written into Audio 4\n"); + error_report("tsc2102_audio_register_write: " + "wrong value written into Audio 4"); #endif return; default: #ifdef TSC_VERBOSE - fprintf(stderr, "tsc2102_audio_register_write: " - "no such register: 0x%02x\n", reg); + error_report("tsc2102_audio_register_write: " + "no such register: 0x%02x", reg); #endif } } @@ -847,7 +847,7 @@ static uint16_t tsc210x_read(TSC210xState *s) uint16_t ret = 0x0000; if (!s->command) - fprintf(stderr, "tsc210x_read: SPI underrun!\n"); + error_report("tsc210x_read: SPI underrun!"); switch (s->page) { case TSC_DATA_REGISTERS_PAGE: @@ -886,7 +886,7 @@ static void tsc210x_write(TSC210xState *s, uint16_t value) s->state = true; } else { if (s->command) - fprintf(stderr, "tsc210x_write: SPI overrun!\n"); + error_report("tsc210x_write: SPI overrun!"); else switch (s->page) { case TSC_DATA_REGISTERS_PAGE: diff --git a/hw/input/virtio-input-hid.c b/hw/input/virtio-input-hid.c index e78faec0b1..172ec2972b 100644 --- a/hw/input/virtio-input-hid.c +++ b/hw/input/virtio-input-hid.c @@ -209,8 +209,8 @@ static void virtio_input_handle_event(DeviceState *dev, QemuConsole *src, virtio_input_send(vinput, &event); } else { if (key->down) { - fprintf(stderr, "%s: unmapped key: %d [%s]\n", __func__, - qcode, QKeyCode_str(qcode)); + error_report("%s: unmapped key: %d [%s]", __func__, + qcode, QKeyCode_str(qcode)); } } break; @@ -230,9 +230,9 @@ static void virtio_input_handle_event(DeviceState *dev, QemuConsole *src, virtio_input_send(vinput, &event); } else { if (btn->down) { - fprintf(stderr, "%s: unmapped button: %d [%s]\n", __func__, - btn->button, - InputButton_str(btn->button)); + error_report("%s: unmapped button: %d [%s]", __func__, + btn->button, + InputButton_str(btn->button)); } } break; @@ -318,8 +318,8 @@ static void virtio_input_hid_handle_status(VirtIOInput *vinput, kbd_put_ledstate(vhid->ledstate); break; default: - fprintf(stderr, "%s: unknown type %d\n", __func__, - le16_to_cpu(event->type)); + error_report("%s: unknown type %d", __func__, + le16_to_cpu(event->type)); break; } } diff --git a/hw/input/virtio-input.c b/hw/input/virtio-input.c index 0e42f0d02c..fb5fa0a280 100644 --- a/hw/input/virtio-input.c +++ b/hw/input/virtio-input.c @@ -5,6 +5,7 @@ */ #include "qemu/osdep.h" +#include "qemu/error-report.h" #include "qapi/error.h" #include "qemu/iov.h" #include "trace.h" @@ -121,8 +122,8 @@ void virtio_input_add_config(VirtIOInput *vinput, if (virtio_input_find_config(vinput, config->select, config->subsel)) { /* should not happen */ - fprintf(stderr, "%s: duplicate config: %d/%d\n", - __func__, config->select, config->subsel); + error_report("%s: duplicate config: %d/%d", + __func__, config->select, config->subsel); abort(); } From patchwork Thu Oct 19 16:16:39 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alistair Francis X-Patchwork-Id: 828199 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; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=xilinx.onmicrosoft.com header.i=@xilinx.onmicrosoft.com header.b="4Xsweaid"; 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 3yHvRj4rn3z9t7p for ; Fri, 20 Oct 2017 03:25:36 +1100 (AEDT) Received: from localhost ([::1]:50085 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e5DdX-0008Ef-3t for incoming@patchwork.ozlabs.org; Thu, 19 Oct 2017 12:25:35 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:55497) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e5DYs-0004mm-Gk for qemu-devel@nongnu.org; Thu, 19 Oct 2017 12:20:48 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1e5DYp-0001Re-8I for qemu-devel@nongnu.org; Thu, 19 Oct 2017 12:20:46 -0400 Received: from mail-bn3nam01on0049.outbound.protection.outlook.com ([104.47.33.49]:41728 helo=NAM01-BN3-obe.outbound.protection.outlook.com) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1e5DYp-0001RE-0Y for qemu-devel@nongnu.org; Thu, 19 Oct 2017 12:20:43 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=xilinx.onmicrosoft.com; s=selector1-xilinx-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=mhcBzN85Xaa7DdXHZ874JeJdhCaa90G+wMGmcl55W1E=; b=4XsweaidsV25Y1U81t3KYB6gf3Ss52J9USHHvyyx8PDNiPttFOO4Cix3bFzauKhXOFxzk1XNLfXUq91SvljHrySIOOl2GMRg1pV9VF/DeF2uHiZHE3hATQ6o7aqqfi9H1CCyBGFgYtY1nmpZe3NmCy8/KRnR9tVQntEFqRcbGA8= Received: from MWHPR02CA0001.namprd02.prod.outlook.com (10.168.209.139) by MWHPR02MB3389.namprd02.prod.outlook.com (10.164.187.166) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.77.7; Thu, 19 Oct 2017 16:20:41 +0000 Received: from CY1NAM02FT031.eop-nam02.prod.protection.outlook.com (2a01:111:f400:7e45::208) by MWHPR02CA0001.outlook.office365.com (2603:10b6:300:4b::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.77.21 via Frontend Transport; Thu, 19 Oct 2017 16:20:41 +0000 Authentication-Results: spf=pass (sender IP is 149.199.60.83) smtp.mailfrom=xilinx.com; suse.de; dkim=none (message not signed) header.d=none;suse.de; dmarc=bestguesspass action=none header.from=xilinx.com; Received-SPF: Pass (protection.outlook.com: domain of xilinx.com designates 149.199.60.83 as permitted sender) receiver=protection.outlook.com; client-ip=149.199.60.83; helo=xsj-pvapsmtpgw01; Received: from xsj-pvapsmtpgw01 (149.199.60.83) by CY1NAM02FT031.mail.protection.outlook.com (10.152.75.180) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.20.77.10 via Frontend Transport; Thu, 19 Oct 2017 16:20:40 +0000 Received: from unknown-38-66.xilinx.com ([149.199.38.66] helo=xsj-pvapsmtp01) by xsj-pvapsmtpgw01 with esmtp (Exim 4.63) (envelope-from ) id 1e5DYm-0008Vd-4x; Thu, 19 Oct 2017 09:20:40 -0700 Received: from [127.0.0.1] (helo=localhost) by xsj-pvapsmtp01 with smtp (Exim 4.63) (envelope-from ) id 1e5DYm-0002zV-24; Thu, 19 Oct 2017 09:20:40 -0700 Received: from xsj-pvapsmtp01 (xsj-mail.xilinx.com [149.199.38.66]) by xsj-smtp-dlp1.xlnx.xilinx.com (8.13.8/8.13.1) with ESMTP id v9JGKWsl017870; Thu, 19 Oct 2017 09:20:32 -0700 Received: from [172.19.2.220] (helo=localhost.localdomain) by xsj-pvapsmtp01 with esmtp (Exim 4.63) (envelope-from ) id 1e5DYe-0002yc-6Z; Thu, 19 Oct 2017 09:20:32 -0700 From: Alistair Francis To: Date: Thu, 19 Oct 2017 09:16:39 -0700 Message-ID: X-Mailer: git-send-email 2.11.0 In-Reply-To: References: X-RCIS-Action: ALLOW X-TM-AS-Product-Ver: IMSS-7.1.0.1224-8.1.0.1062-23404.005 X-TM-AS-User-Approved-Sender: Yes;Yes X-EOPAttributedMessage: 0 X-MS-Office365-Filtering-HT: Tenant X-Forefront-Antispam-Report: CIP:149.199.60.83; IPV:NLI; CTRY:US; EFV:NLI; SFV:NSPM; SFS:(10009020)(6009001)(346002)(376002)(39860400002)(2980300002)(438002)(189002)(199003)(118296001)(54906003)(9786002)(16586007)(106002)(36386004)(316002)(50986999)(5660300001)(5003940100001)(189998001)(76176999)(2906002)(36756003)(77096006)(2351001)(39060400002)(4326008)(47776003)(63266004)(6916009)(305945005)(356003)(478600001)(106466001)(48376002)(50226002)(33646002)(50466002)(8676002)(2950100002)(81156014)(8936002)(81166006)(107986001); DIR:OUT; SFP:1101; SCL:1; SRVR:MWHPR02MB3389; H:xsj-pvapsmtpgw01; FPR:; SPF:Pass; PTR:unknown-60-83.xilinx.com; MX:1; A:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; CY1NAM02FT031; 1:akegFpkied3ELdF2WDcd+4XKdKbjxXud2DsoZAn67F4DEFiL0QqUS2v01yue2QuDnmI/Ok6So+ujEDoZk/kHuDDoWR8v8O5eIlO+dZfczM/xfEJ7HlliANUDw5X70Eca MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: f1f1c51e-62e7-4c8d-51e0-08d5170d5781 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001)(2017030254152)(8251501002)(2017052603199)(201703131423075)(201703031133081)(201702281549075); SRVR:MWHPR02MB3389; X-Microsoft-Exchange-Diagnostics: 1; MWHPR02MB3389; 3:ywOmNQZhhtlzxTKLIscDdF8KRuJVuPWy1KcqnUeyQQPQ55IOjljtM7a7PVM1M27vPJZBKL7WkkSMwrfZHGMW4RCY8b+I+dyYbkByx+8i05SU4JglDpKQGQxW5Ss/KJHS/4HijVGgdBTH27QrUHkAg59SByeYJB3m7nQX1TyAZHBeQgHdba59n31ZuJUQpX+UTzGi1C20+kiZ9sFlPbXU/99GNUhAtSJiQwF5MdmaDWCIxktp5IEsbCwd4gJfd/2U31+U5EJ3d5OpVACn2O54xEcUUI193a0BQTOH+P2AIOE4/VIhzJAA5dBg8nROrUz9YsnYdsA1eAB/+Z4kJt8B8st4vVRf4mUmJcW2P4Mbx4U=; 25:4JWgKmMfDbcVTzHn8pxtZcwepx5XOtNCZGwGcROgI4qY8N0g6W+0R6ebRrKhBKCrcDZrRarXBe+V0Yqya78i4W3ydl/gSD7Ss1457IpufwqXLfzlFCuiL74zBqSsFXhh+3ssibWJhj15rCe2RV0pNSaOBnDluuRhiGEgvshUkR4UcIWIrXGzwRt2i7JizNpiwSOW5KMuQNvrmGat3rbYSBmkVJTdPNlOwzsgZGAlkzwzsAKimkL7WduZvgAQQDytC/GPQUm3v33+3nwzgLohk2J8tcyaUwPX9pxX5Zife/cOJiWiVxRsd8BAgJOMBjz57ewuBVndvMAU2qNqmUds0g== X-MS-TrafficTypeDiagnostic: MWHPR02MB3389: X-Microsoft-Exchange-Diagnostics: 1; MWHPR02MB3389; 31:uZM/kt0x8huH/LeMhAt/gEC3iN58Xrgyw6mOmmaC42tZji3UTwKTBJhA7tARwCX/FF31JwpekDEazOllViUQWRxDvMpjESOZ20BoKmWH1yhBQFHXa/ciScLE4DxLAaOG8fMFA8XT/6z022pOse3+oOuw7nmX9TlS/GUoeB5eM8AQEInSzFwhcrrbkt3n57G5eQ2Mr1D7e6NVjoX8pn8tskn11y5SEvat+bAMyLHomDk=; 20:QidXbvAOB5UERwVb39ynTab/1HqrZtaBbKUYaR9PkKdCKgTb43OmY0i2PYU/2KtIQcBJGfGodbOwq4Ium8RHLAv5C0LD9FUpBmupkW8iRsCyzYe6awLRLVQQSE48//Yuwg9tcWpBiKD4OOy13e31UwHzkDI9AkJGwo5sA7XpPxnZg09NLGQ+EJZj2FE4rr0dpHEYEwVwGptlzMWWKisuB3D2mh3w5VpqDv7qHRqVLHh9pe4j6tZ++CFG+h6tziahpLhyp6XAuGlltCiCfmBjU/XWrHXKdbkwjUdhT1kTUoABDhcsBr4INixvwBj/BGKxI0VHo4flSza8vRU7a7R0k8ss4gE5/rpxik/8YyAfSLV5eEZassnUD7r6F0AluI1i6jV6beudEbIljF1yiJha1W5v3g29DanIgpmp2CzEVCQCLIr9IZtFu7F8dj79apcbK4tf5xJHnnZimwuCErgDNJOxE14RY4IIerdro0LL3RyVCXQ1nU7zmhU3wCIr08U/ X-Exchange-Antispam-Report-Test: UriScan:(788757137089)(190383065149520)(192813158149592)(104084551191319); X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(100000700101)(100105000095)(100000701101)(100105300095)(100000702101)(100105100095)(6040450)(2401047)(5005006)(8121501046)(93006095)(93004095)(10201501046)(100000703101)(100105400095)(3002001)(6055026)(6041248)(20161123564025)(20161123558100)(20161123555025)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123562025)(20161123560025)(6072148)(201708071742011)(100000704101)(100105200095)(100000705101)(100105500095); SRVR:MWHPR02MB3389; BCL:0; PCL:0; RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095); SRVR:MWHPR02MB3389; X-Microsoft-Exchange-Diagnostics: 1; MWHPR02MB3389; 4:VG5ZTbS/oFEIBeoEFp5owiwOLBnLJbEi9ygaPrrkT2kcG7GigecbtRB87kll7iVxsOKan2POpoH/JYo3l7XTYUcq9+t5ae/05uRj5cqeCjtgt2Oo+6BOdpkezt8ANDfn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TCg6xw69co4rQMZTZ2CiIa3a+Edf2wrh7kb/MJM7X/ozLv1ZvA7dwBTqmsw/WmoNGvoJ8Jqj1S0/QUDTbBErwfY4hI/pr5Z/0RsxNC0G5XRQMEB+zw= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: xilinx.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 19 Oct 2017 16:20:40.8055 (UTC) X-MS-Exchange-CrossTenant-Id: 657af505-d5df-48d0-8300-c31994686c5c X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=657af505-d5df-48d0-8300-c31994686c5c; Ip=[149.199.60.83]; Helo=[xsj-pvapsmtpgw01] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: MWHPR02MB3389 X-detected-operating-system: by eggs.gnu.org: Windows 7 or 8 [fuzzy] X-Received-From: 104.47.33.49 Subject: [Qemu-devel] [PATCH v3 18/46] hw/intc: Replace fprintf(stderr, "*\n" with error_report() 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: Peter Maydell , Cornelia Huck , armbru@redhat.com, alistair.francis@xilinx.com, Christian Borntraeger , Alexander Graf , alistair23@gmail.com Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" Replace a large number of the fprintf(stderr, "*\n" calls with error_report(). The functions were renamed with these commands and then compiler issues where manually fixed. find ./* -type f -exec sed -i \ 'N;N;N;N;N;N;N;N;N;N;N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2);|Ig}' \ {} + find ./* -type f -exec sed -i \ 'N;N;N;N;N;N;N;N;N;N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2);|Ig}' \ {} + find ./* -type f -exec sed -i \ 'N;N;N;N;N;N;N;N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2);|Ig}' \ {} + find ./* -type f -exec sed -i \ 'N;N;N;N;N;N;N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2);|Ig}' \ {} + find ./* -type f -exec sed -i \ 'N;N;N;N;N;N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2);|Ig}' \ {} + find ./* -type f -exec sed -i \ 'N;N;N;N;N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2);|Ig}' \ {} + find ./* -type f -exec sed -i \ 'N;N;N;N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2);|Ig}' \ {} + find ./* -type f -exec sed -i \ 'N;N;N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2);|Ig}' \ {} + find ./* -type f -exec sed -i \ 'N;N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2);|Ig}' \ {} + find ./* -type f -exec sed -i \ 'N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2);|Ig}' \ {} + find ./* -type f -exec sed -i \ 'N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2);|Ig}' \ {} + Some lines where then manually tweaked to pass checkpatch. Signed-off-by: Alistair Francis Cc: Peter Maydell Cc: Christian Borntraeger Cc: Cornelia Huck Cc: Alexander Graf Acked-by: Cornelia Huck (s390x part) --- V2: - Split hw patch into individual directories hw/intc/arm_gic_kvm.c | 12 ++++++------ hw/intc/omap_intc.c | 4 ++-- hw/intc/openpic.c | 7 ++++--- hw/intc/openpic_kvm.c | 8 ++++---- hw/intc/s390_flic_kvm.c | 4 ++-- 5 files changed, 18 insertions(+), 17 deletions(-) diff --git a/hw/intc/arm_gic_kvm.c b/hw/intc/arm_gic_kvm.c index ae095d08a3..a5478d3e20 100644 --- a/hw/intc/arm_gic_kvm.c +++ b/hw/intc/arm_gic_kvm.c @@ -316,12 +316,12 @@ static void kvm_arm_gic_put(GICState *s) num_cpu = ((reg & 0xe0) >> 5) + 1; if (num_irq < s->num_irq) { - fprintf(stderr, "Restoring %u IRQs, but kernel supports max %d\n", - s->num_irq, num_irq); + error_report("Restoring %u IRQs, but kernel supports max %d", + s->num_irq, num_irq); abort(); } else if (num_cpu != s->num_cpu) { - fprintf(stderr, "Restoring %u CPU interfaces, kernel only has %d\n", - s->num_cpu, num_cpu); + error_report("Restoring %u CPU interfaces, kernel only has %d", + s->num_cpu, num_cpu); /* Did we not create the VCPUs in the kernel yet? */ abort(); } @@ -411,8 +411,8 @@ static void kvm_arm_gic_get(GICState *s) s->num_cpu = ((reg & 0xe0) >> 5) + 1; if (s->num_irq > GIC_MAXIRQ) { - fprintf(stderr, "Too many IRQs reported from the kernel: %d\n", - s->num_irq); + error_report("Too many IRQs reported from the kernel: %d", + s->num_irq); abort(); } diff --git a/hw/intc/omap_intc.c b/hw/intc/omap_intc.c index 6844c1aa83..7fc239715a 100644 --- a/hw/intc/omap_intc.c +++ b/hw/intc/omap_intc.c @@ -539,8 +539,8 @@ static void omap2_inth_write(void *opaque, hwaddr addr, /* TODO: Make a bitmap (or sizeof(char)map) of access privileges * for every register, see Chapter 3 and 4 for privileged mode. */ if (value & 1) - fprintf(stderr, "%s: protection mode enable attempt\n", - __func__); + error_report("%s: protection mode enable attempt", + __func__); return; case 0x50: /* INTC_IDLE */ diff --git a/hw/intc/openpic.c b/hw/intc/openpic.c index 10d6e871fb..7b1cafcc50 100644 --- a/hw/intc/openpic.c +++ b/hw/intc/openpic.c @@ -34,6 +34,7 @@ * */ #include "qemu/osdep.h" +#include "qemu/error-report.h" #include "hw/hw.h" #include "hw/ppc/mac.h" #include "hw/pci/pci.h" @@ -173,7 +174,7 @@ static int inttgt_to_output(int inttgt) } } - fprintf(stderr, "%s: unsupported inttgt %d\n", __func__, inttgt); + error_report("%s: unsupported inttgt %d", __func__, inttgt); return OPENPIC_OUTPUT_INT; } @@ -547,7 +548,7 @@ static void openpic_set_irq(void *opaque, int n_IRQ, int level) IRQSource *src; if (n_IRQ >= OPENPIC_MAX_IRQ) { - fprintf(stderr, "%s: IRQ %d out of range\n", __func__, n_IRQ); + error_report("%s: IRQ %d out of range", __func__, n_IRQ); abort(); } @@ -1221,7 +1222,7 @@ static uint32_t openpic_iack(OpenPICState *opp, IRQDest *dst, int cpu) src = &opp->src[irq]; if (!(src->ivpr & IVPR_ACTIVITY_MASK) || !(IVPR_PRIORITY(src->ivpr) > dst->ctpr)) { - fprintf(stderr, "%s: bad raised IRQ %d ctpr %d ivpr 0x%08x\n", + error_report("%s: bad raised IRQ %d ctpr %d ivpr 0x%08x", __func__, irq, dst->ctpr, src->ivpr); openpic_update_irq(opp, irq); retval = opp->spve; diff --git a/hw/intc/openpic_kvm.c b/hw/intc/openpic_kvm.c index fa83420254..60c784ae86 100644 --- a/hw/intc/openpic_kvm.c +++ b/hw/intc/openpic_kvm.c @@ -150,8 +150,8 @@ static void kvm_openpic_region_add(MemoryListener *listener, ret = ioctl(opp->fd, KVM_SET_DEVICE_ATTR, &attr); if (ret < 0) { - fprintf(stderr, "%s: %s %" PRIx64 "\n", __func__, - strerror(errno), reg_base); + error_report("%s: %s %" PRIx64 "", __func__, + strerror(errno), reg_base); } } @@ -184,8 +184,8 @@ static void kvm_openpic_region_del(MemoryListener *listener, ret = ioctl(opp->fd, KVM_SET_DEVICE_ATTR, &attr); if (ret < 0) { - fprintf(stderr, "%s: %s %" PRIx64 "\n", __func__, - strerror(errno), reg_base); + error_report("%s: %s %" PRIx64 "", __func__, + strerror(errno), reg_base); } } diff --git a/hw/intc/s390_flic_kvm.c b/hw/intc/s390_flic_kvm.c index d208cb81c4..e710bfdcda 100644 --- a/hw/intc/s390_flic_kvm.c +++ b/hw/intc/s390_flic_kvm.c @@ -83,7 +83,7 @@ static void flic_enable_pfault(KVMS390FLICState *flic) rc = ioctl(flic->fd, KVM_SET_DEVICE_ATTR, &attr); if (rc) { - fprintf(stderr, "flic: couldn't enable pfault\n"); + error_report("flic: couldn't enable pfault"); } } @@ -97,7 +97,7 @@ static void flic_disable_wait_pfault(KVMS390FLICState *flic) rc = ioctl(flic->fd, KVM_SET_DEVICE_ATTR, &attr); if (rc) { - fprintf(stderr, "flic: couldn't disable pfault\n"); + error_report("flic: couldn't disable pfault"); } } From patchwork Thu Oct 19 16:16:42 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Alistair Francis X-Patchwork-Id: 828229 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; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=xilinx.onmicrosoft.com header.i=@xilinx.onmicrosoft.com header.b="yOGFaDry"; 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 3yHvpq3SxZz9s2G for ; Fri, 20 Oct 2017 03:42:11 +1100 (AEDT) Received: from localhost ([::1]:50167 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e5DtZ-0005SD-Ed for incoming@patchwork.ozlabs.org; Thu, 19 Oct 2017 12:42:09 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:55501) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e5DYs-0004my-Qs for qemu-devel@nongnu.org; Thu, 19 Oct 2017 12:20:47 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1e5DYp-0001Ro-KH for qemu-devel@nongnu.org; Thu, 19 Oct 2017 12:20:46 -0400 Received: from mail-bn3nam01on0057.outbound.protection.outlook.com ([104.47.33.57]:58688 helo=NAM01-BN3-obe.outbound.protection.outlook.com) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1e5DYp-0001RO-D3 for qemu-devel@nongnu.org; Thu, 19 Oct 2017 12:20:43 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=xilinx.onmicrosoft.com; s=selector1-xilinx-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=71ajmO0VbL5klbGQQT4VmfLLhKEsbLj/aDnQhbSxDkA=; b=yOGFaDryI1snpK9nj2Rgtsi7RL/LaOwlFqJyeBlY/O0R7mqQYwA+2oN2IvCgkWU4J4TXSPKd0s7A3W4g7jLpdP1MP/DLvaJjAUWSN1UvV0PR7zNRbWvqcjnMIcntjpFGHmKdaHHrdmRRkJoi6uOiXQI5arklGFIU5Ht1F2qQxZQ= Received: from MWHPR02CA0014.namprd02.prod.outlook.com (10.168.209.152) by CY1PR02MB1334.namprd02.prod.outlook.com (10.161.170.25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.77.7; Thu, 19 Oct 2017 16:20:41 +0000 Received: from SN1NAM02FT055.eop-nam02.prod.protection.outlook.com (2a01:111:f400:7e44::208) by MWHPR02CA0014.outlook.office365.com (2603:10b6:300:4b::24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.77.7 via Frontend Transport; Thu, 19 Oct 2017 16:20:41 +0000 Authentication-Results: spf=pass (sender IP is 149.199.60.100) smtp.mailfrom=xilinx.com; redhat.com; dkim=none (message not signed) header.d=none;redhat.com; dmarc=bestguesspass action=none header.from=xilinx.com; Received-SPF: Pass (protection.outlook.com: domain of xilinx.com designates 149.199.60.100 as permitted sender) receiver=protection.outlook.com; client-ip=149.199.60.100; helo=xsj-pvapsmtpgw02; Received: from xsj-pvapsmtpgw02 (149.199.60.100) by SN1NAM02FT055.mail.protection.outlook.com (10.152.72.174) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.20.77.10 via Frontend Transport; Thu, 19 Oct 2017 16:20:40 +0000 Received: from unknown-38-66.xilinx.com ([149.199.38.66]:37950 helo=xsj-pvapsmtp01) by xsj-pvapsmtpgw02 with esmtp (Exim 4.63) (envelope-from ) id 1e5DYm-0007wN-34; Thu, 19 Oct 2017 09:20:40 -0700 Received: from [127.0.0.1] (helo=localhost) by xsj-pvapsmtp01 with smtp (Exim 4.63) (envelope-from ) id 1e5DYl-0002zV-V2; Thu, 19 Oct 2017 09:20:40 -0700 Received: from xsj-pvapsmtp01 (mailhub.xilinx.com [149.199.38.66]) by xsj-smtp-dlp2.xlnx.xilinx.com (8.13.8/8.13.1) with ESMTP id v9JGKZKr006671; Thu, 19 Oct 2017 09:20:36 -0700 Received: from [172.19.2.220] (helo=localhost.localdomain) by xsj-pvapsmtp01 with esmtp (Exim 4.63) (envelope-from ) id 1e5DYh-0002z2-TL; Thu, 19 Oct 2017 09:20:35 -0700 From: Alistair Francis To: Date: Thu, 19 Oct 2017 09:16:42 -0700 Message-ID: X-Mailer: git-send-email 2.11.0 In-Reply-To: References: MIME-Version: 1.0 X-RCIS-Action: ALLOW X-TM-AS-Product-Ver: IMSS-7.1.0.1224-8.1.0.1062-23404.005 X-TM-AS-User-Approved-Sender: Yes;Yes X-EOPAttributedMessage: 0 X-MS-Office365-Filtering-HT: Tenant X-Forefront-Antispam-Report: CIP:149.199.60.100; IPV:NLI; CTRY:US; EFV:NLI; SFV:NSPM; SFS:(10009020)(6009001)(376002)(39860400002)(346002)(2980300002)(438002)(199003)(189002)(81166006)(6666003)(54906003)(4326008)(2950100002)(50226002)(478600001)(47776003)(23676002)(106002)(316002)(6916009)(5820100001)(39060400002)(77096006)(2351001)(81156014)(8936002)(106466001)(36756003)(33646002)(8676002)(63266004)(5660300001)(76176999)(50986999)(36386004)(50466002)(2906002)(9786002)(305945005)(2870700001)(118296001)(189998001)(356003)(107986001)(5001870100001); DIR:OUT; SFP:1101; SCL:1; SRVR:CY1PR02MB1334; H:xsj-pvapsmtpgw02; FPR:; SPF:Pass; PTR:xapps1.xilinx.com,unknown-60-100.xilinx.com; A:1; MX:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; SN1NAM02FT055; 1:WEXM4hadYQqSjhr75VQl5I1nPjrzGCAa/44oAKYWEl0uINbK4eIg7YBDLO05OMmwbjOMXS2QYh6TazH1yFeD9d5jCQRRb3KSdEJ8xF7pbsAuIS2NixccVO6T0HXWuS7U X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 64230775-0809-408a-0b0b-08d5170d572a X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001)(2017030254152)(8251501002)(2017052603199)(201703131423075)(201703031133081)(201702281549075); SRVR:CY1PR02MB1334; X-Microsoft-Exchange-Diagnostics: 1; CY1PR02MB1334; 3:jHdQoD+Ut6qGovfWQb7DlI8F/YsO7kFqdJszrABvrUwsIzC+LamJWK6CQdZLx+QE6AnMDaU+4MfE2jBhe2sF/WndDYEwODKFCTA1bNbZ9fU7TxQa9CL0Yl1b7q4f1Ayo3LfEGH9vVb8xP/wKzt6SD2xqN9h3WCDWvhjMWSsJXwhCznu/r0owJrIJvZQ7MTYFp3tXmysCjvVVwWX9lgEAinOKkGlENPIyYvfzbfQn+/ryAjtkM/qumtltx0Lra2l/wXk4TM+dZnAylUiIDMRJklWh9Td8+ZoaDIoXQB9qU7mMymTNVLQjut2acud4ZwQfmRNgdTAD/njyVi7iEwJBC0sFd6bwqP4afzxna7rqANA=; 25:4Fm/bpI5IJakirMe5dp7cq91o86KJcfTXrtVIb43eZX0NnPcJU4/7SbN8swh44uvWyv2vION/w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zjiY/V26 X-Exchange-Antispam-Report-Test: UriScan:(788757137089)(192813158149592); X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(100000700101)(100105000095)(100000701101)(100105300095)(100000702101)(100105100095)(6040450)(2401047)(8121501046)(5005006)(93006095)(93004095)(10201501046)(100000703101)(100105400095)(3002001)(6055026)(6041248)(20161123555025)(20161123560025)(20161123564025)(20161123558100)(20161123562025)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(6072148)(201708071742011)(100000704101)(100105200095)(100000705101)(100105500095); SRVR:CY1PR02MB1334; BCL:0; PCL:0; RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095); SRVR:CY1PR02MB1334; X-Microsoft-Exchange-Diagnostics: 1; CY1PR02MB1334; 4:CBLifrCFWnba+JGET1cYCdVAtCfkxVyQvFY0tXyd740AIIj7h8lCsu3Jku+tcCScYUHzx9cHDLMSdxhEyiETG0fp0QxisAVLwn4GTw43VeccV63lBy8MoVJQ0cZaLJ3qnfBPVIZkdMdWdWXjg/m6LfYUX5Pd2nEzGkBH+V6gRcp6SQt69CjK34R9rxL48lmwaNdrgMZr6phmCI3lyUcAktjeQfXBMEl0of4PWVMKG5wusI6ucGMibaROAR2TBK6xgDeJMmJTfRL2bUBRsgwMqMl1lROKYWfHQvK9Mfpa+yfskDfEVGxmB4Xgtvg88E620VtKOqeSaQfBOlpgV0yXNg== X-Forefront-PRVS: 0465429B7F X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; CY1PR02MB1334; 23:10s2Jp50y0Y8w/wCq24DlV5SVjkQWdc3HqG8o0Jw1?= F4hgRZgJmTgpEjNDMg1UzQOdZa1HbDi2JQOogvY+jkNcnjtrWVEomeBKYdgoGv5DWCHsJ6gcTkr4r6DFPDBFr6fhydlp37u6MgfReqfOdgT4fgW5ecBbfpGesS6LRXuJp8X9/iRs7qr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IG2uo5S+932hia9wNNwergwmOmaFPxJCfwG5cs5fpKYq3E7l6aif5CAqBbaSzPQ6oLDXHHl6dEWEpLPWQPBdTL3o36waqu6BojzdextG5xhaBuiILBCnh/V6A4OAL0brccxNyjAtLxYhgkM32qnu4GG4AG1Y+Zgur+nnyhLHO2xa0bk/Ivlv/R2ANROLPTydkf8veFU6W3FcA==; 5:P9CMd6xWuSC3MzC+zmQ/3lxR74vVA5WguHWTFKbn8d/RoN4AnTFv10FilVk8F5HFg4Y4zmHIPON4hGJO+Sd6xixJTK0NYvmRcXvcpNaZq+b/MrQdMNpUhPW603qTUdwHUDJGBWyZzRRSx9/MT0ahtw==; 24:DPWZ7FGXZVvT2FwEHgrz42xfrXSGfd0H8/o0wz/XORZGOZYD44fuSQtYpfqnCG4sMTUhB7NdCFo9O5qZ+6oypYx+egKx4ZIhyiVHigHH9aE=; 7:RZZY4MoZiF5MC4GPPw0S/tsD7jHU7sz88/WXiZ5Cnd512tMFw488qlREEQL7EvpmroDCzbsQaor8A0k854A278UewJePkFOXzjvfQMDci2TVwy9kRCmg4j1HDAj/g2MiyFG2jJ/Asl20I1PrFuJWFg8uz0MIxKQfrR3UL19NBfqh8ZO6VDD9nOQjc1YWsgS4a9buzXEhNE+HRP9rIUhHgII1sgqfZOO4GUzlGDttXXU= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: xilinx.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 19 Oct 2017 16:20:40.4992 (UTC) X-MS-Exchange-CrossTenant-Id: 657af505-d5df-48d0-8300-c31994686c5c X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=657af505-d5df-48d0-8300-c31994686c5c; Ip=[149.199.60.100]; Helo=[xsj-pvapsmtpgw02] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY1PR02MB1334 X-detected-operating-system: by eggs.gnu.org: Windows 7 or 8 [fuzzy] X-Received-From: 104.47.33.57 Subject: [Qemu-devel] [PATCH v3 19/46] hw/ipmi: Replace fprintf(stderr, "*\n" with error_report() 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: alistair23@gmail.com, armbru@redhat.com, alistair.francis@xilinx.com Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" Replace a large number of the fprintf(stderr, "*\n" calls with error_report(). The functions were renamed with these commands and then compiler issues where manually fixed. find ./* -type f -exec sed -i \ 'N;N;N;N;N;N;N;N;N;N;N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2);|Ig}' \ {} + find ./* -type f -exec sed -i \ 'N;N;N;N;N;N;N;N;N;N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2);|Ig}' \ {} + find ./* -type f -exec sed -i \ 'N;N;N;N;N;N;N;N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2);|Ig}' \ {} + find ./* -type f -exec sed -i \ 'N;N;N;N;N;N;N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2);|Ig}' \ {} + find ./* -type f -exec sed -i \ 'N;N;N;N;N;N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2);|Ig}' \ {} + find ./* -type f -exec sed -i \ 'N;N;N;N;N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2);|Ig}' \ {} + find ./* -type f -exec sed -i \ 'N;N;N;N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2);|Ig}' \ {} + find ./* -type f -exec sed -i \ 'N;N;N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2);|Ig}' \ {} + find ./* -type f -exec sed -i \ 'N;N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2);|Ig}' \ {} + find ./* -type f -exec sed -i \ 'N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2);|Ig}' \ {} + find ./* -type f -exec sed -i \ 'N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2);|Ig}' \ {} + Some lines where then manually tweaked to pass checkpatch. Signed-off-by: Alistair Francis Reviewed-by: Philippe Mathieu-Daudé --- V3: - Remove left over include V2: - Split hw patch into individual directories hw/ipmi/ipmi_bmc_extern.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/hw/ipmi/ipmi_bmc_extern.c b/hw/ipmi/ipmi_bmc_extern.c index abab3bba4f..8c0535d3dd 100644 --- a/hw/ipmi/ipmi_bmc_extern.c +++ b/hw/ipmi/ipmi_bmc_extern.c @@ -28,6 +28,7 @@ */ #include "qemu/osdep.h" +#include "qemu/error-report.h" #include "qapi/error.h" #include "qemu/timer.h" #include "chardev/char-fe.h" @@ -194,8 +195,8 @@ static void ipmi_bmc_extern_handle_command(IPMIBmc *b, if (ibe->outlen) { /* We already have a command queued. Shouldn't ever happen. */ - fprintf(stderr, "IPMI KCS: Got command when not finished with the" - " previous command\n"); + error_report("IPMI KCS: Got command when not finished with the" + " previous command"); abort(); } From patchwork Thu Oct 19 16:16:46 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Alistair Francis X-Patchwork-Id: 828238 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; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=xilinx.onmicrosoft.com header.i=@xilinx.onmicrosoft.com header.b="vFTq9XnM"; 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 3yHvxB34tnz9s72 for ; Fri, 20 Oct 2017 03:47:42 +1100 (AEDT) Received: from localhost ([::1]:50200 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e5Dyu-0001ty-Ev for incoming@patchwork.ozlabs.org; Thu, 19 Oct 2017 12:47:40 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:55592) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e5DZ3-0004wN-Sv for qemu-devel@nongnu.org; Thu, 19 Oct 2017 12:20:59 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1e5DZ0-0001XL-LU for qemu-devel@nongnu.org; Thu, 19 Oct 2017 12:20:57 -0400 Received: from mail-by2nam03on0066.outbound.protection.outlook.com ([104.47.42.66]:36592 helo=NAM03-BY2-obe.outbound.protection.outlook.com) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1e5DZ0-0001WY-CP for qemu-devel@nongnu.org; Thu, 19 Oct 2017 12:20:54 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=xilinx.onmicrosoft.com; s=selector1-xilinx-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=Lr4ZTul+5rs87pWpEVf3C5JrpgryDN68M9xuzTTLjXk=; b=vFTq9XnMdGr/oEu0XVIlj68V29YlILqpgRLLKpKEmpnwcRpL7zVJTEB0cScbBpSyAMedhlOQLS6Hu12MJSmeGLxoPDk7zlFjF1AT+Vk3Wy/6Bp/Zkdv+lxoaEXP97Us5US7RaLb+Tofzto/kD0R9Dkh9DaC4D5kKquZuqoBuLXA= Received: from SN4PR0201CA0035.namprd02.prod.outlook.com (10.162.76.21) by CY4PR02MB3382.namprd02.prod.outlook.com (10.165.89.153) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.77.7; Thu, 19 Oct 2017 16:20:51 +0000 Received: from CY1NAM02FT017.eop-nam02.prod.protection.outlook.com (2a01:111:f400:7e45::207) by SN4PR0201CA0035.outlook.office365.com (2603:10b6:803:2e::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.156.4 via Frontend Transport; Thu, 19 Oct 2017 16:20:51 +0000 Authentication-Results: spf=pass (sender IP is 149.199.60.100) smtp.mailfrom=xilinx.com; redhat.com; dkim=none (message not signed) header.d=none;redhat.com; dmarc=bestguesspass action=none header.from=xilinx.com; Received-SPF: Pass (protection.outlook.com: domain of xilinx.com designates 149.199.60.100 as permitted sender) receiver=protection.outlook.com; client-ip=149.199.60.100; helo=xsj-pvapsmtpgw02; Received: from xsj-pvapsmtpgw02 (149.199.60.100) by CY1NAM02FT017.mail.protection.outlook.com (10.152.75.181) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.20.77.10 via Frontend Transport; Thu, 19 Oct 2017 16:20:50 +0000 Received: from unknown-38-66.xilinx.com ([149.199.38.66]:38099 helo=xsj-pvapsmtp01) by xsj-pvapsmtpgw02 with esmtp (Exim 4.63) (envelope-from ) id 1e5DYw-0007wT-FG; Thu, 19 Oct 2017 09:20:50 -0700 Received: from [127.0.0.1] (helo=localhost) by xsj-pvapsmtp01 with smtp (Exim 4.63) (envelope-from ) id 1e5DYw-000314-AO; Thu, 19 Oct 2017 09:20:50 -0700 Received: from xsj-pvapsmtp01 (mailman.xilinx.com [149.199.38.66]) by xsj-smtp-dlp1.xlnx.xilinx.com (8.13.8/8.13.1) with ESMTP id v9JGKeDs017895; Thu, 19 Oct 2017 09:20:40 -0700 Received: from [172.19.2.220] (helo=localhost.localdomain) by xsj-pvapsmtp01 with esmtp (Exim 4.63) (envelope-from ) id 1e5DYl-0002zX-Vk; Thu, 19 Oct 2017 09:20:40 -0700 From: Alistair Francis To: Date: Thu, 19 Oct 2017 09:16:46 -0700 Message-ID: <10e63c6a862eee19dae31128b8301f3d566fe30d.1508390588.git.alistair.francis@xilinx.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: References: MIME-Version: 1.0 X-RCIS-Action: ALLOW X-TM-AS-Product-Ver: IMSS-7.1.0.1224-8.1.0.1062-23404.005 X-TM-AS-User-Approved-Sender: Yes;Yes X-EOPAttributedMessage: 0 X-MS-Office365-Filtering-HT: Tenant X-Forefront-Antispam-Report: CIP:149.199.60.100; IPV:NLI; CTRY:US; EFV:NLI; SFV:NSPM; SFS:(10009020)(6009001)(346002)(39860400002)(376002)(2980300002)(438002)(199003)(189002)(6306002)(8676002)(2950100002)(50226002)(47776003)(9786002)(81166006)(5820100001)(81156014)(77096006)(36386004)(63266004)(189998001)(54906003)(316002)(478600001)(8936002)(106466001)(50466002)(6916009)(356003)(118296001)(106002)(76176999)(305945005)(50986999)(2870700001)(39060400002)(36756003)(23676002)(2906002)(5660300001)(4326008)(33646002)(2351001)(575784001)(107986001)(5001870100001); DIR:OUT; SFP:1101; SCL:1; SRVR:CY4PR02MB3382; H:xsj-pvapsmtpgw02; FPR:; SPF:Pass; PTR:unknown-60-100.xilinx.com,xapps1.xilinx.com; A:1; MX:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; CY1NAM02FT017; 1:7xbHQm+FLtDuCdkdHC/LMkQN+VD63QvSN/3ON5JCKSWr/XoD7vPbPuz+mnoe8s440pVxnhAaCIy2Cmc3fdx4B4UxNSjl0g9mIqRI8giA9j5YK60SDU2LWmzPFNCrQXFu X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 215047e5-4006-4b59-20d9-08d5170d5d69 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001)(2017030254168)(8251501002)(4534016)(4602075)(4627075)(201703031133081)(201702281549075)(2017052603199)(201703131423091); SRVR:CY4PR02MB3382; X-Microsoft-Exchange-Diagnostics: 1; CY4PR02MB3382; 3:5n0sg3XzJwL8ufoxElfRIyex08gy5Tv7EF/i0KymBtRhkRWW838gcFdet18Ot1YSe6bDp3VEobqq1EGBuMhwZA+zsiaKJD/UyRDbViZg4wVP+cRKys1ipNkyMW9z/cfegerz4/m/hrLLT0Cq9oQLF1xQVntuPW4IffRrFXhx98IUXHb/ewoWEH4o/1QctT6J/fgMLc7uurkPHzjvDtODbz5VlVipxDeu21Vwus7slv0vHkJOMj7kzpxVNrp9GUIm8yrfGcJas7Fne7T6Nz+9yVSUdjPIbZX9YcZHta8UOF1SVlqB+vcckW89Kh7QKfiFoufA9Ry5IfIWHK1FdAVqyHoKQGKMy1M3XPj0E7n2VaQ=; 25:aGunyObysdKB8IXg/45EjcWjzonvoMbklz9YrY8jQFesARk23kuOqcIYDOxqdSTIjTLqJ1tOIrBtrYUxbhYj+pnCp2FAqTT6voU/5FaYT7hjznorv/9b2+dYmv/ZNyOq3N1dYGHZyxjlw5zkehf2PxPfkl4I+pCtqQebKsnEBbQqS4b1mB7J6m43o13NT34nI2Q4n+z9ut9+T0cN8jevOxr9Y/AI/DMYuAC7+9AV2VKF41WXDyHUS0r22XcKGB4xb2zOfA2wL8B2D9Vw2+TXT/mHMtrmVKitqyDtMJ1CSkzZI0jm6IZSeJYr6Bo/27DSNQC28GTm1L/TG4h7nxWvqA== X-MS-TrafficTypeDiagnostic: CY4PR02MB3382: X-Microsoft-Exchange-Diagnostics: 1; CY4PR02MB3382; 31:uBO6EaiyyIP1ZCL7b3C2MhjE0mZeTRe5amEq0JBTgqgB43IlSUfNUufaf9CS66yAv7VxjcBZhZENzUXirQ5/Qitr0EVytlfvU8x1d+Fnrh7Bf2LIkrJeRtpImeE2iO6ecvr47gs+w5dzMSLz75O4ce6biXMhJ3v6ZC20US4zzFwJUmk62duf55r0dNUFjfN5Uyfc6jhiPPjwkuved3m+hOsp+t9bGFISlilYAfOGfn4=; 20:2h2h3TqA19txE3e4RI6DW1n+9/4GxLpRDhkTq+K0LB0tLZiY7CgY/FJblrIbgZn3TlAtvcsXFxryR6+/7P+r6KKr1TYWrwgvJd4SUm9zTgzz9Do/0DBV+jXKV/NRfbcqVKiH+A3+O8RZflJLsQiKSX0DjGhnJod+JjE9mRqv67gqggFgYDq7QyVP8k8luuOlOJWCXjo++FQJedOpgbFOOri3CxEmPML/wN++RQK8hUFclqKN6/yb73tVEVSLriKh9CuB2vm+NqgAcuL5S+Ra/W+eV1e20MUdFl25MOEi3ru4+0jCPQd3f8x1JroBZ6BOnu/4UKgTWetQPXihwApqi88hs+Rn4TYu0mrdhi3NUat1QYQ+jHqFCy9hVspMfNuK91UnZs3lxdx9VcJH0uS59MR99X1OfiKFZoWqKbAUk0qYhTETeri2Cn2Y7KN8o5Iyady9xpeB8lnahewWhBTIn2FoXMyskVnIHSNIVy/l5YJIybrCz4P/6PNP1409NS7v X-Exchange-Antispam-Report-Test: UriScan:(250305191791016)(22074186197030)(788757137089)(192813158149592); X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(100000700101)(100105000095)(100000701101)(100105300095)(100000702101)(100105100095)(6040450)(2401047)(8121501046)(5005006)(3002001)(93006095)(93004095)(10201501046)(100000703101)(100105400095)(6055026)(6041248)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123560025)(20161123564025)(20161123562025)(20161123558100)(20161123555025)(6072148)(201708071742011)(100000704101)(100105200095)(100000705101)(100105500095); SRVR:CY4PR02MB3382; BCL:0; PCL:0; RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095); SRVR:CY4PR02MB3382; X-Microsoft-Exchange-Diagnostics: 1; CY4PR02MB3382; 4:6JM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AAao9KLqoVlQMLCdv2oC94XTT0Ymx9vnbtmnRdrgKXi8rJ/5jyMZyVCL2LD1WR0=; 7:vkj28ITQ3n//uNjy7QiADEtqrbzkf7t1GJSRRDVnjxqKnmefE7WbQ3gZPyc5XtuCLCXi2MHeuofMq7XZM3TjE1oblnT4g506+CmU3D+xWNbALwS4uoxrt4nFyYg6TQBamE7R2DwqRUsczAtFs8mpqWrQGCa/RlOJjFfockgqr/CJ95bVqW4DtcbpQQm1nigHvdkQ99DpD6Th/VOI12xlRL1XU10ukg02uWZvrRnobHo= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: xilinx.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 19 Oct 2017 16:20:50.8851 (UTC) X-MS-Exchange-CrossTenant-Id: 657af505-d5df-48d0-8300-c31994686c5c X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=657af505-d5df-48d0-8300-c31994686c5c; Ip=[149.199.60.100]; Helo=[xsj-pvapsmtpgw02] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY4PR02MB3382 X-detected-operating-system: by eggs.gnu.org: Windows 7 or 8 [fuzzy] X-Received-From: 104.47.42.66 Subject: [Qemu-devel] [PATCH v3 20/46] hw/isa: Replace fprintf(stderr, "*\n" with error_report() 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: alistair23@gmail.com, armbru@redhat.com, alistair.francis@xilinx.com Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" Replace a large number of the fprintf(stderr, "*\n" calls with error_report(). The functions were renamed with these commands and then compiler issues where manually fixed. find ./* -type f -exec sed -i \ 'N;N;N;N;N;N;N;N;N;N;N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2);|Ig}' \ {} + find ./* -type f -exec sed -i \ 'N;N;N;N;N;N;N;N;N;N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2);|Ig}' \ {} + find ./* -type f -exec sed -i \ 'N;N;N;N;N;N;N;N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2);|Ig}' \ {} + find ./* -type f -exec sed -i \ 'N;N;N;N;N;N;N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2);|Ig}' \ {} + find ./* -type f -exec sed -i \ 'N;N;N;N;N;N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2);|Ig}' \ {} + find ./* -type f -exec sed -i \ 'N;N;N;N;N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2);|Ig}' \ {} + find ./* -type f -exec sed -i \ 'N;N;N;N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2);|Ig}' \ {} + find ./* -type f -exec sed -i \ 'N;N;N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2);|Ig}' \ {} + find ./* -type f -exec sed -i \ 'N;N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2);|Ig}' \ {} + find ./* -type f -exec sed -i \ 'N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2);|Ig}' \ {} + find ./* -type f -exec sed -i \ 'N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2);|Ig}' \ {} + Some lines where then manually tweaked to pass checkpatch. Signed-off-by: Alistair Francis Reviewed-by: Philippe Mathieu-Daudé --- V2: - Split hw patch into individual directories hw/isa/isa-bus.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/hw/isa/isa-bus.c b/hw/isa/isa-bus.c index 348e0eab9d..0f2e426d02 100644 --- a/hw/isa/isa-bus.c +++ b/hw/isa/isa-bus.c @@ -17,6 +17,7 @@ * License along with this library; if not, see . */ #include "qemu/osdep.h" +#include "qemu/error-report.h" #include "qapi/error.h" #include "hw/hw.h" #include "monitor/monitor.h" @@ -186,15 +187,15 @@ ISADevice *isa_vga_init(ISABus *bus) case VGA_CIRRUS: return isa_create_simple(bus, "isa-cirrus-vga"); case VGA_QXL: - fprintf(stderr, "%s: qxl: no PCI bus\n", __func__); + error_report("%s: qxl: no PCI bus", __func__); return NULL; case VGA_STD: return isa_create_simple(bus, "isa-vga"); case VGA_VMWARE: - fprintf(stderr, "%s: vmware_vga: no PCI bus\n", __func__); + error_report("%s: vmware_vga: no PCI bus", __func__); return NULL; case VGA_VIRTIO: - fprintf(stderr, "%s: virtio-vga: no PCI bus\n", __func__); + error_report("%s: virtio-vga: no PCI bus", __func__); return NULL; case VGA_NONE: default: From patchwork Thu Oct 19 16:16:50 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Alistair Francis X-Patchwork-Id: 828225 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; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=xilinx.onmicrosoft.com header.i=@xilinx.onmicrosoft.com header.b="q8901rcr"; 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 3yHvm82jjtz9t6m for ; Fri, 20 Oct 2017 03:39:52 +1100 (AEDT) Received: from localhost ([::1]:50153 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e5DrK-0003Sw-Bf for incoming@patchwork.ozlabs.org; Thu, 19 Oct 2017 12:39:50 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:55590) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e5DZ3-0004wI-Pt for qemu-devel@nongnu.org; Thu, 19 Oct 2017 12:20:59 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1e5DZ0-0001XE-J0 for qemu-devel@nongnu.org; Thu, 19 Oct 2017 12:20:57 -0400 Received: from mail-bl2nam02on0082.outbound.protection.outlook.com ([104.47.38.82]:25234 helo=NAM02-BL2-obe.outbound.protection.outlook.com) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1e5DZ0-0001Wk-DL for qemu-devel@nongnu.org; Thu, 19 Oct 2017 12:20:54 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=xilinx.onmicrosoft.com; s=selector1-xilinx-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=Mt6ryCSbU9aRtZzCtv4eFHusSsEszkLCKMldA9rYx5o=; b=q8901rcrJcdh46xO560S9RyhlEb4BOJBBzGnV1ayBVw58Pc1nXP93hHdvv/yp0ob/q2Cie5uZXOvetMyNBiFeHNMxR8DwQDtha7tFfRCENauK7gDrP4dR2fYKSWKprWtMJlGlLtEEibV+HBhfOI6jgC0b82H+mKmqvu2eVTuuaI= Received: from BN6PR02CA0045.namprd02.prod.outlook.com (10.173.146.159) by DM5PR02MB3385.namprd02.prod.outlook.com (10.164.152.161) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.77.7; Thu, 19 Oct 2017 16:20:52 +0000 Received: from SN1NAM02FT060.eop-nam02.prod.protection.outlook.com (2a01:111:f400:7e44::205) by BN6PR02CA0045.outlook.office365.com (2603:10b6:404:5f::31) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.77.7 via Frontend Transport; Thu, 19 Oct 2017 16:20:52 +0000 Authentication-Results: spf=pass (sender IP is 149.199.60.100) smtp.mailfrom=xilinx.com; walle.cc; dkim=none (message not signed) header.d=none;walle.cc; dmarc=bestguesspass action=none header.from=xilinx.com; Received-SPF: Pass (protection.outlook.com: domain of xilinx.com designates 149.199.60.100 as permitted sender) receiver=protection.outlook.com; client-ip=149.199.60.100; helo=xsj-pvapsmtpgw02; Received: from xsj-pvapsmtpgw02 (149.199.60.100) by SN1NAM02FT060.mail.protection.outlook.com (10.152.72.192) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.20.77.10 via Frontend Transport; Thu, 19 Oct 2017 16:20:50 +0000 Received: from unknown-38-66.xilinx.com ([149.199.38.66]:38109 helo=xsj-pvapsmtp01) by xsj-pvapsmtpgw02 with esmtp (Exim 4.63) (envelope-from ) id 1e5DYw-0007wZ-J3; Thu, 19 Oct 2017 09:20:50 -0700 Received: from [127.0.0.1] (helo=localhost) by xsj-pvapsmtp01 with smtp (Exim 4.63) (envelope-from ) id 1e5DYw-000314-Fi; Thu, 19 Oct 2017 09:20:50 -0700 Received: from xsj-pvapsmtp01 (xsj-pvapsmtp01.xilinx.com [149.199.38.66]) by xsj-smtp-dlp1.xlnx.xilinx.com (8.13.8/8.13.1) with ESMTP id v9JGKjH9017901; Thu, 19 Oct 2017 09:20:45 -0700 Received: from [172.19.2.220] (helo=localhost.localdomain) by xsj-pvapsmtp01 with esmtp (Exim 4.63) (envelope-from ) id 1e5DYr-000304-As; Thu, 19 Oct 2017 09:20:45 -0700 From: Alistair Francis To: Date: Thu, 19 Oct 2017 09:16:50 -0700 Message-ID: <920243e2e3323424d76116ae7bee8423207b68f5.1508390588.git.alistair.francis@xilinx.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: References: MIME-Version: 1.0 X-RCIS-Action: ALLOW X-TM-AS-Product-Ver: IMSS-7.1.0.1224-8.1.0.1062-23404.005 X-TM-AS-User-Approved-Sender: Yes;Yes X-EOPAttributedMessage: 0 X-MS-Office365-Filtering-HT: Tenant X-Forefront-Antispam-Report: CIP:149.199.60.100; IPV:NLI; CTRY:US; EFV:NLI; SFV:NSPM; SFS:(10009020)(6009001)(346002)(39860400002)(376002)(2980300002)(438002)(189002)(199003)(8936002)(33646002)(106466001)(36756003)(36386004)(5660300001)(189998001)(2870700001)(4326008)(5820100001)(118296001)(81166006)(47776003)(8676002)(81156014)(63266004)(9786002)(2351001)(356003)(106002)(316002)(6916009)(77096006)(575784001)(50226002)(50986999)(2950100002)(23676002)(76176999)(54906003)(2906002)(478600001)(6666003)(305945005)(39060400002)(50466002)(107986001)(5001870100001); DIR:OUT; SFP:1101; SCL:1; SRVR:DM5PR02MB3385; H:xsj-pvapsmtpgw02; FPR:; SPF:Pass; PTR:unknown-60-100.xilinx.com,xapps1.xilinx.com; MX:1; A:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; SN1NAM02FT060; 1:PX5avG6LG9pej2fMM1GmfcJXaySrH3Dn7KIKjrkO9ZdNWrg9zgWok7qpPAjjTCavZYj41TD9knOYSjxUTQkMGKKXiOOyVpTOh/fijeYnrghlbK076dhJs9EKzuoDLr0W X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: c8e54608-804a-4a2c-fdbd-08d5170d5d5a X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001)(2017030254152)(8251501002)(2017052603199)(201703131423075)(201703031133081)(201702281549075); SRVR:DM5PR02MB3385; X-Microsoft-Exchange-Diagnostics: 1; DM5PR02MB3385; 3:A4KLtPcmw06IqDv0DEAWX3tul4T2Ozvgh6bbxkKvg5pbXpF0VGZt1ijYjils0esl+C0Q+/7t7QkAaMTuMEIYjBAFAly1GvhYmxCWb6wLbZi6cybSiclItVIhfyRyd5dFIMvHPKraVm11fGc4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pHbS/49GBkV9z++W+DlUOsXVvrRhgDHerZaQWhx0lxHKLpZtM0OCSGA5xOC2lO+iwVd7PdbttVAG/74D3fH5tr2YDO/dMKH0sY5SP+tHamDNKZ2zXFomsLghxWRopaKcJk81N0//W67Ts9jZmg22VzHVTT4Mja0LcZOWd/CdsuMQNZyoEVIvXcjze2Zq4LLIoroODS5OKvLYoIZK/OBiNEarxdIDpDg959Y5xntGTPlw+NDyhex/RCms/A97WfTTHcU2eICbtpRbgJEl/kMg/WNRB0/kaACAeGooVX5TSdFh0ZPKx87rwq9zfw X-Exchange-Antispam-Report-Test: UriScan:(788757137089)(192813158149592); X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(100000700101)(100105000095)(100000701101)(100105300095)(100000702101)(100105100095)(6040450)(2401047)(8121501046)(5005006)(3002001)(93006095)(93004095)(100000703101)(100105400095)(10201501046)(6055026)(6041248)(20161123558100)(20161123555025)(20161123560025)(20161123564025)(20161123562025)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(6072148)(201708071742011)(100000704101)(100105200095)(100000705101)(100105500095); SRVR:DM5PR02MB3385; BCL:0; PCL:0; RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095); SRVR:DM5PR02MB3385; X-Microsoft-Exchange-Diagnostics: 1; DM5PR02MB3385; 4:QjaJLWJUVSmomoRHH8BHwoY1m3FEqRzP2VqApyf3Zpw8kjl0J03C5+KFge14ik/nFpOltaIB+JAOiwOCBcbBR7NZV8Wj1QfCxv5kjGMlBzBz1TYGWbnt1tgqMlXrQgz+ANcbzXiWSpj5fUzeYhcy/FzB98jhN4/KYUAHHB6Po3YuGCzBkXbdqgxI59Z5uHhnOc+SbLKjPI8zJN1m4vplLEpPgjaafODzqfQofkbv5IafEOHxYLCd9iKQkSu0PLLt4FXe+j457MQr4zldaH0/ohh9T6Dv2bJqvqZdJf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SPM X-OriginatorOrg: xilinx.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 19 Oct 2017 16:20:50.8863 (UTC) X-MS-Exchange-CrossTenant-Id: 657af505-d5df-48d0-8300-c31994686c5c X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=657af505-d5df-48d0-8300-c31994686c5c; Ip=[149.199.60.100]; Helo=[xsj-pvapsmtpgw02] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM5PR02MB3385 X-detected-operating-system: by eggs.gnu.org: Windows 7 or 8 [fuzzy] X-Received-From: 104.47.38.82 Subject: [Qemu-devel] [PATCH v3 21/46] hw/lm32: Replace fprintf(stderr, "*\n" with error_report() 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: alistair23@gmail.com, Michael Walle , armbru@redhat.com, alistair.francis@xilinx.com Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" Replace a large number of the fprintf(stderr, "*\n" calls with error_report(). The functions were renamed with these commands and then compiler issues where manually fixed. find ./* -type f -exec sed -i \ 'N;N;N;N;N;N;N;N;N;N;N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2);|Ig}' \ {} + find ./* -type f -exec sed -i \ 'N;N;N;N;N;N;N;N;N;N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2);|Ig}' \ {} + find ./* -type f -exec sed -i \ 'N;N;N;N;N;N;N;N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2);|Ig}' \ {} + find ./* -type f -exec sed -i \ 'N;N;N;N;N;N;N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2);|Ig}' \ {} + find ./* -type f -exec sed -i \ 'N;N;N;N;N;N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2);|Ig}' \ {} + find ./* -type f -exec sed -i \ 'N;N;N;N;N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2);|Ig}' \ {} + find ./* -type f -exec sed -i \ 'N;N;N;N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2);|Ig}' \ {} + find ./* -type f -exec sed -i \ 'N;N;N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2);|Ig}' \ {} + find ./* -type f -exec sed -i \ 'N;N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2);|Ig}' \ {} + find ./* -type f -exec sed -i \ 'N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2);|Ig}' \ {} + find ./* -type f -exec sed -i \ 'N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2);|Ig}' \ {} + Some lines where then manually tweaked to pass checkpatch. Signed-off-by: Alistair Francis Cc: Michael Walle Reviewed-by: Philippe Mathieu-Daudé --- V2: - Split hw patch into individual directories hw/lm32/lm32_boards.c | 7 +++---- hw/lm32/milkymist.c | 7 +++---- 2 files changed, 6 insertions(+), 8 deletions(-) diff --git a/hw/lm32/lm32_boards.c b/hw/lm32/lm32_boards.c index b0bb3ef58a..c00bf683ad 100644 --- a/hw/lm32/lm32_boards.c +++ b/hw/lm32/lm32_boards.c @@ -18,6 +18,7 @@ */ #include "qemu/osdep.h" +#include "qemu/error-report.h" #include "qemu-common.h" #include "cpu.h" #include "hw/sysbus.h" @@ -152,8 +153,7 @@ static void lm32_evr_init(MachineState *machine) } if (kernel_size < 0) { - fprintf(stderr, "qemu: could not load kernel '%s'\n", - kernel_filename); + error_report("could not load kernel '%s'", kernel_filename); exit(1); } } @@ -250,8 +250,7 @@ static void lm32_uclinux_init(MachineState *machine) } if (kernel_size < 0) { - fprintf(stderr, "qemu: could not load kernel '%s'\n", - kernel_filename); + error_report("could not load kernel '%s'", kernel_filename); exit(1); } } diff --git a/hw/lm32/milkymist.c b/hw/lm32/milkymist.c index 4db4d2d533..1000178af6 100644 --- a/hw/lm32/milkymist.c +++ b/hw/lm32/milkymist.c @@ -18,6 +18,7 @@ */ #include "qemu/osdep.h" +#include "qemu/error-report.h" #include "qemu-common.h" #include "cpu.h" #include "hw/sysbus.h" @@ -149,8 +150,7 @@ milkymist_init(MachineState *machine) /* if no kernel is given no valid bios rom is a fatal error */ if (!kernel_filename && !dinfo && !bios_filename && !qtest_enabled()) { - fprintf(stderr, "qemu: could not load Milkymist One bios '%s'\n", - bios_name); + error_report("could not load Milkymist One bios '%s'", bios_name); exit(1); } g_free(bios_filename); @@ -188,8 +188,7 @@ milkymist_init(MachineState *machine) } if (kernel_size < 0) { - fprintf(stderr, "qemu: could not load kernel '%s'\n", - kernel_filename); + error_report("could not load kernel '%s'", kernel_filename); exit(1); } } From patchwork Thu Oct 19 16:16:55 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Alistair Francis X-Patchwork-Id: 828221 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; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=xilinx.onmicrosoft.com header.i=@xilinx.onmicrosoft.com header.b="CNCIRmNK"; 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 3yHvht507sz9t7p for ; Fri, 20 Oct 2017 03:37:02 +1100 (AEDT) Received: from localhost ([::1]:50143 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e5Doa-0001AS-MI for incoming@patchwork.ozlabs.org; Thu, 19 Oct 2017 12:37:00 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:55588) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e5DZ3-0004ve-HZ for qemu-devel@nongnu.org; Thu, 19 Oct 2017 12:20:58 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1e5DZ0-0001Wy-Ah for qemu-devel@nongnu.org; Thu, 19 Oct 2017 12:20:57 -0400 Received: from mail-bn3nam01on0058.outbound.protection.outlook.com ([104.47.33.58]:38432 helo=NAM01-BN3-obe.outbound.protection.outlook.com) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1e5DZ0-0001Wc-40 for qemu-devel@nongnu.org; Thu, 19 Oct 2017 12:20:54 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=xilinx.onmicrosoft.com; s=selector1-xilinx-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=/pfZoMQYFJ8hqNOWaAl14FoomsqY8Riye+Psr2sGJ8s=; b=CNCIRmNKXYCS8h71xET2qUNyZia7l+PnJlxkqgHpjQBqI7V8GteENLLocGEJIxcEhGGX3jg33mciNCox5K+Ea4JqJJ8JPDXSRgV56a+LRDGeDMImvH8AV7jVWCnIt+YStNSHxycoAjFxBlXo+/tg0T2Wq6oAJnu2QiOMBHsocRY= Received: from CY4PR02CA0042.namprd02.prod.outlook.com (10.175.57.156) by SN1PR02MB1344.namprd02.prod.outlook.com (10.162.0.15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.156.4; Thu, 19 Oct 2017 16:20:51 +0000 Received: from CY1NAM02FT030.eop-nam02.prod.protection.outlook.com (2a01:111:f400:7e45::204) by CY4PR02CA0042.outlook.office365.com (2603:10b6:903:117::28) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.156.4 via Frontend Transport; Thu, 19 Oct 2017 16:20:51 +0000 Authentication-Results: spf=pass (sender IP is 149.199.60.100) smtp.mailfrom=xilinx.com; gmail.com; dkim=none (message not signed) header.d=none;gmail.com; dmarc=bestguesspass action=none header.from=xilinx.com; Received-SPF: Pass (protection.outlook.com: domain of xilinx.com designates 149.199.60.100 as permitted sender) receiver=protection.outlook.com; client-ip=149.199.60.100; helo=xsj-pvapsmtpgw02; Received: from xsj-pvapsmtpgw02 (149.199.60.100) by CY1NAM02FT030.mail.protection.outlook.com (10.152.75.163) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.20.77.10 via Frontend Transport; Thu, 19 Oct 2017 16:20:51 +0000 Received: from unknown-38-66.xilinx.com ([149.199.38.66]:38115 helo=xsj-pvapsmtp01) by xsj-pvapsmtpgw02 with esmtp (Exim 4.63) (envelope-from ) id 1e5DYw-0007wf-M5; Thu, 19 Oct 2017 09:20:50 -0700 Received: from [127.0.0.1] (helo=localhost) by xsj-pvapsmtp01 with smtp (Exim 4.63) (envelope-from ) id 1e5DYw-000314-J2; Thu, 19 Oct 2017 09:20:50 -0700 Received: from xsj-pvapsmtp01 (xsj-smtp.xilinx.com [149.199.38.66]) by xsj-smtp-dlp2.xlnx.xilinx.com (8.13.8/8.13.1) with ESMTP id v9JGKm05006693; Thu, 19 Oct 2017 09:20:48 -0700 Received: from [172.19.2.220] (helo=localhost.localdomain) by xsj-pvapsmtp01 with esmtp (Exim 4.63) (envelope-from ) id 1e5DYu-00030M-FE; Thu, 19 Oct 2017 09:20:48 -0700 From: Alistair Francis To: Date: Thu, 19 Oct 2017 09:16:55 -0700 Message-ID: X-Mailer: git-send-email 2.11.0 In-Reply-To: References: MIME-Version: 1.0 X-RCIS-Action: ALLOW X-TM-AS-Product-Ver: IMSS-7.1.0.1224-8.1.0.1062-23404.005 X-TM-AS-User-Approved-Sender: Yes;Yes X-EOPAttributedMessage: 0 X-MS-Office365-Filtering-HT: Tenant X-Forefront-Antispam-Report: CIP:149.199.60.100; IPV:NLI; CTRY:US; EFV:NLI; SFV:NSPM; SFS:(10009020)(6009001)(376002)(346002)(39860400002)(2980300002)(438002)(189002)(199003)(5660300001)(36386004)(39060400002)(47776003)(36756003)(33646002)(2351001)(316002)(6916009)(106466001)(54906003)(63266004)(50986999)(2950100002)(23676002)(8936002)(9786002)(76176999)(8676002)(81156014)(81166006)(5820100001)(356003)(189998001)(50226002)(6666003)(106002)(305945005)(2870700001)(2906002)(4326008)(50466002)(118296001)(77096006)(478600001)(107986001)(5001870100001); DIR:OUT; SFP:1101; SCL:1; SRVR:SN1PR02MB1344; H:xsj-pvapsmtpgw02; FPR:; SPF:Pass; PTR:xapps1.xilinx.com,unknown-60-100.xilinx.com; MX:1; A:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; CY1NAM02FT030; 1:pA/ygxtaw4Lp3ISkwtDYVxtiqxbub/WsO5vCiPlPNbzRK0df/a3cYBwoAkjE3hrs7/b/z6IVe2RCQ82hiTQAJ9H4jM3/bmn62A3gh1xVOKfmCpvDGNCfXkhO+asaGB2z X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: dee9eb7c-a65b-40a6-0ba3-08d5170d5da1 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001)(2017030254168)(8251501002)(4534016)(4602075)(4627075)(201703031133081)(201702281549075)(2017052603199)(201703131423091); SRVR:SN1PR02MB1344; X-Microsoft-Exchange-Diagnostics: 1; SN1PR02MB1344; 3:M1zZNFrWEjd3MrOqh+PvaK/qdcv39v2yMvb2+ihD7rfhILfw5Ch5lvcG4oyoktBjRv+OhQ3oZi5LRlnk9vMx7NVJkvlQUxSc7OEGiO+fBEJ9g/qP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pNo3H1A7hskD2AEIifoBnfI7q/zVA4qodo8EO2EgV9ka0Zm6tYBGYzCAlLabOLDhoApg7mLuBJgINU/pcwVdvA5luCctykqTNat1Gn9JBZ7BqU99olGM3ymfgdyc1mr6iwLxuFzUBcu03gAXSfcQjOYU4at7+nBNVruNRlcCjH8L/Ra7wHeHX88iAVTJ2Iv37VSMEtTPf4lD6mRzbbH4bTygd5sWamM4T4WxUFAoax7UM+6sffeJDWS+7v0crdsh/PUe/GYP5s8c64ANYApep8yhzINvV18PH8nqvNdH5rEXS98HFrkL2DAs+oO7P/AACv+iBGIWLJiHFmZdo9 X-Exchange-Antispam-Report-Test: UriScan:(788757137089)(192813158149592); X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(100000700101)(100105000095)(100000701101)(100105300095)(100000702101)(100105100095)(6040450)(2401047)(8121501046)(5005006)(100000703101)(100105400095)(93006095)(93004095)(10201501046)(3002001)(6055026)(6041248)(20161123562025)(20161123560025)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123564025)(20161123555025)(20161123558100)(6072148)(201708071742011)(100000704101)(100105200095)(100000705101)(100105500095); SRVR:SN1PR02MB1344; BCL:0; PCL:0; RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095); SRVR:SN1PR02MB1344; X-Microsoft-Exchange-Diagnostics: 1; SN1PR02MB1344; 4:/qD7vDP9TzesoWmSRhExdKCrduwRj+UOtpsPYxftlfRToPaGdtpNlVdrOGsUG4SLwW5wV4OrQgIE4ha7F3zYuMULV9VQbSUIByDMBZawY3afiL5GW3xG9sHpGNymZrOSd9yjhydUbIbhkbkofVdoFJTDlp62z7MkaAdzhV5m5jjquQl+sZo3cTTClUdq7frp+yey3roDdRGJhSnYdZW4fZRxnTpMB2+21uQ+FYtK+EggtFSv4/H2z8xlyf9JrG58MbqqjC/3IOub5bFfFoVwDkb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DiagnosticMetadata: NSPM X-OriginatorOrg: xilinx.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 19 Oct 2017 16:20:51.2673 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: dee9eb7c-a65b-40a6-0ba3-08d5170d5da1 X-MS-Exchange-CrossTenant-Id: 657af505-d5df-48d0-8300-c31994686c5c X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=657af505-d5df-48d0-8300-c31994686c5c; Ip=[149.199.60.100]; Helo=[xsj-pvapsmtpgw02] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN1PR02MB1344 X-detected-operating-system: by eggs.gnu.org: Windows 7 or 8 [fuzzy] X-Received-From: 104.47.33.58 Subject: [Qemu-devel] [PATCH v3 22/46] hw/microblaze: Replace fprintf(stderr, "*\n" with error_report() 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: alistair23@gmail.com, "Edgar E. Iglesias" , armbru@redhat.com, alistair.francis@xilinx.com Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" Replace a large number of the fprintf(stderr, "*\n" calls with error_report(). The functions were renamed with these commands and then compiler issues where manually fixed. find ./* -type f -exec sed -i \ 'N;N;N;N;N;N;N;N;N;N;N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2);|Ig}' \ {} + find ./* -type f -exec sed -i \ 'N;N;N;N;N;N;N;N;N;N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2);|Ig}' \ {} + find ./* -type f -exec sed -i \ 'N;N;N;N;N;N;N;N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2);|Ig}' \ {} + find ./* -type f -exec sed -i \ 'N;N;N;N;N;N;N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2);|Ig}' \ {} + find ./* -type f -exec sed -i \ 'N;N;N;N;N;N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2);|Ig}' \ {} + find ./* -type f -exec sed -i \ 'N;N;N;N;N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2);|Ig}' \ {} + find ./* -type f -exec sed -i \ 'N;N;N;N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2);|Ig}' \ {} + find ./* -type f -exec sed -i \ 'N;N;N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2);|Ig}' \ {} + find ./* -type f -exec sed -i \ 'N;N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2);|Ig}' \ {} + find ./* -type f -exec sed -i \ 'N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2);|Ig}' \ {} + find ./* -type f -exec sed -i \ 'N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2);|Ig}' \ {} + Some lines where then manually tweaked to pass checkpatch. Signed-off-by: Alistair Francis Cc: "Edgar E. Iglesias" Reviewed-by: Philippe Mathieu-Daudé --- V2: - Split hw patch into individual directories hw/microblaze/boot.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/microblaze/boot.c b/hw/microblaze/boot.c index 457a08a2fe..31466050de 100644 --- a/hw/microblaze/boot.c +++ b/hw/microblaze/boot.c @@ -86,7 +86,7 @@ static int microblaze_load_dtb(hwaddr addr, r = qemu_fdt_setprop_string(fdt, "/chosen", "bootargs", kernel_cmdline); if (r < 0) { - fprintf(stderr, "couldn't set /chosen/bootargs\n"); + error_report("couldn't set /chosen/bootargs"); } } From patchwork Thu Oct 19 16:16:58 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Alistair Francis X-Patchwork-Id: 828208 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; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=xilinx.onmicrosoft.com header.i=@xilinx.onmicrosoft.com header.b="HhRFUONB"; 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 3yHvWy5xpVz9tX7 for ; Fri, 20 Oct 2017 03:29:18 +1100 (AEDT) Received: from localhost ([::1]:50102 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e5Dh6-0003OQ-Pw for incoming@patchwork.ozlabs.org; Thu, 19 Oct 2017 12:29:16 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:55720) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e5DZG-00056M-07 for qemu-devel@nongnu.org; Thu, 19 Oct 2017 12:21:12 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1e5DZC-0001lD-EF for qemu-devel@nongnu.org; Thu, 19 Oct 2017 12:21:09 -0400 Received: from mail-co1nam03on0077.outbound.protection.outlook.com ([104.47.40.77]:12800 helo=NAM03-CO1-obe.outbound.protection.outlook.com) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1e5DZB-0001jB-W4 for qemu-devel@nongnu.org; Thu, 19 Oct 2017 12:21:06 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=xilinx.onmicrosoft.com; s=selector1-xilinx-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=oBp04+oFX7viJOmIY60tsOyNn3rkfmJnKzmGXvxWaPQ=; b=HhRFUONBTScsb51JGkgp8r+H4+GKqjcRwEMSxm849NR9PqDlnmWKzzQ6xxCwNOkO09GYvw/bOcA41AqKoskOvGvgWbcyIPtwVwgcDoZZGR30k880qI+hgv3JKBU1BaYTnpT0bxgcfu2bSRVpu3Ommum1SrdeWAqUe0dj62wduTc= Received: from SN4PR0201CA0050.namprd02.prod.outlook.com (10.171.31.140) by BN6PR02MB3377.namprd02.prod.outlook.com (10.161.152.165) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.156.4; Thu, 19 Oct 2017 16:21:03 +0000 Received: from CY1NAM02FT011.eop-nam02.prod.protection.outlook.com (2a01:111:f400:7e45::205) by SN4PR0201CA0050.outlook.office365.com (2603:10b6:803:20::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.77.21 via Frontend Transport; Thu, 19 Oct 2017 16:21:02 +0000 Authentication-Results: spf=pass (sender IP is 149.199.60.83) smtp.mailfrom=xilinx.com; reactos.org; dkim=none (message not signed) header.d=none;reactos.org; dmarc=bestguesspass action=none header.from=xilinx.com; Received-SPF: Pass (protection.outlook.com: domain of xilinx.com designates 149.199.60.83 as permitted sender) receiver=protection.outlook.com; client-ip=149.199.60.83; helo=xsj-pvapsmtpgw01; Received: from xsj-pvapsmtpgw01 (149.199.60.83) by CY1NAM02FT011.mail.protection.outlook.com (10.152.75.156) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.20.77.10 via Frontend Transport; Thu, 19 Oct 2017 16:21:01 +0000 Received: from unknown-38-66.xilinx.com ([149.199.38.66] helo=xsj-pvapsmtp01) by xsj-pvapsmtpgw01 with esmtp (Exim 4.63) (envelope-from ) id 1e5DZ6-0008W1-UR; Thu, 19 Oct 2017 09:21:00 -0700 Received: from [127.0.0.1] (helo=localhost) by xsj-pvapsmtp01 with smtp (Exim 4.63) (envelope-from ) id 1e5DZ6-00032v-RH; Thu, 19 Oct 2017 09:21:00 -0700 Received: from xsj-pvapsmtp01 (xsj-smtp1.xilinx.com [149.199.38.66]) by xsj-smtp-dlp1.xlnx.xilinx.com (8.13.8/8.13.1) with ESMTP id v9JGKppp017948; Thu, 19 Oct 2017 09:20:51 -0700 Received: from [172.19.2.220] (helo=localhost.localdomain) by xsj-pvapsmtp01 with esmtp (Exim 4.63) (envelope-from ) id 1e5DYx-00031a-Lk; Thu, 19 Oct 2017 09:20:51 -0700 From: Alistair Francis To: Date: Thu, 19 Oct 2017 09:16:58 -0700 Message-ID: X-Mailer: git-send-email 2.11.0 In-Reply-To: References: MIME-Version: 1.0 X-RCIS-Action: ALLOW X-TM-AS-Product-Ver: IMSS-7.1.0.1224-8.1.0.1062-23404.005 X-TM-AS-User-Approved-Sender: Yes;Yes X-EOPAttributedMessage: 0 X-MS-Office365-Filtering-HT: Tenant X-Forefront-Antispam-Report: CIP:149.199.60.83; IPV:NLI; CTRY:US; EFV:NLI; SFV:NSPM; SFS:(10009020)(6009001)(376002)(39860400002)(346002)(2980300002)(438002)(189002)(199003)(305945005)(356003)(2870700001)(36386004)(50226002)(33646002)(8936002)(2351001)(189998001)(81166006)(8676002)(81156014)(5660300001)(2950100002)(50466002)(118296001)(6916009)(2906002)(77096006)(39060400002)(36756003)(76176999)(23676002)(50986999)(316002)(47776003)(106002)(54906003)(106466001)(63266004)(478600001)(9786002)(5820100001)(4326008)(107986001); DIR:OUT; SFP:1101; SCL:1; SRVR:BN6PR02MB3377; H:xsj-pvapsmtpgw01; FPR:; SPF:Pass; PTR:unknown-60-83.xilinx.com; MX:1; A:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; CY1NAM02FT011; 1:yzPgKgvYGUZhTKEkLNhbvmgOoc1n2p032reSl9lBFlvQQcLX1FdaKsvgaVIufFkYpZaWRjioiCG4A5zl7bmqdhk3Nsu7wdJzrJ9s5XUBUEe1Wb4FYNamLogcXKbgC0cl X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: cfb2ee01-ad7c-457f-a944-08d5170d63fe X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001)(2017030254168)(8251501002)(4534016)(4602075)(4627075)(201703031133081)(201702281549075)(2017052603199)(201703131423091); SRVR:BN6PR02MB3377; X-Microsoft-Exchange-Diagnostics: 1; BN6PR02MB3377; 3:70YL++9P5/99xeZj+ew0UR7AThsxn9hL5qtMm/TuHapQ7glN8xXYlG/S/1fdDVHHXioKGaFZ4EuINp9qE1grkuTp5qejhRf1ScSY9Baqmr/QMSd2gXFzY2jgV3EuAP9HkoHfKAAX6Aoo06Wk50mFcixct9SuC7jJHFZcSsb0gzqH91aF964M2E+J9aHy7/1Ea9vyqzlEAq9AwzhMEtRGdBQfxNZF1aRHkWEU1s70ClVW4qI9yhVHkAaXgzCurU7ztPNiyt1HYnt9Gx6fc3E9mrHcNPIq2Q8Bs3bd/YevDAnSGGnpGCONTQ6B3+CZvKMrZ5SCcJC/031RID7APdbV3URUL2u24aqwA3q8R+jhvhE=; 25:ipizy6nmuCzVOHZORYQJyPqBPXN17v/ltZCkKgnTzfjQIGfYI65/FAdUc+nAu0DynYH0/I785U1VHcSwWgyXKyTIvGljzYuxjwEUTW5OlehlLMLEGA0loAtEra1qiYrw8ENRxFlL8zn0EaeRUSF7g0DIw5nwNWiv+xL+IfXhxzFApPVclUSr7fH5tM7izpk+jNPAbWjkkIM7wEWPfxvrlYHL9djP87spUtZdOvrYmNrLJuvcj13NJUjj8mPN2K+5U/FaQHtR4OOiyZrLI0RqqDsUmCSJhyTh9E3Dt1ds/v8Zjca6viTJPMZn/whZZTE9RvyllsvskDlc68Xr9Qu7tQ== X-MS-TrafficTypeDiagnostic: BN6PR02MB3377: X-Microsoft-Exchange-Diagnostics: 1; BN6PR02MB3377; 31:F0SB14LqduZidbAHoYdMqSroUO0F4CfMBu0//7A/x4uXRj/mVnN9XFvzEG/N1PHGKVv/m527+3TQE6+B2hNrwbW9OZMPiEItmLjTn2MCs8RD5NfSJ+BVI32g0zxkTnnQWahHcSY17Y+LtZXI1S/zilk+6GFZbILXhpGw8efuIeUq9M4FNSi1MBlcsU6Gydqk0IeXhADpcS4FOMHKewnE2PxZvXIytkBkFcMRlwpZe8Q=; 20:r2v2x/3FP+Fcdyfr1q8box9wUDGBRHCNC1lso54fvpfBN+lDy9fcv9NoE1KhGhiBZquKYn6CpEkKmvR5zwH+kpiet1HUeGq+ziEwW2Xela6ZRfW5i7OXahAgu0pfY+0bfxIqv2yUT3Lz2qCyheKVRQsSxBeAg30PNA8cmJ51+6cHDxva2Spa3w8TeMej7d+ZloLUEpEJo6Z1r+Jr7V8G3mOGUedxcOUpHF0hjZ3fIIIGtboY++TlABCPkY4SfeEujQLIe+LQnOTx5n2gn12w6udgS8j+z6MYJZXFOQDGcApNm2HwWmNL0szEXglf20u5CoCrPevjGuQ47snuKtxFiZgdMJlaEkW0kPsZgc2fmRwwbor8L8vIUfXHaInblbcdzjQvv29O6Vn+hJ5K/aQmSaMYv2UCUph+vQTNZrH5ZZ1AtdmeGiwIisbEWmT1NIXqbNkxA4qHpjDcL7MIUfN2l92p2P4E7HOAUp0CFkFulH+KEFNNG1NK3M4mh81IP+Fa X-Exchange-Antispam-Report-Test: UriScan:(788757137089)(192813158149592); X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(100000700101)(100105000095)(100000701101)(100105300095)(100000702101)(100105100095)(6040450)(2401047)(8121501046)(5005006)(100000703101)(100105400095)(93006095)(93004095)(3002001)(10201501046)(6055026)(6041248)(20161123558100)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123564025)(20161123555025)(20161123560025)(20161123562025)(6072148)(201708071742011)(100000704101)(100105200095)(100000705101)(100105500095); SRVR:BN6PR02MB3377; BCL:0; PCL:0; RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095); SRVR:BN6PR02MB3377; X-Microsoft-Exchange-Diagnostics: 1; BN6PR02MB3377; 4:UlYZS9QB8SNqcGviattCutRItmMRt4hWJcQQRAlbgrJ0jpxcSg6jN0jyZ08VsatRgtfMam1a8YrgA2BjZxFEXRMqdxMFStpUEhO3Tf1p6jfKEwpPEXerOYfJhy5czuqbHFPNeJT3tpmxt76/iRXdkMKaCo4zVmrahn9AqWMAlsyQqp8SQ0wo7MNUARKJFoTseib+PzWMS6xpgiYYcPGXyHjk6IDE5FLhMw8qSgL/Cde/m/s9aMmItQVe1jkk6pGeqxhE2+rsSO1LC1m4E2Y0WvZ5yzLLx9hHmBnh1l+e/A/Ijq6Run5T0CooLfZHGP7HUJdXSDWziDY7u4bMOnwFKA== X-Forefront-PRVS: 0465429B7F X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; BN6PR02MB3377; 23:ndzjYrUlAmDpYFZqPszFfDA7Flwbl5jJHA09gunaG?= F+E1gy09JVCGp87qorgu9rgGnN/kBS4hMAy6ghrMQgRCYcErBOirMF/5dLHmGWkNS73VCYpiO67bZOcsS/BMjh1DG+Ho9j4mRcT7EoTyxFA6P2QxyW5QNWKwvgXq30PkDoA9ludicdTXauvLw+AZFCRCc8Sp1YmTYFHeICnE9T5Ia4hvrsE4gyXwtkOrH0sXmIRl09vGTo5eR5XbVL67Xv6Vx5/UjVAc25c/Wfu7HcFAwU368+DHXoV+UVHnYYClS53G6y1UrTBLWIEkG8Kh2a9r3x+jj/i8OhP5gxX0RTSR53bpUfCAnu7HhqCHvDyXw+SdfUIvHSiH4CV7IEW18U8J7JVXHiFN55iCNNauhYi6+vYsbvv6sQGnT3pJFkdhXL0cfzYWCyjGiPYVG7goeb7dPxKJVPHU+O3WC0nmR5RMxFWpFqq7tOvysJTy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x3OfDCT9A==; 24:LnXwx6gP5xVD3oIg1v77yfAFFxWHFQ4IMAAAXpuadbV8bxQqrEBdaivZo2+knWmtQptWIFrSDamu2jFlv+LMGIKuwL40obW7Y4RtVaweuyk=; 7:4hgmXm7CATkScruNcNuqVxGvecOSxoMfO2sIaCtYsnWr28hFMtK+g16DS3Lh3AlFE59XlkenJ5p9IqGn770mVQqmJQGzZBysgZ47iUojSBzxAVLq3ctnlI0ljill47Vz2G/6SMlVzCjQBgy4OXlM/GpgYi0fifT4bTt/hK/tAkA+slLu7oNZXXxWpfVZ2RXfzAuuNSf+/nm7vNeRJY5Obw/2/UHh6Kplyv+rfNrnjKk= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: xilinx.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 19 Oct 2017 16:21:01.6971 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: cfb2ee01-ad7c-457f-a944-08d5170d63fe X-MS-Exchange-CrossTenant-Id: 657af505-d5df-48d0-8300-c31994686c5c X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=657af505-d5df-48d0-8300-c31994686c5c; Ip=[149.199.60.83]; Helo=[xsj-pvapsmtpgw01] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN6PR02MB3377 X-detected-operating-system: by eggs.gnu.org: Windows 7 or 8 [fuzzy] X-Received-From: 104.47.40.77 Subject: [Qemu-devel] [PATCH v3 23/46] hw/mips: Replace fprintf(stderr, "*\n" with error_report() 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: Paul Burton , armbru@redhat.com, alistair.francis@xilinx.com, =?utf-8?q?Herv=C3=A9_Poussineau?= , Yongbok Kim , alistair23@gmail.com, Aurelien Jarno Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" Replace a large number of the fprintf(stderr, "*\n" calls with error_report(). The functions were renamed with these commands and then compiler issues where manually fixed. find ./* -type f -exec sed -i \ 'N;N;N;N;N;N;N;N;N;N;N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2);|Ig}' \ {} + find ./* -type f -exec sed -i \ 'N;N;N;N;N;N;N;N;N;N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2);|Ig}' \ {} + find ./* -type f -exec sed -i \ 'N;N;N;N;N;N;N;N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2);|Ig}' \ {} + find ./* -type f -exec sed -i \ 'N;N;N;N;N;N;N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2);|Ig}' \ {} + find ./* -type f -exec sed -i \ 'N;N;N;N;N;N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2);|Ig}' \ {} + find ./* -type f -exec sed -i \ 'N;N;N;N;N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2);|Ig}' \ {} + find ./* -type f -exec sed -i \ 'N;N;N;N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2);|Ig}' \ {} + find ./* -type f -exec sed -i \ 'N;N;N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2);|Ig}' \ {} + find ./* -type f -exec sed -i \ 'N;N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2);|Ig}' \ {} + find ./* -type f -exec sed -i \ 'N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2);|Ig}' \ {} + find ./* -type f -exec sed -i \ 'N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2);|Ig}' \ {} + Some lines where then manually tweaked to pass checkpatch. Signed-off-by: Alistair Francis Cc: Paul Burton Cc: Aurelien Jarno Cc: Yongbok Kim Cc: "Hervé Poussineau" Reviewed-by: Philippe Mathieu-Daudé --- V2: - Split hw patch into individual directories hw/mips/boston.c | 4 ++-- hw/mips/mips_fulong2e.c | 13 ++++++------- hw/mips/mips_jazz.c | 4 ++-- hw/mips/mips_malta.c | 16 +++++++--------- hw/mips/mips_mipssim.c | 11 +++++------ hw/mips/mips_r4k.c | 18 ++++++++---------- 6 files changed, 30 insertions(+), 36 deletions(-) diff --git a/hw/mips/boston.c b/hw/mips/boston.c index 776ee283e1..ee82968ea7 100644 --- a/hw/mips/boston.c +++ b/hw/mips/boston.c @@ -353,7 +353,7 @@ static const void *boston_fdt_filter(void *opaque, const void *fdt_orig, err = fdt_open_into(fdt_orig, fdt, fdt_sz); if (err) { - fprintf(stderr, "unable to open FDT\n"); + error_report("unable to open FDT"); return NULL; } @@ -361,7 +361,7 @@ static const void *boston_fdt_filter(void *opaque, const void *fdt_orig, ? machine->kernel_cmdline : " "; err = qemu_fdt_setprop_string(fdt, "/chosen", "bootargs", cmdline); if (err < 0) { - fprintf(stderr, "couldn't set /chosen/bootargs\n"); + error_report("couldn't set /chosen/bootargs"); return NULL; } diff --git a/hw/mips/mips_fulong2e.c b/hw/mips/mips_fulong2e.c index 75318680e1..b10ae3a7b4 100644 --- a/hw/mips/mips_fulong2e.c +++ b/hw/mips/mips_fulong2e.c @@ -120,7 +120,7 @@ static int64_t load_kernel (CPUMIPSState *env) (uint64_t *)&kernel_low, (uint64_t *)&kernel_high, 0, EM_MIPS, 1, 0); if (kernel_size < 0) { - error_report("qemu: could not load kernel '%s': %s", + error_report("could not load kernel '%s': %s", loaderparams.kernel_filename, load_elf_strerror(kernel_size)); exit(1); @@ -134,17 +134,16 @@ static int64_t load_kernel (CPUMIPSState *env) if (initrd_size > 0) { initrd_offset = (kernel_high + ~INITRD_PAGE_MASK) & INITRD_PAGE_MASK; if (initrd_offset + initrd_size > ram_size) { - fprintf(stderr, - "qemu: memory too small for initial ram disk '%s'\n", - loaderparams.initrd_filename); + error_report("memory too small for initial ram disk '%s'", + loaderparams.initrd_filename); exit(1); } initrd_size = load_image_targphys(loaderparams.initrd_filename, initrd_offset, ram_size - initrd_offset); } if (initrd_size == (target_ulong) -1) { - fprintf(stderr, "qemu: could not load initial ram disk '%s'\n", - loaderparams.initrd_filename); + error_report("could not load initial ram disk '%s'", + loaderparams.initrd_filename); exit(1); } } @@ -342,7 +341,7 @@ static void mips_fulong2e_init(MachineState *machine) isa_bus = vt82c686b_init(pci_bus, PCI_DEVFN(FULONG2E_VIA_SLOT, 0)); if (!isa_bus) { - fprintf(stderr, "vt82c686b_init error\n"); + error_report("vt82c686b_init error"); exit(1); } diff --git a/hw/mips/mips_jazz.c b/hw/mips/mips_jazz.c index 7e6626dc88..d3999cffd9 100644 --- a/hw/mips/mips_jazz.c +++ b/hw/mips/mips_jazz.c @@ -271,10 +271,10 @@ static void mips_jazz_init(MachineState *machine, sysbus_connect_irq(sysbus, 0, qdev_get_gpio_in(rc4030, 4)); break; } else if (is_help_option(nd->model)) { - fprintf(stderr, "qemu: Supported NICs: dp83932\n"); + error_report("Supported NICs: dp83932"); exit(1); } else { - fprintf(stderr, "qemu: Unsupported NIC: %s\n", nd->model); + error_report("Unsupported NIC: %s", nd->model); exit(1); } } diff --git a/hw/mips/mips_malta.c b/hw/mips/mips_malta.c index 2adb9bcf89..66d3f82a2c 100644 --- a/hw/mips/mips_malta.c +++ b/hw/mips/mips_malta.c @@ -812,7 +812,7 @@ static int64_t load_kernel (void) NULL, (uint64_t *)&kernel_entry, NULL, (uint64_t *)&kernel_high, big_endian, EM_MIPS, 1, 0); if (kernel_size < 0) { - error_report("qemu: could not load kernel '%s': %s", + error_report("could not load kernel '%s': %s", loaderparams.kernel_filename, load_elf_strerror(kernel_size)); exit(1); @@ -846,9 +846,8 @@ static int64_t load_kernel (void) initrd_offset = (loaderparams.ram_low_size - initrd_size - 131072 - ~INITRD_PAGE_MASK) & INITRD_PAGE_MASK; if (kernel_high >= initrd_offset) { - fprintf(stderr, - "qemu: memory too small for initial ram disk '%s'\n", - loaderparams.initrd_filename); + error_report("memory too small for initial ram disk '%s'", + loaderparams.initrd_filename); exit(1); } initrd_size = load_image_targphys(loaderparams.initrd_filename, @@ -856,8 +855,8 @@ static int64_t load_kernel (void) ram_size - initrd_offset); } if (initrd_size == (target_ulong) -1) { - fprintf(stderr, "qemu: could not load initial ram disk '%s'\n", - loaderparams.initrd_filename); + error_report("could not load initial ram disk '%s'", + loaderparams.initrd_filename); exit(1); } } @@ -1043,9 +1042,8 @@ void mips_malta_init(MachineState *machine) /* allocate RAM */ if (ram_size > (2048u << 20)) { - fprintf(stderr, - "qemu: Too much memory for this machine: %d MB, maximum 2048 MB\n", - ((unsigned int)ram_size / (1 << 20))); + error_report("Too much memory for this machine: %dMB, maximum 2048MB", + ((unsigned int)ram_size / (1 << 20))); exit(1); } diff --git a/hw/mips/mips_mipssim.c b/hw/mips/mips_mipssim.c index a092072e2a..deb4c5fce1 100644 --- a/hw/mips/mips_mipssim.c +++ b/hw/mips/mips_mipssim.c @@ -78,7 +78,7 @@ static int64_t load_kernel(void) if ((entry & ~0x7fffffffULL) == 0x80000000) entry = (int32_t)entry; } else { - error_report("qemu: could not load kernel '%s': %s", + error_report("could not load kernel '%s': %s", loaderparams.kernel_filename, load_elf_strerror(kernel_size)); exit(1); @@ -92,17 +92,16 @@ static int64_t load_kernel(void) if (initrd_size > 0) { initrd_offset = (kernel_high + ~INITRD_PAGE_MASK) & INITRD_PAGE_MASK; if (initrd_offset + initrd_size > loaderparams.ram_size) { - fprintf(stderr, - "qemu: memory too small for initial ram disk '%s'\n", - loaderparams.initrd_filename); + error_report("memory too small for initial ram disk '%s'", + loaderparams.initrd_filename); exit(1); } initrd_size = load_image_targphys(loaderparams.initrd_filename, initrd_offset, loaderparams.ram_size - initrd_offset); } if (initrd_size == (target_ulong) -1) { - fprintf(stderr, "qemu: could not load initial ram disk '%s'\n", - loaderparams.initrd_filename); + error_report("could not load initial ram disk '%s'", + loaderparams.initrd_filename); exit(1); } } diff --git a/hw/mips/mips_r4k.c b/hw/mips/mips_r4k.c index 1272d4ef9d..dd3e5f43fc 100644 --- a/hw/mips/mips_r4k.c +++ b/hw/mips/mips_r4k.c @@ -97,7 +97,7 @@ static int64_t load_kernel(void) if ((entry & ~0x7fffffffULL) == 0x80000000) entry = (int32_t)entry; } else { - error_report("qemu: could not load kernel '%s': %s", + error_report("could not load kernel '%s': %s", loaderparams.kernel_filename, load_elf_strerror(kernel_size)); exit(1); @@ -111,9 +111,8 @@ static int64_t load_kernel(void) if (initrd_size > 0) { initrd_offset = (kernel_high + ~INITRD_PAGE_MASK) & INITRD_PAGE_MASK; if (initrd_offset + initrd_size > ram_size) { - fprintf(stderr, - "qemu: memory too small for initial ram disk '%s'\n", - loaderparams.initrd_filename); + error_report("memory too small for initial ram disk '%s'", + loaderparams.initrd_filename); exit(1); } initrd_size = load_image_targphys(loaderparams.initrd_filename, @@ -121,8 +120,8 @@ static int64_t load_kernel(void) ram_size - initrd_offset); } if (initrd_size == (target_ulong) -1) { - fprintf(stderr, "qemu: could not load initial ram disk '%s'\n", - loaderparams.initrd_filename); + error_report("could not load initial ram disk '%s'", + loaderparams.initrd_filename); exit(1); } } @@ -203,9 +202,8 @@ void mips_r4k_init(MachineState *machine) /* allocate RAM */ if (ram_size > (256 << 20)) { - fprintf(stderr, - "qemu: Too much memory for this machine: %d MB, maximum 256 MB\n", - ((unsigned int)ram_size / (1 << 20))); + error_report("Too much memory for this machine: %dMB, maximum 256MB", + ((unsigned int)ram_size / (1 << 20))); exit(1); } memory_region_allocate_system_memory(ram, NULL, "mips_r4k.ram", ram_size); @@ -246,7 +244,7 @@ void mips_r4k_init(MachineState *machine) blk_by_legacy_dinfo(dinfo), sector_len, mips_rom / sector_len, 4, 0, 0, 0, 0, be)) { - fprintf(stderr, "qemu: Error registering flash memory.\n"); + error_report("Error registering flash memory."); } } else if (!qtest_enabled()) { /* not fatal */ From patchwork Thu Oct 19 16:17:02 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Alistair Francis X-Patchwork-Id: 828230 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; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=xilinx.onmicrosoft.com header.i=@xilinx.onmicrosoft.com header.b="XNA7fvUp"; 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 3yHvqN3C1cz9tX8 for ; Fri, 20 Oct 2017 03:42:40 +1100 (AEDT) Received: from localhost ([::1]:50169 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e5Du2-0005oK-10 for incoming@patchwork.ozlabs.org; Thu, 19 Oct 2017 12:42:38 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:55701) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e5DZF-00055L-0W for qemu-devel@nongnu.org; Thu, 19 Oct 2017 12:21:10 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1e5DZB-0001kP-Oc for qemu-devel@nongnu.org; Thu, 19 Oct 2017 12:21:09 -0400 Received: from mail-bn3nam01on0084.outbound.protection.outlook.com ([104.47.33.84]:37664 helo=NAM01-BN3-obe.outbound.protection.outlook.com) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1e5DZB-0001im-GH for qemu-devel@nongnu.org; Thu, 19 Oct 2017 12:21:05 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=xilinx.onmicrosoft.com; s=selector1-xilinx-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=G1ot332bPaAQDdY8BDwR503dQKwlzS9CZj+9JsJquaE=; b=XNA7fvUppRISSPiXbA7taJ/lB2ch7IBQAEvXL05kGldAGsgFHxL17qlubgR+c6i60y4CodOPTB8cLaILsMUwg/3+OCMgtNiqKT+yWKWcweeu1pyv+9fX5LwqZi+KPrdssgRaEAdrkJMxvh1yawVfqvuxWo/c1lf5720HK3REmEQ= Received: from SN4PR0201CA0016.namprd02.prod.outlook.com (10.161.238.154) by MWHPR02MB3389.namprd02.prod.outlook.com (10.164.187.166) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.77.7; Thu, 19 Oct 2017 16:21:02 +0000 Received: from CY1NAM02FT021.eop-nam02.prod.protection.outlook.com (2a01:111:f400:7e45::205) by SN4PR0201CA0016.outlook.office365.com (2603:10b6:803:2b::26) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.77.21 via Frontend Transport; Thu, 19 Oct 2017 16:21:01 +0000 Authentication-Results: spf=pass (sender IP is 149.199.60.83) smtp.mailfrom=xilinx.com; redhat.com; dkim=none (message not signed) header.d=none;redhat.com; dmarc=bestguesspass action=none header.from=xilinx.com; Received-SPF: Pass (protection.outlook.com: domain of xilinx.com designates 149.199.60.83 as permitted sender) receiver=protection.outlook.com; client-ip=149.199.60.83; helo=xsj-pvapsmtpgw01; Received: from xsj-pvapsmtpgw01 (149.199.60.83) by CY1NAM02FT021.mail.protection.outlook.com (10.152.75.187) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.20.77.10 via Frontend Transport; Thu, 19 Oct 2017 16:21:01 +0000 Received: from unknown-38-66.xilinx.com ([149.199.38.66] helo=xsj-pvapsmtp01) by xsj-pvapsmtpgw01 with esmtp (Exim 4.63) (envelope-from ) id 1e5DZ6-0008Vv-PE; Thu, 19 Oct 2017 09:21:00 -0700 Received: from [127.0.0.1] (helo=localhost) by xsj-pvapsmtp01 with smtp (Exim 4.63) (envelope-from ) id 1e5DZ6-00032v-M6; Thu, 19 Oct 2017 09:21:00 -0700 Received: from xsj-pvapsmtp01 (xsj-mail.xilinx.com [149.199.38.66]) by xsj-smtp-dlp1.xlnx.xilinx.com (8.13.8/8.13.1) with ESMTP id v9JGKtCt017968; Thu, 19 Oct 2017 09:20:55 -0700 Received: from [172.19.2.220] (helo=localhost.localdomain) by xsj-pvapsmtp01 with esmtp (Exim 4.63) (envelope-from ) id 1e5DZ1-00031z-E1; Thu, 19 Oct 2017 09:20:55 -0700 From: Alistair Francis To: Date: Thu, 19 Oct 2017 09:17:02 -0700 Message-ID: <98c444579dd3fd79d76692505a48fabb41779584.1508390588.git.alistair.francis@xilinx.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: References: MIME-Version: 1.0 X-RCIS-Action: ALLOW X-TM-AS-Product-Ver: IMSS-7.1.0.1224-8.1.0.1062-23404.005 X-TM-AS-User-Approved-Sender: Yes;Yes X-EOPAttributedMessage: 0 X-MS-Office365-Filtering-HT: Tenant X-Forefront-Antispam-Report: CIP:149.199.60.83; IPV:NLI; CTRY:US; EFV:NLI; SFV:NSPM; SFS:(10009020)(6009001)(346002)(376002)(39860400002)(2980300002)(438002)(189002)(199003)(118296001)(54906003)(5890100001)(5820100001)(9786002)(106002)(2870700001)(36386004)(316002)(50986999)(5660300001)(189998001)(76176999)(2906002)(36756003)(77096006)(6306002)(2351001)(39060400002)(4326008)(47776003)(63266004)(6916009)(305945005)(356003)(478600001)(6666003)(106466001)(50226002)(23676002)(33646002)(50466002)(8676002)(2950100002)(81156014)(8936002)(81166006)(107986001); DIR:OUT; SFP:1101; SCL:1; SRVR:MWHPR02MB3389; H:xsj-pvapsmtpgw01; FPR:; SPF:Pass; PTR:unknown-60-83.xilinx.com; MX:1; A:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; CY1NAM02FT021; 1:MKgvhdUDleWbw7aVn4WdTKUbqlQJuL/Rfstirw2yPN45geOk2o3kE7eKW7maNBDYPPCdZqr1Vse6dpwspM8GW1SWWLHoZHnOsQBUyLCTRrBY1tuapRpWnKKMO9EvWUSb X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 04bdf500-0f06-47cd-d12e-08d5170d63b0 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001)(2017030254152)(8251501002)(2017052603199)(201703131423075)(201703031133081)(201702281549075); SRVR:MWHPR02MB3389; X-Microsoft-Exchange-Diagnostics: 1; MWHPR02MB3389; 3:rzCpBsVsv5EURSIhMNyCJ3GuQwJIvqu1dLFp9pHRbm5DRi3QOdGvbWsrCxvDxxBwintQLY6D9+lJ+fF1qFh5wqY4sMpGz8Qg1TITIwfCjoE+F0zpbQhEQ8O11KfPUP+ytHqZdXmQ41SUwcgT+Gdhk6qcnFz8limvhTPAv0ILYQtQqSw863pmewFcUp5pBQ8uhf9XXxVTAtL9LcTMsK7jmHM7kpnQg3mqmwXdWvUtsWast7lCeRTgnw1UxPC9mSW/dHgGTwEswMydGOhMpTJLDv3Uu9LNQCAVLr+vBOlYa734RSiQEQGHAPi+o1TENbH1U6teNBGCrtkhkzTIMbnieGxGBgnGjGk1Oh6+XSYZuXU=; 25:nAihbGmKPCJVhQr4YYxVW+OnIhhEnrDX3W/LPtCeO+M+JlB9cVYl0hAY0b2Km1dxVtLHSt1f4w8eQqEof5VIUL2XuOvFbAl5xiaBwPubu3kPEecSW/YOKr3SgIcAwFvj7ii8bCyNr5Qj4Jf4LUe0Z+GkRN56Qd1FG07x8q2HEcuj6uS6Sk2/vqFAQJfFqdrV1CPf3OR8qsSVYUX5AhPftYICL+qVmlBPieIU1K7vPAA4yrS9v3bpSNA6XiJnn5ClWXx7OxXqGWZ7mNv8eqRmm4Gj0D9Poadh6mYBUV0qH1EYq2AwjEVbEEOsyXN9ADpwsN6D8LDEGkm6pXpTOtxkzg== X-MS-TrafficTypeDiagnostic: MWHPR02MB3389: X-Microsoft-Exchange-Diagnostics: 1; MWHPR02MB3389; 31:3XGZM5UEknmGmB97qAlSPzSTb2Dj87oRphZDtbvLHHQ4vf0BLQ5N5j62cLYt0ChoF54WVPekPZT11JIikXwIVJ7kvvisYhDe4HyYF+8P6OuPooyBBxUxw4zSsalc1/s77/JPaXBsI0PlhYzjSOdwpmgpXHo7Zyu0mHdnBk2EEpoX5HfHs+scc567zqx5RTO8ySqfAdEbcTm5bDbkDBy1Qbwqqppa/4kds8ei8ruK9sA=; 20:tq2s1NKa7HzpHf/Z+37o2mk3uNvs3aatJzdwvjx07EoPIAu2y7nvNRPAgLqsswhlMlsy2ULysq25i9Swm/2Dwp8hYnUIm9Ys/0UfgC4Dvu0Ise6Y4usEZbcldNa9T1U5q7ajuM6kJ3vl/KUeAAPKv1JoLZDeT7+/gSM+3fj4xRUx9exQ+g7KLr2TsBgDoh3SVBIWOe6H+b1iOtjyAfBNNFzKr1gMo18QwxvTImoHfErY0Nm4ULLVumPfawQeBPYWxovkcJkUmFf+d4OzPkBZSLnuwqcuSJylMOiRBVmvT5JdErj87OKCSvuDB37wd0iuTqvkwwUWIQUMwwTdKoSMeqcqfbVgNWWoRUzFq/X7clF+3yCW0fbnaUwgRPsT0tVwmWzUzuv/lujEWc48jEnXFgfLlI3TC//kr6ExGevun2AtV0lVa5Mp9BPiUupn+Qc1jxa/0MAG/AX68TEGXLNxBCOg0h+hH+kzT0SeIpvGwFgt0R8uHD89myeSLueqaCPm X-Exchange-Antispam-Report-Test: UriScan:(250305191791016)(22074186197030)(788757137089)(192813158149592); X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(100000700101)(100105000095)(100000701101)(100105300095)(100000702101)(100105100095)(6040450)(2401047)(5005006)(8121501046)(93006095)(93004095)(10201501046)(100000703101)(100105400095)(3002001)(6055026)(6041248)(20161123564025)(20161123558100)(20161123555025)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123562025)(20161123560025)(6072148)(201708071742011)(100000704101)(100105200095)(100000705101)(100105500095); SRVR:MWHPR02MB3389; BCL:0; PCL:0; RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095); SRVR:MWHPR02MB3389; X-Microsoft-Exchange-Diagnostics: 1; MWHPR02MB3389; 4:uJxVmGucbXyOpGKmhYy2xbMLeNQwGUsebRsZLZkgG6izyTfzjdQv6GWO9eWG+DmDVBrivhibwwMNLUKhczCPSwK3VHrFQsp5GxyFSfcUNqriUlq9B36lOFOxoBaY8JfoiB+hENMVljVi3ulrOHBi6kmlwHLJn/PB3zYmZGR8yvpwhz04oW57vsT446L64krsBetfN+qpQFGJHWJz6LdOYq6+3YgWGXzVeoa4zTwnhAQWufRQ2tGjzr70inKOpcA4nYcZMj9RGPQhkEAGd1bh0URXOUbDkAWE229agp24kJDO+Dl2GmVu0DMLM6lsckVPrCGhB8JZxpaYaDq4WD8xnw+CQ7YDsNWQ+jS4IvdcXOpImZflDLGXPP02hdPxeN87TCEw2Z/r38L+pRE7K12WPw== X-Forefront-PRVS: 0465429B7F X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; MWHPR02MB3389; 23:6xnuIYDDHRkzwVAMDFHW2R/U1uVbTFHzD+Bpf1/FE?= GWI3q7XMBmlWD/4IjPk9UXzKLHFSpijR2p4cH9Cf941za0lFtBfMaG4jZ50hbPmx4/tYMsiNKBSt4Rn7ofv+EzN1Dt+lgqZfmpPg+adtioURID7riAO+uoE4v+zfL2cHqZHf0hq7dscV4jb7imeleaIzMTUtbK1v+JkpI6dpIR7HohR1EYCnS1QG016eFmPVHDWQ8cKBLx1HBmDiUfADz6ufvrG1Btdh+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QG7bafsnqrDXFZJKAO6OJQ/bjHViqRtZx4bfu6+GPS/T3cdCeTE9fmuLPF9rzlqBa54z9eb+33B45KXNVf0pVk/BvxhJD1a/Nl60ovfM7GBFrcOx2Q2ajhDf+ZSubbWATl91yUwOp9VXunV/vPnxdg==; 5:+gSrJXWYjOYj/yfrgEm4VnSjzf6ywSNE1o+pT7HVuErfHxLaBokDxJ6ahjfEatUHHlb2NGXmkLcTvdW/EsXWjJFtZUDfxasI9WqPsFTh39VNJOto9nIO9dmIYQDqZUdfwuyjLbUhGmfVS7BDOQj50Q==; 24:tyHAtXSTNQ6sF939sdG+ihrOEf1rx1Io69+tr3TIUGzjRQu491cv+0/7OlBbx+OSSm3jYVwOM3dWnCQADEQKS+G6BC4asJJEGq9cJbgKzu8=; 7:MRHgMgqYhOjHa1MN/5evjON1oNJELT2DKI0u0YAhHntoxnhBUhZIM2JziK0p2dj9GV5bZ9CHCIhl4fKlZMaETB5WYsYjK+Lt2pZX3/t6ssD+3r8LszC/qE6JhGXPVUrySMTorr5pqE5XefomZS2G52ViwyZUM56+ne8Wer14KmM27eWJcu8AZhTkbCMfd9/Qsv1TmnOVhrWsub8MoEKvlLZ8aBVeFhUX3Ho8NCHRaQ8= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: xilinx.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 19 Oct 2017 16:21:01.4370 (UTC) X-MS-Exchange-CrossTenant-Id: 657af505-d5df-48d0-8300-c31994686c5c X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=657af505-d5df-48d0-8300-c31994686c5c; Ip=[149.199.60.83]; Helo=[xsj-pvapsmtpgw01] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: MWHPR02MB3389 X-detected-operating-system: by eggs.gnu.org: Windows 7 or 8 [fuzzy] X-Received-From: 104.47.33.84 Subject: [Qemu-devel] [PATCH v3 24/46] hw/misc: Replace fprintf(stderr, "*\n" with error_report() 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: alistair23@gmail.com, armbru@redhat.com, alistair.francis@xilinx.com Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" Replace a large number of the fprintf(stderr, "*\n" calls with error_report(). The functions were renamed with these commands and then compiler issues where manually fixed. find ./* -type f -exec sed -i \ 'N;N;N;N;N;N;N;N;N;N;N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2);|Ig}' \ {} + find ./* -type f -exec sed -i \ 'N;N;N;N;N;N;N;N;N;N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2);|Ig}' \ {} + find ./* -type f -exec sed -i \ 'N;N;N;N;N;N;N;N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2);|Ig}' \ {} + find ./* -type f -exec sed -i \ 'N;N;N;N;N;N;N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2);|Ig}' \ {} + find ./* -type f -exec sed -i \ 'N;N;N;N;N;N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2);|Ig}' \ {} + find ./* -type f -exec sed -i \ 'N;N;N;N;N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2);|Ig}' \ {} + find ./* -type f -exec sed -i \ 'N;N;N;N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2);|Ig}' \ {} + find ./* -type f -exec sed -i \ 'N;N;N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2);|Ig}' \ {} + find ./* -type f -exec sed -i \ 'N;N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2);|Ig}' \ {} + find ./* -type f -exec sed -i \ 'N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2);|Ig}' \ {} + find ./* -type f -exec sed -i \ 'N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2);|Ig}' \ {} + Some lines where then manually tweaked to pass checkpatch. Signed-off-by: Alistair Francis Reviewed-by: Philippe Mathieu-Daudé --- V2: - Split hw patch into individual directories hw/misc/a9scu.c | 3 ++- hw/misc/omap_gpmc.c | 11 ++++++----- hw/misc/omap_l4.c | 5 +++-- hw/misc/omap_sdrc.c | 3 ++- hw/misc/vmport.c | 2 +- 5 files changed, 14 insertions(+), 10 deletions(-) diff --git a/hw/misc/a9scu.c b/hw/misc/a9scu.c index 3e8ad8cd73..21b8e49b6c 100644 --- a/hw/misc/a9scu.c +++ b/hw/misc/a9scu.c @@ -9,6 +9,7 @@ */ #include "qemu/osdep.h" +#include "qemu/error-report.h" #include "hw/misc/a9scu.h" static uint64_t a9_scu_read(void *opaque, hwaddr offset, @@ -59,7 +60,7 @@ static void a9_scu_write(void *opaque, hwaddr offset, mask = 0xffffffff; break; default: - fprintf(stderr, "Invalid size %u in write to a9 scu register %x\n", + error_report("Invalid size %u in write to a9 scu register %x", size, (unsigned)offset); return; } diff --git a/hw/misc/omap_gpmc.c b/hw/misc/omap_gpmc.c index 84f9e4c612..e3b30e90ea 100644 --- a/hw/misc/omap_gpmc.c +++ b/hw/misc/omap_gpmc.c @@ -19,6 +19,7 @@ * with this program; if not, see . */ #include "qemu/osdep.h" +#include "qemu/error-report.h" #include "hw/hw.h" #include "hw/block/flash.h" #include "hw/arm/omap.h" @@ -408,7 +409,7 @@ static void omap_gpmc_cs_map(struct omap_gpmc_s *s, int cs) /* TODO: check for overlapping regions and report access errors */ if (mask != 0x8 && mask != 0xc && mask != 0xe && mask != 0xf && !(s->accept_256 && !mask)) { - fprintf(stderr, "%s: invalid chip-select mask address (0x%x)\n", + error_report("%s: invalid chip-select mask address (0x%x)", __func__, mask); } @@ -642,7 +643,7 @@ static void omap_gpmc_write(void *opaque, hwaddr addr, case 0x010: /* GPMC_SYSCONFIG */ if ((value >> 3) == 0x3) - fprintf(stderr, "%s: bad SDRAM idle mode %"PRIi64"\n", + error_report("%s: bad SDRAM idle mode %"PRIi64"", __func__, value >> 3); if (value & 2) omap_gpmc_reset(s); @@ -806,7 +807,7 @@ static void omap_gpmc_write(void *opaque, hwaddr addr, break; case 0x230: /* GPMC_TESTMODE_CTRL */ if (value & 7) - fprintf(stderr, "%s: test mode enable attempt\n", __func__); + error_report("%s: test mode enable attempt", __func__); break; default: @@ -864,7 +865,7 @@ void omap_gpmc_attach(struct omap_gpmc_s *s, int cs, MemoryRegion *iomem) assert(iomem); if (cs < 0 || cs >= 8) { - fprintf(stderr, "%s: bad chip-select %i\n", __func__, cs); + error_report("%s: bad chip-select %i", __func__, cs); exit(-1); } f = &s->cs_file[cs]; @@ -881,7 +882,7 @@ void omap_gpmc_attach_nand(struct omap_gpmc_s *s, int cs, DeviceState *nand) assert(nand); if (cs < 0 || cs >= 8) { - fprintf(stderr, "%s: bad chip-select %i\n", __func__, cs); + error_report("%s: bad chip-select %i", __func__, cs); exit(-1); } f = &s->cs_file[cs]; diff --git a/hw/misc/omap_l4.c b/hw/misc/omap_l4.c index 96fc057b4e..47d9c10aeb 100644 --- a/hw/misc/omap_l4.c +++ b/hw/misc/omap_l4.c @@ -18,6 +18,7 @@ * with this program; if not, see . */ #include "qemu/osdep.h" +#include "qemu/error-report.h" #include "hw/hw.h" #include "hw/arm/omap.h" @@ -126,7 +127,7 @@ struct omap_target_agent_s *omap_l4ta_get(struct omap_l4_s *bus, break; } if (!ta) { - fprintf(stderr, "%s: bad target agent (%i)\n", __func__, cs); + error_report("%s: bad target agent (%i)", __func__, cs); exit(-1); } @@ -151,7 +152,7 @@ hwaddr omap_l4_attach(struct omap_target_agent_s *ta, hwaddr base; if (region < 0 || region >= ta->regions) { - fprintf(stderr, "%s: bad io region (%i)\n", __func__, region); + error_report("%s: bad io region (%i)", __func__, region); exit(-1); } diff --git a/hw/misc/omap_sdrc.c b/hw/misc/omap_sdrc.c index 7b38c5568c..3dcabc1e00 100644 --- a/hw/misc/omap_sdrc.c +++ b/hw/misc/omap_sdrc.c @@ -18,6 +18,7 @@ * with this program; if not, see . */ #include "qemu/osdep.h" +#include "qemu/error-report.h" #include "hw/hw.h" #include "hw/arm/omap.h" @@ -108,7 +109,7 @@ static void omap_sdrc_write(void *opaque, hwaddr addr, case 0x10: /* SDRC_SYSCONFIG */ if ((value >> 3) != 0x2) - fprintf(stderr, "%s: bad SDRAM idle mode %i\n", + error_report("%s: bad SDRAM idle mode %i", __func__, (unsigned)value >> 3); if (value & 2) omap_sdrc_reset(s); diff --git a/hw/misc/vmport.c b/hw/misc/vmport.c index 165500223f..55369bd180 100644 --- a/hw/misc/vmport.c +++ b/hw/misc/vmport.c @@ -80,7 +80,7 @@ static uint64_t vmport_ioport_read(void *opaque, hwaddr addr, if (!s->func[command]) { #ifdef VMPORT_DEBUG - fprintf(stderr, "vmport: unknown command %x\n", command); + error_report("vmport: unknown command %x", command); #endif return eax; } From patchwork Thu Oct 19 16:17:05 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Alistair Francis X-Patchwork-Id: 828210 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; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=xilinx.onmicrosoft.com header.i=@xilinx.onmicrosoft.com header.b="NuGGvfnL"; 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 3yHvY76MRXz9ryT for ; Fri, 20 Oct 2017 03:30:19 +1100 (AEDT) Received: from localhost ([::1]:50108 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e5Di6-0004Fi-0U for incoming@patchwork.ozlabs.org; Thu, 19 Oct 2017 12:30:18 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:55722) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e5DZG-00056O-1H for qemu-devel@nongnu.org; Thu, 19 Oct 2017 12:21:11 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1e5DZB-0001kg-Rd for qemu-devel@nongnu.org; Thu, 19 Oct 2017 12:21:10 -0400 Received: from mail-by2nam03on0058.outbound.protection.outlook.com ([104.47.42.58]:59527 helo=NAM03-BY2-obe.outbound.protection.outlook.com) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1e5DZB-0001ic-HD for qemu-devel@nongnu.org; Thu, 19 Oct 2017 12:21:05 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=xilinx.onmicrosoft.com; s=selector1-xilinx-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=fDCcVJyS2XYsti9bBBk8QyIv2OX8s9knBwnjRxkW7ag=; b=NuGGvfnL6Rll6DUu1ATb0plsgcsKCOtkLEXqw0VIfnDydCyryUKb93AZLp/RRz5QHRMq6yrvwjxOPZFrve7xXRVWgLD/9a+jy8kAMbl53kI099HhczLIbEiLWZoCGD9KFx6UE7ZwjJLnhM9VaapEL+SBY7CocBpsoU7xs0NlR6Q= Received: from MWHPR02CA0023.namprd02.prod.outlook.com (10.168.209.161) by DM5PR02MB3386.namprd02.prod.outlook.com (10.164.152.162) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.77.7; Thu, 19 Oct 2017 16:21:02 +0000 Received: from CY1NAM02FT051.eop-nam02.prod.protection.outlook.com (2a01:111:f400:7e45::200) by MWHPR02CA0023.outlook.office365.com (2603:10b6:300:4b::33) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.77.21 via Frontend Transport; Thu, 19 Oct 2017 16:21:02 +0000 Authentication-Results: spf=pass (sender IP is 149.199.60.100) smtp.mailfrom=xilinx.com; moxielogic.com; dkim=none (message not signed) header.d=none;moxielogic.com; dmarc=bestguesspass action=none header.from=xilinx.com; Received-SPF: Pass (protection.outlook.com: domain of xilinx.com designates 149.199.60.100 as permitted sender) receiver=protection.outlook.com; client-ip=149.199.60.100; helo=xsj-pvapsmtpgw02; Received: from xsj-pvapsmtpgw02 (149.199.60.100) by CY1NAM02FT051.mail.protection.outlook.com (10.152.74.148) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.20.77.10 via Frontend Transport; Thu, 19 Oct 2017 16:21:01 +0000 Received: from unknown-38-66.xilinx.com ([149.199.38.66]:38257 helo=xsj-pvapsmtp01) by xsj-pvapsmtpgw02 with esmtp (Exim 4.63) (envelope-from ) id 1e5DZ6-0007wt-RB; Thu, 19 Oct 2017 09:21:00 -0700 Received: from [127.0.0.1] (helo=localhost) by xsj-pvapsmtp01 with smtp (Exim 4.63) (envelope-from ) id 1e5DZ6-00032v-Nq; Thu, 19 Oct 2017 09:21:00 -0700 Received: from xsj-pvapsmtp01 (xsj-pvapsmtp01.xilinx.com [149.199.38.66]) by xsj-smtp-dlp2.xlnx.xilinx.com (8.13.8/8.13.1) with ESMTP id v9JGKwfZ006717; Thu, 19 Oct 2017 09:20:58 -0700 Received: from [172.19.2.220] (helo=localhost.localdomain) by xsj-pvapsmtp01 with esmtp (Exim 4.63) (envelope-from ) id 1e5DZ4-00032I-GV; Thu, 19 Oct 2017 09:20:58 -0700 From: Alistair Francis To: Date: Thu, 19 Oct 2017 09:17:05 -0700 Message-ID: <3d8eaf670de93d7f51f881e51ff8d118d4a48ab6.1508390588.git.alistair.francis@xilinx.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: References: MIME-Version: 1.0 X-RCIS-Action: ALLOW X-TM-AS-Product-Ver: IMSS-7.1.0.1224-8.1.0.1062-23404.005 X-TM-AS-User-Approved-Sender: Yes;Yes X-EOPAttributedMessage: 0 X-MS-Office365-Filtering-HT: Tenant X-Forefront-Antispam-Report: CIP:149.199.60.100; IPV:NLI; CTRY:US; EFV:NLI; SFV:NSPM; SFS:(10009020)(6009001)(346002)(376002)(39860400002)(2980300002)(438002)(199003)(189002)(47776003)(23676002)(106466001)(33646002)(118296001)(6916009)(76176999)(5660300001)(50986999)(50466002)(8676002)(2906002)(81166006)(6666003)(9786002)(478600001)(2950100002)(54906003)(81156014)(305945005)(8936002)(2351001)(77096006)(106002)(50226002)(5820100001)(36386004)(316002)(39060400002)(189998001)(63266004)(356003)(36756003)(4326008)(2870700001)(107986001)(5001870100001); DIR:OUT; SFP:1101; SCL:1; SRVR:DM5PR02MB3386; H:xsj-pvapsmtpgw02; FPR:; SPF:Pass; PTR:xapps1.xilinx.com,unknown-60-100.xilinx.com; A:1; MX:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; CY1NAM02FT051; 1:An1OQdKtpgFmu7glShOnpakGyKcjSKEJIuCwgIW5jX1jdZVpQQfO7sv/IvdgYMuxMBMW/hROCvDf4zgjk3MnrbnCffo54mUq+xQX/tCNCwQigeLeI3WQM9zyHJlfQWp1 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 6d8e9c43-292f-40fe-b71a-08d5170d63f5 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001)(2017030254168)(8251501002)(4534016)(4602075)(4627075)(201703031133081)(201702281549075)(2017052603199)(201703131423091); SRVR:DM5PR02MB3386; X-Microsoft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bw2W6eJMmToydWow9dSS1vJpqT4hchHP5popD+O22GpBOhKc+xxeXgwXNzjb0j6GAU7hLGloG8Ra8ziLPrzCQeCzIlSKbka8ZqRbDSol0YxtCJAqKX5oRQfRLAen6TUgCwxd+p7YOpPQ5GmMaCn8MpkYEti6BM0YxR79iJD5PcdOqf19snn9udwT0UFv2PWRBruiFEpgkrv6FHJUVAyJGcZExQdLhCPP+s16TKXKin4/xORJ5S0L6Gk2y6k6JqP4J0BTpAsstdUkX3PwyClwpWfHRzXacDEBj+sjleH58HcVV4R5AfTcVhp7Lw2wiIH05NZBHBJC5kyin+A1HOa4PgFHQYevnQbPeFJeNLQK9DMD2I2RrjNlJytY8I4lWrKOfxMffab8Zm41saUwQVoX+PA2+DmMIjWxCjmsruGWlg78xnDBKMgoiIG8N78nAUGtIUEEve8/MbgUGKImbOiMFQLOHg1FX1QU3u4R4cnA70cMjAHs X-Exchange-Antispam-Report-Test: UriScan:(788757137089)(192813158149592); X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(100000700101)(100105000095)(100000701101)(100105300095)(100000702101)(100105100095)(6040450)(2401047)(5005006)(8121501046)(3002001)(93006095)(93004095)(100000703101)(100105400095)(10201501046)(6055026)(6041248)(20161123560025)(20161123564025)(20161123562025)(20161123558100)(20161123555025)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(6072148)(201708071742011)(100000704101)(100105200095)(100000705101)(100105500095); SRVR:DM5PR02MB3386; BCL:0; PCL:0; RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095); SRVR:DM5PR02MB3386; X-Microsoft-Exchange-Diagnostics: 1; DM5PR02MB3386; 4:IlQ64FxzyT7U0s/kXJE723DAwm8seTk92WTkWo8lQbLF3PaXq7jAqhw3eN5jO2ckFwxLX81Vev3qZT8r4XFsGJXicE+o306J+N34VtGmANORVWCr6+IpRb72KUm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fLzKdwJCisRl01CaSGv94hzjBcGC7zuf5XQv8Koc4/R/S1khPPmdgJpKDZwQPll2pdWXegYaxx1Ptp746jqUc1HmhX+YhlZs/b42k= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: xilinx.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 19 Oct 2017 16:21:01.8416 (UTC) X-MS-Exchange-CrossTenant-Id: 657af505-d5df-48d0-8300-c31994686c5c X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=657af505-d5df-48d0-8300-c31994686c5c; Ip=[149.199.60.100]; Helo=[xsj-pvapsmtpgw02] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM5PR02MB3386 X-detected-operating-system: by eggs.gnu.org: Windows 7 or 8 [fuzzy] X-Received-From: 104.47.42.58 Subject: [Qemu-devel] [PATCH v3 25/46] hw/moxie: Replace fprintf(stderr, "*\n" with error_report() 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: alistair23@gmail.com, Anthony Green , armbru@redhat.com, alistair.francis@xilinx.com Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" Replace a large number of the fprintf(stderr, "*\n" calls with error_report(). The functions were renamed with these commands and then compiler issues where manually fixed. find ./* -type f -exec sed -i \ 'N;N;N;N;N;N;N;N;N;N;N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2);|Ig}' \ {} + find ./* -type f -exec sed -i \ 'N;N;N;N;N;N;N;N;N;N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2);|Ig}' \ {} + find ./* -type f -exec sed -i \ 'N;N;N;N;N;N;N;N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2);|Ig}' \ {} + find ./* -type f -exec sed -i \ 'N;N;N;N;N;N;N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2);|Ig}' \ {} + find ./* -type f -exec sed -i \ 'N;N;N;N;N;N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2);|Ig}' \ {} + find ./* -type f -exec sed -i \ 'N;N;N;N;N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2);|Ig}' \ {} + find ./* -type f -exec sed -i \ 'N;N;N;N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2);|Ig}' \ {} + find ./* -type f -exec sed -i \ 'N;N;N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2);|Ig}' \ {} + find ./* -type f -exec sed -i \ 'N;N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2);|Ig}' \ {} + find ./* -type f -exec sed -i \ 'N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2);|Ig}' \ {} + find ./* -type f -exec sed -i \ 'N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2);|Ig}' \ {} + Some lines where then manually tweaked to pass checkpatch. Signed-off-by: Alistair Francis Cc: Anthony Green Reviewed-by: Philippe Mathieu-Daudé --- V2: - Split hw patch into individual directories hw/moxie/moxiesim.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/hw/moxie/moxiesim.c b/hw/moxie/moxiesim.c index 5ea8dd3a93..95ef5caa22 100644 --- a/hw/moxie/moxiesim.c +++ b/hw/moxie/moxiesim.c @@ -25,6 +25,7 @@ * THE SOFTWARE. */ #include "qemu/osdep.h" +#include "qemu/error-report.h" #include "qapi/error.h" #include "qemu-common.h" #include "cpu.h" @@ -61,8 +62,8 @@ static void load_kernel(MoxieCPU *cpu, LoaderParams *loader_params) 0, 0); if (kernel_size <= 0) { - fprintf(stderr, "qemu: could not load kernel '%s'\n", - loader_params->kernel_filename); + error_report("could not load kernel '%s'", + loader_params->kernel_filename); exit(1); } @@ -75,9 +76,8 @@ static void load_kernel(MoxieCPU *cpu, LoaderParams *loader_params) initrd_offset = (kernel_high + ~TARGET_PAGE_MASK) & TARGET_PAGE_MASK; if (initrd_offset + initrd_size > loader_params->ram_size) { - fprintf(stderr, - "qemu: memory too small for initial ram disk '%s'\n", - loader_params->initrd_filename); + error_report("memory too small for initial ram disk '%s'", + loader_params->initrd_filename); exit(1); } initrd_size = load_image_targphys(loader_params->initrd_filename, @@ -85,8 +85,8 @@ static void load_kernel(MoxieCPU *cpu, LoaderParams *loader_params) ram_size); } if (initrd_size == (target_ulong)-1) { - fprintf(stderr, "qemu: could not load initial ram disk '%s'\n", - loader_params->initrd_filename); + error_report("could not load initial ram disk '%s'", + loader_params->initrd_filename); exit(1); } } From patchwork Thu Oct 19 16:17:08 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Alistair Francis X-Patchwork-Id: 828214 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; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=xilinx.onmicrosoft.com header.i=@xilinx.onmicrosoft.com header.b="i9Sz0Qg/"; 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 3yHvcP2kTWz9t6m for ; Fri, 20 Oct 2017 03:33:09 +1100 (AEDT) Received: from localhost ([::1]:50124 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e5Dkp-0006Zq-Dp for incoming@patchwork.ozlabs.org; Thu, 19 Oct 2017 12:33:07 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:55790) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e5DZP-0005GE-Ie for qemu-devel@nongnu.org; Thu, 19 Oct 2017 12:21:21 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1e5DZM-0001qE-9b for qemu-devel@nongnu.org; Thu, 19 Oct 2017 12:21:19 -0400 Received: from mail-by2nam03on0060.outbound.protection.outlook.com ([104.47.42.60]:63788 helo=NAM03-BY2-obe.outbound.protection.outlook.com) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1e5DZL-0001pM-Tb for qemu-devel@nongnu.org; Thu, 19 Oct 2017 12:21:16 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=xilinx.onmicrosoft.com; s=selector1-xilinx-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=WrC9pDgviRkNolL1sdKOxh5dmzIkls6lvxM6yzqesB0=; b=i9Sz0Qg/lLGjD7KmUQ1eWLMyYjv7mntBgHbz/qUMNJ3ea1upYjecdKrcvR2PRhHJ8JKZi2EobQk7LUPlQW7O5eINdFHVLH8yiQgQRYCUqYjxG2fEZOHYqtFI8ewX6Pmdao6IEECgOTEn9X98txAW9GE9D11Nlh0/wW60YgQCWzM= Received: from MWHPR02CA0056.namprd02.prod.outlook.com (10.164.133.45) by DM5PR02MB3386.namprd02.prod.outlook.com (10.164.152.162) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.77.7; Thu, 19 Oct 2017 16:21:13 +0000 Received: from SN1NAM02FT048.eop-nam02.prod.protection.outlook.com (2a01:111:f400:7e44::202) by MWHPR02CA0056.outlook.office365.com (2603:10b6:301:60::45) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.77.7 via Frontend Transport; Thu, 19 Oct 2017 16:21:12 +0000 Authentication-Results: spf=pass (sender IP is 149.199.60.83) smtp.mailfrom=xilinx.com; redhat.com; dkim=none (message not signed) header.d=none;redhat.com; dmarc=bestguesspass action=none header.from=xilinx.com; Received-SPF: Pass (protection.outlook.com: domain of xilinx.com designates 149.199.60.83 as permitted sender) receiver=protection.outlook.com; client-ip=149.199.60.83; helo=xsj-pvapsmtpgw01; Received: from xsj-pvapsmtpgw01 (149.199.60.83) by SN1NAM02FT048.mail.protection.outlook.com (10.152.72.202) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.20.77.10 via Frontend Transport; Thu, 19 Oct 2017 16:21:11 +0000 Received: from unknown-38-66.xilinx.com ([149.199.38.66] helo=xsj-pvapsmtp01) by xsj-pvapsmtpgw01 with esmtp (Exim 4.63) (envelope-from ) id 1e5DZH-0008WD-7R; Thu, 19 Oct 2017 09:21:11 -0700 Received: from [127.0.0.1] (helo=localhost) by xsj-pvapsmtp01 with smtp (Exim 4.63) (envelope-from ) id 1e5DZH-000357-3O; Thu, 19 Oct 2017 09:21:11 -0700 Received: from xsj-pvapsmtp01 (smtp.xilinx.com [149.199.38.66]) by xsj-smtp-dlp2.xlnx.xilinx.com (8.13.8/8.13.1) with ESMTP id v9JGL2SI006735; Thu, 19 Oct 2017 09:21:02 -0700 Received: from [172.19.2.220] (helo=localhost.localdomain) by xsj-pvapsmtp01 with esmtp (Exim 4.63) (envelope-from ) id 1e5DZ7-00033b-W3; Thu, 19 Oct 2017 09:21:02 -0700 From: Alistair Francis To: Date: Thu, 19 Oct 2017 09:17:08 -0700 Message-ID: <6f22ccc78ba73da75180bade20a12d37938c8d5b.1508390588.git.alistair.francis@xilinx.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: References: MIME-Version: 1.0 X-RCIS-Action: ALLOW X-TM-AS-Product-Ver: IMSS-7.1.0.1224-8.1.0.1062-23404.005 X-TM-AS-User-Approved-Sender: Yes;Yes X-EOPAttributedMessage: 0 X-MS-Office365-Filtering-HT: Tenant X-Forefront-Antispam-Report: CIP:149.199.60.83; IPV:NLI; CTRY:US; EFV:NLI; SFV:NSPM; SFS:(10009020)(6009001)(346002)(376002)(39860400002)(2980300002)(438002)(199003)(189002)(47776003)(23676002)(106466001)(33646002)(575784001)(118296001)(6916009)(76176999)(5660300001)(50986999)(50466002)(8676002)(2906002)(81166006)(9786002)(478600001)(2950100002)(54906003)(81156014)(305945005)(8936002)(2351001)(77096006)(106002)(50226002)(5820100001)(36386004)(316002)(39060400002)(189998001)(63266004)(356003)(36756003)(4326008)(2870700001)(107986001); DIR:OUT; SFP:1101; SCL:1; SRVR:DM5PR02MB3386; H:xsj-pvapsmtpgw01; FPR:; SPF:Pass; PTR:unknown-60-83.xilinx.com; A:1; MX:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; SN1NAM02FT048; 1:YIXodYp7zsSknr7/g4uVjMPegxdpFIvOd3TOhgiPrXHbEChj1W9Qov8rqzBOSr2D3AGz0RZhn1VtK3x9hStqVguHh91h+6rUIP0e+wtwjg0ctc58csVrxsGpjiTfrH7t X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: aed244ae-bc63-481a-2dc3-08d5170d69f8 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001)(2017030254168)(8251501002)(4534016)(4602075)(4627075)(201703031133081)(201702281549075)(2017052603199)(201703131423091); SRVR:DM5PR02MB3386; X-Microsoft-Exchange-Diagnostics: 1; DM5PR02MB3386; 3:jWRHC+5kU0BVqJ14bGrBh2uUlBTdFSubOj/ZPzi7EaU/jx1d+y5Oc5rbZKHbTYenGcGAju8BURI8uRKkngY7D4CQ+cYO9y5dJe8yTXIfLNKQ4s6DBPhCW1+/4Jmo1g8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RUUDY6yLfiAvj8AZg7Pbl6b+ri8kg8BFxlxBvqOknRVBM2OLSIn7CgAT7CdK7+Fr6gYBMNbTFjqfesW4KOhx9DZGrQKZj76qHVl0fo8jmK3gdDHI2ZC7cKwTPNVTAv36EsM+RQwiWPpaThxHoCLDGsCnVn+jdMyunrRZl90kUkhzImEFBKmvW1zTs7U64n/fko9d4AAG2+CTIIIfksY32XGlVwmABlMgLCe8QUSuZGWicIvKBe3FfnQ6BvbK6ySjyxjyrnxYilPKphXE/MBJknDPF1EjxZ/UXyFQJS10lU8pQYKehYVDP6eIfzz+AwcYR1 X-Exchange-Antispam-Report-Test: UriScan:(788757137089)(192813158149592); X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(100000700101)(100105000095)(100000701101)(100105300095)(100000702101)(100105100095)(6040450)(2401047)(5005006)(8121501046)(3002001)(93006095)(93004095)(100000703101)(100105400095)(10201501046)(6055026)(6041248)(20161123560025)(20161123564025)(20161123562025)(20161123558100)(20161123555025)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(6072148)(201708071742011)(100000704101)(100105200095)(100000705101)(100105500095); SRVR:DM5PR02MB3386; BCL:0; PCL:0; RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095); SRVR:DM5PR02MB3386; X-Microsoft-Exchange-Diagnostics: 1; DM5PR02MB3386; 4:HDZZiUwAMGshLtClVkVWuYJlgRKSvUSgFDadCzP0HLVnUhqbOuz4XI38W6JsaTmayAuSfk2V/u8J6cLMFj7mxBIgHQF6MljjSTTMQFpU60rpl/iZiy9Gxl5t99j/vshh5L4uRhm4Z0NiHoibl8+NyZp9+2wAv2H1oBNBFek9nuZk7PdQabvI/XIZQjTtZWcWXXljN7SFN8I8IHQj0+6GWY8o5XRgk0fxuJI8nhVLI1xA4nUc6LdJ+OivEVT5cIw5TtlTK+G3fAvSE9j+NAyleP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Org: xilinx.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 19 Oct 2017 16:21:11.9710 (UTC) X-MS-Exchange-CrossTenant-Id: 657af505-d5df-48d0-8300-c31994686c5c X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=657af505-d5df-48d0-8300-c31994686c5c; Ip=[149.199.60.83]; Helo=[xsj-pvapsmtpgw01] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM5PR02MB3386 X-detected-operating-system: by eggs.gnu.org: Windows 7 or 8 [fuzzy] X-Received-From: 104.47.42.60 Subject: [Qemu-devel] [PATCH v3 26/46] hw/net: Replace fprintf(stderr, "*\n" with error_report() 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: "Michael S. Tsirkin" , Jason Wang , Alexander Graf , armbru@redhat.com, alistair23@gmail.com, alistair.francis@xilinx.com Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" Replace a large number of the fprintf(stderr, "*\n" calls with error_report(). The functions were renamed with these commands and then compiler issues where manually fixed. find ./* -type f -exec sed -i \ 'N;N;N;N;N;N;N;N;N;N;N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2);|Ig}' \ {} + find ./* -type f -exec sed -i \ 'N;N;N;N;N;N;N;N;N;N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2);|Ig}' \ {} + find ./* -type f -exec sed -i \ 'N;N;N;N;N;N;N;N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2);|Ig}' \ {} + find ./* -type f -exec sed -i \ 'N;N;N;N;N;N;N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2);|Ig}' \ {} + find ./* -type f -exec sed -i \ 'N;N;N;N;N;N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2);|Ig}' \ {} + find ./* -type f -exec sed -i \ 'N;N;N;N;N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2);|Ig}' \ {} + find ./* -type f -exec sed -i \ 'N;N;N;N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2);|Ig}' \ {} + find ./* -type f -exec sed -i \ 'N;N;N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2);|Ig}' \ {} + find ./* -type f -exec sed -i \ 'N;N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2);|Ig}' \ {} + find ./* -type f -exec sed -i \ 'N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2);|Ig}' \ {} + find ./* -type f -exec sed -i \ 'N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2);|Ig}' \ {} + Some lines where then manually tweaked to pass checkpatch. Manually remove a trailing '.' from hw/net/pcnet.c Signed-off-by: Alistair Francis Cc: Alexander Graf Cc: Jason Wang Cc: "Michael S. Tsirkin" Reviewed-by: Philippe Mathieu-Daudé --- V3: - Drop tailing '.' V2: - Split hw patch into individual directories hw/net/fsl_etsec/etsec.c | 2 +- hw/net/pcnet.c | 2 +- hw/net/smc91c111.c | 5 +++-- hw/net/vhost_net.c | 16 ++++++++-------- 4 files changed, 13 insertions(+), 12 deletions(-) diff --git a/hw/net/fsl_etsec/etsec.c b/hw/net/fsl_etsec/etsec.c index 9da1932970..965effa314 100644 --- a/hw/net/fsl_etsec/etsec.c +++ b/hw/net/fsl_etsec/etsec.c @@ -347,7 +347,7 @@ static ssize_t etsec_receive(NetClientState *nc, eTSEC *etsec = qemu_get_nic_opaque(nc); #if defined(HEX_DUMP) - fprintf(stderr, "%s receive size:%zd\n", nc->name, size); + error_report("%s receive size:%zd", nc->name, size); qemu_hexdump((void *)buf, stderr, "", size); #endif /* Flush is unnecessary as are already in receiving path */ diff --git a/hw/net/pcnet.c b/hw/net/pcnet.c index 654455355f..e7c89b41a8 100644 --- a/hw/net/pcnet.c +++ b/hw/net/pcnet.c @@ -1070,7 +1070,7 @@ ssize_t pcnet_receive(NetClientState *nc, const uint8_t *buf, size_t size_) if (!s->looptest) { if (size > 4092) { #ifdef PCNET_DEBUG_RMD - fprintf(stderr, "pcnet: truncates rx packet.\n"); + error_report("pcnet: truncates rx packet"); #endif size = 4092; } diff --git a/hw/net/smc91c111.c b/hw/net/smc91c111.c index 3b16dcf5a1..ae40fd6e6e 100644 --- a/hw/net/smc91c111.c +++ b/hw/net/smc91c111.c @@ -8,6 +8,7 @@ */ #include "qemu/osdep.h" +#include "qemu/error-report.h" #include "hw/sysbus.h" #include "net/net.h" #include "hw/devices.h" @@ -362,9 +363,9 @@ static void smc91c111_writeb(void *opaque, hwaddr offset, return; case 12: /* Control */ if (value & 1) - fprintf(stderr, "smc91c111:EEPROM store not implemented\n"); + error_report("smc91c111:EEPROM store not implemented"); if (value & 2) - fprintf(stderr, "smc91c111:EEPROM reload not implemented\n"); + error_report("smc91c111:EEPROM reload not implemented"); value &= ~3; SET_LOW(ctr, value); return; diff --git a/hw/net/vhost_net.c b/hw/net/vhost_net.c index e037db63a3..37d0cce560 100644 --- a/hw/net/vhost_net.c +++ b/hw/net/vhost_net.c @@ -135,7 +135,7 @@ static int vhost_net_get_fd(NetClientState *backend) case NET_CLIENT_DRIVER_TAP: return tap_get_fd(backend); default: - fprintf(stderr, "vhost-net requires tap backend\n"); + error_report("vhost-net requires tap backend"); return -EBADFD; } } @@ -148,7 +148,7 @@ struct vhost_net *vhost_net_init(VhostNetOptions *options) uint64_t features = 0; if (!options->net_backend) { - fprintf(stderr, "vhost-net requires net backend to be setup\n"); + error_report("vhost-net requires net backend to be setup"); goto fail; } net->nc = options->net_backend; @@ -186,8 +186,8 @@ struct vhost_net *vhost_net_init(VhostNetOptions *options) net->dev.features &= ~(1ULL << VIRTIO_NET_F_MRG_RXBUF); } if (~net->dev.features & net->dev.backend_features) { - fprintf(stderr, "vhost lacks feature mask %" PRIu64 - " for backend\n", + error_report("vhost lacks feature mask %" PRIu64 + " for backend", (uint64_t)(~net->dev.features & net->dev.backend_features)); goto fail; } @@ -197,8 +197,8 @@ struct vhost_net *vhost_net_init(VhostNetOptions *options) if (net->nc->info->type == NET_CLIENT_DRIVER_VHOST_USER) { features = vhost_user_get_acked_features(net->nc); if (~net->dev.features & features) { - fprintf(stderr, "vhost lacks feature mask %" PRIu64 - " for backend\n", + error_report("vhost lacks feature mask %" PRIu64 + " for backend", (uint64_t)(~net->dev.features & features)); goto fail; } @@ -349,7 +349,7 @@ err_start: } e = k->set_guest_notifiers(qbus->parent, total_queues * 2, false); if (e < 0) { - fprintf(stderr, "vhost guest notifier cleanup failed: %d\n", e); + error_report("vhost guest notifier cleanup failed: %d", e); fflush(stderr); } err: @@ -370,7 +370,7 @@ void vhost_net_stop(VirtIODevice *dev, NetClientState *ncs, r = k->set_guest_notifiers(qbus->parent, total_queues * 2, false); if (r < 0) { - fprintf(stderr, "vhost guest notifier cleanup failed: %d\n", r); + error_report("vhost guest notifier cleanup failed: %d", r); fflush(stderr); } assert(r >= 0); From patchwork Thu Oct 19 16:17:12 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Alistair Francis X-Patchwork-Id: 828236 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; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=xilinx.onmicrosoft.com header.i=@xilinx.onmicrosoft.com header.b="AaYpoIU6"; 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 3yHvtV1zHKz9tX7 for ; Fri, 20 Oct 2017 03:45:22 +1100 (AEDT) Received: from localhost ([::1]:50184 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e5Dwe-00088z-AH for incoming@patchwork.ozlabs.org; Thu, 19 Oct 2017 12:45:20 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:55844) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e5DZY-0005O5-Hz for qemu-devel@nongnu.org; Thu, 19 Oct 2017 12:21:30 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1e5DZV-0001u6-Ar for qemu-devel@nongnu.org; Thu, 19 Oct 2017 12:21:28 -0400 Received: from mail-bn3nam01on0084.outbound.protection.outlook.com ([104.47.33.84]:4016 helo=NAM01-BN3-obe.outbound.protection.outlook.com) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1e5DZV-0001u2-52 for qemu-devel@nongnu.org; Thu, 19 Oct 2017 12:21:25 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=xilinx.onmicrosoft.com; s=selector1-xilinx-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=X2lxFrJlHbafkWluuB3j7M+RFmJyjjf1Qrt3N/6HcUY=; b=AaYpoIU6BIT3TkeU4nBD4WuZT8gFoeq1QmrSnIrg12CXuJ6EbO0qcxjzmDudgC3srPMR32R9T7RNZk0EEyp9XudSaL8fHywQ/iV8LR+BCX+E25wRZkrY2ePpeC1ZenWJGTPrw5p4ydxcDtUTeJfSmJ5Zfyt9tJwIzzYyEIVAKkA= Received: from SN4PR0201CA0008.namprd02.prod.outlook.com (10.161.238.146) by SN1PR02MB1344.namprd02.prod.outlook.com (10.162.0.15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.156.4; Thu, 19 Oct 2017 16:21:23 +0000 Received: from CY1NAM02FT021.eop-nam02.prod.protection.outlook.com (2a01:111:f400:7e45::204) by SN4PR0201CA0008.outlook.office365.com (2603:10b6:803:2b::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.156.4 via Frontend Transport; Thu, 19 Oct 2017 16:21:23 +0000 Authentication-Results: spf=pass (sender IP is 149.199.60.83) smtp.mailfrom=xilinx.com; denx.de; dkim=none (message not signed) header.d=none;denx.de; dmarc=bestguesspass action=none header.from=xilinx.com; Received-SPF: Pass (protection.outlook.com: domain of xilinx.com designates 149.199.60.83 as permitted sender) receiver=protection.outlook.com; client-ip=149.199.60.83; helo=xsj-pvapsmtpgw01; Received: from xsj-pvapsmtpgw01 (149.199.60.83) by CY1NAM02FT021.mail.protection.outlook.com (10.152.75.187) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.20.77.10 via Frontend Transport; Thu, 19 Oct 2017 16:21:22 +0000 Received: from unknown-38-66.xilinx.com ([149.199.38.66] helo=xsj-pvapsmtp01) by xsj-pvapsmtpgw01 with esmtp (Exim 4.63) (envelope-from ) id 1e5DZR-0008WR-IN; Thu, 19 Oct 2017 09:21:21 -0700 Received: from [127.0.0.1] (helo=localhost) by xsj-pvapsmtp01 with smtp (Exim 4.63) (envelope-from ) id 1e5DZR-00036G-FU; Thu, 19 Oct 2017 09:21:21 -0700 Received: from xsj-pvapsmtp01 (xsj-mail.xilinx.com [149.199.38.66]) by xsj-smtp-dlp1.xlnx.xilinx.com (8.13.8/8.13.1) with ESMTP id v9JGLBZx018030; Thu, 19 Oct 2017 09:21:11 -0700 Received: from [172.19.2.220] (helo=localhost.localdomain) by xsj-pvapsmtp01 with esmtp (Exim 4.63) (envelope-from ) id 1e5DZH-00035D-8O; Thu, 19 Oct 2017 09:21:11 -0700 From: Alistair Francis To: Date: Thu, 19 Oct 2017 09:17:12 -0700 Message-ID: X-Mailer: git-send-email 2.11.0 In-Reply-To: References: MIME-Version: 1.0 X-RCIS-Action: ALLOW X-TM-AS-Product-Ver: IMSS-7.1.0.1224-8.1.0.1062-23404.005 X-TM-AS-User-Approved-Sender: Yes;Yes X-EOPAttributedMessage: 0 X-MS-Office365-Filtering-HT: Tenant X-Forefront-Antispam-Report: CIP:149.199.60.83; IPV:NLI; CTRY:US; EFV:NLI; SFV:NSPM; SFS:(10009020)(6009001)(376002)(346002)(39860400002)(2980300002)(438002)(189002)(199003)(5660300001)(36386004)(39060400002)(47776003)(36756003)(33646002)(2351001)(316002)(6916009)(106466001)(54906003)(63266004)(50986999)(2950100002)(23676002)(8936002)(9786002)(76176999)(8676002)(81156014)(81166006)(5820100001)(356003)(189998001)(50226002)(106002)(305945005)(2870700001)(2906002)(4326008)(50466002)(118296001)(77096006)(478600001)(107986001); DIR:OUT; SFP:1101; SCL:1; SRVR:SN1PR02MB1344; H:xsj-pvapsmtpgw01; FPR:; SPF:Pass; PTR:unknown-60-83.xilinx.com; MX:1; A:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; CY1NAM02FT021; 1:2oK0kkcMMH/iWnKkDzwuj94pTOc1TIzP83ljiKRhfuwFY+ysLHaWVY/cVbcPWqkTQNW/TubwvGn+Usvi7WpNHg47u7t1oleFCJlwLWaMKtEwWKBJMppXnGnhP65JAeTU X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 33d8cd24-bd02-4b99-b7b7-08d5170d700c X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001)(2017030254168)(8251501002)(4534016)(4602075)(4627075)(201703031133081)(201702281549075)(2017052603199)(201703131423091); SRVR:SN1PR02MB1344; X-Microsoft-Exchange-Diagnostics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BaG1aSUeoOAJPz1DV9H7+rTLrRM/5iDvO4QkXEDGWlIzJoSnL4G2Tqgr9QHde00NFrtkuPOlul2WdDqN/vGBNqUNKZOw3MPWtmOA0GLrSczUEah+QrX6USQ+RoDgZW7Z8m9tDsBxx0Kol6V7aOkZs7B8e6ik9un8sM8xhGC8U+oDMx7FzFH6Fal5FUSogiQbaNw7oOL98i5/fGTb/vPzkl07ikiGa7332My6nhY4ufbX9EvShOSu4PtC0Yg4HavcfmRu83n7CFwtKlSGVH1IpnRsCvqMI5RTEnvc69GgwZU44sDC9rjo8IEwBgl8avFCWR6KuENNISUkBD6+b+8M1jkuBN8TUG7WFbIL9zS4ab3U9H/kS6pTTefwT0UQqU3qcbaiaDBGSE2ghjQau4M5fEjhW99EV7v+aUM3fMx5skr7zs2gAZJTk+zsaLpFDK+JXNv268wse8qpiVID5MeGUDoqn X-Exchange-Antispam-Report-Test: UriScan:(788757137089)(192813158149592); X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(100000700101)(100105000095)(100000701101)(100105300095)(100000702101)(100105100095)(6040450)(2401047)(8121501046)(5005006)(100000703101)(100105400095)(93006095)(93004095)(10201501046)(3002001)(6055026)(6041248)(20161123562025)(20161123560025)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123564025)(20161123555025)(20161123558100)(6072148)(201708071742011)(100000704101)(100105200095)(100000705101)(100105500095); SRVR:SN1PR02MB1344; BCL:0; PCL:0; RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095); SRVR:SN1PR02MB1344; X-Microsoft-Exchange-Diagnostics: 1; SN1PR02MB1344; 4:f+t448hcPrsF24IncG2TERKN4FlXMAkbm+s7/kKTg1ZR2InaQtluRQe6LqJcY2HLwnI2ZNX50c3MlQ4umU8OI1ta2R+dgpqdJadjlYk85BMmzMB0D3zIdbGsPoUC7Tt2YwnsW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CCquDhAlqLNS3IoEolJWgWnZL2kz4qyPitD/uUOGxza0rZepUNUNK7/l2kZ5k= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: xilinx.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 19 Oct 2017 16:21:22.1250 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 33d8cd24-bd02-4b99-b7b7-08d5170d700c X-MS-Exchange-CrossTenant-Id: 657af505-d5df-48d0-8300-c31994686c5c X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=657af505-d5df-48d0-8300-c31994686c5c; Ip=[149.199.60.83]; Helo=[xsj-pvapsmtpgw01] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN1PR02MB1344 X-detected-operating-system: by eggs.gnu.org: Windows 7 or 8 [fuzzy] X-Received-From: 104.47.33.84 Subject: [Qemu-devel] [PATCH v3 27/46] hw/nios2: Replace fprintf(stderr, "*\n" with error_report() 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: Marek Vasut , alistair23@gmail.com, Chris Wulff , armbru@redhat.com, alistair.francis@xilinx.com Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" Replace a large number of the fprintf(stderr, "*\n" calls with error_report(). The functions were renamed with these commands and then compiler issues where manually fixed. find ./* -type f -exec sed -i \ 'N;N;N;N;N;N;N;N;N;N;N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2);|Ig}' \ {} + find ./* -type f -exec sed -i \ 'N;N;N;N;N;N;N;N;N;N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2);|Ig}' \ {} + find ./* -type f -exec sed -i \ 'N;N;N;N;N;N;N;N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2);|Ig}' \ {} + find ./* -type f -exec sed -i \ 'N;N;N;N;N;N;N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2);|Ig}' \ {} + find ./* -type f -exec sed -i \ 'N;N;N;N;N;N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2);|Ig}' \ {} + find ./* -type f -exec sed -i \ 'N;N;N;N;N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2);|Ig}' \ {} + find ./* -type f -exec sed -i \ 'N;N;N;N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2);|Ig}' \ {} + find ./* -type f -exec sed -i \ 'N;N;N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2);|Ig}' \ {} + find ./* -type f -exec sed -i \ 'N;N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2);|Ig}' \ {} + find ./* -type f -exec sed -i \ 'N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2);|Ig}' \ {} + find ./* -type f -exec sed -i \ 'N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2);|Ig}' \ {} + Some lines where then manually tweaked to pass checkpatch. Signed-off-by: Alistair Francis Cc: Chris Wulff Cc: Marek Vasut Reviewed-by: Philippe Mathieu-Daudé --- V2: - Split hw patch into individual directories hw/nios2/boot.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/nios2/boot.c b/hw/nios2/boot.c index 2b31f5b844..c896e8007b 100644 --- a/hw/nios2/boot.c +++ b/hw/nios2/boot.c @@ -96,7 +96,7 @@ static int nios2_load_dtb(struct nios2_boot_info bi, const uint32_t ramsize, r = qemu_fdt_setprop_string(fdt, "/chosen", "bootargs", kernel_cmdline); if (r < 0) { - fprintf(stderr, "couldn't set /chosen/bootargs\n"); + error_report("couldn't set /chosen/bootargs"); } } From patchwork Thu Oct 19 16:17:21 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alistair Francis X-Patchwork-Id: 828219 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; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=xilinx.onmicrosoft.com header.i=@xilinx.onmicrosoft.com header.b="uQgKej9+"; 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 3yHvgg6BNFz9t6m for ; Fri, 20 Oct 2017 03:35:58 +1100 (AEDT) Received: from localhost ([::1]:50138 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e5DnY-0000Il-AV for incoming@patchwork.ozlabs.org; Thu, 19 Oct 2017 12:35:56 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:55846) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e5DZY-0005O6-Ki for qemu-devel@nongnu.org; Thu, 19 Oct 2017 12:21:30 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1e5DZV-0001uD-Dy for qemu-devel@nongnu.org; Thu, 19 Oct 2017 12:21:28 -0400 Received: from mail-sn1nam02on0081.outbound.protection.outlook.com ([104.47.36.81]:10155 helo=NAM02-SN1-obe.outbound.protection.outlook.com) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1e5DZV-0001tu-5u for qemu-devel@nongnu.org; Thu, 19 Oct 2017 12:21:25 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=xilinx.onmicrosoft.com; s=selector1-xilinx-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=9cSzHDO48jSBxRttUgtcOo3cv4+NvaOfFlbSri5jme0=; b=uQgKej9+LyE7VxKKPbCCCQPZZEVir/71rAEcuFrXRRRL0EkE/ae01AS23FXyHZ7GZe9gikI9SOUmTuTy96F4EbY6uJUT9tRatSh/sGXHfexO4t7Ej0sEhUsMh3rQkUCM+JufB4IaVR0/kYx0x8AUbUd1/dCKAeUl103SwWZ/IE0= Received: from BLUPR0201CA0038.namprd02.prod.outlook.com (10.163.116.48) by BN6PR02MB3268.namprd02.prod.outlook.com (10.161.152.140) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.77.7; Thu, 19 Oct 2017 16:21:22 +0000 Received: from SN1NAM02FT035.eop-nam02.prod.protection.outlook.com (2a01:111:f400:7e44::203) by BLUPR0201CA0038.outlook.office365.com (2a01:111:e400:52e7::48) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.77.7 via Frontend Transport; Thu, 19 Oct 2017 16:21:22 +0000 Authentication-Results: spf=pass (sender IP is 149.199.60.100) smtp.mailfrom=xilinx.com; redhat.com; dkim=none (message not signed) header.d=none;redhat.com; dmarc=bestguesspass action=none header.from=xilinx.com; Received-SPF: Pass (protection.outlook.com: domain of xilinx.com designates 149.199.60.100 as permitted sender) receiver=protection.outlook.com; client-ip=149.199.60.100; helo=xsj-pvapsmtpgw02; Received: from xsj-pvapsmtpgw02 (149.199.60.100) by SN1NAM02FT035.mail.protection.outlook.com (10.152.72.145) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.20.77.10 via Frontend Transport; Thu, 19 Oct 2017 16:21:22 +0000 Received: from unknown-38-66.xilinx.com ([149.199.38.66]:38535 helo=xsj-pvapsmtp01) by xsj-pvapsmtpgw02 with esmtp (Exim 4.63) (envelope-from ) id 1e5DZR-0007x5-Gt; Thu, 19 Oct 2017 09:21:21 -0700 Received: from [127.0.0.1] (helo=localhost) by xsj-pvapsmtp01 with smtp (Exim 4.63) (envelope-from ) id 1e5DZR-00036G-Dh; Thu, 19 Oct 2017 09:21:21 -0700 Received: from xsj-pvapsmtp01 (smtp2.xilinx.com [149.199.38.66]) by xsj-smtp-dlp1.xlnx.xilinx.com (8.13.8/8.13.1) with ESMTP id v9JGLEpw018038; Thu, 19 Oct 2017 09:21:14 -0700 Received: from [172.19.2.220] (helo=localhost.localdomain) by xsj-pvapsmtp01 with esmtp (Exim 4.63) (envelope-from ) id 1e5DZK-00035r-N6; Thu, 19 Oct 2017 09:21:14 -0700 From: Alistair Francis To: Date: Thu, 19 Oct 2017 09:17:21 -0700 Message-ID: <1cde3cda34e054676e4bb17a7d65f1dd7c74cad6.1508390588.git.alistair.francis@xilinx.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: References: X-RCIS-Action: ALLOW X-TM-AS-Product-Ver: IMSS-7.1.0.1224-8.1.0.1062-23404.005 X-TM-AS-User-Approved-Sender: Yes;Yes X-EOPAttributedMessage: 0 X-MS-Office365-Filtering-HT: Tenant X-Forefront-Antispam-Report: CIP:149.199.60.100; IPV:NLI; CTRY:US; EFV:NLI; SFV:NSPM; SFS:(10009020)(6009001)(39860400002)(346002)(376002)(2980300002)(438002)(199003)(189002)(8936002)(2950100002)(5660300001)(356003)(118296001)(106002)(16586007)(8676002)(36386004)(76176999)(6916009)(54906003)(50986999)(9786002)(4326008)(575784001)(305945005)(81166006)(81156014)(47776003)(36756003)(2906002)(6666003)(77096006)(63266004)(189998001)(106466001)(48376002)(2351001)(5003940100001)(478600001)(50466002)(50226002)(316002)(33646002)(39060400002)(107986001)(5001870100001); DIR:OUT; SFP:1101; SCL:1; SRVR:BN6PR02MB3268; H:xsj-pvapsmtpgw02; FPR:; SPF:Pass; PTR:unknown-60-100.xilinx.com,xapps1.xilinx.com; A:1; MX:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; SN1NAM02FT035; 1:HNSvPHqCqhoQ6I2MBIv5ExPMA5mG49emrkEloNq8OxSWALaj4euuxpQWkxz8XS6D8iVzLkrkTXsY+xZUJLhkaOoY/EcHAsV4ZKdL/Lxy9SyZh192eh6JLfVIAh/pi9YN MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 6d749fc1-4d40-4289-01f0-08d5170d700d X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001)(2017030254152)(8251501002)(2017052603199)(201703131423075)(201703031133081)(201702281549075); SRVR:BN6PR02MB3268; X-Microsoft-Exchange-Diagnostics: 1; BN6PR02MB3268; 3:M6AfIhZKpW0V+bu3/XvTQg2oEoUKmzr4ZTMPAJcZeEkKd1Keurar6obj/qoosUu8UK021479ZExlkWF1qCgHSdiesYwsJHMDc4YM9SXm7Ik6QQJDLY/GeLy2YM8TfckKyjG8YLOzkif/2m32tqNJuukBL38ZoTm4a23KJ8a2Pfs0sGLMOPRG8FgeS+Tj6URVJ8d4MdVHK35R1MA7hhXs2CM5b0aI/2Gz+56G8MZq/S25cxVMBI0fiJIgv6t6Q40+GJRekHxvfVQrLF7LzJ/XWMJ4uk/uIbPIUTYaafgz1mFB2sTLZdr4SH7ZYr+A46ap+XKNNI7mOyOP1wx88n3+3Z13OXJPrhI8xhAR4HGTA4A=; 25:1QPfYW8vpaKx+GPsXvvlETrMgE5ZJs39f+uINH4LWH+DFGaBIVeZsPMq+0WAJbabFeCKaTtu7MilloKFlfBUbfDVJMdG8V0WHlX8c5/sZc84ll0jGKosm0MnM3UNveqk1Q6Ut5FxJXuaWFHkvVV3DBbkfp2voUREgWp5aUXwmj3/OQSpEDkwFZ5qQ7u+rBij8YE4DyG7l0582KOwGby1HnTxmscRmJ/2X8S+as1WNlFkj79vJsQSXngKyv8xuiFLEPZgjmuhuxVPF02Plv6AyBFsnt6UonwUbZLBB17F7UvsIkMgiPRxt0uOPaT1X8omj/BBjNrAgrYf2BoAoRHLJg== X-MS-TrafficTypeDiagnostic: BN6PR02MB3268: X-Microsoft-Exchange-Diagnostics: 1; BN6PR02MB3268; 31:tTFIkRgLpij1KZr7dWkcKaKFruw5VyRlitRoe8tdTtLOHQxMpLbY12VJw7br6HODTfhWtpZ3kUbXG32hLGQpSDHVvZS/7m1nt8v58D2HvBJoIFN6EE+2YByC1ztU2htTFgEBWcaLjcf+uCXGMq/mF08zJA2Gpe1mJR5ZyQCYZ7VTn+Umbr8JS8jKGdBCkQjCxUl8m9aD8rctWhnwezyCmoWV6NXuaC2YPei9YPo+Lb4=; 20:rakbxDoHZV7bNErX351e0OjYpHKZY8+tQqdGeU1UsxD/s+yM/iTWQK3+8srOd7qmMkjgo8GMrjzbdKwuQFu0Oks1myK8uov/QC9LE8KfaosiYoByc6/T+0WQu1jTFULQTLppFhoLT2fAGkpquoirUFfAVpUkxY97x4twLSPvbOO0BUOxnYQnUatKJPiTjmz6r/bD7VDQNfbav0fvFpCDl+6MlNtVLl9MTNaif1ccy63bQqWin98nR/8vKecJNZf23LilV8AXp8UIVs2iC+W+N35SvIzur6bvyqVmYbm6clH6+pclQ/8P9zENWUxt4/vuP6hKnlAhC4wGCwfiRUvi1zLWT7Hd6j1IA1CTaoR3IGekqByXzkvpeFe8zRr70WmmcbEI3fm0GQShu5BF7l6yKDTfDnCzUyQKyQQGK3CKBggwSh8CRvZbvw9avuZxXIqAOtDIvZhzKD2jtZWVq+cDKC7EU46OIn3PZkCpZbM5V6EuGJvueQdnUFodX98ZRPf+ X-Exchange-Antispam-Report-Test: UriScan:(788757137089)(192813158149592); X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(100000700101)(100105000095)(100000701101)(100105300095)(100000702101)(100105100095)(6040450)(2401047)(8121501046)(5005006)(93006095)(93004095)(100000703101)(100105400095)(10201501046)(3002001)(6055026)(6041248)(20161123558100)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123555025)(20161123564025)(20161123562025)(20161123560025)(6072148)(201708071742011)(100000704101)(100105200095)(100000705101)(100105500095); SRVR:BN6PR02MB3268; BCL:0; PCL:0; RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095); SRVR:BN6PR02MB3268; X-Microsoft-Exchange-Diagnostics: 1; BN6PR02MB3268; 4:Uv6nFauWckmjjf6YTDmgO8XQgf2O7Pg/0tB3D2nT9K8E1BgfJn8t3YyyZ2CcGUe56KiTs953bVktP0i8JeZcaARUqqLiQE0Ipy1RCJiLC77a2n3D2mCJvVfyrz8lBwcLZ23X9EkujQtXh2UUTzoyrBUFQIXbbTbYNgWJGyHWczMRQ8Nbue9EQ+x5oZs5bZCobg4Hcu/AzmJqOhxCrab37Is2iEAKJ32kd7IQi+6gAe/id8ZuqVnN1dhsE1wQko6wuALT7hnUZkqOLLmEIj8TOEOeTI6UYNn9kU8kn0tSkILayPF9vPYBb9XpwK6YsZ+F0t1MosI+X31D8tdcYvcIsg== X-Forefront-PRVS: 0465429B7F X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; BN6PR02MB3268; 23:1wcLkpveYxHh/B+YbCtLYsCNV79loOap0FtNsP5kM?= ErCzq56lJ+vIPbXt+AmYroefp51rqGdoka//z6sHvIrXeT5kWH+ylSnzFxKid65/0TVGVVBInzd/+Kkg62MrEYRQzy8tkorXr3+C8iPwlmcLzyPpok/LKw5tLSUTM5wVNoVWoVW6/rT+/jT692CEc4IREyu7k+RkHaWUKPNgYJCoJScycWBVxDBkbCCFyMkp3QOlcApAkgP0yD9IkttL2mFsER6q3KPBCE+d3QpuE6NNXjm0MtzhlRD0xhZZY9qxAfMEQMoUZeVmF9ytSGW3JIr9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c9ZBIRCWIIII8S2dBm7n33D3yVHRA9iXzZGpbhD0lKZOoc9sMGNGJkxWv7s9pV82BRES4Eoxk/00KloNqQ7pA4KyXDhnG8ZbAMcmHiyetGA==; 5:YgJTBgvo970CwNXxrWrDMX925sB5trudvpPvVajZGn6F7MJkrMhnjEOXQy7HZ/NqFjBi6O0zqZ5l6Ch8uQ0cnMIpDaciBO8g8xhPwzBsyZAAJUIKRPgjZAO3059b513yKG1LmnP1K8tLNGKyJmLm4A==; 24:Zbar527KqSubYIa7Ad4FMjupGa85NWX0WuMvVD1c6UgdbEHthvze5Hp1MhnLUXoSkaE6UyViGovzw3Q6WFwDutPuSrv+GcVggt/+9Y0uGL0=; 7:dG7fduiax58lb8aTNxpAoKnAfGzKd10znK8cFec9XEuJ2RxnrcEV/RAHNch4ehNbm9/yeGCAndLzYh6eeNYCJpyPSaHflX4PhlIXmeAG5aAfxJ3koXscV+9SQu8YDsldJl+E4QV0u91GU/KQzZzKENIE8XND0xbFwgFclgBb2DU/Jwah9RFkBo3sV8NgDMCOnaXyYWwyVzYjx/3ECiykb595f1aJ8bMpnjI2QZt6da0= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: xilinx.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 19 Oct 2017 16:21:22.2520 (UTC) X-MS-Exchange-CrossTenant-Id: 657af505-d5df-48d0-8300-c31994686c5c X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=657af505-d5df-48d0-8300-c31994686c5c; Ip=[149.199.60.100]; Helo=[xsj-pvapsmtpgw02] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN6PR02MB3268 X-detected-operating-system: by eggs.gnu.org: Windows 7 or 8 [fuzzy] X-Received-From: 104.47.36.81 Subject: [Qemu-devel] [PATCH v3 28/46] hw/nvram: Replace fprintf(stderr, "*\n" with error_report() 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: alistair23@gmail.com, armbru@redhat.com, alistair.francis@xilinx.com Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" Replace a large number of the fprintf(stderr, "*\n" calls with error_report(). The functions were renamed with these commands and then compiler issues where manually fixed. find ./* -type f -exec sed -i \ 'N;N;N;N;N;N;N;N;N;N;N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2);|Ig}' \ {} + find ./* -type f -exec sed -i \ 'N;N;N;N;N;N;N;N;N;N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2);|Ig}' \ {} + find ./* -type f -exec sed -i \ 'N;N;N;N;N;N;N;N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2);|Ig}' \ {} + find ./* -type f -exec sed -i \ 'N;N;N;N;N;N;N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2);|Ig}' \ {} + find ./* -type f -exec sed -i \ 'N;N;N;N;N;N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2);|Ig}' \ {} + find ./* -type f -exec sed -i \ 'N;N;N;N;N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2);|Ig}' \ {} + find ./* -type f -exec sed -i \ 'N;N;N;N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2);|Ig}' \ {} + find ./* -type f -exec sed -i \ 'N;N;N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2);|Ig}' \ {} + find ./* -type f -exec sed -i \ 'N;N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2);|Ig}' \ {} + find ./* -type f -exec sed -i \ 'N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2);|Ig}' \ {} + find ./* -type f -exec sed -i \ 'N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2);|Ig}' \ {} + Some lines where then manually tweaked to pass checkpatch. Some of the message in put_unused() was removed and replaced with g_assert_not_reached(). Signed-off-by: Alistair Francis --- V3: - Add g_assert_not_reached() in unused function V2: - Split hw patch into individual directories hw/nvram/eeprom93xx.c | 5 +++-- hw/nvram/fw_cfg.c | 5 +++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/hw/nvram/eeprom93xx.c b/hw/nvram/eeprom93xx.c index 2fd0e3c29f..5cad031eba 100644 --- a/hw/nvram/eeprom93xx.c +++ b/hw/nvram/eeprom93xx.c @@ -36,6 +36,7 @@ */ #include "qemu/osdep.h" +#include "qemu/error-report.h" #include "hw/hw.h" #include "hw/nvram/eeprom93xx.h" @@ -105,8 +106,8 @@ static int get_uint16_from_uint8(QEMUFile *f, void *pv, size_t size, static int put_unused(QEMUFile *f, void *pv, size_t size, VMStateField *field, QJSON *vmdesc) { - fprintf(stderr, "uint16_from_uint8 is used only for backwards compatibility.\n"); - fprintf(stderr, "Never should be used to write a new state.\n"); + error_report("uint16_from_uint8 is used only for backwards compatibility."); + error_report("Never should be used to write a new state."); exit(0); return 0; diff --git a/hw/nvram/fw_cfg.c b/hw/nvram/fw_cfg.c index 753ac0e4ea..1c66052f1f 100644 --- a/hw/nvram/fw_cfg.c +++ b/hw/nvram/fw_cfg.c @@ -518,8 +518,9 @@ static int get_uint32_as_uint16(QEMUFile *f, void *pv, size_t size, static int put_unused(QEMUFile *f, void *pv, size_t size, VMStateField *field, QJSON *vmdesc) { - fprintf(stderr, "uint32_as_uint16 is only used for backward compatibility.\n"); - fprintf(stderr, "This functions shouldn't be called.\n"); + error_report("uint32_as_uint16 is only used for backward compatibility."); + + g_assert_not_reached(); return 0; } From patchwork Thu Oct 19 16:17:24 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alistair Francis X-Patchwork-Id: 828241 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; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=xilinx.onmicrosoft.com header.i=@xilinx.onmicrosoft.com header.b="kdA37n0f"; 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 3yHw0b4qppz9s72 for ; Fri, 20 Oct 2017 03:50:39 +1100 (AEDT) Received: from localhost ([::1]:50214 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e5E1l-0004bl-9Z for incoming@patchwork.ozlabs.org; Thu, 19 Oct 2017 12:50:37 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:55962) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e5DZo-0005aD-Jp for qemu-devel@nongnu.org; Thu, 19 Oct 2017 12:21:45 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1e5DZl-0001zf-D0 for qemu-devel@nongnu.org; Thu, 19 Oct 2017 12:21:44 -0400 Received: from mail-dm3nam03on0043.outbound.protection.outlook.com ([104.47.41.43]:3584 helo=NAM03-DM3-obe.outbound.protection.outlook.com) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1e5DZl-0001zU-66 for qemu-devel@nongnu.org; Thu, 19 Oct 2017 12:21:41 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=xilinx.onmicrosoft.com; s=selector1-xilinx-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=BQe5HYY7ofgy9s2ZqvgoZvLj+BQfS2Ir3xlaFrInMRs=; b=kdA37n0fTO4tCvnO46SO6FpVceJlRxcQ92n0qgFmQZSSL8dBKxrcqHICKVz4zhNpbPIu+5xdBoe7BwkWXLzfVmLFIt9p1l8l4HI7ooPxq2MpuLoeZSDdn7yaXMSSa28oIGkiB3DM0L27EXn3z//VS4bS9tSQo9P00IHwxURMv3k= Received: from SN4PR0201CA0043.namprd02.prod.outlook.com (10.162.76.29) by DM5PR02MB3385.namprd02.prod.outlook.com (10.164.152.161) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.77.7; Thu, 19 Oct 2017 16:21:33 +0000 Received: from CY1NAM02FT025.eop-nam02.prod.protection.outlook.com (2a01:111:f400:7e45::204) by SN4PR0201CA0043.outlook.office365.com (2603:10b6:803:2e::29) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.77.7 via Frontend Transport; Thu, 19 Oct 2017 16:21:33 +0000 Authentication-Results: spf=pass (sender IP is 149.199.60.100) smtp.mailfrom=xilinx.com; gmail.com; dkim=none (message not signed) header.d=none;gmail.com; dmarc=bestguesspass action=none header.from=xilinx.com; Received-SPF: Pass (protection.outlook.com: domain of xilinx.com designates 149.199.60.100 as permitted sender) receiver=protection.outlook.com; client-ip=149.199.60.100; helo=xsj-pvapsmtpgw02; Received: from xsj-pvapsmtpgw02 (149.199.60.100) by CY1NAM02FT025.mail.protection.outlook.com (10.152.75.148) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.20.77.10 via Frontend Transport; Thu, 19 Oct 2017 16:21:33 +0000 Received: from unknown-38-66.xilinx.com ([149.199.38.66]:38640 helo=xsj-pvapsmtp01) by xsj-pvapsmtpgw02 with esmtp (Exim 4.63) (envelope-from ) id 1e5DZc-0007xZ-5r; Thu, 19 Oct 2017 09:21:32 -0700 Received: from [127.0.0.1] (helo=localhost) by xsj-pvapsmtp01 with smtp (Exim 4.63) (envelope-from ) id 1e5DZc-00037b-2p; Thu, 19 Oct 2017 09:21:32 -0700 Received: from xsj-pvapsmtp01 (mailhub.xilinx.com [149.199.38.66]) by xsj-smtp-dlp1.xlnx.xilinx.com (8.13.8/8.13.1) with ESMTP id v9JGLKPI018065; Thu, 19 Oct 2017 09:21:21 -0700 Received: from [172.19.2.220] (helo=localhost.localdomain) by xsj-pvapsmtp01 with esmtp (Exim 4.63) (envelope-from ) id 1e5DZQ-00036D-ST; Thu, 19 Oct 2017 09:21:20 -0700 From: Alistair Francis To: Date: Thu, 19 Oct 2017 09:17:24 -0700 Message-ID: X-Mailer: git-send-email 2.11.0 In-Reply-To: References: X-RCIS-Action: ALLOW X-TM-AS-Product-Ver: IMSS-7.1.0.1224-8.1.0.1062-23404.005 X-TM-AS-User-Approved-Sender: Yes;Yes X-EOPAttributedMessage: 0 X-MS-Office365-Filtering-HT: Tenant X-Forefront-Antispam-Report: CIP:149.199.60.100; IPV:NLI; CTRY:US; EFV:NLI; SFV:NSPM; SFS:(10009020)(6009001)(346002)(39860400002)(376002)(2980300002)(438002)(189002)(199003)(8936002)(33646002)(106466001)(36756003)(5003940100001)(36386004)(5660300001)(189998001)(4326008)(118296001)(81166006)(47776003)(8676002)(81156014)(63266004)(16586007)(9786002)(2351001)(356003)(106002)(316002)(6916009)(77096006)(50226002)(50986999)(2950100002)(48376002)(76176999)(54906003)(2906002)(478600001)(305945005)(39060400002)(50466002)(107986001)(5001870100001); DIR:OUT; SFP:1101; SCL:1; SRVR:DM5PR02MB3385; H:xsj-pvapsmtpgw02; FPR:; SPF:Pass; PTR:xapps1.xilinx.com,unknown-60-100.xilinx.com; MX:1; A:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; CY1NAM02FT025; 1:SDSi1Kk+v+Q4DEN4JVbmU2mW0ycfZIPf7rD1rjMyfP8nDEHIO4IqT2Kq9Pcq/rYBYjRBj7eOBuuKNJRF3caTnNITmQUgxNnrEwSNIQPwE4JfbwmKDHp5O8lbAXJxGlUl MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: ea1b426a-baea-423f-cbe4-08d5170d7692 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001)(2017030254152)(8251501002)(2017052603199)(201703131423075)(201703031133081)(201702281549075); SRVR:DM5PR02MB3385; X-Microsoft-Exchange-Diagnostics: 1; DM5PR02MB3385; 3:0Xjs3bV/VnIo1xG1CkhtKN2U6mnSzKzh6pQOfMXCuEQkqNvzEl7rXTetTJ0G7zeyicciDvcRUSxfnRRxsRlmupisImv+YhPLI68NwJb4YAIU3ZFkMQUb8kPDQMlucfjOvewS64tLGYGIsap8zrFaQlzjwEEBjgT+f/FcwJts/e7wVPo7nw9m5FBGKjDuQO4Ohn15OFbkDBjFzYoYKjyUxt4c1oILbDREHKnN3LTvoH346YO6tOqzATJTwCKtsqL+VlSuE8pnl0TkEANpLOQQiac4z49NIxPJTmrhUf09RnEE64QXRe/a+EUU+wgTzZdRHoZc9yiGx0Sos5XhtPwOneud+LtDYTxCrUa9SxtOLrQ=; 25:UbAVyVMwXega7gK4Ocn8WaH3uO4ehAmyIS7OaGyuR9LiryyvuewbLBn+JP+Ih6luBcIYe1PbAELr7PvTE5/AoJyPN4U8M2e4Uw6mPjwkcuie/wI/FGIY480kycLKfthZO0gdkKI5pu15CuIM5R88vpLw88fRSnAdvUIPqqcnRPp+aJ2jUO4uLw2pbdMIUquhtppwzfbeVVbkyW0bzHULKPN5tWKQ2n2p7J/Vb33x3lr4tBv6utTISj4FpRC4kmJhCmaGQaD6aWZEx595oXvGGAQKim7M7nvFNajenwmVNWUvDszQfpWxpaEsY010do8A/63pzpVJvZFY2ea33V1rVQ== X-MS-TrafficTypeDiagnostic: DM5PR02MB3385: X-Microsoft-Exchange-Diagnostics: 1; DM5PR02MB3385; 31:SBVmwfnjWL8OX38XwhF8e9QHnckybCzVQYSRG7bzKlNvLE5M7Xfb3Q2/7gQHjG5QVVfy7CM5qGV7D/aURUtBlRSyINfHcwOgpYVhTP+Y2ohdm89AjT463Qt5ob79sBsyPITHGuXUgd9JYnE2aA/3g/wicXHos/bAxdkB4Nor778le4X7rOuTSYzHjdXKsO7dWzpZN80KduCnT4HJgkFvVgBcFWqk455lATwxOTzOO6k=; 20:Qbd/9nMJjL98QbBqbWCmxZ3TvWzJ3HpLmQnqRGyuoPp8dGWHwkDZwKyPJAECkVncfs7jPaH7JMD2S3I6jw7hCVWXz5mDmqOGxBEgehBzvchxtVDdcEOmgLBXh4BAAQ2aff4YKaBEqVhKB+N5ule9DaUB4BZVymZPUx+iWiTs/t3TbxQUXLR47VdMmqs2DId/zAx4b/9iKIFxdFJ4iBl5dKNmSblHr0Nh2lcZ2pZPybukDb5dWAHbUNM0KF+Vzaa5sypGUs5dE32uMOt551aCqbU2Ya1xcEZG1RJy5vBARtkzBg7bOT7+71p2tTLf9JjMgyYLjjv854eiJXP6th8KaDys9VSMWDxcLYjFQq7Bd2919g8wGz2skHSTU4X4DaRa3YBumks1ROLDJFqNOlKnqUmHUJcW4Cu9QGPgcbFS93wEAiu4nCCIB49wnI++osqGb1tlbdIVR2yTO+ITxj+WTK97ebtcNfdkXu6HFmi/8+L+fo4z2kJISnepJWV6XqYo X-Exchange-Antispam-Report-Test: UriScan:(788757137089)(192813158149592); X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(100000700101)(100105000095)(100000701101)(100105300095)(100000702101)(100105100095)(6040450)(2401047)(8121501046)(5005006)(3002001)(93006095)(93004095)(100000703101)(100105400095)(10201501046)(6055026)(6041248)(20161123558100)(20161123555025)(20161123560025)(20161123564025)(20161123562025)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(6072148)(201708071742011)(100000704101)(100105200095)(100000705101)(100105500095); SRVR:DM5PR02MB3385; BCL:0; PCL:0; RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095); SRVR:DM5PR02MB3385; X-Microsoft-Exchange-Diagnostics: 1; DM5PR02MB3385; 4:DxMTNaKCKhadn6pg4V6bV6+r9eHqNQmAW/9IuTf5mRy3JSO31q60Y7HUQ1d/MDy5bdZCT0QvyPSNFIgaEMZgtS8qOY3bwH2Tx39qvYX5wgsU5rDx0S8UU2ImOAmOV2Sf3QptkGePqwgcVX82tD5c/v6EURRZLV1H07oFP4CBv/1r/23wq8HzdaWGgOhHm13xU06A4/RLqFUa4gRIDZ7BK0imSn0iRyhiSeM7mhhYMxF0p23pnLoTLFH7CRZTq7+Z3rcdkEnj4eMbuVb+WPcOJSUGkvtiqNMA0XqNdqMIKiyudVMD3djpMLWNpHGW9R00V0lk9c28h2T59BUA3h7PAA== X-Forefront-PRVS: 0465429B7F X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; DM5PR02MB3385; 23:YfmGM1WcigdFXWW7JE6EoEjRbBiv77WFvng1XiEOu?= xLIaokEKaqBARnzaETwNLjwZmEFNZg/NAaAyKQkey9V9vfX3L8DW1EeFmT3dfPf0qaAA4M4DG+byH31sid1HNiPk30CrJZc8mPy8zkC0TcQPb+wkK1ocqKLdm06xumOzLu1JO9wBoiSApygyLJ12cTU8kPhbSpjhNJUx+RMCcek7faUsfnaQQBoRqoyYatWnmK9w17tEZE5ZcVzfANQCqNvTfgm8pPOIypq89GjLj6G09AMFchPHZV/k198UtoUz+ovsEwzlWsudb1MjiARrCEWJuRcytkrIDUAcx2oyH7ube7cEcWqBkOyUDH22uwZJaYi8eZi1Pn4/SYD2lDbp+yo07NK24g29SRr3wBlb7DrDoh/sKmnJWLsCNeR0F8o2tt2vg5Z7tjjZ6Iki3DcqWqXsRGHNUOgpdumeL3BbpbHW0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iAYXEzmoEwSEm88UHTDA9S0YOCPFNVqlH/fFEIjaiQ226yBfbqbZh4nko6PgDw==; 24:MLnLyuMDbe1vrsJGNM+LlWo9ZCaq/NuKSZ3m9RLxnph4cQYW0qj8/FjqaK2KLMGoB5ZazDz6ZcT2p0gAhveGTfC1mxn4VdZ0e4k3HeSgAxM=; 7:3jRMCqsV8bRnCuDj9hYLaphMh34nZbKOcj+Tc4S6ZWcw7niXHRBn1GfFERvcxDm0fZK47J5bt9TBKEqMlBGMp3BCCdbcqyf0uqm4Pp5pazEMMuG03lEZ8+rhDzqJk6UaRfxzuyxybtf3N46zV17wC9LeaUAGc8auW3tw+qicsP7SG9Enkin74kPOi1MCSkjat8W0IRfvEONtdUys/t5jR/V9qB4E3MxNqw/we1KLEmo= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: xilinx.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 19 Oct 2017 16:21:33.0232 (UTC) X-MS-Exchange-CrossTenant-Id: 657af505-d5df-48d0-8300-c31994686c5c X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=657af505-d5df-48d0-8300-c31994686c5c; Ip=[149.199.60.100]; Helo=[xsj-pvapsmtpgw02] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM5PR02MB3385 X-detected-operating-system: by eggs.gnu.org: Windows 7 or 8 [fuzzy] X-Received-From: 104.47.41.43 Subject: [Qemu-devel] [PATCH v3 29/46] hw/openrisc: Replace fprintf(stderr, "*\n" with error_report() 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: alistair23@gmail.com, Stafford Horne , armbru@redhat.com, Jia Liu , alistair.francis@xilinx.com Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" Replace a large number of the fprintf(stderr, "*\n" calls with error_report(). The functions were renamed with these commands and then compiler issues where manually fixed. find ./* -type f -exec sed -i \ 'N;N;N;N;N;N;N;N;N;N;N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2);|Ig}' \ {} + find ./* -type f -exec sed -i \ 'N;N;N;N;N;N;N;N;N;N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2);|Ig}' \ {} + find ./* -type f -exec sed -i \ 'N;N;N;N;N;N;N;N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2);|Ig}' \ {} + find ./* -type f -exec sed -i \ 'N;N;N;N;N;N;N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2);|Ig}' \ {} + find ./* -type f -exec sed -i \ 'N;N;N;N;N;N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2);|Ig}' \ {} + find ./* -type f -exec sed -i \ 'N;N;N;N;N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2);|Ig}' \ {} + find ./* -type f -exec sed -i \ 'N;N;N;N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2);|Ig}' \ {} + find ./* -type f -exec sed -i \ 'N;N;N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2);|Ig}' \ {} + find ./* -type f -exec sed -i \ 'N;N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2);|Ig}' \ {} + find ./* -type f -exec sed -i \ 'N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2);|Ig}' \ {} + find ./* -type f -exec sed -i \ 'N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2);|Ig}' \ {} + Some lines where then manually tweaked to pass checkpatch. Signed-off-by: Alistair Francis Cc: Jia Liu Cc: Stafford Horne Acked-by: Stafford Horne --- V2: - Split hw patch into individual directories hw/openrisc/openrisc_sim.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/hw/openrisc/openrisc_sim.c b/hw/openrisc/openrisc_sim.c index 86bf2849c4..ba74e24e8a 100644 --- a/hw/openrisc/openrisc_sim.c +++ b/hw/openrisc/openrisc_sim.c @@ -19,6 +19,7 @@ */ #include "qemu/osdep.h" +#include "qemu/error-report.h" #include "qapi/error.h" #include "qemu-common.h" #include "cpu.h" @@ -87,8 +88,7 @@ static void cpu_openrisc_load_kernel(ram_addr_t ram_size, } if (kernel_size < 0) { - fprintf(stderr, "QEMU: couldn't load the kernel '%s'\n", - kernel_filename); + error_report("couldn't load the kernel '%s'", kernel_filename); exit(1); } cpu->env.pc = entry; From patchwork Thu Oct 19 16:17:31 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Alistair Francis X-Patchwork-Id: 828223 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; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=xilinx.onmicrosoft.com header.i=@xilinx.onmicrosoft.com header.b="ipghdOx8"; 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 3yHvlD23Rcz9tX8 for ; Fri, 20 Oct 2017 03:38:57 +1100 (AEDT) Received: from localhost ([::1]:50150 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e5DqR-0002iC-Io for incoming@patchwork.ozlabs.org; Thu, 19 Oct 2017 12:38:55 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:55921) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e5DZj-0005WX-9N for qemu-devel@nongnu.org; Thu, 19 Oct 2017 12:21:41 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1e5DZg-0001xl-3O for qemu-devel@nongnu.org; Thu, 19 Oct 2017 12:21:39 -0400 Received: from mail-sn1nam01on0055.outbound.protection.outlook.com ([104.47.32.55]:51986 helo=NAM01-SN1-obe.outbound.protection.outlook.com) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1e5DZf-0001xL-S6 for qemu-devel@nongnu.org; Thu, 19 Oct 2017 12:21:36 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=xilinx.onmicrosoft.com; s=selector1-xilinx-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=MLDtmzh9d3ZkTIM7UCOC88YXbJcXnS3/xvvYSfnR3OE=; b=ipghdOx85Rj6C6UJ4TWk8QMLk8k4/T+wdFeXp/TQ36ZfwViwNO1gE1be2r6HFozS29o8o2NLDcWZsioYOJU6jtMhRNc5W9prTaoCijAPGogfPpch/7PDMTeiggv8YW3vTjqPLIKnIBB3N8wfOHAQ0xQHmWOcqvpyMJAlRxueccM= Received: from BY2PR02CA0006.namprd02.prod.outlook.com (10.163.44.144) by CY4PR02MB3383.namprd02.prod.outlook.com (10.165.89.154) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.77.7; Thu, 19 Oct 2017 16:21:33 +0000 Received: from SN1NAM02FT004.eop-nam02.prod.protection.outlook.com (2a01:111:f400:7e44::208) by BY2PR02CA0006.outlook.office365.com (2a01:111:e400:5261::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.156.4 via Frontend Transport; Thu, 19 Oct 2017 16:21:32 +0000 Authentication-Results: spf=pass (sender IP is 149.199.60.100) smtp.mailfrom=xilinx.com; redhat.com; dkim=none (message not signed) header.d=none;redhat.com; dmarc=bestguesspass action=none header.from=xilinx.com; Received-SPF: Pass (protection.outlook.com: domain of xilinx.com designates 149.199.60.100 as permitted sender) receiver=protection.outlook.com; client-ip=149.199.60.100; helo=xsj-pvapsmtpgw02; Received: from xsj-pvapsmtpgw02 (149.199.60.100) by SN1NAM02FT004.mail.protection.outlook.com (10.152.72.175) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.20.77.10 via Frontend Transport; Thu, 19 Oct 2017 16:21:32 +0000 Received: from unknown-38-66.xilinx.com ([149.199.38.66]:38626 helo=xsj-pvapsmtp01) by xsj-pvapsmtpgw02 with esmtp (Exim 4.63) (envelope-from ) id 1e5DZb-0007xI-Sc; Thu, 19 Oct 2017 09:21:31 -0700 Received: from [127.0.0.1] (helo=localhost) by xsj-pvapsmtp01 with smtp (Exim 4.63) (envelope-from ) id 1e5DZb-00037b-OJ; Thu, 19 Oct 2017 09:21:31 -0700 Received: from xsj-pvapsmtp01 (xsj-smtp.xilinx.com [149.199.38.66]) by xsj-smtp-dlp2.xlnx.xilinx.com (8.13.8/8.13.1) with ESMTP id v9JGLNhg006818; Thu, 19 Oct 2017 09:21:24 -0700 Received: from [172.19.2.220] (helo=localhost.localdomain) by xsj-pvapsmtp01 with esmtp (Exim 4.63) (envelope-from ) id 1e5DZT-00036l-SH; Thu, 19 Oct 2017 09:21:23 -0700 From: Alistair Francis To: Date: Thu, 19 Oct 2017 09:17:31 -0700 Message-ID: X-Mailer: git-send-email 2.11.0 In-Reply-To: References: MIME-Version: 1.0 X-RCIS-Action: ALLOW X-TM-AS-Product-Ver: IMSS-7.1.0.1224-8.1.0.1062-23404.005 X-TM-AS-User-Approved-Sender: Yes;Yes X-EOPAttributedMessage: 0 X-MS-Office365-Filtering-HT: Tenant X-Forefront-Antispam-Report: CIP:149.199.60.100; IPV:NLI; CTRY:US; EFV:NLI; SFV:NSPM; SFS:(10009020)(979002)(6009001)(39860400002)(346002)(376002)(2980300002)(438002)(189002)(199003)(478600001)(4326008)(81166006)(81156014)(63266004)(39060400002)(8676002)(23676002)(305945005)(189998001)(118296001)(356003)(6666003)(47776003)(50226002)(5820100001)(36386004)(9786002)(36756003)(2351001)(2906002)(106466001)(33646002)(77096006)(50986999)(316002)(2870700001)(106002)(2950100002)(50466002)(5660300001)(6916009)(54906003)(76176999)(8936002)(107986001)(5001870100001)(969003)(989001)(999001)(1009001)(1019001); DIR:OUT; SFP:1101; SCL:1; SRVR:CY4PR02MB3383; H:xsj-pvapsmtpgw02; FPR:; SPF:Pass; PTR:xapps1.xilinx.com,unknown-60-100.xilinx.com; MX:1; A:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; SN1NAM02FT004; 1:pJVYL0kNnEaaG/a0IdhotGjiGE30QozY/KfsXO4jf4YdiPIgFA5Uk5/sQDH8742LzG6mgL68rENtBj3JT1vEFkn/mivDTEknXKLaFxM6Hn/jtrDZfZq0dt+yIjI2mh3E X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 635d5f7a-2a0e-406c-3a83-08d5170d7627 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001)(2017030254152)(8251501002)(2017052603199)(201703131423075)(201703031133081)(201702281549075); SRVR:CY4PR02MB3383; X-Microsoft-Exchange-Diagnostics: 1; CY4PR02MB3383; 3:ZCRGBXPiVtc0ApLTJNVAPmlwwTQEEC+fCqWCN3O8a0YL+WsrQSAatyvrir1lJFWb+pgkxKCwXFrMjJQ2OX4F3BucfDfDR+R66B/cOMjnGCgUNA8qZndYWng+YHr2jXyiuOTXXKPNmgVBNk8Y34q95ud2zEHcigc44cfci0U7lUDDah50kvEtIgFHKO7JS4fLHgS8R9fflqcU9ZRVGPXTBiXPcWajy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IC7hkdAb+kqYYBcSc6Jyp8YKg/g86VjYow58FUfuKRo2LawRnT0XR0G32sM5TotsyVzGTnt7ACwXgOSWyMEB/a8WKZBoZKXsa74HJq+qyw/b0x+J/WT9oIQXuKFoLSGINQxTxiluMbMd1AqTFnMM+x2mRD1UhxIET8UhNN2QzWx8uUY09sxro/2JAIYu+yBW7WMi7uck24DX5N5B+KzqT+omZpm2vW6XGl4wi5O5eqCdREvsAL X-Exchange-Antispam-Report-Test: UriScan:(788757137089)(192813158149592); X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(100000700101)(100105000095)(100000701101)(100105300095)(100000702101)(100105100095)(6040450)(2401047)(5005006)(8121501046)(10201501046)(93006095)(93004095)(100000703101)(100105400095)(3002001)(6055026)(6041248)(20161123558100)(20161123560025)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123564025)(20161123555025)(20161123562025)(6072148)(201708071742011)(100000704101)(100105200095)(100000705101)(100105500095); SRVR:CY4PR02MB3383; BCL:0; PCL:0; RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095); SRVR:CY4PR02MB3383; X-Microsoft-Exchange-Diagnostics: 1; CY4PR02MB3383; 4:ggqEXfqUtQABeKNgQ1WfBdVhWsujQ8L+q70E+cHAAFn6yeJhU2EYDzMb1aTUDYB+wLeScORBpXz2clM8Lx4bYHXaulH6+nN5f6UPBbhGIgU2DhenhqsFv5cE7Y3Cj4K8vJXPC09uW3W7V2jOcsCj7+KwBCr8GF0DEVFQr0KEWcllJH3WsI4de5nPEZfyGzgE9B9Vk/qv4Q69xHHRHmT1lt190i4BLFTEVpkVVmHbCj5II31V4LbSYRjIknpUI9VgYz7mJQH2YNRBMpVGFprMJZfCJCTRTXZ2kyOf09klZ0TyLXUX7SEqAco/Vb4C/CucWEPi7B5Y+jyVOwXqDFhNRw== X-Forefront-PRVS: 0465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nosticMetadata: NSPM X-OriginatorOrg: xilinx.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 19 Oct 2017 16:21:32.4432 (UTC) X-MS-Exchange-CrossTenant-Id: 657af505-d5df-48d0-8300-c31994686c5c X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=657af505-d5df-48d0-8300-c31994686c5c; Ip=[149.199.60.100]; Helo=[xsj-pvapsmtpgw02] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY4PR02MB3383 X-detected-operating-system: by eggs.gnu.org: Windows 7 or 8 [fuzzy] X-Received-From: 104.47.32.55 Subject: [Qemu-devel] [PATCH v3 30/46] hw/pci*: Replace fprintf(stderr, "*\n" with error_report() 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: Marcel Apfelbaum , alistair23@gmail.com, "Michael S. Tsirkin" , armbru@redhat.com, alistair.francis@xilinx.com Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" Replace a large number of the fprintf(stderr, "*\n" calls with error_report(). The functions were renamed with these commands and then compiler issues where manually fixed. find ./* -type f -exec sed -i \ 'N;N;N;N;N;N;N;N;N;N;N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2);|Ig}' \ {} + find ./* -type f -exec sed -i \ 'N;N;N;N;N;N;N;N;N;N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2);|Ig}' \ {} + find ./* -type f -exec sed -i \ 'N;N;N;N;N;N;N;N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2);|Ig}' \ {} + find ./* -type f -exec sed -i \ 'N;N;N;N;N;N;N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2);|Ig}' \ {} + find ./* -type f -exec sed -i \ 'N;N;N;N;N;N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2);|Ig}' \ {} + find ./* -type f -exec sed -i \ 'N;N;N;N;N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2);|Ig}' \ {} + find ./* -type f -exec sed -i \ 'N;N;N;N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2);|Ig}' \ {} + find ./* -type f -exec sed -i \ 'N;N;N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2);|Ig}' \ {} + find ./* -type f -exec sed -i \ 'N;N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2);|Ig}' \ {} + find ./* -type f -exec sed -i \ 'N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2);|Ig}' \ {} + find ./* -type f -exec sed -i \ 'N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2);|Ig}' \ {} + Some lines where then manually tweaked to pass checkpatch. A trailing '.' was removed in hw/pci/pci.c Signed-off-by: Alistair Francis Cc: "Michael S. Tsirkin" Cc: Marcel Apfelbaum Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Marcel Apfelbaum --- V2: - Split hw patch into individual directories hw/pci-host/bonito.c | 6 +++--- hw/pci/pci.c | 12 ++++++------ 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/hw/pci-host/bonito.c b/hw/pci-host/bonito.c index 2ebeab5d90..6f2e589bee 100644 --- a/hw/pci-host/bonito.c +++ b/hw/pci-host/bonito.c @@ -38,7 +38,7 @@ */ #include "qemu/osdep.h" - +#include "qemu/error-report.h" #include "hw/hw.h" #include "hw/pci/pci.h" #include "hw/i386/pc.h" @@ -449,8 +449,8 @@ static uint32_t bonito_sbridge_pciaddr(void *opaque, hwaddr addr) regno = (cfgaddr & BONITO_PCICONF_REG_MASK) >> BONITO_PCICONF_REG_OFFSET; if (idsel == 0) { - fprintf(stderr, "error in bonito pci config address " TARGET_FMT_plx - ",pcimap_cfg=%x\n", addr, s->regs[BONITO_PCIMAP_CFG]); + error_report("error in bonito pci config address " TARGET_FMT_plx + ",pcimap_cfg=%x", addr, s->regs[BONITO_PCIMAP_CFG]); exit(1); } pciaddr = PCI_ADDR(pci_bus_num(phb->bus), devno, funno, regno); diff --git a/hw/pci/pci.c b/hw/pci/pci.c index 5ed3c8dca4..948d4e04ee 100644 --- a/hw/pci/pci.c +++ b/hw/pci/pci.c @@ -525,8 +525,8 @@ static int get_pci_irq_state(QEMUFile *f, void *pv, size_t size, for (i = 0; i < PCI_NUM_PINS; ++i) { irq_state[i] = qemu_get_be32(f); if (irq_state[i] != 0x1 && irq_state[i] != 0) { - fprintf(stderr, "irq state %d: must be 0 or 1.\n", - irq_state[i]); + error_report("irq state %d: must be 0 or 1", + irq_state[i]); return -EINVAL; } } @@ -688,7 +688,7 @@ static PCIBus *pci_get_bus_devfn(int *devfnp, PCIBus *root, unsigned slot; if (!root) { - fprintf(stderr, "No primary PCI bus\n"); + error_report("No primary PCI bus"); return NULL; } @@ -704,7 +704,7 @@ static PCIBus *pci_get_bus_devfn(int *devfnp, PCIBus *root, } if (dom != 0) { - fprintf(stderr, "No support for non-zero PCI domains\n"); + error_report("No support for non-zero PCI domains"); return NULL; } @@ -1128,8 +1128,8 @@ void pci_register_bar(PCIDevice *pci_dev, int region_num, assert(region_num >= 0); assert(region_num < PCI_NUM_REGIONS); if (size & (size-1)) { - fprintf(stderr, "ERROR: PCI region size must be pow2 " - "type=0x%x, size=0x%"FMT_PCIBUS"\n", type, size); + error_report("ERROR: PCI region size must be pow2 " + "type=0x%x, size=0x%"FMT_PCIBUS"", type, size); exit(1); } From patchwork Thu Oct 19 16:17:34 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alistair Francis X-Patchwork-Id: 828213 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; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=xilinx.onmicrosoft.com header.i=@xilinx.onmicrosoft.com header.b="WV4XxHSG"; 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 3yHvbg0zBPz9t6m for ; Fri, 20 Oct 2017 03:32:31 +1100 (AEDT) Received: from localhost ([::1]:50123 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e5DkD-00064f-3A for incoming@patchwork.ozlabs.org; Thu, 19 Oct 2017 12:32:29 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:55981) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e5DZp-0005bL-S0 for qemu-devel@nongnu.org; Thu, 19 Oct 2017 12:21:49 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1e5DZn-00020M-F6 for qemu-devel@nongnu.org; Thu, 19 Oct 2017 12:21:45 -0400 Received: from mail-cys01nam02on0045.outbound.protection.outlook.com ([104.47.37.45]:3204 helo=NAM02-CY1-obe.outbound.protection.outlook.com) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1e5DZh-0001xp-1k; Thu, 19 Oct 2017 12:21:37 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=xilinx.onmicrosoft.com; s=selector1-xilinx-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=tWnliW+hQyaZG8DEpW7dQMJoiOvz4pS1/RDcl7XhqB0=; b=WV4XxHSGdBzbyiYKpr78WAOMpkJgO1ISKSfpGu0ef+PwZae5pbl60nApl7eSp5YF+kuCA663lXYyzM1MhYtisNBXsWj7YNQ2X497kX4FIsF5zgUkdQEiNpezUc5+xgkhMUjxk68JZooZOyurhkdQXszpo3AwyX4ffEt3BAX8VHo= Received: from MWHPR0201CA0009.namprd02.prod.outlook.com (10.167.160.150) by BY2PR02MB1329.namprd02.prod.outlook.com (10.162.79.24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.77.7; Thu, 19 Oct 2017 16:21:33 +0000 Received: from CY1NAM02FT014.eop-nam02.prod.protection.outlook.com (2a01:111:f400:7e45::203) by MWHPR0201CA0009.outlook.office365.com (2603:10b6:301:74::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.156.4 via Frontend Transport; Thu, 19 Oct 2017 16:21:33 +0000 Authentication-Results: spf=pass (sender IP is 149.199.60.100) smtp.mailfrom=xilinx.com; nongnu.org; dkim=none (message not signed) header.d=none;nongnu.org; dmarc=bestguesspass action=none header.from=xilinx.com; Received-SPF: Pass (protection.outlook.com: domain of xilinx.com designates 149.199.60.100 as permitted sender) receiver=protection.outlook.com; client-ip=149.199.60.100; helo=xsj-pvapsmtpgw02; Received: from xsj-pvapsmtpgw02 (149.199.60.100) by CY1NAM02FT014.mail.protection.outlook.com (10.152.75.142) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.20.77.10 via Frontend Transport; Thu, 19 Oct 2017 16:21:32 +0000 Received: from unknown-38-66.xilinx.com ([149.199.38.66]:38623 helo=xsj-pvapsmtp01) by xsj-pvapsmtpgw02 with esmtp (Exim 4.63) (envelope-from ) id 1e5DZb-0007xH-R0; Thu, 19 Oct 2017 09:21:31 -0700 Received: from [127.0.0.1] (helo=localhost) by xsj-pvapsmtp01 with smtp (Exim 4.63) (envelope-from ) id 1e5DZb-00037b-MN; Thu, 19 Oct 2017 09:21:31 -0700 Received: from xsj-pvapsmtp01 (maildrop.xilinx.com [149.199.38.66]) by xsj-smtp-dlp2.xlnx.xilinx.com (8.13.8/8.13.1) with ESMTP id v9JGLQa0006837; Thu, 19 Oct 2017 09:21:27 -0700 Received: from [172.19.2.220] (helo=localhost.localdomain) by xsj-pvapsmtp01 with esmtp (Exim 4.63) (envelope-from ) id 1e5DZW-000375-TI; Thu, 19 Oct 2017 09:21:26 -0700 From: Alistair Francis To: Date: Thu, 19 Oct 2017 09:17:34 -0700 Message-ID: X-Mailer: git-send-email 2.11.0 In-Reply-To: References: X-RCIS-Action: ALLOW X-TM-AS-Product-Ver: IMSS-7.1.0.1224-8.1.0.1062-23404.005 X-TM-AS-User-Approved-Sender: Yes;Yes X-EOPAttributedMessage: 0 X-MS-Office365-Filtering-HT: Tenant X-Forefront-Antispam-Report: CIP:149.199.60.100; IPV:NLI; CTRY:US; EFV:NLI; SFV:NSPM; SFS:(10009020)(6009001)(39860400002)(376002)(346002)(2980300002)(438002)(189002)(199003)(81156014)(356003)(33646002)(4326008)(106002)(81166006)(50986999)(2906002)(8936002)(16586007)(47776003)(6916009)(5003940100001)(8676002)(2950100002)(106466001)(189998001)(2351001)(76176999)(5660300001)(39060400002)(6666003)(50226002)(305945005)(63266004)(9786002)(54906003)(48376002)(478600001)(36756003)(118296001)(50466002)(77096006)(316002)(36386004)(107986001)(21314002)(5001870100001); DIR:OUT; SFP:1101; SCL:1; SRVR:BY2PR02MB1329; H:xsj-pvapsmtpgw02; FPR:; SPF:Pass; PTR:unknown-60-100.xilinx.com,xapps1.xilinx.com; MX:1; A:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; CY1NAM02FT014; 1:RM2/OXmKBZQZ10TwZfJ1HsYMkslraO+nO6LuXuVLfowTrcJUQF90T/jfriPP3Bvv4sHU11sAqpBJsexxIu1QX97wFdAKcVPN8hCmVbjqBg2B5IJIjmwFF2tvvTovjmGF MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 43c54b50-984d-46d8-0844-08d5170d75f8 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001)(2017030254168)(8251501002)(4534016)(4602075)(4627075)(201703031133081)(201702281549075)(2017052603199)(201703131423091); SRVR:BY2PR02MB1329; X-Microsoft-Exchange-Diagnostics: 1; BY2PR02MB1329; 3:RWoAtjVi8TtoUseTxI2Jqjf+Vc/cv/uMkAFFI/VvZfCysqsmOJB6FupqabV02PSrewERJ/FcONBQzUF2AQo6l/HVwxVXxNw5Eye09xRYnSmbnNsIhC2VFtBxh7JT1ECbCJEKomvPhvQ8JgeQ+BCTwOYG6JYto79q29Nf38nFiqGASomvqB/0eFQSn3lvNrLL2etjPdXM6Q9hr3k3aWSJ1YrQcq3AF9rQre7AOBJW7L2W2rfc//0nPAWzUMXEh4/c8Moe77lWQKCW/t5G94OSiJYy6yY2VXJs9aiTw5fV5Ddb/up9K8+GG3nEPTe5NgSJ2oFXjKxiQROR3q8mVDXftlkFAr0hNhE7Y2PnXwHo3Qo=; 25:HPEdSIlxj6mABzYtL8vV2+1fPyCmqbyq7x5ZK60ojbPWxrnqk0MwjGU/OIQuraJpKL5hK+NXze0Yf4MGqjtsTe/LUnocYPDUMwLmATpvHAhBa1+DYPOpXb688kv6ikcDufgc/rRZS8w1oXNQ9agwwHAQ7J+iR4XZsCU+A16olexLIgm5OJwQuLQqiAxokVxGgbC+C7xDxbejt5mvCJ9DxybIf/umxJbaug0cQvnRixj+aI1EhUrROLUDu0Bt1XSXKMoXeSAvUnsCrG+YGi+TyAkzN6BQ4IgXZ2CfJ2t7OeH7yjSFTz03rq7KDi2+zW6idI52zBLi1ss1+jpCBCg4HA== X-MS-TrafficTypeDiagnostic: BY2PR02MB1329: X-Microsoft-Exchange-Diagnostics: 1; BY2PR02MB1329; 31:p2FbsY19dTxYb5KpjEg8G+FIJpgnN8wAVClcrma896j5SuSr+pZnI5i6klzeg9nO4v8vc2rawa2cOfdLrG0ZM1DUXIsRalVyjtqDYVG47FeDuZHfkqT82q12R2OhCBd9W+Lg9dAplK+M4GjOcvDLTtULR4nnsB1BQGMTPWF0rNyGXLvRZkcd87lA4NBVlALsvBaDtHN6PgakZOMyMDM/x+xX9SPKA2zSGXbV+QiLTdM=; 20:3RC+eri0FUtWST7dtjrReV5d24jW0kcSOZXiLPucyiFwJd773sV0pGEhSRVUoQ0tsc8rImoeAEkNprc8oNZgXRx0jVqPfISrcHFSRHbsWmkfQqwabZTapZiRzvd2jZXe02oNc87Md9QA/UXxWmaTouC2sX9cxZpQhloY5UwGSUP+TwpXVG+pBjcAJrcXt0ALqa4U9Searx8cOVFzYJ8StZCpexoc9XTLth8A+RiAxYeY3U0qaOUOEKE4bZAtMcJbxWLvv76xcjdkplwUeQZgziXDx5egNlDvW8Pn0Z6hx2nn1TWEJVsjKeTxBBci8heUgUPwq0tDgKG4sdb7A0m8LMwIkJUKws2Aia8TgOsSAoaVSvBeXkCEI798LRe3iY2xmt30lAMJ3haN9pa70BgX5Np3eSsTaEJqZlOc7Tp8gdpWpXDvWwBBAJ+KTforL0p8zyCaTAqWJ1IXqjmrYGAaekJ/XxRZXgvJSZCZ6ZpHacVt7Rec1vC2bkbgR+fqGQFK X-Exchange-Antispam-Report-Test: UriScan:(142945433499172)(788757137089)(192813158149592)(21532816269658); X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(100000700101)(100105000095)(100000701101)(100105300095)(100000702101)(100105100095)(6040450)(2401047)(8121501046)(5005006)(100000703101)(100105400095)(93006095)(93004095)(10201501046)(3002001)(6055026)(6041248)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123558100)(20161123564025)(20161123562025)(20161123560025)(20161123555025)(6072148)(201708071742011)(100000704101)(100105200095)(100000705101)(100105500095); SRVR:BY2PR02MB1329; BCL:0; PCL:0; RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095); SRVR:BY2PR02MB1329; X-Microsoft-Exchange-Diagnostics: 1; BY2PR02MB1329; 4:8O1FVTc/35Olpw8OV6Kk5uHXyP5iXg3asqz8N2ShH37uqkiy8SzQyYgQJAWZTcDhGmLKxnS89ffUyh70evKULRIyH0izJia6djHpFk+cnCA+YnztIGrGa0UGElwRMyjXiAf1FP9DW8p9RrumGVy+uendAAccD9bgkK6reGvmF13yfHqLNXiNeK6qgGWaKS+zwuvo0LHiCd6TIOGYuxqSnwbOZkAkw8DyLFct8QMoJNHa7yXOhN1fdpJ8oFuNOcA8NIVL7oeG/J3a4KeAaQB/2LlSSWqKTBMuaW/mVvqKWBkHS7PPL3EORWzVB3Y+cKY4pnT0uuCttja+aXOr5Bzlz+/E2XSw6Nf01UhrFMFB88uIBosMEIiB9lSjud2anqlL7PRyiqwfG1l5Uu2vh1/v9w== X-Forefront-PRVS: 0465429B7F X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; BY2PR02MB1329; 23:8xoVkpq+jLxPQt9863jiG3+LoHtM4P4CBA6t0oyN8?= KMiuTSVbcWbRUgYSjx9Ry0ugmq/ue9j/vHgo0pOj4qttTemlZnZZi6xLGtAoecsNSO0WyIhfjpWyqtSkguHu3Q7LEve+8I832OMPvWx7CTlHCTGOipTQGCnPZdUi2RqAb0lsyWJg2zD3p5/ogC/TtqCoqgYO5Mi6pDG7+OwHH37iGPUHkKLISKTvVqOVB1GKret1DyWel0yVvAcunCUZ6Hao3ghrSavvrpE3rtWiXKee0wTZrDo/FhSIrk4VHhSbvTA3wy2Zaak4hG6sHyFizsZYAiqdl0FUb/aoL1XeTvJ4dpvwA7L/l0KVpBAR4JMoTlgxaksw1DPSkGMxlRerKGgyKYg+J0w3LOnnaK7vI+m9gG8E+TBg49t0ZKb+CN0lu8TIGQazT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kXKOUezRGpG06MlZpcHFjJ/XWYrIewnRX+BWUYW3EyWvYhdN2dmwbqaMPZ3BN5PxrbpOl9ih5AUk55iRK7qkqtgi54IOXZAiOsq6G1waCjajvMoPVmF17HvlHNA==; 24:5bkn4+sRVs/BygGD2Wp10XuZ3J3hLjBSpfqAIhYFVD1CNTKmdZUs2AKpeAQ/BbKcgd55oBXgMjY25DpZhwGkj8UFNWjyDmGHeJjwPVWfX5U=; 7:eyVKG9A0aTnqCdnoVzPzrfsmIc/luhrKwbW/15Ra+wF/STNqzz5Whb4EunmuOvIqakp78N4IKxhgnwjOyGuVNXqkN1oiPaRHP44q34IimK9sDFydd/MSGK78/HmPnTkVVRQulLJqVJa5NPZaw+yetvlWfOTgEu7nspyk4yUrA/iHHOu1GyI714pt7EXIbmtfz8Ggfe5JhHO5YYwjVM32Tn3wpKahdnhT8cyzfi4QGtw= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: xilinx.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 19 Oct 2017 16:21:32.0246 (UTC) X-MS-Exchange-CrossTenant-Id: 657af505-d5df-48d0-8300-c31994686c5c X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=657af505-d5df-48d0-8300-c31994686c5c; Ip=[149.199.60.100]; Helo=[xsj-pvapsmtpgw02] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BY2PR02MB1329 X-detected-operating-system: by eggs.gnu.org: Windows 7 or 8 [fuzzy] X-Received-From: 104.47.37.45 Subject: [Qemu-devel] [PATCH v3 31/46] hw/ppc: Replace fprintf(stderr, "*\n" with error_report() 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: alistair23@gmail.com, qemu-ppc@nongnu.org, armbru@redhat.com, alistair.francis@xilinx.com Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" Replace a large number of the fprintf(stderr, "*\n" calls with error_report(). The functions were renamed with these commands and then compiler issues where manually fixed. find ./* -type f -exec sed -i \ 'N;N;N;N;N;N;N;N;N;N;N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2);|Ig}' \ {} + find ./* -type f -exec sed -i \ 'N;N;N;N;N;N;N;N;N;N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2);|Ig}' \ {} + find ./* -type f -exec sed -i \ 'N;N;N;N;N;N;N;N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2);|Ig}' \ {} + find ./* -type f -exec sed -i \ 'N;N;N;N;N;N;N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2);|Ig}' \ {} + find ./* -type f -exec sed -i \ 'N;N;N;N;N;N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2);|Ig}' \ {} + find ./* -type f -exec sed -i \ 'N;N;N;N;N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2);|Ig}' \ {} + find ./* -type f -exec sed -i \ 'N;N;N;N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2);|Ig}' \ {} + find ./* -type f -exec sed -i \ 'N;N;N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2);|Ig}' \ {} + find ./* -type f -exec sed -i \ 'N;N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2);|Ig}' \ {} + find ./* -type f -exec sed -i \ 'N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2);|Ig}' \ {} + find ./* -type f -exec sed -i \ 'N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2);|Ig}' \ {} + Some lines where then manually tweaked to pass checkpatch. Signed-off-by: Alistair Francis Cc: qemu-ppc@nongnu.org Acked-by: David Gibson --- V2: - Split hw patch into individual directories hw/ppc/e500.c | 22 +++++++++++----------- hw/ppc/mac_newworld.c | 2 +- hw/ppc/mac_oldworld.c | 2 +- hw/ppc/mpc8544_guts.c | 5 +++-- hw/ppc/ppc405_boards.c | 15 ++++++--------- hw/ppc/ppc440_bamboo.c | 22 +++++++++++----------- hw/ppc/ppc4xx_pci.c | 3 ++- hw/ppc/prep.c | 4 ++-- hw/ppc/virtex_ml507.c | 4 ++-- 9 files changed, 39 insertions(+), 40 deletions(-) diff --git a/hw/ppc/e500.c b/hw/ppc/e500.c index 9178e70132..e488fb4f3a 100644 --- a/hw/ppc/e500.c +++ b/hw/ppc/e500.c @@ -333,13 +333,13 @@ static int ppce500_load_device_tree(MachineState *machine, ret = qemu_fdt_setprop_cell(fdt, "/chosen", "linux,initrd-start", initrd_base); if (ret < 0) { - fprintf(stderr, "couldn't set /chosen/linux,initrd-start\n"); + error_report("couldn't set /chosen/linux,initrd-start"); } ret = qemu_fdt_setprop_cell(fdt, "/chosen", "linux,initrd-end", (initrd_base + initrd_size)); if (ret < 0) { - fprintf(stderr, "couldn't set /chosen/linux,initrd-end\n"); + error_report("couldn't set /chosen/linux,initrd-end"); } } @@ -353,7 +353,7 @@ static int ppce500_load_device_tree(MachineState *machine, ret = qemu_fdt_setprop_string(fdt, "/chosen", "bootargs", machine->kernel_cmdline); if (ret < 0) - fprintf(stderr, "couldn't set /chosen/bootargs\n"); + error_report("couldn't set /chosen/bootargs"); if (kvm_enabled()) { /* Read out host's frequencies */ @@ -720,7 +720,7 @@ static DeviceState *ppce500_init_mpic_kvm(PPCE500Params *params, CPU_FOREACH(cs) { if (kvm_openpic_connect_vcpu(dev, cs)) { - fprintf(stderr, "%s: failed to connect vcpu to irqchip\n", + error_report("%s: failed to connect vcpu to irqchip", __func__); abort(); } @@ -815,7 +815,7 @@ void ppce500_init(MachineState *machine, PPCE500Params *params) cs = CPU(cpu); if (env->mmu_model != POWERPC_MMU_BOOKE206) { - fprintf(stderr, "MMU model %i not supported by this machine.\n", + error_report("MMU model %i not supported by this machine.", env->mmu_model); exit(1); } @@ -961,8 +961,8 @@ void ppce500_init(MachineState *machine, PPCE500Params *params) cur_base, ram_size - cur_base); if (kernel_size < 0) { - fprintf(stderr, "qemu: could not load kernel '%s'\n", - machine->kernel_filename); + error_report("could not load kernel '%s'", + machine->kernel_filename); exit(1); } @@ -976,8 +976,8 @@ void ppce500_init(MachineState *machine, PPCE500Params *params) ram_size - initrd_base); if (initrd_size < 0) { - fprintf(stderr, "qemu: could not load initial ram disk '%s'\n", - machine->initrd_filename); + error_report("could not load initial ram disk '%s'", + machine->initrd_filename); exit(1); } @@ -1018,7 +1018,7 @@ void ppce500_init(MachineState *machine, PPCE500Params *params) kernel_size = load_uimage(filename, &bios_entry, &loadaddr, NULL, NULL, NULL); if (kernel_size < 0) { - fprintf(stderr, "qemu: could not load firmware '%s'\n", filename); + error_report("could not load firmware '%s'", filename); exit(1); } } @@ -1031,7 +1031,7 @@ void ppce500_init(MachineState *machine, PPCE500Params *params) initrd_base, initrd_size, kernel_base, kernel_size); if (dt_size < 0) { - fprintf(stderr, "couldn't load device tree\n"); + error_report("couldn't load device tree"); exit(1); } assert(dt_size < DTB_MAX_SIZE); diff --git a/hw/ppc/mac_newworld.c b/hw/ppc/mac_newworld.c index 3fa7c429d5..b832417a56 100644 --- a/hw/ppc/mac_newworld.c +++ b/hw/ppc/mac_newworld.c @@ -270,7 +270,7 @@ static void ppc_core99_init(MachineState *machine) } } if (ppc_boot_device == '\0') { - fprintf(stderr, "No valid boot device for Mac99 machine\n"); + error_report("No valid boot device for Mac99 machine"); exit(1); } } diff --git a/hw/ppc/mac_oldworld.c b/hw/ppc/mac_oldworld.c index 010ea36bf2..d1f4546613 100644 --- a/hw/ppc/mac_oldworld.c +++ b/hw/ppc/mac_oldworld.c @@ -218,7 +218,7 @@ static void ppc_heathrow_init(MachineState *machine) #endif } if (ppc_boot_device == '\0') { - fprintf(stderr, "No valid boot device for G3 Beige machine\n"); + error_report("No valid boot device for G3 Beige machine"); exit(1); } } diff --git a/hw/ppc/mpc8544_guts.c b/hw/ppc/mpc8544_guts.c index ce1254b5d4..3a2c49e3fd 100644 --- a/hw/ppc/mpc8544_guts.c +++ b/hw/ppc/mpc8544_guts.c @@ -18,6 +18,7 @@ */ #include "qemu/osdep.h" +#include "qemu/error-report.h" #include "qemu-common.h" #include "cpu.h" #include "hw/hw.h" @@ -83,7 +84,7 @@ static uint64_t mpc8544_guts_read(void *opaque, hwaddr addr, value = env->spr[SPR_E500_SVR]; break; default: - fprintf(stderr, "guts: Unknown register read: %x\n", (int)addr); + error_report("guts: Unknown register read: %x", (int)addr); break; } @@ -102,7 +103,7 @@ static void mpc8544_guts_write(void *opaque, hwaddr addr, } break; default: - fprintf(stderr, "guts: Unknown register write: %x = %x\n", + error_report("guts: Unknown register write: %x = %x", (int)addr, (unsigned)value); break; } diff --git a/hw/ppc/ppc405_boards.c b/hw/ppc/ppc405_boards.c index e92db2c66a..fae9c76174 100644 --- a/hw/ppc/ppc405_boards.c +++ b/hw/ppc/ppc405_boards.c @@ -324,8 +324,7 @@ static void ref405ep_init(MachineState *machine) kernel_size = load_image_targphys(kernel_filename, kernel_base, ram_size - kernel_base); if (kernel_size < 0) { - fprintf(stderr, "qemu: could not load kernel '%s'\n", - kernel_filename); + error_report("could not load kernel '%s'", kernel_filename); exit(1); } printf("Load kernel size %ld at " TARGET_FMT_lx, @@ -336,8 +335,8 @@ static void ref405ep_init(MachineState *machine) initrd_size = load_image_targphys(initrd_filename, initrd_base, ram_size - initrd_base); if (initrd_size < 0) { - fprintf(stderr, "qemu: could not load initial ram disk '%s'\n", - initrd_filename); + error_report("could not load initial ram disk '%s'", + initrd_filename); exit(1); } } else { @@ -607,8 +606,7 @@ static void taihu_405ep_init(MachineState *machine) kernel_size = load_image_targphys(kernel_filename, kernel_base, ram_size - kernel_base); if (kernel_size < 0) { - fprintf(stderr, "qemu: could not load kernel '%s'\n", - kernel_filename); + error_report("could not load kernel '%s'", kernel_filename); exit(1); } /* load initrd */ @@ -617,9 +615,8 @@ static void taihu_405ep_init(MachineState *machine) initrd_size = load_image_targphys(initrd_filename, initrd_base, ram_size - initrd_base); if (initrd_size < 0) { - fprintf(stderr, - "qemu: could not load initial ram disk '%s'\n", - initrd_filename); + error_report("could not load initial ram disk '%s'", + initrd_filename); exit(1); } } else { diff --git a/hw/ppc/ppc440_bamboo.c b/hw/ppc/ppc440_bamboo.c index 693c215108..12f92b9f2c 100644 --- a/hw/ppc/ppc440_bamboo.c +++ b/hw/ppc/ppc440_bamboo.c @@ -12,6 +12,7 @@ */ #include "qemu/osdep.h" +#include "qemu/error-report.h" #include "qemu-common.h" #include "net/net.h" #include "hw/hw.h" @@ -80,22 +81,22 @@ static int bamboo_load_device_tree(hwaddr addr, ret = qemu_fdt_setprop(fdt, "/memory", "reg", mem_reg_property, sizeof(mem_reg_property)); if (ret < 0) - fprintf(stderr, "couldn't set /memory/reg\n"); + error_report("couldn't set /memory/reg"); ret = qemu_fdt_setprop_cell(fdt, "/chosen", "linux,initrd-start", initrd_base); if (ret < 0) - fprintf(stderr, "couldn't set /chosen/linux,initrd-start\n"); + error_report("couldn't set /chosen/linux,initrd-start"); ret = qemu_fdt_setprop_cell(fdt, "/chosen", "linux,initrd-end", (initrd_base + initrd_size)); if (ret < 0) - fprintf(stderr, "couldn't set /chosen/linux,initrd-end\n"); + error_report("couldn't set /chosen/linux,initrd-end"); ret = qemu_fdt_setprop_string(fdt, "/chosen", "bootargs", kernel_cmdline); if (ret < 0) - fprintf(stderr, "couldn't set /chosen/bootargs\n"); + error_report("couldn't set /chosen/bootargs"); /* Copy data from the host device tree into the guest. Since the guest can * directly access the timebase without host involvement, we must expose @@ -186,7 +187,7 @@ static void bamboo_init(MachineState *machine) env = &cpu->env; if (env->mmu_model != POWERPC_MMU_BOOKE) { - fprintf(stderr, "MMU model %i not supported by this machine.\n", + error_report("MMU model %i not supported by this machine.", env->mmu_model); exit(1); } @@ -220,7 +221,7 @@ static void bamboo_init(MachineState *machine) NULL); pcibus = (PCIBus *)qdev_get_child_bus(dev, "pci.0"); if (!pcibus) { - fprintf(stderr, "couldn't create PCI controller!\n"); + error_report("couldn't create PCI controller!"); exit(1); } @@ -261,8 +262,7 @@ static void bamboo_init(MachineState *machine) } /* XXX try again as binary */ if (success < 0) { - fprintf(stderr, "qemu: could not load kernel '%s'\n", - kernel_filename); + error_report("could not load kernel '%s'", kernel_filename); exit(1); } } @@ -273,8 +273,8 @@ static void bamboo_init(MachineState *machine) ram_size - RAMDISK_ADDR); if (initrd_size < 0) { - fprintf(stderr, "qemu: could not load ram disk '%s' at %x\n", - initrd_filename, RAMDISK_ADDR); + error_report("could not load ram disk '%s' at %x", + initrd_filename, RAMDISK_ADDR); exit(1); } } @@ -283,7 +283,7 @@ static void bamboo_init(MachineState *machine) if (kernel_filename) { if (bamboo_load_device_tree(FDT_ADDR, ram_size, RAMDISK_ADDR, initrd_size, kernel_cmdline) < 0) { - fprintf(stderr, "couldn't load device tree\n"); + error_report("couldn't load device tree"); exit(1); } } diff --git a/hw/ppc/ppc4xx_pci.c b/hw/ppc/ppc4xx_pci.c index 4765dcecca..807e91b8fa 100644 --- a/hw/ppc/ppc4xx_pci.c +++ b/hw/ppc/ppc4xx_pci.c @@ -20,6 +20,7 @@ * 4xx SoCs, such as the 440EP. */ #include "qemu/osdep.h" +#include "qemu/error-report.h" #include "hw/hw.h" #include "hw/ppc/ppc.h" #include "hw/ppc/ppc4xx.h" @@ -254,7 +255,7 @@ static void ppc4xx_pci_set_irq(void *opaque, int irq_num, int level) trace_ppc4xx_pci_set_irq(irq_num); if (irq_num < 0) { - fprintf(stderr, "%s: PCI irq %d\n", __func__, irq_num); + error_report("%s: PCI irq %d", __func__, irq_num); return; } qemu_set_irq(pci_irqs[irq_num], level); diff --git a/hw/ppc/prep.c b/hw/ppc/prep.c index 6f8accc397..17d6d1960b 100644 --- a/hw/ppc/prep.c +++ b/hw/ppc/prep.c @@ -573,7 +573,7 @@ static void ppc_prep_init(MachineState *machine) } } if (ppc_boot_device == '\0') { - fprintf(stderr, "No valid boot device for Mac99 machine\n"); + error_report("No valid boot device for Mac99 machine"); exit(1); } } @@ -594,7 +594,7 @@ static void ppc_prep_init(MachineState *machine) qdev_init_nofail(dev); pci_bus = (PCIBus *)qdev_get_child_bus(dev, "pci.0"); if (pci_bus == NULL) { - fprintf(stderr, "Couldn't create PCI host controller.\n"); + error_report("Couldn't create PCI host controller."); exit(1); } sysctrl->contiguous_map_irq = qdev_get_gpio_in(dev, 0); diff --git a/hw/ppc/virtex_ml507.c b/hw/ppc/virtex_ml507.c index 5ac4f76613..c1cac864c6 100644 --- a/hw/ppc/virtex_ml507.c +++ b/hw/ppc/virtex_ml507.c @@ -187,7 +187,7 @@ static int xilinx_load_device_tree(hwaddr addr, r = qemu_fdt_setprop_string(fdt, "/chosen", "bootargs", kernel_cmdline); if (r < 0) - fprintf(stderr, "couldn't set /chosen/bootargs\n"); + error_report("couldn't set /chosen/bootargs"); cpu_physical_memory_write(addr, fdt, fdt_size); return fdt_size; } @@ -215,7 +215,7 @@ static void virtex_init(MachineState *machine) env = &cpu->env; if (env->mmu_model != POWERPC_MMU_BOOKE) { - fprintf(stderr, "MMU model %i not supported by this machine.\n", + error_report("MMU model %i not supported by this machine.", env->mmu_model); exit(1); } From patchwork Thu Oct 19 16:17:37 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alistair Francis X-Patchwork-Id: 828239 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; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=xilinx.onmicrosoft.com header.i=@xilinx.onmicrosoft.com header.b="o66GDYIT"; 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 3yHvxZ1g4wz9tX7 for ; Fri, 20 Oct 2017 03:48:02 +1100 (AEDT) Received: from localhost ([::1]:50202 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e5DzE-0002Dv-6v for incoming@patchwork.ozlabs.org; Thu, 19 Oct 2017 12:48:00 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:55918) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e5DZj-0005WW-6P for qemu-devel@nongnu.org; Thu, 19 Oct 2017 12:21:41 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1e5DZg-0001xf-0A for qemu-devel@nongnu.org; Thu, 19 Oct 2017 12:21:39 -0400 Received: from mail-dm3nam03on0056.outbound.protection.outlook.com ([104.47.41.56]:7679 helo=NAM03-DM3-obe.outbound.protection.outlook.com) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1e5DZf-0001x2-Oj for qemu-devel@nongnu.org; Thu, 19 Oct 2017 12:21:35 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=xilinx.onmicrosoft.com; s=selector1-xilinx-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=eR+JmdtQfO3nbH54EsidxXp4kywW4mlEVDtb+GeS4F0=; b=o66GDYITOeacE8Yaul/7FmcWZ+ziVV5/uTp3qAu0EOYevgtckbDB67o0ygmBJXO8wMZrNy6arC714eFtg2KlKI9zLIo06osfDrRBDeCMrxx7KIrbs9wnOJ9WweYb5K6hCUJ4x5ldimidktttws9pZQiovWzBeqemcjSzOQ8yGrM= Received: from BN6PR02CA0103.namprd02.prod.outlook.com (2603:10b6:405:60::44) by DM2PR02MB1340.namprd02.prod.outlook.com (2a01:111:e400:50c8::27) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.77.7; Thu, 19 Oct 2017 16:21:33 +0000 Received: from CY1NAM02FT019.eop-nam02.prod.protection.outlook.com (2a01:111:f400:7e45::202) by BN6PR02CA0103.outlook.office365.com (2603:10b6:405:60::44) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.77.21 via Frontend Transport; Thu, 19 Oct 2017 16:21:33 +0000 Authentication-Results: spf=pass (sender IP is 149.199.60.100) smtp.mailfrom=xilinx.com; redhat.com; dkim=none (message not signed) header.d=none;redhat.com; dmarc=bestguesspass action=none header.from=xilinx.com; Received-SPF: Pass (protection.outlook.com: domain of xilinx.com designates 149.199.60.100 as permitted sender) receiver=protection.outlook.com; client-ip=149.199.60.100; helo=xsj-pvapsmtpgw02; Received: from xsj-pvapsmtpgw02 (149.199.60.100) by CY1NAM02FT019.mail.protection.outlook.com (10.152.75.177) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.20.77.10 via Frontend Transport; Thu, 19 Oct 2017 16:21:32 +0000 Received: from unknown-38-66.xilinx.com ([149.199.38.66]:38633 helo=xsj-pvapsmtp01) by xsj-pvapsmtpgw02 with esmtp (Exim 4.63) (envelope-from ) id 1e5DZb-0007xT-Uj; Thu, 19 Oct 2017 09:21:31 -0700 Received: from [127.0.0.1] (helo=localhost) by xsj-pvapsmtp01 with smtp (Exim 4.63) (envelope-from ) id 1e5DZb-00037b-Ra; Thu, 19 Oct 2017 09:21:31 -0700 Received: from xsj-pvapsmtp01 (xsj-smtp1.xilinx.com [149.199.38.66]) by xsj-smtp-dlp2.xlnx.xilinx.com (8.13.8/8.13.1) with ESMTP id v9JGLUZp006845; Thu, 19 Oct 2017 09:21:30 -0700 Received: from [172.19.2.220] (helo=localhost.localdomain) by xsj-pvapsmtp01 with esmtp (Exim 4.63) (envelope-from ) id 1e5DZZ-00037K-VZ; Thu, 19 Oct 2017 09:21:30 -0700 From: Alistair Francis To: Date: Thu, 19 Oct 2017 09:17:37 -0700 Message-ID: <3a47068b0561596283383c38e6e1188b1d6e7d2f.1508390588.git.alistair.francis@xilinx.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: References: X-RCIS-Action: ALLOW X-TM-AS-Product-Ver: IMSS-7.1.0.1224-8.1.0.1062-23404.005 X-TM-AS-User-Approved-Sender: Yes;Yes X-EOPAttributedMessage: 0 X-MS-Office365-Filtering-HT: Tenant X-Forefront-Antispam-Report: CIP:149.199.60.100; IPV:NLI; CTRY:US; EFV:NLI; SFV:NSPM; SFS:(10009020)(6009001)(39860400002)(346002)(376002)(2980300002)(438002)(189002)(199003)(2950100002)(81156014)(9786002)(50226002)(47776003)(50986999)(478600001)(76176999)(305945005)(4326008)(8676002)(2906002)(8936002)(33646002)(2351001)(81166006)(5003940100001)(39060400002)(77096006)(16586007)(36756003)(316002)(356003)(48376002)(5660300001)(50466002)(6916009)(36386004)(118296001)(54906003)(106002)(106466001)(189998001)(63266004)(21314002)(107986001)(5001870100001); DIR:OUT; SFP:1101; SCL:1; SRVR:DM2PR02MB1340; H:xsj-pvapsmtpgw02; FPR:; SPF:Pass; PTR:unknown-60-100.xilinx.com,xapps1.xilinx.com; MX:1; A:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; CY1NAM02FT019; 1:Hl/3h610a0qoFIglZxZpiA4NYBuoUm0x25I75AuP+WX+zBGWgV/3pWDcTkVjPU86LAXNFBcibJdMOgv/HLa1AIDF2oBd5hXVkm0gX4pFR0GvsVuns3KgyjpOdIdMFkgQ MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: a113eb79-64fa-4f10-7b5b-08d5170d7636 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001)(2017030254152)(8251501002)(2017052603199)(201703131423075)(201703031133081)(201702281549075); SRVR:DM2PR02MB1340; X-Microsoft-Exchange-Diagnostics: 1; DM2PR02MB1340; 3:EAnRWc/Qgw2W+RxpIb998ivUSX2YpsrfK43d37N0Yv/hLMvftciGAl4O345OVhmNHyhil1k7ifGG7ktWNXP7pgsRwJxA+cVB7lKoKZSWxOPemAOi07X9Ot+/q0RjrwpRjewTuxOjXXCXHnScR334GI4qkE2cU9p2OwE5RQljFsOHYxeKrWF1YEd30sUmLllzzynAmQAldLkvcirL0by8+hrK0GSd0PumOEw0UXdWSkM9OcbvP0npgW5qc8ffN8Ps/B/w9VqRBM8iYSt2rD0+ORDOqjZxuhcuozlY4ezN1eSmto4QVcMECDmrjgfSsYTy5ubJpihZT911oqnjtFtoDFIDb7vYGozc11NkT6+yDV4=; 25:ZT2Bk/Xu17scn1evIjPErY37mu/O4yqEACjFAGniRqYnEGnKtKcTm64WTduOln2LXlAL7p+27ppm6QHY1vy3hx7Fqs2NB/1mKsflZ4PHu4g773728gzEtbD/KsW5S2vsrhVNSB+FkdHvuo0WoVTjiJ1AIdHw749EDzWtzEzAAW58qm+E/tpiBruoFTTLiNzlS9DrK3NzOK1XCV4fKng9QVphGNWCOZT6z53E7fylDVKAsAmjOYjoeu+6bxjXjzN9/eDbNIem3SYSAK5jJmPGUtdUvKXkYTj8KRW/IDiC2/bWmDFlQFHzu57Z4+QoU5lk2/Gitrmakv5RTVOSWKRf8g== X-MS-TrafficTypeDiagnostic: DM2PR02MB1340: X-Microsoft-Exchange-Diagnostics: 1; DM2PR02MB1340; 31:BgDSQUSjF1Bn31rZKccVVNaSd+MVWCF6GGhrPXt3ZdJMwVmCPKKMKDLgvBJo3jPdrDTzccf6hD3acmr7So80N5OYEsEkx9Py4SCMo64nIPZzVyUfsf7rd0ApAsiK3nhoPWCT0/b+XQ9KZ2mFKvmh+I1J1Udhe1VDTGtKyUdLu1tV7e7dqH5zD7OblSkruIwZYhAAxX9EbCclAQt7bKbrJnqQNJsn7TKqN2OGXUVgGeI=; 20:E+VKtp7n9e8bOknwfr6pP0JG4VFd8bnZIGH0vYe6RutsiZB1rcBIe2xbZpuXcgknKmHAFNV9UjfNJ+8SzgpSE8ObW4M0qacY9icdf+5qp0lv8YKNdyGVeAKCJG+upv0ACeUr0uUorm9rXYH7AygGXadN2J9VnGGMUty004DOm8MlrEuYhBivCl3TqQNXxxLFW58V5vPuc9bg7N5kVNpdNcQGn2B4mrIkwjInGa5BJRl66FV6WwFLUDCX6iZ70ZVZO1clReaKkNFBr4wUAwMJEmusIBhW3mR6PRF/JelC66sKzLVw2V6HUdNxfKg6oTiUAIIVJLDGFxGrgx1EpG+fQxlk3b0ToNPe+MhHRQk6mKTyMxTWdgmQ7XwZaGuEmY6yBRVkvXjx3heC+FbgU9e0Je9xzyEZ1Bmv55m19TsFYf6Hi0r091Z/7hH8RqUrO7VcmLDvAy1RuQ9DIZo5IVQerbKT19mzKevG+IRHQ12y3gDZ+4cSwuIVx5qTL75lUjD8 X-Exchange-Antispam-Report-Test: UriScan:(788757137089)(192813158149592); X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(100000700101)(100105000095)(100000701101)(100105300095)(100000702101)(100105100095)(6040450)(2401047)(5005006)(8121501046)(10201501046)(3002001)(100000703101)(100105400095)(93006095)(93004095)(6055026)(6041248)(20161123558100)(20161123562025)(20161123560025)(20161123564025)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123555025)(6072148)(201708071742011)(100000704101)(100105200095)(100000705101)(100105500095); SRVR:DM2PR02MB1340; BCL:0; PCL:0; RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095); SRVR:DM2PR02MB1340; X-Microsoft-Exchange-Diagnostics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6VP/Ur0oCnjGoo=; 7:C5cXSrebLZPXd02jB0oj/vYlNyIF3P9OdX/uucpNBMZwlkhlHplKGpflG5i+w6H4BhZu8NSfRlbrE+w4g06Mkr+A6NlOeeI2v2kVXmB3pRuTC0yrvXvxUP7PxvGL+RPxWwBxFYLBwwTS87oR+YQbXS2Vgx9oXpGE/w4QRTO4SZ65fqYcPyD0XRu6q7QOHVbsuA6nRRuXjLIdyCKowbJ/Uzk+c9UWuUr+FFrBfLE14MU= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: xilinx.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 19 Oct 2017 16:21:32.5120 (UTC) X-MS-Exchange-CrossTenant-Id: 657af505-d5df-48d0-8300-c31994686c5c X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=657af505-d5df-48d0-8300-c31994686c5c; Ip=[149.199.60.100]; Helo=[xsj-pvapsmtpgw02] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM2PR02MB1340 X-detected-operating-system: by eggs.gnu.org: Windows 7 or 8 [fuzzy] X-Received-From: 104.47.41.56 Subject: [Qemu-devel] [PATCH v3 32/46] hw/s390x: Replace fprintf(stderr, "*\n" with error_report() 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: alistair23@gmail.com, armbru@redhat.com, alistair.francis@xilinx.com Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" Replace a large number of the fprintf(stderr, "*\n" calls with error_report(). The functions were renamed with these commands and then compiler issues where manually fixed. find ./* -type f -exec sed -i \ 'N;N;N;N;N;N;N;N;N;N;N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2);|Ig}' \ {} + find ./* -type f -exec sed -i \ 'N;N;N;N;N;N;N;N;N;N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2);|Ig}' \ {} + find ./* -type f -exec sed -i \ 'N;N;N;N;N;N;N;N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2);|Ig}' \ {} + find ./* -type f -exec sed -i \ 'N;N;N;N;N;N;N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2);|Ig}' \ {} + find ./* -type f -exec sed -i \ 'N;N;N;N;N;N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2);|Ig}' \ {} + find ./* -type f -exec sed -i \ 'N;N;N;N;N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2);|Ig}' \ {} + find ./* -type f -exec sed -i \ 'N;N;N;N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2);|Ig}' \ {} + find ./* -type f -exec sed -i \ 'N;N;N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2);|Ig}' \ {} + find ./* -type f -exec sed -i \ 'N;N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2);|Ig}' \ {} + find ./* -type f -exec sed -i \ 'N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2);|Ig}' \ {} + find ./* -type f -exec sed -i \ 'N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2);|Ig}' \ {} + Some lines where then manually tweaked to pass checkpatch. One fprintf(stderr, was manually converted to a qemu_log_mask(LOG_GUEST_ERROR, Signed-off-by: Alistair Francis Reviewed-by: Thomas Huth --- V3: - Use a qemu_log_mask(LOG_GUEST_ERROR, V2: - Split hw patch into individual directories hw/s390x/virtio-ccw.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/hw/s390x/virtio-ccw.c b/hw/s390x/virtio-ccw.c index 085f17f871..1c6ea916b8 100644 --- a/hw/s390x/virtio-ccw.c +++ b/hw/s390x/virtio-ccw.c @@ -426,8 +426,9 @@ static int virtio_ccw_cb(SubchDev *sch, CCW1 ccw) * passes us zeroes for those we don't support. */ if (features.features) { - fprintf(stderr, "Guest bug: features[%i]=%x (expected 0)\n", - features.index, features.features); + qemu_log_mask(LOG_GUEST_ERROR, + "Guest bug: features[%i]=%x (expected 0)", + features.index, features.features); /* XXX: do a unit check here? */ } } From patchwork Thu Oct 19 16:17:40 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alistair Francis X-Patchwork-Id: 828245 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; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=xilinx.onmicrosoft.com header.i=@xilinx.onmicrosoft.com header.b="Mq8K156X"; 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 3yHw3P6GmSz9t44 for ; Fri, 20 Oct 2017 03:53:05 +1100 (AEDT) Received: from localhost ([::1]:50231 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e5E47-0006cT-UZ for incoming@patchwork.ozlabs.org; Thu, 19 Oct 2017 12:53:03 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:56012) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e5DZu-0005fh-93 for qemu-devel@nongnu.org; Thu, 19 Oct 2017 12:21:57 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1e5DZq-00021g-Ua for qemu-devel@nongnu.org; Thu, 19 Oct 2017 12:21:50 -0400 Received: from mail-cys01nam02on0042.outbound.protection.outlook.com ([104.47.37.42]:57479 helo=NAM02-CY1-obe.outbound.protection.outlook.com) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1e5DZq-000217-IV for qemu-devel@nongnu.org; Thu, 19 Oct 2017 12:21:46 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=xilinx.onmicrosoft.com; s=selector1-xilinx-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=gNIViipH0bP2OXTPmUcM69t/dc9upyc+PqyUVN5Mu+s=; b=Mq8K156XRMz+fCmJU8lRnRlriE4Fa5b7G1jUNfRZFnjqz+uuJol5ijHnOjOBhFTTaqyPTEHpWbjmRZIo2K7rxxNKdy1+i9KzsRjiyllK+6662jYiMMfcVpI//NdKXNKsCk3Fb3iQAvpEETw691SnFUQPoZOdD+avw5qQKoyYaZk= Received: from BY2PR02CA0115.namprd02.prod.outlook.com (10.163.44.169) by BY2PR02MB1329.namprd02.prod.outlook.com (10.162.79.24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.77.7; Thu, 19 Oct 2017 16:21:44 +0000 Received: from BL2NAM02FT033.eop-nam02.prod.protection.outlook.com (2a01:111:f400:7e46::207) by BY2PR02CA0115.outlook.office365.com (2a01:111:e400:5261::41) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.77.7 via Frontend Transport; Thu, 19 Oct 2017 16:21:43 +0000 Authentication-Results: spf=pass (sender IP is 149.199.60.83) smtp.mailfrom=xilinx.com; suse.de; dkim=none (message not signed) header.d=none;suse.de; dmarc=bestguesspass action=none header.from=xilinx.com; Received-SPF: Pass (protection.outlook.com: domain of xilinx.com designates 149.199.60.83 as permitted sender) receiver=protection.outlook.com; client-ip=149.199.60.83; helo=xsj-pvapsmtpgw01; Received: from xsj-pvapsmtpgw01 (149.199.60.83) by BL2NAM02FT033.mail.protection.outlook.com (10.152.77.163) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.20.77.10 via Frontend Transport; Thu, 19 Oct 2017 16:21:43 +0000 Received: from unknown-38-66.xilinx.com ([149.199.38.66] helo=xsj-pvapsmtp01) by xsj-pvapsmtpgw01 with esmtp (Exim 4.63) (envelope-from ) id 1e5DZm-000059-GP; Thu, 19 Oct 2017 09:21:42 -0700 Received: from [127.0.0.1] (helo=localhost) by xsj-pvapsmtp01 with smtp (Exim 4.63) (envelope-from ) id 1e5DZm-00039X-DL; Thu, 19 Oct 2017 09:21:42 -0700 Received: from xsj-pvapsmtp01 (xsj-pvapsmtp01.xilinx.com [149.199.38.66]) by xsj-smtp-dlp1.xlnx.xilinx.com (8.13.8/8.13.1) with ESMTP id v9JGLXBM018081; Thu, 19 Oct 2017 09:21:33 -0700 Received: from [172.19.2.220] (helo=localhost.localdomain) by xsj-pvapsmtp01 with esmtp (Exim 4.63) (envelope-from ) id 1e5DZd-00038T-4k; Thu, 19 Oct 2017 09:21:33 -0700 From: Alistair Francis To: Date: Thu, 19 Oct 2017 09:17:40 -0700 Message-ID: <5d68af196a5b6386f66e6461d1c65b6a935b6ea0.1508390588.git.alistair.francis@xilinx.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: References: X-RCIS-Action: ALLOW X-TM-AS-Product-Ver: IMSS-7.1.0.1224-8.1.0.1062-23404.005 X-TM-AS-User-Approved-Sender: Yes;Yes X-EOPAttributedMessage: 0 X-MS-Office365-Filtering-HT: Tenant X-Forefront-Antispam-Report: CIP:149.199.60.83; IPV:NLI; CTRY:US; EFV:NLI; SFV:NSPM; SFS:(10009020)(6009001)(39860400002)(376002)(346002)(2980300002)(438002)(189002)(199003)(81156014)(356003)(33646002)(4326008)(106002)(81166006)(50986999)(2906002)(8936002)(16586007)(47776003)(6916009)(5003940100001)(8676002)(2950100002)(106466001)(189998001)(2351001)(76176999)(5660300001)(39060400002)(6666003)(50226002)(305945005)(63266004)(9786002)(54906003)(48376002)(478600001)(36756003)(118296001)(50466002)(77096006)(316002)(36386004)(107986001)(21314002); DIR:OUT; SFP:1101; SCL:1; SRVR:BY2PR02MB1329; H:xsj-pvapsmtpgw01; FPR:; SPF:Pass; PTR:unknown-60-83.xilinx.com; MX:1; A:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BL2NAM02FT033; 1:zWvr2tr3H/G9f+/nQ6FFYb/COsP1SCN8mr+81sr6nYc5p3y+Yg6OJSjXxQbvUDQ8fAyPqgrd3DH9d7u6xxSDCIwSEpmDQ/oxP8U3/dqbErXM8BZmqhgbryy23pnKdJGl MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 42151ca4-bcd1-4351-2956-08d5170d7c94 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001)(2017030254168)(8251501002)(4534016)(4602075)(4627075)(201703031133081)(201702281549075)(2017052603199)(201703131423091); SRVR:BY2PR02MB1329; X-Microsoft-Exchange-Diagnostics: 1; BY2PR02MB1329; 3:W+zw9OhUW3/oLuhjNxp2cCAdr+KAEchuRZou74BJT+KbNjsQsXz8Y+YYI3Mf83ZCEh7nYPcdOGoRNlhQYxrDJqXMxzTWgSHToCJpX35x8CWBp0SYX8BHVedeZmeOtzoP7u20r8mkdN1ZOV7gAn3t54cxOtxrWao+uc5pw99RxTcPbyJKoVaN9tknEBTtKG8QWECe/fD1Qb9d5aGBUXaYs7KlTwSJWaBTG42o8TwRPPIhy2SYrdUHCm4z7Shcx1FtOJB6lANwZLJGf0fPGP52o+6ohx5h5lWSlzLUmqOZmx+7sOgKskolnwUFDVhc6PYVRsrJMW7nbYjXZ1HpiUVzc5wUTskUgMTZww5y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VDwpyEuyDZqcy0NtJtOx42ZqLIjONTXNqSoYdc/v1YQ10zbrlybiWEnf7LoomaiUPTRIxLAWxIuFddWzbKCUIRoK2vI5V88+ X-Exchange-Antispam-Report-Test: UriScan:(788757137089)(192813158149592); X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(100000700101)(100105000095)(100000701101)(100105300095)(100000702101)(100105100095)(6040450)(2401047)(8121501046)(5005006)(100000703101)(100105400095)(93006095)(93004095)(10201501046)(3002001)(6055026)(6041248)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123558100)(20161123564025)(20161123562025)(20161123560025)(20161123555025)(6072148)(201708071742011)(100000704101)(100105200095)(100000705101)(100105500095); SRVR:BY2PR02MB1329; BCL:0; PCL:0; RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095); SRVR:BY2PR02MB1329; X-Microsoft-Exchange-Diagnostics: 1; BY2PR02MB1329; 4:jCWddkoTuzviBlwxzjTLSmpM9jKCQ67ZEonMft7QwgvW37dziupO/6WYY7wO/OZbfz3DKBS9qwcysYG6ztY2zUbVhUx2sGj7r9NF1Z6+AJwXH3C7uAMbuksXKtdbLW9tOADEx+faNcvjO00ipCOboZMvj5orD6MF2Z2xrQoGHA0fXkCL2ny4lGpec0U5H7PK5yukBG+8LvOvQ3Do94G6JPRm5SsUmB+Y3jAtPGD7IrWPCKY3ZIGrMVjIgCq7zdGYBacRBBIDKzpT7qipvjD+NCSGmSkkvHw7o8KqLfofC3sQYhwCjh1U4d120l2/PLMVGyUW80YFvDvtLbFyha0DQw== X-Forefront-PRVS: 0465429B7F X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; BY2PR02MB1329; 23:M+T9vC0tqx3UcrduJUxIBenupQBp22MkedFkDu35B?= e6u0u4uH4aISAULZTjcc+Bko+8lPY9a4Pud/gVJncg7HkWs4OgGjJ4twq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BQO7ImikGWAgyRGrOpqFHa3N86nJcKdl1XUHYAtnD9eG0Crs23Ejg2iX+F41MsCH7VG3X0wzpqBkSVlUYd/qU7oW5TmgyYsEcXqbOjWKjwliu/LT4LS240axaorqHAPLqK50Br6Qxjpq0//2gXTRo4Ve/2cI89amY9t++1NSCk2jHTD7uPpriNE8XsqtqCxSibMdkGqhTnXXpZMFlB1qfkCQ43aKh/nihaAFoHylJI1VufmfBm08UJjMNSE4XrevXrqfCXxyeOuF3SULgI35RKyAnuczt0jTzrKdyRnCw==; 5:/ZOVlPfpHaMYn6e38iOEewptfq3Tsii4tfc+tt2vHY0t0Q1UdlGbOkIo2pLtpJE8Rp5GQgEwLdpuuEoAvygSidxUpQUVvHEBKrR1sNb48JAJfmE6YbAqZPto9mMLZtlG1LbHsti6IF1E9F2vYlWMmw==; 24:F3f1h+1rLIg1pKoTd8oc/t8gvmmlaSV8eOdUSp5MBJxzoXe4waweI+0cEiATKPDy/vii42E/9oqf/eniK0t7E+KaOBS7v/ZeOYzMnVRmf34=; 7:S2h4ja02fhHa2kA6L+vGKLV8q6o2KvymW5r6IySnlxo5JeexLBV9DC4eg/gljS/iMGCxzlywZVuTOssmUN9KPDHNdyo8UZGK3ZSkLqcDJEahqCSHz2kwhLB7UQ/tgWtkx6IhA/LyVIHlyelrtY8mZqOYo+/bZsslK1G0arSpJ9jBcBXJLck1CugHeHR5rTUuJ0Hl+4v4r1/aF0tKEfx2SaZvMKjKFAVWe6BA1zkSMNc= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: xilinx.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 19 Oct 2017 16:21:43.1766 (UTC) X-MS-Exchange-CrossTenant-Id: 657af505-d5df-48d0-8300-c31994686c5c X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=657af505-d5df-48d0-8300-c31994686c5c; Ip=[149.199.60.83]; Helo=[xsj-pvapsmtpgw01] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BY2PR02MB1329 X-detected-operating-system: by eggs.gnu.org: Windows 7 or 8 [fuzzy] X-Received-From: 104.47.37.42 Subject: [Qemu-devel] [PATCH v3 33/46] hw/scsi: Replace fprintf(stderr, "*\n" with error_report() 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: Alexander Graf , armbru@redhat.com, Paolo Bonzini , alistair23@gmail.com, alistair.francis@xilinx.com, David Gibson Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" Replace a large number of the fprintf(stderr, "*\n" calls with error_report(). The functions were renamed with these commands and then compiler issues where manually fixed. find ./* -type f -exec sed -i \ 'N;N;N;N;N;N;N;N;N;N;N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2);|Ig}' \ {} + find ./* -type f -exec sed -i \ 'N;N;N;N;N;N;N;N;N;N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2);|Ig}' \ {} + find ./* -type f -exec sed -i \ 'N;N;N;N;N;N;N;N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2);|Ig}' \ {} + find ./* -type f -exec sed -i \ 'N;N;N;N;N;N;N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2);|Ig}' \ {} + find ./* -type f -exec sed -i \ 'N;N;N;N;N;N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2);|Ig}' \ {} + find ./* -type f -exec sed -i \ 'N;N;N;N;N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2);|Ig}' \ {} + find ./* -type f -exec sed -i \ 'N;N;N;N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2);|Ig}' \ {} + find ./* -type f -exec sed -i \ 'N;N;N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2);|Ig}' \ {} + find ./* -type f -exec sed -i \ 'N;N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2);|Ig}' \ {} + find ./* -type f -exec sed -i \ 'N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2);|Ig}' \ {} + find ./* -type f -exec sed -i \ 'N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2);|Ig}' \ {} + Some lines where then manually tweaked to pass checkpatch. Signed-off-by: Alistair Francis Cc: Paolo Bonzini Cc: David Gibson Cc: Alexander Graf Acked-by: David Gibson --- V2: - Split hw patch into individual directories hw/scsi/lsi53c895a.c | 4 ++-- hw/scsi/spapr_vscsi.c | 49 +++++++++++++++++++++-------------------- hw/scsi/virtio-scsi-dataplane.c | 6 ++--- 3 files changed, 30 insertions(+), 29 deletions(-) diff --git a/hw/scsi/lsi53c895a.c b/hw/scsi/lsi53c895a.c index 191505df5b..7c9a930e2f 100644 --- a/hw/scsi/lsi53c895a.c +++ b/hw/scsi/lsi53c895a.c @@ -14,7 +14,7 @@ */ #include "qemu/osdep.h" - +#include "qemu/error-report.h" #include "hw/hw.h" #include "hw/pci/pci.h" #include "hw/scsi/scsi.h" @@ -1501,7 +1501,7 @@ again: This is apparently sufficient to beat the drivers into submission. */ if (!(s->sien0 & LSI_SIST0_UDC)) - fprintf(stderr, "inf. loop with UDC masked\n"); + error_report("inf. loop with UDC masked"); lsi_script_scsi_interrupt(s, LSI_SIST0_UDC, 0); lsi_disconnect(s); } else if (s->istat1 & LSI_ISTAT1_SRUN && !s->waiting) { diff --git a/hw/scsi/spapr_vscsi.c b/hw/scsi/spapr_vscsi.c index 360db53ac8..8c4eabcf3d 100644 --- a/hw/scsi/spapr_vscsi.c +++ b/hw/scsi/spapr_vscsi.c @@ -32,6 +32,7 @@ * - Maybe do autosense (PAPR seems to mandate it, linux doesn't care) */ #include "qemu/osdep.h" +#include "qemu/error-report.h" #include "qemu-common.h" #include "cpu.h" #include "hw/hw.h" @@ -179,7 +180,7 @@ static int vscsi_send_iu(VSCSIState *s, vscsi_req *req, rc = spapr_vio_dma_write(&s->vdev, req->crq.s.IU_data_ptr, &req->iu, length); if (rc) { - fprintf(stderr, "vscsi_send_iu: DMA write failure !\n"); + error_report("vscsi_send_iu: DMA write failure !"); } req->crq.s.valid = 0x80; @@ -197,7 +198,7 @@ static int vscsi_send_iu(VSCSIState *s, vscsi_req *req, rc1 = spapr_vio_send_crq(&s->vdev, req->crq.raw); if (rc1) { - fprintf(stderr, "vscsi_send_iu: Error sending response\n"); + error_report("vscsi_send_iu: Error sending response"); return rc1; } @@ -330,7 +331,7 @@ static int vscsi_fetch_desc(VSCSIState *s, struct vscsi_req *req, break; } default: - fprintf(stderr, "VSCSI: Unknown format %x\n", req->dma_fmt); + error_report("VSCSI: Unknown format %x", req->dma_fmt); return -1; } @@ -518,7 +519,7 @@ static void vscsi_transfer_data(SCSIRequest *sreq, uint32_t len) trace_spapr_vscsi_transfer_data(sreq->tag, len, req); if (req == NULL) { - fprintf(stderr, "VSCSI: Can't find request for tag 0x%x\n", sreq->tag); + error_report("VSCSI: Can't find request for tag 0x%x", sreq->tag); return; } @@ -527,7 +528,7 @@ static void vscsi_transfer_data(SCSIRequest *sreq, uint32_t len) rc = vscsi_srp_transfer_data(s, req, req->writing, buf, len); } if (rc < 0) { - fprintf(stderr, "VSCSI: RDMA error rc=%d!\n", rc); + error_report("VSCSI: RDMA error rc=%d!", rc); req->dma_error = true; scsi_req_cancel(req->sreq); return; @@ -547,7 +548,7 @@ static void vscsi_command_complete(SCSIRequest *sreq, uint32_t status, size_t re trace_spapr_vscsi_command_complete(sreq->tag, status, req); if (req == NULL) { - fprintf(stderr, "VSCSI: Can't find request for tag 0x%x\n", sreq->tag); + error_report("VSCSI: Can't find request for tag 0x%x", sreq->tag); return; } @@ -639,7 +640,7 @@ static void *vscsi_load_request(QEMUFile *f, SCSIRequest *sreq) memset(req, 0, sizeof(*req)); rc = vmstate_load_state(f, &vmstate_spapr_vscsi_req, req, 1); if (rc) { - fprintf(stderr, "VSCSI: failed loading request tag#%u\n", sreq->tag); + error_report("VSCSI: failed loading request tag#%u", sreq->tag); return NULL; } assert(req->active); @@ -827,7 +828,7 @@ static int vscsi_process_tsk_mgmt(VSCSIState *s, vscsi_req *req) uint64_t tag = iu->srp.rsp.tag; uint8_t sol_not = iu->srp.cmd.sol_not; - fprintf(stderr, "vscsi_process_tsk_mgmt %02x\n", + error_report("vscsi_process_tsk_mgmt %02x", iu->srp.tsk_mgmt.tsk_mgmt_func); d = vscsi_device_find(&s->bus, be64_to_cpu(req->iu.srp.tsk_mgmt.lun), &lun); @@ -932,10 +933,10 @@ static int vscsi_handle_srp_req(VSCSIState *s, vscsi_req *req) case SRP_CRED_RSP: case SRP_AER_REQ: case SRP_AER_RSP: - fprintf(stderr, "VSCSI: Unsupported opcode %02x\n", opcode); + error_report("VSCSI: Unsupported opcode %02x", opcode); break; default: - fprintf(stderr, "VSCSI: Unknown type %02x\n", opcode); + error_report("VSCSI: Unknown type %02x", opcode); } return done; @@ -953,7 +954,7 @@ static int vscsi_send_adapter_info(VSCSIState *s, vscsi_req *req) rc = spapr_vio_dma_read(&s->vdev, be64_to_cpu(sinfo->buffer), &info, be16_to_cpu(sinfo->common.length)); if (rc) { - fprintf(stderr, "vscsi_send_adapter_info: DMA read failure !\n"); + error_report("vscsi_send_adapter_info: DMA read failure !"); } #endif memset(&info, 0, sizeof(info)); @@ -967,7 +968,7 @@ static int vscsi_send_adapter_info(VSCSIState *s, vscsi_req *req) rc = spapr_vio_dma_write(&s->vdev, be64_to_cpu(sinfo->buffer), &info, be16_to_cpu(sinfo->common.length)); if (rc) { - fprintf(stderr, "vscsi_send_adapter_info: DMA write failure !\n"); + error_report("vscsi_send_adapter_info: DMA write failure !"); } sinfo->common.status = rc ? cpu_to_be32(1) : 0; @@ -987,7 +988,7 @@ static int vscsi_send_capabilities(VSCSIState *s, vscsi_req *req) req_len = len = be16_to_cpu(vcap->common.length); buffer = be64_to_cpu(vcap->buffer); if (len > sizeof(cap)) { - fprintf(stderr, "vscsi_send_capabilities: capabilities size mismatch !\n"); + error_report("vscsi_send_capabilities: capabilities size mismatch !"); /* * Just read and populate the structure that is known. @@ -997,7 +998,7 @@ static int vscsi_send_capabilities(VSCSIState *s, vscsi_req *req) } rc = spapr_vio_dma_read(&s->vdev, buffer, &cap, len); if (rc) { - fprintf(stderr, "vscsi_send_capabilities: DMA read failure !\n"); + error_report("vscsi_send_capabilities: DMA read failure !"); } /* @@ -1013,7 +1014,7 @@ static int vscsi_send_capabilities(VSCSIState *s, vscsi_req *req) rc = spapr_vio_dma_write(&s->vdev, buffer, &cap, len); if (rc) { - fprintf(stderr, "vscsi_send_capabilities: DMA write failure !\n"); + error_report("vscsi_send_capabilities: DMA write failure !"); } if (req_len > len) { /* @@ -1034,11 +1035,11 @@ static int vscsi_handle_mad_req(VSCSIState *s, vscsi_req *req) switch (be32_to_cpu(mad->empty_iu.common.type)) { case VIOSRP_EMPTY_IU_TYPE: - fprintf(stderr, "Unsupported EMPTY MAD IU\n"); + error_report("Unsupported EMPTY MAD IU"); retlen = sizeof(mad->empty_iu); break; case VIOSRP_ERROR_LOG_TYPE: - fprintf(stderr, "Unsupported ERROR LOG MAD IU\n"); + error_report("Unsupported ERROR LOG MAD IU"); retlen = sizeof(mad->error_log); break; case VIOSRP_ADAPTER_INFO_TYPE: @@ -1053,7 +1054,7 @@ static int vscsi_handle_mad_req(VSCSIState *s, vscsi_req *req) request_handled = true; break; default: - fprintf(stderr, "VSCSI: Unknown MAD type %02x\n", + error_report("VSCSI: Unknown MAD type %02x", be32_to_cpu(mad->empty_iu.common.type)); /* * PAPR+ says that "The length field is set to the length @@ -1078,7 +1079,7 @@ static void vscsi_got_payload(VSCSIState *s, vscsi_crq *crq) req = vscsi_get_req(s); if (req == NULL) { - fprintf(stderr, "VSCSI: Failed to get a request !\n"); + error_report("VSCSI: Failed to get a request !"); return; } @@ -1088,7 +1089,7 @@ static void vscsi_got_payload(VSCSIState *s, vscsi_crq *crq) * of the structure. */ if (crq->s.IU_length > sizeof(union viosrp_iu)) { - fprintf(stderr, "VSCSI: SRP IU too long (%d bytes) !\n", + error_report("VSCSI: SRP IU too long (%d bytes) !", crq->s.IU_length); vscsi_put_req(req); return; @@ -1097,7 +1098,7 @@ static void vscsi_got_payload(VSCSIState *s, vscsi_crq *crq) /* XXX Handle failure differently ? */ if (spapr_vio_dma_read(&s->vdev, crq->s.IU_data_ptr, &req->iu, crq->s.IU_length)) { - fprintf(stderr, "vscsi_got_payload: DMA read failure !\n"); + error_report("vscsi_got_payload: DMA read failure !"); vscsi_put_req(req); return; } @@ -1158,16 +1159,16 @@ static int vscsi_do_crq(struct VIOsPAPRDevice *dev, uint8_t *crq_data) case VIOSRP_AIX_FORMAT: case VIOSRP_LINUX_FORMAT: case VIOSRP_INLINE_FORMAT: - fprintf(stderr, "vscsi_do_srq: Unsupported payload format %02x\n", + error_report("vscsi_do_srq: Unsupported payload format %02x", crq.s.format); break; default: - fprintf(stderr, "vscsi_do_srq: Unknown payload format %02x\n", + error_report("vscsi_do_srq: Unknown payload format %02x", crq.s.format); } break; default: - fprintf(stderr, "vscsi_do_crq: unknown CRQ %02x %02x ...\n", + error_report("vscsi_do_crq: unknown CRQ %02x %02x ...", crq.raw[0], crq.raw[1]); }; diff --git a/hw/scsi/virtio-scsi-dataplane.c b/hw/scsi/virtio-scsi-dataplane.c index add4b3f4a4..e047361310 100644 --- a/hw/scsi/virtio-scsi-dataplane.c +++ b/hw/scsi/virtio-scsi-dataplane.c @@ -97,7 +97,7 @@ static int virtio_scsi_vring_init(VirtIOSCSI *s, VirtQueue *vq, int n, /* Set up virtqueue notify */ rc = virtio_bus_set_host_notifier(VIRTIO_BUS(qbus), n, true); if (rc != 0) { - fprintf(stderr, "virtio-scsi: Failed to set host notifier (%d)\n", + error_report("virtio-scsi: Failed to set host notifier (%d)", rc); s->dataplane_fenced = true; return rc; @@ -141,8 +141,8 @@ int virtio_scsi_dataplane_start(VirtIODevice *vdev) /* Set up guest notifier (irq) */ rc = k->set_guest_notifiers(qbus->parent, vs->conf.num_queues + 2, true); if (rc != 0) { - fprintf(stderr, "virtio-scsi: Failed to set guest notifiers (%d), " - "ensure -enable-kvm is set\n", rc); + error_report("virtio-scsi: Failed to set guest notifiers (%d), " + "ensure -enable-kvm is set", rc); goto fail_guest_notifiers; } From patchwork Thu Oct 19 16:17:43 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Alistair Francis X-Patchwork-Id: 828242 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; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=xilinx.onmicrosoft.com header.i=@xilinx.onmicrosoft.com header.b="l3VBug4o"; 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 3yHw1K3W67z9t44 for ; Fri, 20 Oct 2017 03:51:16 +1100 (AEDT) Received: from localhost ([::1]:50224 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e5E2L-00054c-FW for incoming@patchwork.ozlabs.org; Thu, 19 Oct 2017 12:51:13 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:56069) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e5Da3-0005pp-Ow for qemu-devel@nongnu.org; Thu, 19 Oct 2017 12:22:01 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1e5Da0-00024g-I0 for qemu-devel@nongnu.org; Thu, 19 Oct 2017 12:21:59 -0400 Received: from mail-dm3nam03on0069.outbound.protection.outlook.com ([104.47.41.69]:51760 helo=NAM03-DM3-obe.outbound.protection.outlook.com) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1e5Da0-00024O-AY for qemu-devel@nongnu.org; Thu, 19 Oct 2017 12:21:56 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=xilinx.onmicrosoft.com; s=selector1-xilinx-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=m9eVTZWUyII8KpWXEkcWTmrRnh/jAXyIB/CglQP+I3k=; b=l3VBug4oWzpV0uC6gXtN6LbB1UaVduLbObNI6pwQ2LSYO+aYrvhiSBRS+MXRYZNZ0/YZ8Hm+LI3T30sSTKooq3IQ1gTBkogYC8kgszqyRWPEVpBihDk4Zbj9+wvUbe466qyoAmhDn7FgoqGAzYFQf0i9FaC/lIFVuUTfHPsj/j0= Received: from MWHPR02CA0015.namprd02.prod.outlook.com (10.168.209.153) by DM5PR02MB3385.namprd02.prod.outlook.com (10.164.152.161) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.77.7; Thu, 19 Oct 2017 16:21:54 +0000 Received: from CY1NAM02FT031.eop-nam02.prod.protection.outlook.com (2a01:111:f400:7e45::208) by MWHPR02CA0015.outlook.office365.com (2603:10b6:300:4b::25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.77.7 via Frontend Transport; Thu, 19 Oct 2017 16:21:53 +0000 Authentication-Results: spf=pass (sender IP is 149.199.60.100) smtp.mailfrom=xilinx.com; redhat.com; dkim=none (message not signed) header.d=none;redhat.com; dmarc=bestguesspass action=none header.from=xilinx.com; Received-SPF: Pass (protection.outlook.com: domain of xilinx.com designates 149.199.60.100 as permitted sender) receiver=protection.outlook.com; client-ip=149.199.60.100; helo=xsj-pvapsmtpgw02; Received: from xsj-pvapsmtpgw02 (149.199.60.100) by CY1NAM02FT031.mail.protection.outlook.com (10.152.75.180) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.20.77.10 via Frontend Transport; Thu, 19 Oct 2017 16:21:53 +0000 Received: from unknown-38-66.xilinx.com ([149.199.38.66]:38875 helo=xsj-pvapsmtp01) by xsj-pvapsmtpgw02 with esmtp (Exim 4.63) (envelope-from ) id 1e5DZw-0007xy-Lt; Thu, 19 Oct 2017 09:21:52 -0700 Received: from [127.0.0.1] (helo=localhost) by xsj-pvapsmtp01 with smtp (Exim 4.63) (envelope-from ) id 1e5DZw-0003B2-II; Thu, 19 Oct 2017 09:21:52 -0700 Received: from xsj-pvapsmtp01 (mailhub.xilinx.com [149.199.38.66]) by xsj-smtp-dlp1.xlnx.xilinx.com (8.13.8/8.13.1) with ESMTP id v9JGLks9018132; Thu, 19 Oct 2017 09:21:46 -0700 Received: from [172.19.2.220] (helo=localhost.localdomain) by xsj-pvapsmtp01 with esmtp (Exim 4.63) (envelope-from ) id 1e5DZq-0003AC-8w; Thu, 19 Oct 2017 09:21:46 -0700 From: Alistair Francis To: Date: Thu, 19 Oct 2017 09:17:43 -0700 Message-ID: X-Mailer: git-send-email 2.11.0 In-Reply-To: References: X-RCIS-Action: ALLOW X-TM-AS-Product-Ver: IMSS-7.1.0.1224-8.1.0.1062-23404.005 X-TM-AS-User-Approved-Sender: Yes;Yes X-EOPAttributedMessage: 0 X-MS-Office365-Filtering-HT: Tenant X-Forefront-Antispam-Report: CIP:149.199.60.100; IPV:NLI; CTRY:US; EFV:NLI; SFV:NSPM; SFS:(10009020)(6009001)(346002)(39860400002)(376002)(2980300002)(438002)(189002)(199003)(8936002)(33646002)(106466001)(36756003)(5003940100001)(36386004)(5660300001)(189998001)(4326008)(118296001)(81166006)(47776003)(8676002)(81156014)(63266004)(16586007)(9786002)(2351001)(356003)(106002)(316002)(6916009)(77096006)(575784001)(50226002)(50986999)(2950100002)(48376002)(76176999)(54906003)(2906002)(478600001)(6666003)(305945005)(39060400002)(50466002)(107986001)(5001870100001); DIR:OUT; SFP:1101; SCL:1; SRVR:DM5PR02MB3385; H:xsj-pvapsmtpgw02; FPR:; SPF:Pass; PTR:xapps1.xilinx.com,unknown-60-100.xilinx.com; MX:1; A:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; CY1NAM02FT031; 1:7OYs5N+jCrfeb/9Qgx3V/9iUoNpvoCwV1pWBcx6RL3oTW4jw//U0u9IkBfi+yoG027/O/A/ZgIXZG/5C7/6v5mSx3zVUA1EnZDA4Uo3/I/BQ+BMdHuMoGwQsXWswVr6/ MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 36c3b2df-031b-48e8-a1af-08d5170d829b X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001)(2017030254152)(8251501002)(2017052603199)(201703131423075)(201703031133081)(201702281549075); SRVR:DM5PR02MB3385; X-Microsoft-Exchange-Diagnostics: 1; DM5PR02MB3385; 3:vLxmZcSl/dO+CsnM0z5+R2Dfdo1+BLWe93cINLrU3ow+53l1Oz0wyEL20xHZzdBA32oExkE7mzTYKV9q/oB3ZyPNIMGss51H7Nwkcd26Lk7Cm5zQxukfKlMUA8L+u8hTYeA1A2BcVjp5sW9uEsCYoigu7+AW00zV9uvhQcwcseW0QkrIwudAu18PXdADhcra07lPbsxTP9dXbzMHP73I9nc2872+PIP+8roW85k2Sw9OQwx12/1Wrh/lPKjfA+kEUEuSuBXYja1yaPGL5TpxK0c7lADkE79Ob0QuPZEz6stOzChAM4D3L7bT24/ntJkqcmDilbBrPzknTJa+r27JU6PTNgxXmzLdGKoAds1ig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7BZgonvKDGyr17Qr2NktvmAoA06v/dkna0p6s27wBkL6/Fn47XqLpVZ/enYgTejZoidfqhl/oxsuj6UYLCZzYueHrdVnnHCNcA2Fg28AA0pz X-Exchange-Antispam-Report-Test: UriScan:(788757137089)(192813158149592); X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(100000700101)(100105000095)(100000701101)(100105300095)(100000702101)(100105100095)(6040450)(2401047)(8121501046)(5005006)(3002001)(93006095)(93004095)(100000703101)(100105400095)(10201501046)(6055026)(6041248)(20161123558100)(20161123555025)(20161123560025)(20161123564025)(20161123562025)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(6072148)(201708071742011)(100000704101)(100105200095)(100000705101)(100105500095); SRVR:DM5PR02MB3385; BCL:0; PCL:0; RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095); SRVR:DM5PR02MB3385; X-Microsoft-Exchange-Diagnostics: 1; DM5PR02MB3385; 4:5NSuddcRys/rWbETFeTJBG6XGDp4Y1r1P+U+Jb2+6go+wEg/8JuciT0a1xgSttl3KAYFGXaKGW9kH5YrHKyKK7wpzaCnAcYDLQxWKnnOvfn4kXsbceqp2uPgopFz7U0HvzRuwniPYYxapETpDH3P/56dv6AaWu3KzdOfOjMV7dK+bY2bcoAkTh0kPc8YO3Vj6uTOUkFbSNEOQU+B5nEIi0bf3KHRfkXLRBciYxW/NGoSLMNrsphyMEfQMuspdzbqkOiqLGY7/vM7l6dms56y9Gs1ooKD12IMUjXyjIObcLmUhLSAFdAFVO1EDaq/64rIT2W3yLPeYJfJgXC8CjTlYA== X-Forefront-PRVS: 0465429B7F X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; DM5PR02MB3385; 23:iZ3pI9wiyJOBlI+/E9yZbEuA3ZnY0gzOAb2pvHrD6?= KcaOudMf6Mzdpg2JyZrArVnqkklnwNlRh+T7lJ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RH2LtE2qTl47/8HbO2nCerEQ/VkLz5tre4kvOi/UxzB75sxS8ghVkBhmX1bK4YxR3GtjwmdgaUzMvQ3rqbilPVR5pcl+LDEOBFLcqQ26tmM74u430FgaAdqSiaoKAy1Yr2rmGO7zfRhNtmT/jYW6cGsN2iKwemSz3UmDJ6/+T3w8roAoCI3jPci030wLCtWbzwHhfaG6nOrgWjsetHwtU744m61geBo2rGnoVEqMh7gHw+/Ph4eWY0m4+nEpZGLlSmKlWeE2WR5Apq8y2Scw3hut0mtAX9BZ22ffxq4SH2dXyBO63X70swVFqRc9vFGsXnEvqy92xJbQ==; 5:Fq5nsJD+Y28UOrlvj5PXnpiN5rc7JnfqrcD/SxkXI7wlkN/5YcFUrOffG6XiAGyzT50kMTo6tSW8ryup30xfKiN7gUc3UfXDYxvRjBF904chGBG3YixWev63VnIuNmQe0OJmRyBlywUhmM8eAEyiOA==; 24:Sgqo5v5yIpN57hrzPBpT+ptOzuojOgqUy9Lbt2sHjysRHHeTXX/CHUf/g+/EvyP7GTDPIAXmMeThqmCCO9FHLBJxbR+9DmKCiPGXmUWH/6Q=; 7:8ghRH54AHR7iNEBqPd5fHGqkJSC9Wq+J5xzzK44bETa7mAm3I2yCoXzIugcYevUwTv3GYx3AIuqsWquBw1c+sBgm6yfxO9Qxxtq8deijhk9vl+QxPMPeiEHU/2BgHfQO3mmHLjNsGL4U8NvTikxf0aMKP4YVD6YoQcEtpRJC523MF2FfIJ5T4sWgH8NAM927vWs6x8JqhLRboQTuGNMyr8FSKOMHb2cZJxD/iAQ40Ww= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: xilinx.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 19 Oct 2017 16:21:53.3075 (UTC) X-MS-Exchange-CrossTenant-Id: 657af505-d5df-48d0-8300-c31994686c5c X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=657af505-d5df-48d0-8300-c31994686c5c; Ip=[149.199.60.100]; Helo=[xsj-pvapsmtpgw02] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM5PR02MB3385 X-detected-operating-system: by eggs.gnu.org: Windows 7 or 8 [fuzzy] X-Received-From: 104.47.41.69 Subject: [Qemu-devel] [PATCH v3 34/46] hw/sd: Replace fprintf(stderr, "*\n" with error_report() 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: alistair23@gmail.com, armbru@redhat.com, alistair.francis@xilinx.com Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" Replace a large number of the fprintf(stderr, "*\n" calls with error_report(). The functions were renamed with these commands and then compiler issues where manually fixed. find ./* -type f -exec sed -i \ 'N;N;N;N;N;N;N;N;N;N;N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2);|Ig}' \ {} + find ./* -type f -exec sed -i \ 'N;N;N;N;N;N;N;N;N;N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2);|Ig}' \ {} + find ./* -type f -exec sed -i \ 'N;N;N;N;N;N;N;N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2);|Ig}' \ {} + find ./* -type f -exec sed -i \ 'N;N;N;N;N;N;N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2);|Ig}' \ {} + find ./* -type f -exec sed -i \ 'N;N;N;N;N;N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2);|Ig}' \ {} + find ./* -type f -exec sed -i \ 'N;N;N;N;N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2);|Ig}' \ {} + find ./* -type f -exec sed -i \ 'N;N;N;N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2);|Ig}' \ {} + find ./* -type f -exec sed -i \ 'N;N;N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2);|Ig}' \ {} + find ./* -type f -exec sed -i \ 'N;N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2);|Ig}' \ {} + find ./* -type f -exec sed -i \ 'N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2);|Ig}' \ {} + find ./* -type f -exec sed -i \ 'N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2);|Ig}' \ {} + Some lines where then manually tweaked to pass checkpatch. Some of the prints in hw/sd/sd.c were manually converted to using DPRINTF() instead. Signed-off-by: Alistair Francis Reviewed-by: Philippe Mathieu-Daudé --- V3: - Fixup some DPRINTF() prints being wrong V2: - Split hw patch into individual directories hw/sd/pl181.c | 5 +++-- hw/sd/sd.c | 15 ++++++++------- 2 files changed, 11 insertions(+), 9 deletions(-) diff --git a/hw/sd/pl181.c b/hw/sd/pl181.c index 55c8098ecd..2b878a0c5e 100644 --- a/hw/sd/pl181.c +++ b/hw/sd/pl181.c @@ -8,6 +8,7 @@ */ #include "qemu/osdep.h" +#include "qemu/error-report.h" #include "sysemu/block-backend.h" #include "sysemu/blockdev.h" #include "hw/sysbus.h" @@ -146,7 +147,7 @@ static void pl181_fifo_push(PL181State *s, uint32_t value) int n; if (s->fifo_len == PL181_FIFO_LEN) { - fprintf(stderr, "pl181: FIFO overflow\n"); + error_report("pl181: FIFO overflow"); return; } n = (s->fifo_pos + s->fifo_len) & (PL181_FIFO_LEN - 1); @@ -160,7 +161,7 @@ static uint32_t pl181_fifo_pop(PL181State *s) uint32_t value; if (s->fifo_len == 0) { - fprintf(stderr, "pl181: FIFO underflow\n"); + error_report("pl181: FIFO underflow"); return 0; } value = s->fifo[s->fifo_pos]; diff --git a/hw/sd/sd.c b/hw/sd/sd.c index 35347a5bbc..5d7fa3e418 100644 --- a/hw/sd/sd.c +++ b/hw/sd/sd.c @@ -700,7 +700,7 @@ static void sd_lock_command(SDState *sd) sd->card_status &= ~CARD_IS_LOCKED; sd->pwd_len = 0; /* Erasing the entire card here! */ - fprintf(stderr, "SD: Card force-erased by CMD42\n"); + error_report("SD: Card force-erased by CMD42"); return; } @@ -1282,7 +1282,7 @@ static sd_rsp_type_t sd_normal_command(SDState *sd, return sd_r1; case 56: /* CMD56: GEN_CMD */ - fprintf(stderr, "SD: GEN_CMD 0x%08x\n", req.arg); + error_report("SD: GEN_CMD 0x%08x", req.arg); switch (sd->state) { case sd_transfer_state: @@ -1564,9 +1564,10 @@ send_response: if (rsplen) { int i; DPRINTF("Response:"); - for (i = 0; i < rsplen; i++) - fprintf(stderr, " %02x", response[i]); - fprintf(stderr, " state %d\n", sd->state); + for (i = 0; i < rsplen; i++) { + DPRINTF(" %02x", response[i]); + } + DPRINTF(" state %d\n", sd->state); } else { DPRINTF("No response %d\n", sd->state); } @@ -1580,14 +1581,14 @@ static void sd_blk_read(SDState *sd, uint64_t addr, uint32_t len) DPRINTF("sd_blk_read: addr = 0x%08llx, len = %d\n", (unsigned long long) addr, len); if (!sd->blk || blk_pread(sd->blk, addr, sd->data, len) < 0) { - fprintf(stderr, "sd_blk_read: read error on host side\n"); + error_report("sd_blk_read: read error on host side"); } } static void sd_blk_write(SDState *sd, uint64_t addr, uint32_t len) { if (!sd->blk || blk_pwrite(sd->blk, addr, sd->data, len, 0) < 0) { - fprintf(stderr, "sd_blk_write: write error on host side\n"); + error_report("sd_blk_write: write error on host side"); } } From patchwork Thu Oct 19 16:17:56 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alistair Francis X-Patchwork-Id: 828228 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; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=xilinx.onmicrosoft.com header.i=@xilinx.onmicrosoft.com header.b="jsIUF/Bs"; 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 3yHvpL1c3fz9t6m for ; Fri, 20 Oct 2017 03:41:46 +1100 (AEDT) Received: from localhost ([::1]:50165 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e5DtA-00053q-77 for incoming@patchwork.ozlabs.org; Thu, 19 Oct 2017 12:41:44 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:56079) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e5Da5-0005rI-GP for qemu-devel@nongnu.org; Thu, 19 Oct 2017 12:22:07 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1e5Da2-000257-6u for qemu-devel@nongnu.org; Thu, 19 Oct 2017 12:22:01 -0400 Received: from mail-bl2nam02on0080.outbound.protection.outlook.com ([104.47.38.80]:9280 helo=NAM02-BL2-obe.outbound.protection.outlook.com) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1e5Da2-000251-0n for qemu-devel@nongnu.org; Thu, 19 Oct 2017 12:21:58 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=xilinx.onmicrosoft.com; s=selector1-xilinx-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=aZB6LIjwtqerKdO+CeatQgq1tQlEgenh6RUwDz3eDQU=; b=jsIUF/BsMoxGv1pkPobNpVHTI3LZFUqk6ChFoBHMwM65FFecGXaytaT87nWQcLOAyg+ofD9z0Vcl59mj6TA98LcGrjWyDM9oQNYu1ZIkP60OkV18SIGeeFlvLO5K/Ih0at5BwfgBhUmW1llwshUVH5Bu4rew4LAwBdLsa8ofnJ8= Received: from SN4PR0201CA0013.namprd02.prod.outlook.com (10.161.238.151) by CY4PR02MB3381.namprd02.prod.outlook.com (10.165.89.152) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.77.7; Thu, 19 Oct 2017 16:21:53 +0000 Received: from SN1NAM02FT046.eop-nam02.prod.protection.outlook.com (2a01:111:f400:7e44::205) by SN4PR0201CA0013.outlook.office365.com (2603:10b6:803:2b::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.156.4 via Frontend Transport; Thu, 19 Oct 2017 16:21:53 +0000 Authentication-Results: spf=pass (sender IP is 149.199.60.83) smtp.mailfrom=xilinx.com; aurel32.net; dkim=none (message not signed) header.d=none;aurel32.net; dmarc=bestguesspass action=none header.from=xilinx.com; Received-SPF: Pass (protection.outlook.com: domain of xilinx.com designates 149.199.60.83 as permitted sender) receiver=protection.outlook.com; client-ip=149.199.60.83; helo=xsj-pvapsmtpgw01; Received: from xsj-pvapsmtpgw01 (149.199.60.83) by SN1NAM02FT046.mail.protection.outlook.com (10.152.72.191) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.20.77.10 via Frontend Transport; Thu, 19 Oct 2017 16:21:53 +0000 Received: from unknown-38-66.xilinx.com ([149.199.38.66] helo=xsj-pvapsmtp01) by xsj-pvapsmtpgw01 with esmtp (Exim 4.63) (envelope-from ) id 1e5DZw-00005F-Kd; Thu, 19 Oct 2017 09:21:52 -0700 Received: from [127.0.0.1] (helo=localhost) by xsj-pvapsmtp01 with smtp (Exim 4.63) (envelope-from ) id 1e5DZw-0003B2-GS; Thu, 19 Oct 2017 09:21:52 -0700 Received: from xsj-pvapsmtp01 (xsj-smtp.xilinx.com [149.199.38.66]) by xsj-smtp-dlp2.xlnx.xilinx.com (8.13.8/8.13.1) with ESMTP id v9JGLnVD006875; Thu, 19 Oct 2017 09:21:49 -0700 Received: from [172.19.2.220] (helo=localhost.localdomain) by xsj-pvapsmtp01 with esmtp (Exim 4.63) (envelope-from ) id 1e5DZt-0003AX-9h; Thu, 19 Oct 2017 09:21:49 -0700 From: Alistair Francis To: Date: Thu, 19 Oct 2017 09:17:56 -0700 Message-ID: <388233ed6156d0e80674d1f477772dc260776144.1508390588.git.alistair.francis@xilinx.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: References: X-RCIS-Action: ALLOW X-TM-AS-Product-Ver: IMSS-7.1.0.1224-8.1.0.1062-23404.005 X-TM-AS-User-Approved-Sender: Yes;Yes X-EOPAttributedMessage: 0 X-MS-Office365-Filtering-HT: Tenant X-Forefront-Antispam-Report: CIP:149.199.60.83; IPV:NLI; CTRY:US; EFV:NLI; SFV:NSPM; SFS:(10009020)(6009001)(39860400002)(346002)(376002)(2980300002)(438002)(189002)(199003)(118296001)(316002)(36756003)(77096006)(6666003)(16586007)(48376002)(50466002)(356003)(5003940100001)(305945005)(54906003)(4326008)(5660300001)(478600001)(6916009)(106002)(47776003)(2950100002)(81156014)(189998001)(81166006)(33646002)(8936002)(106466001)(8676002)(2906002)(2351001)(50986999)(76176999)(63266004)(9786002)(36386004)(39060400002)(50226002)(107986001); DIR:OUT; SFP:1101; SCL:1; SRVR:CY4PR02MB3381; H:xsj-pvapsmtpgw01; FPR:; SPF:Pass; PTR:unknown-60-83.xilinx.com; MX:1; A:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; SN1NAM02FT046; 1:sPM7stlc2s9ZcXAf3ZPyFciI5+F0aCjY/FDqwDpTtZHkYsjW9wAKw7JkTtALx7cyJ5GbVXBKcY2JFCnyk/NyV6dSOyiEOOCZEm3J56wfcuXnBXDo41k9qKKnatszjwYr MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 1d9be360-e2a4-415f-1572-08d5170d8276 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001)(2017030254168)(8251501002)(4534016)(4602075)(4627075)(201703031133081)(201702281549075)(2017052603199)(201703131423091); SRVR:CY4PR02MB3381; X-Microsoft-Exchange-Diagnostics: 1; CY4PR02MB3381; 3:rGedeGJL0BZMSmtZFpRxzsKFCn0/yQSzASVRm0bolbKkjMBzrKaXbPbEMjbDc56WDTp73TexlFdRcbmPbWY6DeSrosS2xBEFKr2Kq6mhApKQ5zoTI13y2vwxLblKc0P6DL4uzoBe0yi4RU+QkhblKLxvbgAVvF7xCJcv4ATdCcZFII6HT9hxyH4Qvpp37HCgCW5zfjromEw/q0Jo0uEVVcniAP1QD28txJIP0z/C/Z6RY1KxhzV+Fv6o6P3nTGC/fEWwdAqb/Za01lgPjWLc803r4l33J3q/408+gCfCTOc48akBK3b6tAjD5fj5DNFm0FZdQEgGJ9XZzd3hmpm7ZugHaGCyeB3IirDIcS/wS2Y=; 25:8Y2KYSXEsAxAUHiuHARsMnOo/UNf8QNezha8Qa87eHWTLskN1dpnJ8PWciAZjN7vY9mU2xOANU3nAtgSdSxejEb/p4HJdKgzWbPlQt4/WUe93KJt/r/JXmfKfyFFleRmIe87fyIleqbgCM0oW+ZoVwwsdTs1KyuXOt3q55ccpCS9rV0Q7t3NRn/eZHmTL8q4HPDR8NC4J3rhp8MxNaiq12ySGaTonMzvKG3Wcbhn/5caMLKMZONHMguriZUSFgE2OW+E78JoB7O/6LaT77GVDBRQRnkaOv2bs/GB0yXh6cwS2VoASuCPRGk4MoAxr9BYU9X6vZCSL6DDTGwninQG4Q== X-MS-TrafficTypeDiagnostic: CY4PR02MB3381: X-Microsoft-Exchange-Diagnostics: 1; CY4PR02MB3381; 31:CwFuxbsoIy3MVM+2ySZfe1yikcs086fsqHC/eLVD3y8r87g9mbgBgbwR3lhtBf8DmHTwoY1nVEaO+ewOjY5IZGBJ/Vt+MCAYeNOtsdZA662iBZJ0BzZKPrnts/aqqIsqc7lG7x/ocfgAbueiHitdTfCL0wdb9EZJkP9gyKtYp0wJGLjWKyfcnCgzwCMTBMz+bCicdra4er6iedIc+1dg162dHnjxJtjosG3Q2FsOjww=; 20:64uDfIwbZRy7DH/PFnBGnsGWDzoWlojfkDoJqOiHE6JcYSUp9GMvuxf5rCa9zSqOF7SnV3lCL4cbEDBMSsZy6XjJFC1mPWkxm0DMyvMEQKHjNOfAhWxuIWpF9Kl3GIbmdxYXAUQ/iDdi1k3JCrtbtdyJNMT6nMSanRtOkafBNVz8xeTmrqp1jEuGhh2HP/a/op41YBiZ8MM+eHrB8HGAS8U/+jfv1nntuT0OJQ6rG2gPtDbU4022CkBI1FluUkX3gFwr8C9Db0hbibvkdFlou+E6/adQ7Fd5tvmYvFOB+8aH6aRFCu0DT4iK4CVw1Ig4uaPQC/rtx7q1wSoUf6in1IIysGGr5Vwa8FIPUdJ3J9H9mpVK4Ij+vm2EokVboA1vfIXwUh3M7KG/RLm2ztNnD0EXK8rtGiMlvM9c6x4WsGDjBsDoYZDWDgC6FAfneqNWB3OV+YHERRbWXBfsF2aPF47iCc4hhVEjsqeQSrj2OnEbeKe6co04ntOGFr1J2U0f X-Exchange-Antispam-Report-Test: UriScan:(788757137089)(192813158149592); X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(100000700101)(100105000095)(100000701101)(100105300095)(100000702101)(100105100095)(6040450)(2401047)(8121501046)(5005006)(3002001)(93006095)(93004095)(10201501046)(100000703101)(100105400095)(6055026)(6041248)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123560025)(20161123564025)(20161123562025)(20161123558100)(20161123555025)(6072148)(201708071742011)(100000704101)(100105200095)(100000705101)(100105500095); SRVR:CY4PR02MB3381; BCL:0; PCL:0; RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095); SRVR:CY4PR02MB3381; X-Microsoft-Exchange-Diagnostics: 1; CY4PR02MB3381; 4:e3Tih8ETg0XXQpNWjVjrRnnAJkSPWWDsVr5HDwIXmAyjECjh1WpGiHMpU51ZFNhK4BKtEXrx2xm7PjKWOpewXjKDMA/vTvPyB91Z+Vn6K67zAninZIgQ8eIFFzXu6gwQA9nx5RwPmradMKQH9I2/WO9DWWkQUAcIUXCflx3t6JO7M2p2XQ1J2JnzDQ3aoNWq9sgMAIKHM1yG7XPrfWV5keqFZiu8uiZ5Kf5yN3O26vbdZuWUguAVkR3KkCGWGHGfTLmUV/hhCt/aNJhvbZynTVliB1400QK3oSOzLLmGMYFSrK9g2B0WMnU5EBeP3xTlYky1UA27Eu/IHP3caZh9uw== X-Forefront-PRVS: 0465429B7F X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; CY4PR02MB3381; 23:SWpdIpw1o6682BmDwB+GD/raRJC3hoiC5wyW0J6OL?= NCugk0/t+ggkg9dU53LqafXcEAJGt7mQ9bxvNh5ug+FuqdvrPzAp23MX3vRs6KufeCoIZXIxr+b/nQzFytPoWyTIom2vA2LOi7g7vS8tI7mBaKNEkBWTyz38bTOFCanZRSa0huSNyxiEKixm3PKhhNZdfT2lmP4L9rG5Xw8O/lyr6a458vIV9m+LkRcHvftgv7wdcsyRrI3l7xGXy3P7SKDD3G7Dlxv5bOLMDCsW9M5dFzO5+8PmtyTtRJyJWBpITIklR+/ehiFJd/4ZMPDHWZbO43ffuWDbSaMgiIk01xPhW+4aU3MeML6rzsMTZJTTxn41Xhh/SicMUy5tE624rASKUWSIbl08U3KfjOqYAFrHMlcc/BzpO2r7KShT7ZwiXjbCsJKXGAi9WrdDzzKzxu66bLHMExilc5GT0IFpdolvOWwSYXvVnhG9qcojInh311dg+AVGJC6W9CqPPH5y9Jy9l9cywYWIukQ11psOxaOhiDy91HTB4W19N8nJ7Av/Wu6tfdtCt6u7ebvCWFSL80p3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pTk+hwqk6neiDT4Awe79VS+u/wHjT77oNX/us7daFIUTvPbtcJute1yE8FLpplTiWnFzAE=; 7:tisDh7JrPIXDU8IDpqK/D2mGAH49vE7QWWSWZ2haAGsfMvPWwTJCFKBimPX42E6Ig0KYspLDWARehsTSUvmPq/Rx2/g2Zo9GJO/0gigz2ODBo/f90MPhI0aGtBWTf3LF4rQaXWKMCzSfJ7lp07iC5aOzKymSU5ew0+oZwjAFal1RXyHy4x1YfsT1vGKI61xzs+vveF8ETTPgVvqGCs59NMGy+9iPV12wVYb8q4vQC00= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: xilinx.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 19 Oct 2017 16:21:53.0614 (UTC) X-MS-Exchange-CrossTenant-Id: 657af505-d5df-48d0-8300-c31994686c5c X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=657af505-d5df-48d0-8300-c31994686c5c; Ip=[149.199.60.83]; Helo=[xsj-pvapsmtpgw01] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY4PR02MB3381 X-detected-operating-system: by eggs.gnu.org: Windows 7 or 8 [fuzzy] X-Received-From: 104.47.38.80 Subject: [Qemu-devel] [PATCH v3 35/46] hw/sh4: Replace fprintf(stderr, "*\n" with error_report() 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: alistair23@gmail.com, Magnus Damm , armbru@redhat.com, Aurelien Jarno , alistair.francis@xilinx.com Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" Replace a large number of the fprintf(stderr, "*\n" calls with error_report(). The functions were renamed with these commands and then compiler issues where manually fixed. find ./* -type f -exec sed -i \ 'N;N;N;N;N;N;N;N;N;N;N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2);|Ig}' \ {} + find ./* -type f -exec sed -i \ 'N;N;N;N;N;N;N;N;N;N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2);|Ig}' \ {} + find ./* -type f -exec sed -i \ 'N;N;N;N;N;N;N;N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2);|Ig}' \ {} + find ./* -type f -exec sed -i \ 'N;N;N;N;N;N;N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2);|Ig}' \ {} + find ./* -type f -exec sed -i \ 'N;N;N;N;N;N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2);|Ig}' \ {} + find ./* -type f -exec sed -i \ 'N;N;N;N;N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2);|Ig}' \ {} + find ./* -type f -exec sed -i \ 'N;N;N;N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2);|Ig}' \ {} + find ./* -type f -exec sed -i \ 'N;N;N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2);|Ig}' \ {} + find ./* -type f -exec sed -i \ 'N;N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2);|Ig}' \ {} + find ./* -type f -exec sed -i \ 'N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2);|Ig}' \ {} + find ./* -type f -exec sed -i \ 'N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2);|Ig}' \ {} + Some lines where then manually tweaked to pass checkpatch. Signed-off-by: Alistair Francis Cc: Magnus Damm Cc: Aurelien Jarno --- V2: - Split hw patch into individual directories hw/sh4/r2d.c | 9 ++++---- hw/sh4/sh7750.c | 64 +++++++++++++++++++++++++++++---------------------------- 2 files changed, 38 insertions(+), 35 deletions(-) diff --git a/hw/sh4/r2d.c b/hw/sh4/r2d.c index 16b9ed2db2..127b510b6d 100644 --- a/hw/sh4/r2d.c +++ b/hw/sh4/r2d.c @@ -24,6 +24,7 @@ */ #include "qemu/osdep.h" +#include "qemu/error-report.h" #include "qapi/error.h" #include "qemu-common.h" #include "cpu.h" @@ -319,8 +320,8 @@ static void r2d_init(MachineState *machine) SDRAM_BASE + LINUX_LOAD_OFFSET, INITRD_LOAD_OFFSET - LINUX_LOAD_OFFSET); if (kernel_size < 0) { - fprintf(stderr, "qemu: could not load kernel '%s'\n", kernel_filename); - exit(1); + error_report("could not load kernel '%s'", kernel_filename); + exit(1); } /* initialization which should be done by firmware */ @@ -339,8 +340,8 @@ static void r2d_init(MachineState *machine) SDRAM_SIZE - INITRD_LOAD_OFFSET); if (initrd_size < 0) { - fprintf(stderr, "qemu: could not load initrd '%s'\n", initrd_filename); - exit(1); + error_report("could not load initrd '%s'", initrd_filename); + exit(1); } /* initialization which should be done by firmware */ diff --git a/hw/sh4/sh7750.c b/hw/sh4/sh7750.c index 166e4bd947..64ffc4c1d2 100644 --- a/hw/sh4/sh7750.c +++ b/hw/sh4/sh7750.c @@ -23,6 +23,7 @@ * THE SOFTWARE. */ #include "qemu/osdep.h" +#include "qemu/error-report.h" #include "hw/hw.h" #include "hw/sh4/sh.h" #include "sysemu/sysemu.h" @@ -147,9 +148,9 @@ static void porta_changed(SH7750State * s, uint16_t prev) int i, r = 0; #if 0 - fprintf(stderr, "porta changed from 0x%04x to 0x%04x\n", + error_report("porta changed from 0x%04x to 0x%04x", prev, porta_lines(s)); - fprintf(stderr, "pdtra=0x%04x, pctra=0x%08x\n", s->pdtra, s->pctra); + error_report("pdtra=0x%04x, pctra=0x%08x", s->pdtra, s->pctra); #endif currenta = porta_lines(s); if (currenta == prev) @@ -200,13 +201,13 @@ static void portb_changed(SH7750State * s, uint16_t prev) static void error_access(const char *kind, hwaddr addr) { - fprintf(stderr, "%s to %s (0x" TARGET_FMT_plx ") not supported\n", + error_report("%s to %s (0x" TARGET_FMT_plx ") not supported", kind, regname(addr), addr); } static void ignore_access(const char *kind, hwaddr addr) { - fprintf(stderr, "%s to %s (0x" TARGET_FMT_plx ") ignored\n", + error_report("%s to %s (0x" TARGET_FMT_plx ") ignored", kind, regname(addr), addr); } @@ -326,47 +327,48 @@ static void sh7750_mem_writew(void *opaque, hwaddr addr, uint16_t temp; switch (addr) { - /* SDRAM controller */ + /* SDRAM controller */ case SH7750_BCR2_A7: s->bcr2 = mem_value; return; case SH7750_BCR3_A7: - if(!has_bcr3_and_bcr4(s)) - error_access("word write", addr); - s->bcr3 = mem_value; - return; + if (!has_bcr3_and_bcr4(s)) { + error_access("word write", addr); + } + s->bcr3 = mem_value; + return; case SH7750_PCR_A7: - s->pcr = mem_value; - return; + s->pcr = mem_value; + return; case SH7750_RTCNT_A7: case SH7750_RTCOR_A7: case SH7750_RTCSR_A7: - ignore_access("word write", addr); - return; - /* IO ports */ + ignore_access("word write", addr); + return; + /* IO ports */ case SH7750_PDTRA_A7: - temp = porta_lines(s); - s->pdtra = mem_value; - porta_changed(s, temp); - return; + temp = porta_lines(s); + s->pdtra = mem_value; + porta_changed(s, temp); + return; case SH7750_PDTRB_A7: - temp = portb_lines(s); - s->pdtrb = mem_value; - portb_changed(s, temp); - return; + temp = portb_lines(s); + s->pdtrb = mem_value; + portb_changed(s, temp); + return; case SH7750_RFCR_A7: - fprintf(stderr, "Write access to refresh count register\n"); - s->rfcr = mem_value; - return; + error_report("Write access to refresh count register"); + s->rfcr = mem_value; + return; case SH7750_GPIOIC_A7: - s->gpioic = mem_value; - if (mem_value != 0) { - fprintf(stderr, "I/O interrupts not implemented\n"); + s->gpioic = mem_value; + if (mem_value != 0) { + error_report("I/O interrupts not implemented"); abort(); - } - return; + } + return; default: - error_access("word write", addr); + error_access("word write", addr); abort(); } } From patchwork Thu Oct 19 16:17:59 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Alistair Francis X-Patchwork-Id: 828233 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; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=xilinx.onmicrosoft.com header.i=@xilinx.onmicrosoft.com header.b="Tw5Wjzk8"; 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 3yHvsS6DZZz9t41 for ; Fri, 20 Oct 2017 03:44:28 +1100 (AEDT) Received: from localhost ([::1]:50180 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e5Dvn-0007Oh-0D for incoming@patchwork.ozlabs.org; Thu, 19 Oct 2017 12:44:27 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:56141) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e5DaH-0005zE-J5 for qemu-devel@nongnu.org; Thu, 19 Oct 2017 12:22:15 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1e5DaE-00028h-45 for qemu-devel@nongnu.org; Thu, 19 Oct 2017 12:22:13 -0400 Received: from mail-by2nam03on0070.outbound.protection.outlook.com ([104.47.42.70]:44096 helo=NAM03-BY2-obe.outbound.protection.outlook.com) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1e5DaD-00028F-Mi for qemu-devel@nongnu.org; Thu, 19 Oct 2017 12:22:10 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=xilinx.onmicrosoft.com; s=selector1-xilinx-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=hUqe3XWXhP8HShrclETV7OO9c+A0LH1swx+lqsx6hnE=; b=Tw5Wjzk8iyljCnWIazyfv1EuH423U3rSE4W1OxfAHxQquYNopN7Z/fo01t/XbgQW+6G4EyU9R6Syp3o8t55xeV56I1DVzfkVFEMjhIdkdMPDN/8mmMwXz9uy8AhWs8lnFjEXZAalRvLi8DeRMnnAKXwnBJCj+aTgev2vbXK2UE8= Received: from BY2PR02CA0118.namprd02.prod.outlook.com (10.163.44.172) by DM5PR02MB3386.namprd02.prod.outlook.com (10.164.152.162) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.77.7; Thu, 19 Oct 2017 16:22:06 +0000 Received: from SN1NAM02FT029.eop-nam02.prod.protection.outlook.com (2a01:111:f400:7e44::200) by BY2PR02CA0118.outlook.office365.com (2a01:111:e400:5261::44) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.77.7 via Frontend Transport; Thu, 19 Oct 2017 16:22:06 +0000 Authentication-Results: spf=pass (sender IP is 149.199.60.83) smtp.mailfrom=xilinx.com; gmail.com; dkim=none (message not signed) header.d=none;gmail.com; dmarc=bestguesspass action=none header.from=xilinx.com; Received-SPF: Pass (protection.outlook.com: domain of xilinx.com designates 149.199.60.83 as permitted sender) receiver=protection.outlook.com; client-ip=149.199.60.83; helo=xsj-pvapsmtpgw01; Received: from xsj-pvapsmtpgw01 (149.199.60.83) by SN1NAM02FT029.mail.protection.outlook.com (10.152.72.110) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.20.77.10 via Frontend Transport; Thu, 19 Oct 2017 16:22:05 +0000 Received: from unknown-38-66.xilinx.com ([149.199.38.66] helo=xsj-pvapsmtp01) by xsj-pvapsmtpgw01 with esmtp (Exim 4.63) (envelope-from ) id 1e5Da8-00005R-Qt; Thu, 19 Oct 2017 09:22:04 -0700 Received: from [127.0.0.1] (helo=localhost) by xsj-pvapsmtp01 with smtp (Exim 4.63) (envelope-from ) id 1e5Da8-0003FY-NZ; Thu, 19 Oct 2017 09:22:04 -0700 Received: from xsj-pvapsmtp01 (mailman.xilinx.com [149.199.38.66]) by xsj-smtp-dlp2.xlnx.xilinx.com (8.13.8/8.13.1) with ESMTP id v9JGLqXO006889; Thu, 19 Oct 2017 09:21:52 -0700 Received: from [172.19.2.220] (helo=localhost.localdomain) by xsj-pvapsmtp01 with esmtp (Exim 4.63) (envelope-from ) id 1e5DZw-0003Az-78; Thu, 19 Oct 2017 09:21:52 -0700 From: Alistair Francis To: Date: Thu, 19 Oct 2017 09:17:59 -0700 Message-ID: <106b49578902e1e7ec8a05c3b638f02cd95737ca.1508390588.git.alistair.francis@xilinx.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: References: MIME-Version: 1.0 X-RCIS-Action: ALLOW X-TM-AS-Product-Ver: IMSS-7.1.0.1224-8.1.0.1062-23404.005 X-TM-AS-User-Approved-Sender: Yes;Yes X-EOPAttributedMessage: 0 X-MS-Office365-Filtering-HT: Tenant X-Forefront-Antispam-Report: CIP:149.199.60.83; IPV:NLI; CTRY:US; EFV:NLI; SFV:NSPM; SFS:(10009020)(6009001)(346002)(376002)(39860400002)(2980300002)(438002)(199003)(189002)(47776003)(23676002)(106466001)(33646002)(575784001)(118296001)(6916009)(76176999)(5660300001)(50986999)(50466002)(8676002)(2906002)(81166006)(9786002)(478600001)(2950100002)(54906003)(81156014)(305945005)(8936002)(2351001)(77096006)(106002)(50226002)(5820100001)(36386004)(316002)(39060400002)(189998001)(63266004)(356003)(36756003)(4326008)(2870700001)(107986001); DIR:OUT; SFP:1101; SCL:1; SRVR:DM5PR02MB3386; H:xsj-pvapsmtpgw01; FPR:; SPF:Pass; PTR:unknown-60-83.xilinx.com; A:1; MX:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; SN1NAM02FT029; 1:MYWJEiESxKWEpPTg1sDmXn3suvlK5GSzFeOXQDvXNLWpxqtmEEBhax/jvweZR+1OhjY/U65quFw+OhcP1Xke+koUqzoMSZ1Yh5KsymKEO7RTe5WClbGSVvm/jw1B1X4c X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: c6ed2a14-ac61-4469-f6f3-08d5170d89ea X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001)(2017030254168)(8251501002)(4534016)(4602075)(4627075)(201703031133081)(201702281549075)(2017052603199)(201703131423091); SRVR:DM5PR02MB3386; X-Microsoft-Exchange-Diagnostics: 1; DM5PR02MB3386; 3:EjHQLGAkptbk1mHf2QiCYgu6kY7hUtIMMPpcMc/rq6SAlshjc4EU4NlGKYkQYKA4wK2nLx1l0dMyjYybpt3oROgO4nlD/kXuLt3DY4RGTs37JeimySbDcWVNz7q2l6EjE9CKLzsx+nQR6exiWrQGGU8bSdmL6OvstASIAjx3aCZvlksWHSx+/PneekcAWPeyMH9QWSQ13SJWXTMjZsL6JMamdQMU9yWt6QBCQQPHsdacKCKbxyvgK7dOoBSNirGFHYzi0U2aSlhVTJNWhcdTsV5K1b/jPIRXd0KbCQ2lF4J26KQESD+HhlF3Awa+gVviS2GbY6mxh9h33QaG/rVPZQsrQzUzhjdyT4XI7ZvOEYo=; 25:MRLA30W6hFICbZyOcr5BbjvY56w0RhjYsnYYAniYtchQ5uADVZUV93Y0PSuF9YC+o0s5EXC6ZeK4iAtLELlOVLn5SmCiPOtA8bil6On16C8Y6dpZbFUu0HqIaWtGGbOHx/ZBVdsHV5yPWmKKqTLgRqUK9ddoqhwLbmRMpE2fMXkBrpRDLUb2KlKR8d0xsdE7BWm8h+v/ZtmU17LFIO1MrpfZco3lD+absSvBPna9SwBOBHRoDT8NQUwUVyVrtClNK3W5Uz8Mb1buraeLMa1Cwg8iVLteH3H8IuNTDQRaY2tpN+JyqkRGwHhnaMoCwhAVE24VDsBULG+/lNtUsOrb+w== X-MS-TrafficTypeDiagnostic: DM5PR02MB3386: X-Microsoft-Exchange-Diagnostics: 1; DM5PR02MB3386; 31:JzWSZZ5PijE6wOmxpm3VPMtSvLlKAotUFG2AlJZTXlK7X//7vJ2DxtjCdXuN/SZqhoBJdm+LPPlAz3F3BXUsV6PLuWEmL8vYF4fnWVW7cWbdAdunSyB0d/EMb7KhIm4uJglJj1+HHOhjFcEAVMLbRdJKE/UKrFKqSh6O9l1C+/pbYofLqj0PxuLcaxkGaQOPiZP5vsDv5iGAfGEAC4Z6+AzLnDIL9ILu0CepPpYxsWY=; 20:iBUsq6Mjd665nyEesWnq8VAgm/L+xuE5N3NFcVaz3zyHTKGcUVXpVK43ImwDKZN0w64rI2FDo1RjgB5dDnIELPOP9o8o4magd5ImRph39/+TWC0UYlwkMiZ0WAi74cGoPgYMFMl8pgDFD+8Qc2UvpK4oq5Z6pFFTVgeCzLyAB4O3n0T+jx7+CnDgKDm2oNcNDptheKiBOUaHGng0lWrIGaIFTdEqTY0xQ5QREob0MhB1AuBGYEoDvxdi0Bjh24GqDTWDJ4i/8ZrJzggAiJfWqaVDfjGW2QZOc+BXbsHhdYc7LHcl5DiuSbaFz+G2cnIHDeau+LoJf/djEr8O4qJPtaQTZFITFk4ibKlX63qDtMuJlkNsEAyBN0WdTk0pNqlqV9/rOXzY93KqkO4x6otN7GA/VrfkK5CVJV0A+QJ85JI9qGE+Od0wUkGa6RqQSxM5kPY6DsGWTW7ECA8EHTdTt3x3rbNQX41OPVfmEU0QoU7DreJF6suXe5qRoz93ZcYx X-Exchange-Antispam-Report-Test: UriScan:(788757137089)(192813158149592); X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(100000700101)(100105000095)(100000701101)(100105300095)(100000702101)(100105100095)(6040450)(2401047)(5005006)(8121501046)(3002001)(93006095)(93004095)(100000703101)(100105400095)(10201501046)(6055026)(6041248)(20161123560025)(20161123564025)(20161123562025)(20161123558100)(20161123555025)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(6072148)(201708071742011)(100000704101)(100105200095)(100000705101)(100105500095); SRVR:DM5PR02MB3386; BCL:0; PCL:0; RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095); SRVR:DM5PR02MB3386; X-Microsoft-Exchange-Diagnostics: 1; DM5PR02MB3386; 4:c7bD/Dr8nKNycgCXBXlANr3l10IN0EA98S88hJ88BjrzZATBJsoIJpUlIcmG7ioFxSFVQrOJxtxeGXNn/sO2aMNsFssf9nvk2UTIg1J2+sLwuinIxfiQHP9XvjP9cGIHGj56T/E2tIMPYYb2AAqhI89O/ftJoUvGN+7/1l+3V3sKp5vNrUzyDmWzByiTeeowMIpfWPCxaDartef7HrZV/SKuEla8OHqYiUmTyLZZU/MH/6v+3D69cY8kvCsFYoab0omT7tqs2+GURs2qXPD237z4AQ8RVY+w4yHS2q8OAHuSJFI9Mhny6XG99ORKD/8nW/4IvwyFOswj760TFbIwFw== X-Forefront-PRVS: 0465429B7F X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; DM5PR02MB3386; 23:BYx/4lfA77+iuikdkvKmdsqWVXiP9hE8QYe9WXx4f?= viHNnz/btBnNRZKdmsFKBOnw2IV1aFf1Gk5Q2lpjoSilpEDgx03MNOGFs/a5fDzvjE30nho+7KE2g17gK84ExhtowXu/6Uw3x4IjY4gCNGNm+8grAtQRsWiLmYSJNXPIaORl54QE+mdcYFqHv+zRU/godWt0cw0SDUBkInXc5DjW7CtXk57VXKLlMnV+s86ExWqYF4Cz/qBTSkvC9LV71aadICeKNjlLHe08iMMx5+7o4/Yf/bYwVQOn93TYYUUDAYZXIZlAK7C8sf3qebDyUWL0YrGmFMw6vNUEv95WfxygpPFBJjy3JFMv/Qj00aXjERfU376KWYrAT9xdC1uKZ6VQZ6k4jaynd5XpU6+CsJX6ZdgfXLaLCn6aqfQvkWRq+PWJvIboUYGEJZaMQY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dWGDuT9JE8T2J1yJA+ZMVbfuAp/8MQWwPBoz1pFk2K9Hi9j8ZjLsmdmLaWrdAdGWEayJJhoofu01zFVFeRR8OFsXxpLzt9tA==; 24:Er81YqxGqbVJUBOtj6V9GpZxksoSOLxkvypFf6V3C6cnFqbjTM+qAIcxlpteSq6AyBpQgB/wN6ZWe3BHv+OIScxtBf0M8lDv8VAVNGCNegw=; 7:Q4hF/VE4Tc0rka2ixh/c28wPZWE3xP+OcQl+gasibAPT6VvssVg80l8TrOKVgNjGFTiN49CTToIEpwLKE49PnsMLSTbIHtoxNaaeqUr7D37+9COAEt/xt8BcHLQP48PVivJwXFED33eayIvvBX26RfY5pkvj8daEHxZ41smBrgtwHjwtrjfRCuKuXbhxLr/wLckNsOnoQEqPqxde+z0Tw2nTA9bU59SCxn77bqxyBIE= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: xilinx.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 19 Oct 2017 16:22:05.5246 (UTC) X-MS-Exchange-CrossTenant-Id: 657af505-d5df-48d0-8300-c31994686c5c X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=657af505-d5df-48d0-8300-c31994686c5c; Ip=[149.199.60.83]; Helo=[xsj-pvapsmtpgw01] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM5PR02MB3386 X-detected-operating-system: by eggs.gnu.org: Windows 7 or 8 [fuzzy] X-Received-From: 104.47.42.70 Subject: [Qemu-devel] [PATCH v3 36/46] hw/sparc*: Replace fprintf(stderr, "*\n" with error_report() 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: Mark Cave-Ayland , armbru@redhat.com, Fabien Chouteau , alistair.francis@xilinx.com, alistair23@gmail.com, Artyom Tarasenko Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" Replace a large number of the fprintf(stderr, "*\n" calls with error_report(). The functions were renamed with these commands and then compiler issues where manually fixed. find ./* -type f -exec sed -i \ 'N;N;N;N;N;N;N;N;N;N;N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2);|Ig}' \ {} + find ./* -type f -exec sed -i \ 'N;N;N;N;N;N;N;N;N;N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2);|Ig}' \ {} + find ./* -type f -exec sed -i \ 'N;N;N;N;N;N;N;N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2);|Ig}' \ {} + find ./* -type f -exec sed -i \ 'N;N;N;N;N;N;N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2);|Ig}' \ {} + find ./* -type f -exec sed -i \ 'N;N;N;N;N;N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2);|Ig}' \ {} + find ./* -type f -exec sed -i \ 'N;N;N;N;N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2);|Ig}' \ {} + find ./* -type f -exec sed -i \ 'N;N;N;N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2);|Ig}' \ {} + find ./* -type f -exec sed -i \ 'N;N;N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2);|Ig}' \ {} + find ./* -type f -exec sed -i \ 'N;N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2);|Ig}' \ {} + find ./* -type f -exec sed -i \ 'N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2);|Ig}' \ {} + find ./* -type f -exec sed -i \ 'N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2);|Ig}' \ {} + Some lines where then manually tweaked to pass checkpatch. Signed-off-by: Alistair Francis Cc: Fabien Chouteau Cc: Mark Cave-Ayland Cc: Artyom Tarasenko Reviewed-by: Philippe Mathieu-Daudé --- V2: - Split hw patch into individual directories hw/sparc/leon3.c | 16 +++++++--------- hw/sparc/sun4m.c | 16 +++++++--------- hw/sparc64/niagara.c | 4 ++-- hw/sparc64/sun4u.c | 10 +++++----- 4 files changed, 21 insertions(+), 25 deletions(-) diff --git a/hw/sparc/leon3.c b/hw/sparc/leon3.c index ec2816bf94..b69d69c515 100644 --- a/hw/sparc/leon3.c +++ b/hw/sparc/leon3.c @@ -22,6 +22,7 @@ * THE SOFTWARE. */ #include "qemu/osdep.h" +#include "qemu/error-report.h" #include "qapi/error.h" #include "qemu-common.h" #include "cpu.h" @@ -144,9 +145,8 @@ static void leon3_generic_hw_init(MachineState *machine) /* Allocate RAM */ if ((uint64_t)ram_size > (1UL << 30)) { - fprintf(stderr, - "qemu: Too much memory for this machine: %d, maximum 1G\n", - (unsigned int)(ram_size / (1024 * 1024))); + error_report("Too much memory for this machine: %d, maximum 1G", + (unsigned int)(ram_size / (1024 * 1024))); exit(1); } @@ -172,19 +172,18 @@ static void leon3_generic_hw_init(MachineState *machine) } if (bios_size > prom_size) { - fprintf(stderr, "qemu: could not load prom '%s': file too big\n", - filename); + error_report("could not load prom '%s': file too big", filename); exit(1); } if (bios_size > 0) { ret = load_image_targphys(filename, 0x00000000, bios_size); if (ret < 0 || ret > prom_size) { - fprintf(stderr, "qemu: could not load prom '%s'\n", filename); + error_report("could not load prom '%s'", filename); exit(1); } } else if (kernel_filename == NULL && !qtest_enabled()) { - fprintf(stderr, "Can't read bios image %s\n", filename); + error_report("Can't read bios image %s", filename); exit(1); } g_free(filename); @@ -197,8 +196,7 @@ static void leon3_generic_hw_init(MachineState *machine) kernel_size = load_elf(kernel_filename, NULL, NULL, &entry, NULL, NULL, 1 /* big endian */, EM_SPARC, 0, 0); if (kernel_size < 0) { - fprintf(stderr, "qemu: could not load kernel '%s'\n", - kernel_filename); + error_report("could not load kernel '%s'", kernel_filename); exit(1); } if (bios_size <= 0) { diff --git a/hw/sparc/sun4m.c b/hw/sparc/sun4m.c index e1bdd4828d..1ce0b0a407 100644 --- a/hw/sparc/sun4m.c +++ b/hw/sparc/sun4m.c @@ -261,8 +261,7 @@ static unsigned long sun4m_load_kernel(const char *kernel_filename, KERNEL_LOAD_ADDR, RAM_size - KERNEL_LOAD_ADDR); if (kernel_size < 0) { - fprintf(stderr, "qemu: could not load kernel '%s'\n", - kernel_filename); + error_report("could not load kernel '%s'", kernel_filename); exit(1); } @@ -273,8 +272,8 @@ static unsigned long sun4m_load_kernel(const char *kernel_filename, INITRD_LOAD_ADDR, RAM_size - INITRD_LOAD_ADDR); if (initrd_size < 0) { - fprintf(stderr, "qemu: could not load initial ram disk '%s'\n", - initrd_filename); + error_report("could not load initial ram disk '%s'", + initrd_filename); exit(1); } } @@ -688,7 +687,7 @@ static void prom_init(hwaddr addr, const char *bios_name) ret = -1; } if (ret < 0 || ret > PROM_SIZE_MAX) { - fprintf(stderr, "qemu: could not load prom '%s'\n", bios_name); + error_report("could not load prom '%s'", bios_name); exit(1); } } @@ -754,10 +753,9 @@ static void ram_init(hwaddr addr, ram_addr_t RAM_size, /* allocate RAM */ if ((uint64_t)RAM_size > max_mem) { - fprintf(stderr, - "qemu: Too much memory for this machine: %d, maximum %d\n", - (unsigned int)(RAM_size / (1024 * 1024)), - (unsigned int)(max_mem / (1024 * 1024))); + error_report("Too much memory for this machine: %d, maximum %d", + (unsigned int)(RAM_size / (1024 * 1024)), + (unsigned int)(max_mem / (1024 * 1024))); exit(1); } dev = qdev_create(NULL, "memory"); diff --git a/hw/sparc64/niagara.c b/hw/sparc64/niagara.c index 9a8d6109d4..b267b2dbda 100644 --- a/hw/sparc64/niagara.c +++ b/hw/sparc64/niagara.c @@ -153,8 +153,8 @@ static void niagara_init(MachineState *machine) dinfo->is_default = 1; rom_add_file_fixed(blk_bs(blk)->filename, NIAGARA_VDISK_BASE, -1); } else { - fprintf(stderr, "qemu: could not load ram disk '%s'\n", - blk_bs(blk)->filename); + error_report("could not load ram disk '%s'", + blk_bs(blk)->filename); exit(1); } } diff --git a/hw/sparc64/sun4u.c b/hw/sparc64/sun4u.c index 8282651aeb..780c695cf9 100644 --- a/hw/sparc64/sun4u.c +++ b/hw/sparc64/sun4u.c @@ -22,6 +22,7 @@ * THE SOFTWARE. */ #include "qemu/osdep.h" +#include "qemu/error-report.h" #include "qapi/error.h" #include "qemu-common.h" #include "cpu.h" @@ -165,8 +166,7 @@ static uint64_t sun4u_load_kernel(const char *kernel_filename, RAM_size - KERNEL_LOAD_ADDR); } if (kernel_size < 0) { - fprintf(stderr, "qemu: could not load kernel '%s'\n", - kernel_filename); + error_report("could not load kernel '%s'", kernel_filename); exit(1); } /* load initrd above kernel */ @@ -178,8 +178,8 @@ static uint64_t sun4u_load_kernel(const char *kernel_filename, *initrd_addr, RAM_size - *initrd_addr); if ((int)*initrd_size < 0) { - fprintf(stderr, "qemu: could not load initial ram disk '%s'\n", - initrd_filename); + error_report("could not load initial ram disk '%s'", + initrd_filename); exit(1); } } @@ -326,7 +326,7 @@ static void prom_init(hwaddr addr, const char *bios_name) ret = -1; } if (ret < 0 || ret > PROM_SIZE_MAX) { - fprintf(stderr, "qemu: could not load prom '%s'\n", bios_name); + error_report("could not load prom '%s'", bios_name); exit(1); } } From patchwork Thu Oct 19 16:18:02 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Alistair Francis X-Patchwork-Id: 828248 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; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=xilinx.onmicrosoft.com header.i=@xilinx.onmicrosoft.com header.b="Dy+s3EPD"; 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 3yHw5M6Rghz9t44 for ; Fri, 20 Oct 2017 03:54:47 +1100 (AEDT) Received: from localhost ([::1]:50237 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e5E5m-0008DH-1t for incoming@patchwork.ozlabs.org; Thu, 19 Oct 2017 12:54:46 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:56135) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e5DaG-0005z8-VY for qemu-devel@nongnu.org; Thu, 19 Oct 2017 12:22:14 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1e5DaD-00028Z-Od for qemu-devel@nongnu.org; Thu, 19 Oct 2017 12:22:12 -0400 Received: from mail-by2nam03on0058.outbound.protection.outlook.com ([104.47.42.58]:49639 helo=NAM03-BY2-obe.outbound.protection.outlook.com) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1e5DaD-000283-EA for qemu-devel@nongnu.org; Thu, 19 Oct 2017 12:22:09 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=xilinx.onmicrosoft.com; s=selector1-xilinx-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=jjFlPZrgUL3AAEN3jgsJQaGXpgvdXBVIUr+KwGQ2tUs=; b=Dy+s3EPD4s64KLizxilbM8cpOgoTYrcTc9WXb2UX57pFSyxTFWU3lcr6T7sc0nhnrpte1Flmz4Pii0IDvgbV6P7qILOyydrZupe6oacVFqYkKogQvW/l7RPwdDCROIHb6FiyevLqAlHDXt9CLU+IE7gi/wX2UGbdGpfeECTyDjI= Received: from BY2PR02CA0101.namprd02.prod.outlook.com (10.163.44.155) by CY1PR02MB1335.namprd02.prod.outlook.com (10.161.170.26) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.77.7; Thu, 19 Oct 2017 16:22:06 +0000 Received: from BL2NAM02FT034.eop-nam02.prod.protection.outlook.com (2a01:111:f400:7e46::206) by BY2PR02CA0101.outlook.office365.com (2a01:111:e400:5261::27) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.77.7 via Frontend Transport; Thu, 19 Oct 2017 16:22:06 +0000 Authentication-Results: spf=pass (sender IP is 149.199.60.83) smtp.mailfrom=xilinx.com; redhat.com; dkim=none (message not signed) header.d=none;redhat.com; dmarc=bestguesspass action=none header.from=xilinx.com; Received-SPF: Pass (protection.outlook.com: domain of xilinx.com designates 149.199.60.83 as permitted sender) receiver=protection.outlook.com; client-ip=149.199.60.83; helo=xsj-pvapsmtpgw01; Received: from xsj-pvapsmtpgw01 (149.199.60.83) by BL2NAM02FT034.mail.protection.outlook.com (10.152.77.161) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.20.77.10 via Frontend Transport; Thu, 19 Oct 2017 16:22:05 +0000 Received: from unknown-38-66.xilinx.com ([149.199.38.66] helo=xsj-pvapsmtp01) by xsj-pvapsmtpgw01 with esmtp (Exim 4.63) (envelope-from ) id 1e5Da9-00005d-9C; Thu, 19 Oct 2017 09:22:05 -0700 Received: from [127.0.0.1] (helo=localhost) by xsj-pvapsmtp01 with smtp (Exim 4.63) (envelope-from ) id 1e5Da8-0003FY-PG; Thu, 19 Oct 2017 09:22:04 -0700 Received: from xsj-pvapsmtp01 (xsj-mail.xilinx.com [149.199.38.66]) by xsj-smtp-dlp2.xlnx.xilinx.com (8.13.8/8.13.1) with ESMTP id v9JGLtOY006899; Thu, 19 Oct 2017 09:21:55 -0700 Received: from [172.19.2.220] (helo=localhost.localdomain) by xsj-pvapsmtp01 with esmtp (Exim 4.63) (envelope-from ) id 1e5DZz-0003BR-4R; Thu, 19 Oct 2017 09:21:55 -0700 From: Alistair Francis To: Date: Thu, 19 Oct 2017 09:18:02 -0700 Message-ID: <97781919d5a1350b199108a7dbbaa8badf89a211.1508390588.git.alistair.francis@xilinx.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: References: MIME-Version: 1.0 X-RCIS-Action: ALLOW X-TM-AS-Product-Ver: IMSS-7.1.0.1224-8.1.0.1062-23404.005 X-TM-AS-User-Approved-Sender: Yes;Yes X-EOPAttributedMessage: 0 X-MS-Office365-Filtering-HT: Tenant X-Forefront-Antispam-Report: CIP:149.199.60.83; IPV:NLI; CTRY:US; EFV:NLI; SFV:NSPM; SFS:(10009020)(6009001)(39860400002)(346002)(376002)(2980300002)(438002)(199003)(189002)(81166006)(106002)(50466002)(2906002)(6916009)(36386004)(118296001)(2870700001)(8936002)(77096006)(47776003)(5820100001)(4326008)(50986999)(63266004)(76176999)(6666003)(39060400002)(23676002)(5660300001)(8676002)(2351001)(54906003)(81156014)(106466001)(33646002)(478600001)(305945005)(2950100002)(316002)(189998001)(50226002)(356003)(9786002)(36756003)(107986001); DIR:OUT; SFP:1101; SCL:1; SRVR:CY1PR02MB1335; H:xsj-pvapsmtpgw01; FPR:; SPF:Pass; PTR:unknown-60-83.xilinx.com; A:1; MX:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BL2NAM02FT034; 1:v54yKufpkYC0DKeH5YiCE9XZhY3xKKHH53qfGrneKQFpFClVNoF/9z+Hr3ChrrCto+OmnrcEto77KIXU/hNmyzQBMJle9k78IcYR/VToK27aeW2G5SoreARiY1MNMwKW X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: cd899dad-a59a-46dd-5a5a-08d5170d8a1d X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001)(2017030254169)(8251501002)(4534017)(4602075)(4627075)(201703031133081)(201702281549075)(2017052603199)(201703131423092); SRVR:CY1PR02MB1335; X-Microsoft-Exchange-Diagnostics: 1; CY1PR02MB1335; 3:r94qPWHq/sBG7iGyOozMLb6q0p/bqpv5LNy/zIikzfGfDNL7hJ2w8wgmGGIdSfnIesamF549QNTIhLxgs/aYXg7QeZ+iyIOCAS2VI9YcGZcMn4QAYTK93sGH8CbCTVVU/Wrsi/oBq4ROYwMMdRibvGTeQy+uw/G80lUkB81dGQBN0FX9XPMow8MnlzUfD4Rcao4QyB3Ow/qSjpbjBTw3x8koDS5526l/D4Go/qA2zfMLVTa3ZsuHYAjqi4zeulGbNZnUPgWqueo5wD/YCnvCj6cvlsucmAgHGiUcbWc2I6HvYDG8yQrfehdZ+QIR1zDmmjPim7s9sLZgsXE5XhkcZsPr0D8X2j8byvgBTqy708E=; 25:3zgaxG9o+9HG/hvD5K7EYDdAPggltJ1Z4UT8tc0yMvJ26RlsZ7wGO249Z7LYliebU84cs178ERzYUWVaTmJSzOayFEDU8804zAcrfiBApQsXPg43JOW4GAgdmlRQKfojmu1FXp7cqC5P/zLeMmC/phMXn4Ju0yq+BHy9oiWqGknyLLVZ5ORlHOQLmjiqrO+VON/XgC/tWxFcGSWf/PhRjjltbriT0Dwb+9kScTPqzHfi6/KEuc6UugIZ4FBXhF29Dr/K2OTiWjfUk8TskUKzT6j+YnUQlSUWBp/Qo2Bp8E3C/lXJbzF9yLQpjLPKTvV7ufWBCG+VXfCo2gbM538w7g== X-MS-TrafficTypeDiagnostic: CY1PR02MB1335: X-Microsoft-Exchange-Diagnostics: 1; CY1PR02MB1335; 31:H2dAiHCmuW1b0ka8bACM8xCUgiT+uuSVwIsaPUyHbV5F+Czeoab8SAecaAnKvd2umnZCGZQcolig2gBbM1JvDOGxiI79HHR3n+6JUvEiJPQG68JQFs/3TufZLe1vC3HNlodO9vzGqPWdT/BKVITSRcZ3op0yOQA8V1y56Vx8k4ja6fh36rbZldAhnR7Cf21h6uML/carHhar8aQeiOkENnhyNSCY52c74IhyWDJc8WE=; 20:KcDlWYD7t6CI4JNjgzo1ODmbQnjBEh4x/S2eoX/eVp5niCDqFkTK4pnqP2W7M5lA2NPg2AwIipYqIbj8z6HFox082mYqepCLpZR4B0k8ap8mrTTZuLxJBlcsUvq22/40llNZgy59y1r3C+sWzvKDj7NoeHTuR5poQS/NveLRclL4e0AlREtln2ERLfUx4vAOpBOuBtc/6unGR49GW0tcvyZlRuidyUi8yGytewC7ET0HjMDQ/RcZXpJSdV3m/wD6Ogv6y0iETxS3tWGZLXqXO8TOrQH4W+zLGE4I+gLIA4gqhfQogFnqy7MXEpvjoSKeWRNC2XVnctPo1Dgx2FuWutTRrk2vuoQBQ4qZG8IfdkUXrKBqXG7Sw7ze+4iBOxMd71CqCmPdMsZlYlzDLKKlsupeAudBFn9FrQcDN6Y7a+qf6h+oH79A8IBVZ2cS1o+eqG3H9Q6unwwmG86sNOjtwBZMGuc5uLL9eJDMN1lispBz05Mb1eukzhbyJEDB0YF4 X-Exchange-Antispam-Report-Test: UriScan:(788757137089)(192813158149592); X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(100000700101)(100105000095)(100000701101)(100105300095)(100000702101)(100105100095)(6040450)(2401047)(5005006)(8121501046)(93006095)(93004095)(100000703101)(100105400095)(3002001)(10201501046)(6055026)(6041248)(20161123560025)(20161123564025)(20161123558100)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123562025)(20161123555025)(6072148)(201708071742011)(100000704101)(100105200095)(100000705101)(100105500095); SRVR:CY1PR02MB1335; BCL:0; PCL:0; RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095); SRVR:CY1PR02MB1335; X-Microsoft-Exchange-Diagnostics: 1; CY1PR02MB1335; 4:UVgm2rKxMFweryCEdZcEzHnphoLMc5uUiT30FErhDcAxXUhCoVeZmQh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/VP/rZFdBEeEPAy9F3Cn1CQdFvLITK7AsgSHYrDM6G92kMI7fBrVcoUs+T3tQXL+KmuJtwcX3iGAJ037dRqSCkEAPg9QTC7n8CktWL5yCcRT/DtMyr8VLr3QZXFrmP2U4DBC8CVNRpuQJ8mvz8fEFI1pks2R5/KU43yKyJKlkEFMReE= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: xilinx.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 19 Oct 2017 16:22:05.9486 (UTC) X-MS-Exchange-CrossTenant-Id: 657af505-d5df-48d0-8300-c31994686c5c X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=657af505-d5df-48d0-8300-c31994686c5c; Ip=[149.199.60.83]; Helo=[xsj-pvapsmtpgw01] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY1PR02MB1335 X-detected-operating-system: by eggs.gnu.org: Windows 7 or 8 [fuzzy] X-Received-From: 104.47.42.58 Subject: [Qemu-devel] [PATCH v3 37/46] hw/ssi: Replace fprintf(stderr, "*\n" with error_report() 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: alistair23@gmail.com, armbru@redhat.com, alistair.francis@xilinx.com Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" Replace a large number of the fprintf(stderr, "*\n" calls with error_report(). The functions were renamed with these commands and then compiler issues where manually fixed. find ./* -type f -exec sed -i \ 'N;N;N;N;N;N;N;N;N;N;N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2);|Ig}' \ {} + find ./* -type f -exec sed -i \ 'N;N;N;N;N;N;N;N;N;N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2);|Ig}' \ {} + find ./* -type f -exec sed -i \ 'N;N;N;N;N;N;N;N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2);|Ig}' \ {} + find ./* -type f -exec sed -i \ 'N;N;N;N;N;N;N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2);|Ig}' \ {} + find ./* -type f -exec sed -i \ 'N;N;N;N;N;N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2);|Ig}' \ {} + find ./* -type f -exec sed -i \ 'N;N;N;N;N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2);|Ig}' \ {} + find ./* -type f -exec sed -i \ 'N;N;N;N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2);|Ig}' \ {} + find ./* -type f -exec sed -i \ 'N;N;N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2);|Ig}' \ {} + find ./* -type f -exec sed -i \ 'N;N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2);|Ig}' \ {} + find ./* -type f -exec sed -i \ 'N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2);|Ig}' \ {} + find ./* -type f -exec sed -i \ 'N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2);|Ig}' \ {} + Some lines where then manually tweaked to pass checkpatch. Signed-off-by: Alistair Francis Reviewed-by: Philippe Mathieu-Daudé --- V2: - Split hw patch into individual directories hw/ssi/omap_spi.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/hw/ssi/omap_spi.c b/hw/ssi/omap_spi.c index 34163e5646..98242d1e8b 100644 --- a/hw/ssi/omap_spi.c +++ b/hw/ssi/omap_spi.c @@ -20,6 +20,7 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ #include "qemu/osdep.h" +#include "qemu/error-report.h" #include "hw/hw.h" #include "hw/arm/omap.h" @@ -295,9 +296,9 @@ static void omap_mcspi_write(void *opaque, hwaddr addr, if ((value ^ s->ch[ch].config) & (3 << 14)) /* DMAR | DMAW */ omap_mcspi_dmarequest_update(s->ch + ch); if (((value >> 12) & 3) == 3) /* TRM */ - fprintf(stderr, "%s: invalid TRM value (3)\n", __func__); + error_report("%s: invalid TRM value (3)", __func__); if (((value >> 7) & 0x1f) < 3) /* WL */ - fprintf(stderr, "%s: invalid WL value (%" PRIx64 ")\n", + error_report("%s: invalid WL value (%" PRIx64 ")", __func__, (value >> 7) & 0x1f); s->ch[ch].config = value & 0x7fffff; break; From patchwork Thu Oct 19 16:18:05 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Alistair Francis X-Patchwork-Id: 828237 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; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=xilinx.onmicrosoft.com header.i=@xilinx.onmicrosoft.com header.b="oHuxFmlV"; 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 3yHvwX2rbHz9s72 for ; Fri, 20 Oct 2017 03:47:08 +1100 (AEDT) Received: from localhost ([::1]:50198 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e5DyM-0001KV-Dp for incoming@patchwork.ozlabs.org; Thu, 19 Oct 2017 12:47:06 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:56157) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e5DaJ-00060V-KY for qemu-devel@nongnu.org; Thu, 19 Oct 2017 12:22:17 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1e5DaG-00029n-BH for qemu-devel@nongnu.org; Thu, 19 Oct 2017 12:22:15 -0400 Received: from mail-sn1nam01on0045.outbound.protection.outlook.com ([104.47.32.45]:5920 helo=NAM01-SN1-obe.outbound.protection.outlook.com) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1e5DaG-00029D-0j for qemu-devel@nongnu.org; Thu, 19 Oct 2017 12:22:12 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=xilinx.onmicrosoft.com; s=selector1-xilinx-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=8l+q5OJM722BgtdBFojxquDjjLY/IxiWEAKWKbMXB1U=; b=oHuxFmlVrTmpiEAGbIaYiSxsNCdxBkQDgsO2sIYiyJZhTC8V9tmrjm3wEcFcYNEf7cr9tA95A03zgKEpyWW4ZUJbHVqIxwyaruQ+nJbX4Iu9sla4qidbkdpsrkjm4F2HWJ0u/zWJbxOlOCZLx0jkmFp6GPd1pgVkO2YwXp3EvTQ= Received: from BN6PR02CA0041.namprd02.prod.outlook.com (10.173.146.155) by BY2PR02MB1330.namprd02.prod.outlook.com (10.162.79.25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.77.7; Thu, 19 Oct 2017 16:22:06 +0000 Received: from BL2NAM02FT048.eop-nam02.prod.protection.outlook.com (2a01:111:f400:7e46::209) by BN6PR02CA0041.outlook.office365.com (2603:10b6:404:5f::27) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.77.7 via Frontend Transport; Thu, 19 Oct 2017 16:22:06 +0000 Authentication-Results: spf=pass (sender IP is 149.199.60.83) smtp.mailfrom=xilinx.com; redhat.com; dkim=none (message not signed) header.d=none;redhat.com; dmarc=bestguesspass action=none header.from=xilinx.com; Received-SPF: Pass (protection.outlook.com: domain of xilinx.com designates 149.199.60.83 as permitted sender) receiver=protection.outlook.com; client-ip=149.199.60.83; helo=xsj-pvapsmtpgw01; Received: from xsj-pvapsmtpgw01 (149.199.60.83) by BL2NAM02FT048.mail.protection.outlook.com (10.152.76.109) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.20.77.10 via Frontend Transport; Thu, 19 Oct 2017 16:22:05 +0000 Received: from unknown-38-66.xilinx.com ([149.199.38.66] helo=xsj-pvapsmtp01) by xsj-pvapsmtpgw01 with esmtp (Exim 4.63) (envelope-from ) id 1e5Da9-00005X-03; Thu, 19 Oct 2017 09:22:05 -0700 Received: from [127.0.0.1] (helo=localhost) by xsj-pvapsmtp01 with smtp (Exim 4.63) (envelope-from ) id 1e5Da8-0003FY-SX; Thu, 19 Oct 2017 09:22:04 -0700 Received: from xsj-pvapsmtp01 (smtp3.xilinx.com [149.199.38.66]) by xsj-smtp-dlp1.xlnx.xilinx.com (8.13.8/8.13.1) with ESMTP id v9JGLwDo018168; Thu, 19 Oct 2017 09:21:58 -0700 Received: from [172.19.2.220] (helo=localhost.localdomain) by xsj-pvapsmtp01 with esmtp (Exim 4.63) (envelope-from ) id 1e5Da2-0003Bq-BR; Thu, 19 Oct 2017 09:21:58 -0700 From: Alistair Francis To: Date: Thu, 19 Oct 2017 09:18:05 -0700 Message-ID: X-Mailer: git-send-email 2.11.0 In-Reply-To: References: MIME-Version: 1.0 X-RCIS-Action: ALLOW X-TM-AS-Product-Ver: IMSS-7.1.0.1224-8.1.0.1062-23404.005 X-TM-AS-User-Approved-Sender: Yes;Yes X-EOPAttributedMessage: 0 X-MS-Office365-Filtering-HT: Tenant X-Forefront-Antispam-Report: CIP:149.199.60.83; IPV:NLI; CTRY:US; EFV:NLI; SFV:NSPM; SFS:(10009020)(6009001)(346002)(39860400002)(376002)(2980300002)(438002)(189002)(199003)(2950100002)(189998001)(5660300001)(81166006)(54906003)(8676002)(6916009)(8936002)(33646002)(118296001)(50226002)(478600001)(77096006)(106002)(81156014)(23676002)(356003)(5820100001)(36386004)(6306002)(2906002)(2351001)(305945005)(4326008)(316002)(63266004)(2870700001)(36756003)(50466002)(9786002)(76176999)(6666003)(47776003)(39060400002)(50986999)(106466001)(107986001); DIR:OUT; SFP:1101; SCL:1; SRVR:BY2PR02MB1330; H:xsj-pvapsmtpgw01; FPR:; SPF:Pass; PTR:unknown-60-83.xilinx.com; MX:1; A:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BL2NAM02FT048; 1:Ka9lSH9VUQ4ZrBJl+gNd8Y77WqOV8UXtt8S+O9/+qroAPEKGLhTZUSysCJ3Re9iUxf7J8DkaubP+SkfP8/Qhl7vcCvbCAhZ8bdNSkzIsxsl2VvfSYUC9zcNi7fflSUnD X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: c855fe75-950a-4462-c6ca-08d5170d89fb X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001)(2017030254152)(8251501002)(2017052603199)(201703131423075)(201703031133081)(201702281549075); SRVR:BY2PR02MB1330; X-Microsoft-Exchange-Diagnostics: 1; BY2PR02MB1330; 3:Myn9l049KDAAIrhRGcWvN0+9DwMe44pX/aKpTvh3usin1T4gbBF3rSEnXTg5lnjhP0HrK6+Do0AF0KlJw1zSEfYFwR9506hdSN/9wDXy9O9tKbr5fKgO4dfhumUNrUE8KSlKhfrP5V34QkqwZH1xWH69laLX5M/JrG46Onuz5y58PqMG8E7pSKO9Ob7bCPiXBdrvFqdPGtZUdX1ok2jx4i168my6r8ICwYOq1Qgk/2rVOBuzdfyOGnxyr5PrtvAhcsNbFNVQmgiZBhKiEDJkzk0jcCHgFveQ2Bl5kflTTiEQzJ7b9D5OMjRY+uXob/asmyoAKgDlda7TSs6uuzD0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t+QXPQNezmRiJV2glVMQtA8Xzr+l+bacRKAw96X2bZGQN471/dnId1dhDm2CkGmgnOW951Dh2AhFBcNJJKm9jOOEids40KV/lvV3NOX0tSe8+7gH4d+nQgodmPCgM X-Exchange-Antispam-Report-Test: UriScan:(250305191791016)(22074186197030)(788757137089)(192813158149592); X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(100000700101)(100105000095)(100000701101)(100105300095)(100000702101)(100105100095)(6040450)(2401047)(5005006)(8121501046)(10201501046)(3002001)(100000703101)(100105400095)(93006095)(93004095)(6055026)(6041248)(20161123558100)(20161123562025)(20161123560025)(20161123564025)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123555025)(6072148)(201708071742011)(100000704101)(100105200095)(100000705101)(100105500095); SRVR:BY2PR02MB1330; BCL:0; PCL:0; RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095); SRVR:BY2PR02MB1330; X-Microsoft-Exchange-Diagnostics: 1; BY2PR02MB1330; 4:KpkPcUl94Qxz5au//vtFBXvC/0lBMiSzgsYA+SJ8Pw5hctyodG94C85Ni6qUdCA/V2VSlrehCnRoyvj8yhXb+6pk1LsCotoqmpzirxoYG6gdYr+rqeXYklUrGfx6qaKD8Zh7Bx37LlvVjQVYSw00JQRpk+TONUteCgNixAp+R72rhBCPzxJY01Da2whwFxiszUZD9GNqB4SPFNGznHuOXxXzpwQGmoW+t6ZZeHm3+ZAkM1UzKzFItkQ7Jt0DMXfM+cmbiFwQdp4NkNT8r+yjTgM0Gdc7BH1mCnWzC6jzbIabH8rgRBA4MCu+mOfSc58LqwNiN7I5fsPvVOzgrSI2UEZPvYcd7WUu0JKnLftf6RSeD24ZQcwspNxQsZEs8iBzC44xSjouCTfkLLboyupkpQ== X-Forefront-PRVS: 0465429B7F X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; BY2PR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+9fbc5fmjDHYp X-Microsoft-Exchange-Diagnostics: 1; BY2PR02MB1330; 6:XoVbdrQPBk32G0YjPXV1VA6z1/TIMN3ciMDByAbHNfqlipzaC5wr30tLcZP3Arn/Zik9p0QNNNiwoV8i7jJIowAWvaM3z4lIDcS3ETx3wmS5cCgnCafLPsCqYinpFoRoXwOFC/ETBCARb4UsfruEdZhRaHnEsRu026ONYJvEMHXiApRCv8YM2B8MD/dSaAR95jhfIe44pFA2GRJ5W0iVCgBKZ0zPWm8bNQejhb6gDoWXsUTyZ/YyG+XlLaV7K+mppueWJzI3NXJRquPVOitxDwy+d1fPsXWOLEsxRdE1ZjLPw2hYbKgv4+mkCBvC7Z9fsdWtbWL/npMGw6lUqhkW7w==; 5:TV42g3elvaVRoJtE14G9aH5y6sCXPp1j/Q0GSO+BU0ZqKCe92dLJatx5h7L6S2Nv4VpklpiW8jCbfNYqBg2iN5PFCDf/mObyrdwf0F2FWe4qoB6GPB/9AqQJL6efZclUELTBxNDYe/HvyAQN5O02AA==; 24:d979dnlNa2ISnldsAe89DCG3HjaRmX0yvrZJhDH3V167djs8LsU1odVn6RjELSogcVmFTsTjEqdJEM6skwDBU+4tyNhvQnfX6PSSsUO4nvo=; 7:TtvHZs06F4+SR+SeIAJpdKVuLI8OiuuNGL69zsoB8n4AepGvSXU0yuDIA4+H2EJ8HKH0Ckf2hUUiuHAksbEUFfqfoOfBfYX80EYtX5dHIT04GUNuPMvPll9tBW2i75tMPIefSF+gw5M08uD7UazkcuxQ8xCjlUxYpZBPzTxuEtSTqpua24d7rfb2xrTD9JI1nGYSJ/CdQ2gAL+VYVYWPZpZIN2y371ijBo/YhkZqc/M= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: xilinx.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 19 Oct 2017 16:22:05.7285 (UTC) X-MS-Exchange-CrossTenant-Id: 657af505-d5df-48d0-8300-c31994686c5c X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=657af505-d5df-48d0-8300-c31994686c5c; Ip=[149.199.60.83]; Helo=[xsj-pvapsmtpgw01] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BY2PR02MB1330 X-detected-operating-system: by eggs.gnu.org: Windows 7 or 8 [fuzzy] X-Received-From: 104.47.32.45 Subject: [Qemu-devel] [PATCH v3 38/46] hw/timer: Replace fprintf(stderr, "*\n" with error_report() 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: alistair23@gmail.com, armbru@redhat.com, alistair.francis@xilinx.com Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" Replace a large number of the fprintf(stderr, "*\n" calls with error_report(). The functions were renamed with these commands and then compiler issues where manually fixed. find ./* -type f -exec sed -i \ 'N;N;N;N;N;N;N;N;N;N;N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2);|Ig}' \ {} + find ./* -type f -exec sed -i \ 'N;N;N;N;N;N;N;N;N;N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2);|Ig}' \ {} + find ./* -type f -exec sed -i \ 'N;N;N;N;N;N;N;N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2);|Ig}' \ {} + find ./* -type f -exec sed -i \ 'N;N;N;N;N;N;N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2);|Ig}' \ {} + find ./* -type f -exec sed -i \ 'N;N;N;N;N;N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2);|Ig}' \ {} + find ./* -type f -exec sed -i \ 'N;N;N;N;N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2);|Ig}' \ {} + find ./* -type f -exec sed -i \ 'N;N;N;N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2);|Ig}' \ {} + find ./* -type f -exec sed -i \ 'N;N;N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2);|Ig}' \ {} + find ./* -type f -exec sed -i \ 'N;N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2);|Ig}' \ {} + find ./* -type f -exec sed -i \ 'N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2);|Ig}' \ {} + find ./* -type f -exec sed -i \ 'N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2);|Ig}' \ {} + Some lines where then manually tweaked to pass checkpatch. Signed-off-by: Alistair Francis Reviewed-by: Philippe Mathieu-Daudé --- V2: - Split hw patch into individual directories hw/timer/omap_gptimer.c | 11 ++++++----- hw/timer/twl92230.c | 2 +- hw/timer/xilinx_timer.c | 8 ++++---- 3 files changed, 11 insertions(+), 10 deletions(-) diff --git a/hw/timer/omap_gptimer.c b/hw/timer/omap_gptimer.c index ae2dc99832..0f064241d3 100644 --- a/hw/timer/omap_gptimer.c +++ b/hw/timer/omap_gptimer.c @@ -18,6 +18,7 @@ * with this program; if not, see . */ #include "qemu/osdep.h" +#include "qemu/error-report.h" #include "hw/hw.h" #include "qemu/timer.h" #include "hw/arm/omap.h" @@ -356,7 +357,7 @@ static void omap_gp_timer_write(void *opaque, hwaddr addr, case 0x10: /* TIOCP_CFG */ s->config = value & 0x33d; if (((value >> 3) & 3) == 3) /* IDLEMODE */ - fprintf(stderr, "%s: illegal IDLEMODE value in TIOCP_CFG\n", + error_report("%s: illegal IDLEMODE value in TIOCP_CFG", __func__); if (value & 2) /* SOFTRESET */ omap_gp_timer_reset(s); @@ -394,11 +395,11 @@ static void omap_gp_timer_write(void *opaque, hwaddr addr, s->ar = (value >> 1) & 1; s->st = (value >> 0) & 1; if (s->inout && s->trigger != gpt_trigger_none) - fprintf(stderr, "%s: GP timer pin must be an output " - "for this trigger mode\n", __func__); + error_report("%s: GP timer pin must be an output " + "for this trigger mode", __func__); if (!s->inout && s->capture != gpt_capture_none) - fprintf(stderr, "%s: GP timer pin must be an input " - "for this capture mode\n", __func__); + error_report("%s: GP timer pin must be an input " + "for this capture mode", __func__); if (s->trigger == gpt_trigger_none) omap_gp_timer_out(s, s->scpwm); /* TODO: make sure this doesn't overflow 32-bits */ diff --git a/hw/timer/twl92230.c b/hw/timer/twl92230.c index ef116c636c..18880884c6 100644 --- a/hw/timer/twl92230.c +++ b/hw/timer/twl92230.c @@ -614,7 +614,7 @@ static void menelaus_write(void *opaque, uint8_t addr, uint8_t value) break; rtc_badness: default: - fprintf(stderr, "%s: bad RTC_UPDATE value %02x\n", + error_report("%s: bad RTC_UPDATE value %02x", __func__, value); s->status |= 1 << 10; /* RTCERR */ menelaus_update(s); diff --git a/hw/timer/xilinx_timer.c b/hw/timer/xilinx_timer.c index 59439c05be..a80bba846b 100644 --- a/hw/timer/xilinx_timer.c +++ b/hw/timer/xilinx_timer.c @@ -127,7 +127,7 @@ timer_read(void *opaque, hwaddr addr, unsigned int size) break; } - D(fprintf(stderr, "%s timer=%d %x=%x\n", __func__, timer, addr * 4, r)); + D(error_report("%s timer=%d %x=%x", __func__, timer, addr * 4, r)); return r; } @@ -135,7 +135,7 @@ static void timer_enable(struct xlx_timer *xt) { uint64_t count; - D(fprintf(stderr, "%s timer=%d down=%d\n", __func__, + D(error_report("%s timer=%d down=%d", __func__, xt->nr, xt->regs[R_TCSR] & TCSR_UDT)); ptimer_stop(xt->ptimer); @@ -160,7 +160,7 @@ timer_write(void *opaque, hwaddr addr, addr >>= 2; timer = timer_from_addr(addr); xt = &t->timers[timer]; - D(fprintf(stderr, "%s addr=%x val=%x (timer=%d off=%d)\n", + D(error_report("%s addr=%x val=%x (timer=%d off=%d)", __func__, addr * 4, value, timer, addr & 3)); /* Further decoding to address a specific timers reg. */ addr &= 3; @@ -197,7 +197,7 @@ static void timer_hit(void *opaque) { struct xlx_timer *xt = opaque; struct timerblock *t = xt->parent; - D(fprintf(stderr, "%s %d\n", __func__, xt->nr)); + D(error_report("%s %d", __func__, xt->nr)); xt->regs[R_TCSR] |= TCSR_TINT; if (xt->regs[R_TCSR] & TCSR_ARHT) From patchwork Thu Oct 19 16:18:08 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alistair Francis X-Patchwork-Id: 828260 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; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=xilinx.onmicrosoft.com header.i=@xilinx.onmicrosoft.com header.b="ab1iv7E5"; 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 3yHw9h1gJSz9tX4 for ; Fri, 20 Oct 2017 03:58:32 +1100 (AEDT) Received: from localhost ([::1]:50260 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e5E9O-0003TE-9J for incoming@patchwork.ozlabs.org; Thu, 19 Oct 2017 12:58:30 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:56224) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e5DaT-00068F-KL for qemu-devel@nongnu.org; Thu, 19 Oct 2017 12:22:28 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1e5DaP-0002EK-NT for qemu-devel@nongnu.org; Thu, 19 Oct 2017 12:22:25 -0400 Received: from mail-cys01nam02on0056.outbound.protection.outlook.com ([104.47.37.56]:25883 helo=NAM02-CY1-obe.outbound.protection.outlook.com) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1e5DaP-0002Db-BG for qemu-devel@nongnu.org; Thu, 19 Oct 2017 12:22:21 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=xilinx.onmicrosoft.com; s=selector1-xilinx-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=aM0LYe3oP+Pw+2HiQcI/COLLCN7fdqHjJqDjyYbbgc8=; b=ab1iv7E5JJKJatp/d+u7K/DT46++NcSQ+NvxcdGaCKxpUqFSiCQwVqTXzFV2CMzKmfDdTVpe01w2VwQP3ws6jzq5HBHV3Jp+zjMe9VTUkwB1FWBOQyolF6usyMhVxofiaKjCGPzgUJsbxnjT3Spd5b/G1koliNutQkOJbJN3LrQ= Received: from BY2PR02CA0122.namprd02.prod.outlook.com (10.163.44.176) by MWHPR02MB3280.namprd02.prod.outlook.com (10.164.187.140) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.156.4; Thu, 19 Oct 2017 16:22:17 +0000 Received: from SN1NAM02FT033.eop-nam02.prod.protection.outlook.com (2a01:111:f400:7e44::200) by BY2PR02CA0122.outlook.office365.com (2a01:111:e400:5261::48) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.77.7 via Frontend Transport; Thu, 19 Oct 2017 16:22:16 +0000 Received-SPF: Pass (protection.outlook.com: domain of xilinx.com designates 149.199.60.83 as permitted sender) receiver=protection.outlook.com; client-ip=149.199.60.83; helo=xsj-pvapsmtpgw01; Received: from xsj-pvapsmtpgw01 (149.199.60.83) by SN1NAM02FT033.mail.protection.outlook.com (10.152.72.133) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.20.77.10 via Frontend Transport; Thu, 19 Oct 2017 16:22:16 +0000 Received: from unknown-38-66.xilinx.com ([149.199.38.66] helo=xsj-pvapsmtp01) by xsj-pvapsmtpgw01 with esmtp (Exim 4.63) (envelope-from ) id 1e5DaJ-00006X-F4; Thu, 19 Oct 2017 09:22:15 -0700 Received: from [127.0.0.1] (helo=localhost) by xsj-pvapsmtp01 with smtp (Exim 4.63) (envelope-from ) id 1e5DaJ-0003J5-CC; Thu, 19 Oct 2017 09:22:15 -0700 Received: from xsj-pvapsmtp01 (mailhost.xilinx.com [149.199.38.66]) by xsj-smtp-dlp1.xlnx.xilinx.com (8.13.8/8.13.1) with ESMTP id v9JGM1iE018274; Thu, 19 Oct 2017 09:22:01 -0700 Received: from [172.19.2.220] (helo=localhost.localdomain) by xsj-pvapsmtp01 with esmtp (Exim 4.63) (envelope-from ) id 1e5Da5-0003EY-Gh; Thu, 19 Oct 2017 09:22:01 -0700 From: Alistair Francis To: Date: Thu, 19 Oct 2017 09:18:08 -0700 Message-ID: <9721c76be2faed85b0516b2e4184ab17e4690570.1508390588.git.alistair.francis@xilinx.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: References: X-RCIS-Action: ALLOW X-TM-AS-Product-Ver: IMSS-7.1.0.1224-8.1.0.1062-23404.005 X-TM-AS-User-Approved-Sender: Yes;Yes X-EOPAttributedMessage: 0 X-MS-Office365-Filtering-HT: Tenant X-Forefront-Antispam-Report: CIP:149.199.60.83; IPV:NLI; CTRY:US; EFV:NLI; SFV:NSPM; SFS:(10009020)(6009001)(39860400002)(346002)(376002)(2980300002)(438002)(189002)(199003)(2906002)(77096006)(305945005)(189998001)(81166006)(81156014)(8676002)(575784001)(4326008)(5003940100001)(39060400002)(106002)(36386004)(50466002)(8936002)(9786002)(2950100002)(6916009)(48376002)(50226002)(106466001)(551934003)(16586007)(2351001)(5660300001)(54906003)(63266004)(118296001)(356003)(76176999)(50986999)(47776003)(36756003)(33646002)(316002)(478600001)(6306002)(107986001); DIR:OUT; SFP:1101; SCL:1; SRVR:MWHPR02MB3280; H:xsj-pvapsmtpgw01; FPR:; SPF:Pass; PTR:unknown-60-83.xilinx.com; MX:1; A:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; SN1NAM02FT033; 1:O7SIINNgsyfBDsTuQZPHnUtDx0CMziLmUouUX4kte6FfcnGQXWMkBuR0721DbVZEqAqQuNjcO47fB1WjHI6ZHKeeCMRkG24jXpm0hCJmCO5JKFMDcYKtSr9hBKHMHhLh MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 782d845b-7388-4261-7853-08d5170d9071 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001)(2017030254169)(8251501002)(4534017)(4602075)(4627075)(201703031133081)(201702281549075)(2017052603229)(201703131423092); SRVR:MWHPR02MB3280; X-Microsoft-Exchange-Diagnostics: 1; MWHPR02MB3280; 3:eeqbbOYJe8x30jexOREasVzE8xsqqsvbXnnUsdOs9JuU/jwpf+2H8o8StIq9ufC+UmfrSGfSLeI3f5b0jBXzk6TKgcalzmfAbd3nHjfng8UseisQwA+sOx4FkgpEFAJElP9xlfFA8YhgKLfmvRDzhs2Z0Mtpkt7XdEk6xesHMWJuWZgQrcffqO4rp6a+p3xeugx0ZyjuERplgFe5fB8T5vC1h0IwNokSDxwusWHa6Kht004q4axYfDPDLbwlxC38VNG9tBb95Qu8fwuZNTKYbFj2AfuWOBVNTbE3pjgsQ1HGhpQDEChMOp70Rqlnp+AMqCMAc75e4+3ttKONrgutvcWiOyNK9bQr0nleav8ItZ8=; 25:o+HUL4IERi331QS0Bztf/Ab8c4naKpyiqh91KRsz9DoA7eSznbF4BeDZEdBBczi1E4bh4c+BmJTdXKUEBIJU1dIWW93i7gnCkR5dumOtJLIDpKfVxU5Raw4k+7NVExAPbwbORkG4pJNJw7W5tIfl7CAIbvctdqV4In0CkbMnxMoRuaDRA8p0PJ1xgRGx7daOHPo5KxYU8p/MD2EwH7tfcqE4n7EecykIp6GtPNLDhdNIr1iAEYuA3IJBk411+3APn7d4ly9DpzGBBPm65RGQ/vvp2uL/PTtT20UFY18RSgmnFqsQ5QqbYmTFHhSPyn1f+M1wDCl7/3TiOSzY6s0CHg== X-MS-TrafficTypeDiagnostic: MWHPR02MB3280: X-Microsoft-Exchange-Diagnostics: 1; MWHPR02MB3280; 31:s2OCQ4mLNPxg4/y0SEmfAt4srUptECUAwqTQbKn08IV3E05G1wvTF9M2nywkv4ELbtMNcCyxKT6Kn+YghPbCwuAYB8FP0ANA/MJA9YH8M1SDdt9Gu7A43ybilKcVE/Jz8fRScclCX8Ym0/9+ovp/Ih76RAcvRjlcsWXHlPE3ZoF2uFyszbYUukloJaukbOkTRVKUmX/jcl2e9rwEI7tVkRYqa5gZ0p8WWOxBjXc1nMc=; 20:xiA4VkZ8rHJC2lGLmmVoXw9DOm+Lg7ra0KynaycKOQZEATMaF/1DwXaDBGnQioRgiTkMq2Q9jMIzExa5Rp5basgcW/mGITvms1nwbAaUf9inC58aMLYoDYreLr19V3P2vJFDswIu9DX/JTqpWqzHUbcKaXqBiMgfipr+wGYUqOO7xg97NFvPU7a53dd0BJUtZiJ/MeWuaNzMhKAPcXwHwPVHqLWUrCFOSC29VuzK9SgYTs/PwkHAB3I5LtMmapG1T+MJT3G+5PowUXPqeFKrtMg5jqN2LHxVP3+kIsH/fFhtDWS2mS/VeV6qp1N/nzpxZc11ISrVoG0clIkcKFqLSB0RZgUoMTCy0cPbUR/zSxMHyHrNUH4GgT5HFBQRyz1kS9yJlLX7IBfeKuOQkZD59zU+KloIu3YjX60I5xPZESno08NkYITuc6/BDKwxjdHY+2+s+p5UhuyWIxW9F3CKKsbcXX+i9POP+Zu8QME2jik+W1VBE26sYNZex03bcLJj X-Exchange-Antispam-Report-Test: UriScan:(250305191791016)(72170088055959)(22074186197030)(788757137089)(192813158149592); X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(100000700101)(100105000095)(100000701101)(100105300095)(100000702101)(100105100095)(6040450)(2401047)(8121501046)(5005006)(93006095)(93004095)(10201501046)(100000703101)(100105400095)(3002001)(6055026)(6041248)(20161123558100)(20161123564025)(20161123562025)(20161123555025)(20161123560025)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(6072148)(201708071742011)(100000704101)(100105200095)(100000705101)(100105500095); SRVR:MWHPR02MB3280; BCL:0; PCL:0; RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095); SRVR:MWHPR02MB3280; X-Microsoft-Exchange-Diagnostics: 1; MWHPR02MB3280; 4:xTRk8gPYov/ra7v8X1Ajy4UnA4ukuWfyq0ACi1KMOcWJoBCTEBAJr3cRphuBiz1nqJVyUqtWVQ66iePbHZtcEW+wE3fZoeblYitoiKF+EvHcvj5HB9dq5wOqrVHobeuaBOkXt/DqZa0Xzym8q5pcE6N5Ujf9dhCj/pa39Bt3eZe+IzoktWCewXvNgzzNNpiuhAyKCEFMriDUh8WpxKUYqT5tlKJfBDHxZOo3hS7Rjr8YgaYyb1u8g2fcl4wia2iy/nD7A174N2ClUpCet2pVGaYS/sxXvJ3BM51KW8ZNQZrglzpl67Z1HASovI5ZefrvXJYku75bBHYqU8gQpbYPjDCDA5q6oablk0WPW6FpCydY+lZf/iibq9JOX6XFw3ae7V1BFIIaWHuQPwk9uurFWD9BUAMsf3Wex3+GEfC+E2c= X-Forefront-PRVS: 0465429B7F X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; MWHPR02MB3280; 23:XfFp4gR4VpXBwTie105MUAMObnr4ecMAoPb5MRyEB?= Ts/IO3lwz0eW/7ZlgcmMn/6Fv1YclKVc7jp1MZ0yhSuUZXD+muQt3r3VnjeJgew/p1eS82SKnj84VI3fn7hVbC9/uj3MTVlWJBURM8gHyXs1trj/LyVP5xiDkyFpamkL3N97ZOhy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9BSCxsPoAUg7Y1OZHw5pJ3l1g1H9Tf8vi19Z9dCjK5e0G5zU+VU3I5CBqH4Nfs+tORvdWTMNBQmdFn1S6Ouvpg9EYvHVxCWfYBE8IgvZs/NCJ24a4iz6sFfoi3fNuBii8I675ly60PIVKjKEanoByGB0KzM1nbB0jZOL5IGr8OlgXPl3q0Kd1J6eMIDNF3L6xWCQ/A9/u10FbwwWrx4Rkiirq0Ijb9dZEQ==; 5:8ePSDQhEVKstMERSTAWSIICX6mnU2uieqPVHgw5v2U8X9+UldnAHf2le2E7q0Vmpnbds7tJx0+HXRWwiDvXZoz0IlvTa8uWuniwk82DxK7lhqUjawscbfSpUokea0ycwwp809DuwTjqywmQyA5cMUw==; 24:yS4y2YRD+o6W/w8r/8JKeEPO1wwfZQeOXUP1L35PUlJtE+Al0KaXHcvtV9jd+mo84ATEwYFwX6CM8AF2hKMfiU/rKVXHNN4WpDOpocDN3VQ=; 7:YxJifjU9gnch/nFHPp7fmFwGK41AC1seY/c4gtRAXLxfXtDX9JIc9Dgr9VaSF9odMxkKLpGQJhDWY1Vhy3uVO8qAxO8GBjuXLNBXMIkXsXqHWKIcKwqRD0v/2klh2rj5EqxKpTrwnStnEvWPgZsmcBYFVgZXomG6X/F165QiVsR6/OaC3wRVBvugPLx57hk0O2XiYZ3BAvUhTWiQSZmPIcl7iNq8YA4p3fwyuAp3G5o= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: xilinx.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 19 Oct 2017 16:22:16.4724 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 782d845b-7388-4261-7853-08d5170d9071 X-MS-Exchange-CrossTenant-Id: 657af505-d5df-48d0-8300-c31994686c5c X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=657af505-d5df-48d0-8300-c31994686c5c; Ip=[149.199.60.83]; Helo=[xsj-pvapsmtpgw01] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: MWHPR02MB3280 X-detected-operating-system: by eggs.gnu.org: Windows 7 or 8 [fuzzy] X-Received-From: 104.47.37.56 Subject: [Qemu-devel] [PATCH v3 39/46] hw/usb: Replace fprintf(stderr, "*\n" with error_report() 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: alistair23@gmail.com, Gerd Hoffmann , armbru@redhat.com, alistair.francis@xilinx.com Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" Replace a large number of the fprintf(stderr, "*\n" calls with error_report(). The functions were renamed with these commands and then compiler issues where manually fixed. find ./* -type f -exec sed -i \ 'N;N;N;N;N;N;N;N;N;N;N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2);|Ig}' \ {} + find ./* -type f -exec sed -i \ 'N;N;N;N;N;N;N;N;N;N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2);|Ig}' \ {} + find ./* -type f -exec sed -i \ 'N;N;N;N;N;N;N;N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2);|Ig}' \ {} + find ./* -type f -exec sed -i \ 'N;N;N;N;N;N;N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2);|Ig}' \ {} + find ./* -type f -exec sed -i \ 'N;N;N;N;N;N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2);|Ig}' \ {} + find ./* -type f -exec sed -i \ 'N;N;N;N;N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2);|Ig}' \ {} + find ./* -type f -exec sed -i \ 'N;N;N;N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2);|Ig}' \ {} + find ./* -type f -exec sed -i \ 'N;N;N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2);|Ig}' \ {} + find ./* -type f -exec sed -i \ 'N;N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2);|Ig}' \ {} + find ./* -type f -exec sed -i \ 'N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2);|Ig}' \ {} + find ./* -type f -exec sed -i \ 'N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2);|Ig}' \ {} + Some lines where then manually tweaked to pass checkpatch. The debug prints in usb_net_handle_control() where reverted to use fprintf(stderr, and usb_mtp_cancel_packet() now uses g_assert_not_reached(). Signed-off-by: Alistair Francis Cc: Gerd Hoffmann --- V3: - Use g_assert_not_reached() in usb_mtp_cancel_packet() - Leave the fprintf(stderr in usb_net_handle_control() V2: - Split hw patch into individual directories hw/usb/core.c | 15 ++++++++------- hw/usb/desc.c | 6 +++--- hw/usb/dev-audio.c | 39 ++++++++++++++++++++------------------- hw/usb/dev-bluetooth.c | 4 ++-- hw/usb/dev-mtp.c | 9 +++++---- hw/usb/dev-network.c | 14 +++++++------- hw/usb/hcd-ehci.c | 32 ++++++++++++++++---------------- hw/usb/hcd-musb.c | 4 ++-- hw/usb/hcd-xhci.c | 3 ++- hw/usb/host-legacy.c | 3 ++- 10 files changed, 67 insertions(+), 62 deletions(-) diff --git a/hw/usb/core.c b/hw/usb/core.c index 241ae66b15..9ffdef055c 100644 --- a/hw/usb/core.c +++ b/hw/usb/core.c @@ -24,6 +24,7 @@ * THE SOFTWARE. */ #include "qemu/osdep.h" +#include "qemu/error-report.h" #include "qemu-common.h" #include "hw/usb.h" #include "qemu/iov.h" @@ -599,7 +600,7 @@ void usb_packet_copy(USBPacket *p, void *ptr, size_t bytes) iov_from_buf(iov->iov, iov->niov, p->actual_length, ptr, bytes); break; default: - fprintf(stderr, "%s: invalid pid: %x\n", __func__, p->pid); + error_report("%s: invalid pid: %x", __func__, p->pid); abort(); } p->actual_length += bytes; @@ -681,7 +682,7 @@ void usb_ep_dump(USBDevice *dev) }; int ifnum, ep, first; - fprintf(stderr, "Device \"%s\", config %d\n", + error_report("Device \"%s\", config %d", dev->product_desc, dev->configuration); for (ifnum = 0; ifnum < 16; ifnum++) { first = 1; @@ -690,10 +691,10 @@ void usb_ep_dump(USBDevice *dev) dev->ep_in[ep].ifnum == ifnum) { if (first) { first = 0; - fprintf(stderr, " Interface %d, alternative %d\n", + error_report(" Interface %d, alternative %d", ifnum, dev->altsetting[ifnum]); } - fprintf(stderr, " Endpoint %d, IN, %s, %d max\n", ep, + error_report(" Endpoint %d, IN, %s, %d max", ep, tname[dev->ep_in[ep].type], dev->ep_in[ep].max_packet_size); } @@ -701,16 +702,16 @@ void usb_ep_dump(USBDevice *dev) dev->ep_out[ep].ifnum == ifnum) { if (first) { first = 0; - fprintf(stderr, " Interface %d, alternative %d\n", + error_report(" Interface %d, alternative %d", ifnum, dev->altsetting[ifnum]); } - fprintf(stderr, " Endpoint %d, OUT, %s, %d max\n", ep, + error_report(" Endpoint %d, OUT, %s, %d max", ep, tname[dev->ep_out[ep].type], dev->ep_out[ep].max_packet_size); } } } - fprintf(stderr, "--\n"); + error_report("--"); } struct USBEndpoint *usb_ep_get(USBDevice *dev, int pid, int ep) diff --git a/hw/usb/desc.c b/hw/usb/desc.c index 85c15addc5..bde39e3903 100644 --- a/hw/usb/desc.c +++ b/hw/usb/desc.c @@ -1,5 +1,5 @@ #include "qemu/osdep.h" - +#include "qemu/error-report.h" #include "hw/usb.h" #include "hw/usb/desc.h" #include "trace.h" @@ -688,8 +688,8 @@ int usb_desc_get_descriptor(USBDevice *dev, USBPacket *p, break; default: - fprintf(stderr, "%s: %d unknown type %d (len %zd)\n", __func__, - dev->addr, type, len); + error_report("%s: %d unknown type %d (len %zd)", __func__, + dev->addr, type, len); break; } diff --git a/hw/usb/dev-audio.c b/hw/usb/dev-audio.c index 343345235c..a95e4cdbd9 100644 --- a/hw/usb/dev-audio.c +++ b/hw/usb/dev-audio.c @@ -30,6 +30,7 @@ */ #include "qemu/osdep.h" +#include "qemu/error-report.h" #include "qemu-common.h" #include "hw/usb.h" #include "hw/usb/desc.h" @@ -398,7 +399,7 @@ static int usb_audio_set_output_altset(USBAudioState *s, int altset) } if (s->debug) { - fprintf(stderr, "usb-audio: set interface %d\n", altset); + error_report("usb-audio: set interface %d", altset); } s->out.altset = altset; return 0; @@ -478,7 +479,7 @@ static int usb_audio_set_control(USBAudioState *s, uint8_t attrib, uint16_t vol = data[0] + (data[1] << 8); if (s->debug) { - fprintf(stderr, "usb-audio: vol %04x\n", (uint16_t)vol); + error_report("usb-audio: vol %04x", (uint16_t)vol); } vol -= 0x8000; @@ -496,8 +497,8 @@ static int usb_audio_set_control(USBAudioState *s, uint8_t attrib, if (set_vol) { if (s->debug) { - fprintf(stderr, "usb-audio: mute %d, lvol %3d, rvol %3d\n", - s->out.mute, s->out.vol[0], s->out.vol[1]); + error_report("usb-audio: mute %d, lvol %3d, rvol %3d", + s->out.mute, s->out.vol[0], s->out.vol[1]); } AUD_set_volume_out(s->out.voice, s->out.mute, s->out.vol[0], s->out.vol[1]); @@ -514,9 +515,9 @@ static void usb_audio_handle_control(USBDevice *dev, USBPacket *p, int ret = 0; if (s->debug) { - fprintf(stderr, "usb-audio: control transaction: " - "request 0x%04x value 0x%04x index 0x%04x length 0x%04x\n", - request, value, index, length); + error_report("usb-audio: control transaction: " + "request 0x%04x value 0x%04x index 0x%04x length 0x%04x", + request, value, index, length); } ret = usb_desc_handle_control(dev, p, request, value, index, length, data); @@ -533,7 +534,7 @@ static void usb_audio_handle_control(USBDevice *dev, USBPacket *p, length, data); if (ret < 0) { if (s->debug) { - fprintf(stderr, "usb-audio: fail: get control\n"); + error_report("usb-audio: fail: get control"); } goto fail; } @@ -548,7 +549,7 @@ static void usb_audio_handle_control(USBDevice *dev, USBPacket *p, length, data); if (ret < 0) { if (s->debug) { - fprintf(stderr, "usb-audio: fail: set control\n"); + error_report("usb-audio: fail: set control"); } goto fail; } @@ -557,9 +558,9 @@ static void usb_audio_handle_control(USBDevice *dev, USBPacket *p, default: fail: if (s->debug) { - fprintf(stderr, "usb-audio: failed control transaction: " - "request 0x%04x value 0x%04x index 0x%04x length 0x%04x\n", - request, value, index, length); + error_report("usb-audio: failed control transaction: " + "request 0x%04x value 0x%04x index 0x%04x length 0x%04x", + request, value, index, length); } p->status = USB_RET_STALL; break; @@ -581,7 +582,7 @@ static void usb_audio_handle_reset(USBDevice *dev) USBAudioState *s = USB_AUDIO(dev); if (s->debug) { - fprintf(stderr, "usb-audio: reset\n"); + error_report("usb-audio: reset"); } usb_audio_set_output_altset(s, ALTSET_OFF); } @@ -595,8 +596,8 @@ static void usb_audio_handle_dataout(USBAudioState *s, USBPacket *p) streambuf_put(&s->out.buf, p); if (p->actual_length < p->iov.size && s->debug > 1) { - fprintf(stderr, "usb-audio: output overrun (%zd bytes)\n", - p->iov.size - p->actual_length); + error_report("usb-audio: output overrun (%zd bytes)", + p->iov.size - p->actual_length); } } @@ -611,9 +612,9 @@ static void usb_audio_handle_data(USBDevice *dev, USBPacket *p) p->status = USB_RET_STALL; if (s->debug) { - fprintf(stderr, "usb-audio: failed data transaction: " - "pid 0x%x ep 0x%x len 0x%zx\n", - p->pid, p->ep->nr, p->iov.size); + error_report("usb-audio: failed data transaction: " + "pid 0x%x ep 0x%x len 0x%zx", + p->pid, p->ep->nr, p->iov.size); } } @@ -622,7 +623,7 @@ static void usb_audio_unrealize(USBDevice *dev, Error **errp) USBAudioState *s = USB_AUDIO(dev); if (s->debug) { - fprintf(stderr, "usb-audio: destroy\n"); + error_report("usb-audio: destroy"); } usb_audio_set_output_altset(s, ALTSET_OFF); diff --git a/hw/usb/dev-bluetooth.c b/hw/usb/dev-bluetooth.c index 0bbceaea0b..dfef258dca 100644 --- a/hw/usb/dev-bluetooth.c +++ b/hw/usb/dev-bluetooth.c @@ -274,13 +274,13 @@ static void usb_bt_fifo_enqueue(struct usb_hci_in_fifo_s *fifo, if (off <= DFIFO_LEN_MASK) { if (off + len > DFIFO_LEN_MASK + 1 && (fifo->dsize = off + len) > (DFIFO_LEN_MASK + 1) * 2) { - fprintf(stderr, "%s: can't alloc %i bytes\n", __func__, len); + error_report("%s: can't alloc %i bytes", __func__, len); exit(-1); } buf = fifo->data + off; } else { if (fifo->dlen > fifo->dsize) { - fprintf(stderr, "%s: can't alloc %i bytes\n", __func__, len); + error_report("%s: can't alloc %i bytes", __func__, len); exit(-1); } buf = fifo->data + off - fifo->dsize; diff --git a/hw/usb/dev-mtp.c b/hw/usb/dev-mtp.c index 94c2e94f10..69e2eac259 100644 --- a/hw/usb/dev-mtp.c +++ b/hw/usb/dev-mtp.c @@ -10,6 +10,7 @@ */ #include "qemu/osdep.h" +#include "qemu/error-report.h" #include "qapi/error.h" #include #include @@ -546,7 +547,7 @@ static void inotify_watchfn(void *arg) break; default: - fprintf(stderr, "usb-mtp: failed to parse inotify event\n"); + error_report("usb-mtp: failed to parse inotify event"); continue; } @@ -617,7 +618,7 @@ static void usb_mtp_object_readdir(MTPState *s, MTPObject *o) #ifdef CONFIG_INOTIFY1 int watchfd = usb_mtp_add_watch(s->inotifyfd, o->path); if (watchfd == -1) { - fprintf(stderr, "usb-mtp: failed to add watch for %s\n", o->path); + error_report("usb-mtp: failed to add watch for %s", o->path); } else { trace_usb_mtp_inotify_event(s->dev.addr, o->path, 0, "Watch Added"); @@ -1144,7 +1145,7 @@ static void usb_mtp_command(MTPState *s, MTPControl *c) usb_mtp_object_alloc(s, s->next_handle++, NULL, s->root); #ifdef CONFIG_INOTIFY1 if (usb_mtp_inotify_init(s)) { - fprintf(stderr, "usb-mtp: file monitoring init failed\n"); + error_report("usb-mtp: file monitoring init failed"); } #endif break; @@ -1348,7 +1349,7 @@ static void usb_mtp_handle_control(USBDevice *dev, USBPacket *p, static void usb_mtp_cancel_packet(USBDevice *dev, USBPacket *p) { /* we don't use async packets, so this should never be called */ - fprintf(stderr, "%s\n", __func__); + g_assert_not_reached(); } static void usb_mtp_handle_data(USBDevice *dev, USBPacket *p) diff --git a/hw/usb/dev-network.c b/hw/usb/dev-network.c index 85fc81bf43..7245182467 100644 --- a/hw/usb/dev-network.c +++ b/hw/usb/dev-network.c @@ -815,7 +815,7 @@ static int ndis_query(USBNetState *s, uint32_t oid, return sizeof(le32); default: - fprintf(stderr, "usbnet: unknown OID 0x%08x\n", oid); + error_report("usbnet: unknown OID 0x%08x", oid); return 0; } return -1; @@ -1120,9 +1120,9 @@ static void usb_net_handle_control(USBDevice *dev, USBPacket *p, default: fail: - fprintf(stderr, "usbnet: failed control transaction: " - "request 0x%x value 0x%x index 0x%x length 0x%x\n", - request, value, index, length); + error_report("usbnet: failed control transaction: " + "request 0x%x value 0x%x index 0x%x length 0x%x", + request, value, index, length); p->status = USB_RET_STALL; break; } @@ -1190,7 +1190,7 @@ static void usb_net_handle_dataout(USBNetState *s, USBPacket *p) uint32_t len; #ifdef TRAFFIC_DEBUG - fprintf(stderr, "usbnet: data out len %zu\n", p->iov.size); + error_report("usbnet: data out len %zu", p->iov.size); iov_hexdump(p->iov.iov, p->iov.niov, stderr, "usbnet", p->iov.size); #endif @@ -1260,8 +1260,8 @@ static void usb_net_handle_data(USBDevice *dev, USBPacket *p) } if (p->status == USB_RET_STALL) { - fprintf(stderr, "usbnet: failed data transaction: " - "pid 0x%x ep 0x%x len 0x%zx\n", + error_report("usbnet: failed data transaction: " + "pid 0x%x ep 0x%x len 0x%zx", p->pid, p->ep->nr, p->iov.size); } } diff --git a/hw/usb/hcd-ehci.c b/hw/usb/hcd-ehci.c index 0134232627..e405b882fb 100644 --- a/hw/usb/hcd-ehci.c +++ b/hw/usb/hcd-ehci.c @@ -419,7 +419,7 @@ static int ehci_get_pid(EHCIqtd *qtd) case 2: return USB_TOKEN_SETUP; default: - fprintf(stderr, "bad token\n"); + error_report("bad token"); return 0; } } @@ -1033,7 +1033,7 @@ static void ehci_opreg_write(void *ptr, hwaddr addr, /* not supporting dynamic frame list size at the moment */ if ((val & USBCMD_FLS) && !(s->usbcmd & USBCMD_FLS)) { - fprintf(stderr, "attempt to set frame list size -- value %d\n", + error_report("attempt to set frame list size -- value %d", (int)val & USBCMD_FLS); val &= ~USBCMD_FLS; } @@ -1190,7 +1190,7 @@ static int ehci_init_transfer(EHCIPacket *p) while (bytes > 0) { if (cpage > 4) { - fprintf(stderr, "cpage out of range (%d)\n", cpage); + error_report("cpage out of range (%d)", cpage); qemu_sglist_destroy(&p->sgl); return -1; } @@ -1296,7 +1296,7 @@ static void ehci_execute_complete(EHCIQueue *q) break; default: /* should not be triggerable */ - fprintf(stderr, "USB invalid response %d\n", p->packet.status); + error_report("USB invalid response %d", p->packet.status); g_assert_not_reached(); break; } @@ -1345,7 +1345,7 @@ static int ehci_execute(EHCIPacket *p, const char *action) p->async == EHCI_ASYNC_INITIALIZED); if (!(p->qtd.token & QTD_TOKEN_ACTIVE)) { - fprintf(stderr, "Attempting to execute inactive qtd\n"); + error_report("Attempting to execute inactive qtd"); return -1; } @@ -1383,7 +1383,7 @@ static int ehci_execute(EHCIPacket *p, const char *action) p->packet.actual_length); if (p->packet.actual_length > BUFF_SIZE) { - fprintf(stderr, "ret from usb_handle_packet > BUFF_SIZE\n"); + error_report("ret from usb_handle_packet > BUFF_SIZE"); return -1; } @@ -1461,7 +1461,7 @@ static int ehci_process_itd(EHCIState *ehci, case USB_RET_SUCCESS: break; default: - fprintf(stderr, "Unexpected iso usb result: %d\n", + error_report("Unexpected iso usb result: %d", ehci->ipacket.status); /* Fall through */ case USB_RET_IOERROR: @@ -1564,7 +1564,7 @@ static int ehci_state_fetchentry(EHCIState *ehci, int async) /* section 4.8, only QH in async schedule */ if (async && (NLPTR_TYPE_GET(entry) != NLPTR_TYPE_QH)) { - fprintf(stderr, "non queue head request in async schedule\n"); + error_report("non queue head request in async schedule"); return -1; } @@ -1586,8 +1586,8 @@ static int ehci_state_fetchentry(EHCIState *ehci, int async) default: /* TODO: handle FSTN type */ - fprintf(stderr, "FETCHENTRY: entry at %X is of type %d " - "which is not supported yet\n", entry, NLPTR_TYPE_GET(entry)); + error_report("FETCHENTRY: entry at %X is of type %d " + "which is not supported yet", entry, NLPTR_TYPE_GET(entry)); return -1; } @@ -2086,7 +2086,7 @@ static void ehci_advance_state(EHCIState *ehci, int async) break; default: - fprintf(stderr, "Bad state!\n"); + error_report("Bad state!"); again = -1; g_assert_not_reached(); break; @@ -2094,7 +2094,7 @@ static void ehci_advance_state(EHCIState *ehci, int async) if (again < 0 || itd_count > 16) { /* TODO: notify guest (raise HSE irq?) */ - fprintf(stderr, "processing error - resetting ehci HC\n"); + error_report("processing error - resetting ehci HC"); ehci_reset(ehci); again = 0; } @@ -2151,8 +2151,8 @@ static void ehci_advance_async_state(EHCIState *ehci) default: /* this should only be due to a developer mistake */ - fprintf(stderr, "ehci: Bad asynchronous state %d. " - "Resetting to active\n", ehci->astate); + error_report("ehci: Bad asynchronous state %d. " + "Resetting to active", ehci->astate); g_assert_not_reached(); } } @@ -2201,8 +2201,8 @@ static void ehci_advance_periodic_state(EHCIState *ehci) default: /* this should only be due to a developer mistake */ - fprintf(stderr, "ehci: Bad periodic state %d. " - "Resetting to active\n", ehci->pstate); + error_report("ehci: Bad periodic state %d. " + "Resetting to active", ehci->pstate); g_assert_not_reached(); } } diff --git a/hw/usb/hcd-musb.c b/hw/usb/hcd-musb.c index d70a91a58c..4729926124 100644 --- a/hw/usb/hcd-musb.c +++ b/hw/usb/hcd-musb.c @@ -253,8 +253,8 @@ /* #define MUSB_DEBUG */ #ifdef MUSB_DEBUG -#define TRACE(fmt, ...) fprintf(stderr, "%s@%d: " fmt "\n", __func__, \ - __LINE__, ##__VA_ARGS__) +#define TRACE(fmt, ...) error_report("%s@%d: " fmt "", __func__, \ + __LINE__, ##__VA_ARGS__) #else #define TRACE(...) #endif diff --git a/hw/usb/hcd-xhci.c b/hw/usb/hcd-xhci.c index af3a9d88de..14f4f455a0 100644 --- a/hw/usb/hcd-xhci.c +++ b/hw/usb/hcd-xhci.c @@ -19,6 +19,7 @@ * License along with this library; if not, see . */ #include "qemu/osdep.h" +#include "qemu/error-report.h" #include "hw/hw.h" #include "qemu/timer.h" #include "qemu/queue.h" @@ -39,7 +40,7 @@ #else #define DPRINTF(...) do {} while (0) #endif -#define FIXME(_msg) do { fprintf(stderr, "FIXME %s:%d %s\n", \ +#define FIXME(_msg) do { error_report("FIXME %s:%d %s", \ __func__, __LINE__, _msg); abort(); } while (0) #define TRB_LINK_LIMIT 32 diff --git a/hw/usb/host-legacy.c b/hw/usb/host-legacy.c index 3b57e21b52..56865c40ed 100644 --- a/hw/usb/host-legacy.c +++ b/hw/usb/host-legacy.c @@ -34,6 +34,7 @@ #include "qemu-common.h" #include "hw/usb.h" #include "hw/usb/host.h" +#include "qemu/error-report.h" /* * Autoconnect filter @@ -86,7 +87,7 @@ static int parse_filter(const char *spec, struct USBAutoFilter *f) } if (i < DEV) { - fprintf(stderr, "husb: invalid auto filter spec %s\n", spec); + error_report("husb: invalid auto filter spec %s", spec); return -1; } From patchwork Thu Oct 19 16:18:11 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alistair Francis X-Patchwork-Id: 828240 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; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=xilinx.onmicrosoft.com header.i=@xilinx.onmicrosoft.com header.b="WLag0d4O"; 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 3yHvzm3TKRz9tXC for ; Fri, 20 Oct 2017 03:49:55 +1100 (AEDT) Received: from localhost ([::1]:50209 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e5E13-0003pg-Og for incoming@patchwork.ozlabs.org; Thu, 19 Oct 2017 12:49:53 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:56191) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e5DaQ-000655-7z for qemu-devel@nongnu.org; Thu, 19 Oct 2017 12:22:23 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1e5DaN-0002D2-1W for qemu-devel@nongnu.org; Thu, 19 Oct 2017 12:22:22 -0400 Received: from mail-sn1nam01on0043.outbound.protection.outlook.com ([104.47.32.43]:65360 helo=NAM01-SN1-obe.outbound.protection.outlook.com) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1e5DaM-0002Ce-NC for qemu-devel@nongnu.org; Thu, 19 Oct 2017 12:22:18 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=xilinx.onmicrosoft.com; s=selector1-xilinx-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=+nA7w9IjM8UIJ5+EEBYljfw0NOSoZ+/+7W9oC1GAjBc=; b=WLag0d4O4aZoqqemeSX3DiCEFnzfqS8Oy6g6vMjyMx618BKfHJznhX5ERtrJmxHPaFO0pQQYjFQ0ttMor3Xcibz881e6PI9owQz7nyyMVbb8hHtb3Htll3v3rfOcDrSEOCOdHPF2v/cpLwZ0TaeEs6zXu1rK+Fae+AQhtKzi+jU= Received: from SN4PR0201CA0054.namprd02.prod.outlook.com (10.171.31.144) by BY2PR02MB1330.namprd02.prod.outlook.com (10.162.79.25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.77.7; Thu, 19 Oct 2017 16:22:16 +0000 Received: from BL2NAM02FT006.eop-nam02.prod.protection.outlook.com (2a01:111:f400:7e46::209) by SN4PR0201CA0054.outlook.office365.com (2603:10b6:803:20::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.77.21 via Frontend Transport; Thu, 19 Oct 2017 16:22:16 +0000 Authentication-Results: spf=pass (sender IP is 149.199.60.83) smtp.mailfrom=xilinx.com; redhat.com; dkim=none (message not signed) header.d=none;redhat.com; dmarc=bestguesspass action=none header.from=xilinx.com; Received-SPF: Pass (protection.outlook.com: domain of xilinx.com designates 149.199.60.83 as permitted sender) receiver=protection.outlook.com; client-ip=149.199.60.83; helo=xsj-pvapsmtpgw01; Received: from xsj-pvapsmtpgw01 (149.199.60.83) by BL2NAM02FT006.mail.protection.outlook.com (10.152.76.239) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.20.77.10 via Frontend Transport; Thu, 19 Oct 2017 16:22:15 +0000 Received: from unknown-38-66.xilinx.com ([149.199.38.66] helo=xsj-pvapsmtp01) by xsj-pvapsmtpgw01 with esmtp (Exim 4.63) (envelope-from ) id 1e5DaJ-00006R-DI; Thu, 19 Oct 2017 09:22:15 -0700 Received: from [127.0.0.1] (helo=localhost) by xsj-pvapsmtp01 with smtp (Exim 4.63) (envelope-from ) id 1e5DaJ-0003J5-93; Thu, 19 Oct 2017 09:22:15 -0700 Received: from xsj-pvapsmtp01 (maildrop.xilinx.com [149.199.38.66]) by xsj-smtp-dlp1.xlnx.xilinx.com (8.13.8/8.13.1) with ESMTP id v9JGM4JC018294; Thu, 19 Oct 2017 09:22:04 -0700 Received: from [172.19.2.220] (helo=localhost.localdomain) by xsj-pvapsmtp01 with esmtp (Exim 4.63) (envelope-from ) id 1e5Da8-0003GK-Ir; Thu, 19 Oct 2017 09:22:04 -0700 From: Alistair Francis To: Date: Thu, 19 Oct 2017 09:18:11 -0700 Message-ID: X-Mailer: git-send-email 2.11.0 In-Reply-To: References: X-RCIS-Action: ALLOW X-TM-AS-Product-Ver: IMSS-7.1.0.1224-8.1.0.1062-23404.005 X-TM-AS-User-Approved-Sender: Yes;Yes X-EOPAttributedMessage: 0 X-MS-Office365-Filtering-HT: Tenant X-Forefront-Antispam-Report: CIP:149.199.60.83; IPV:NLI; CTRY:US; EFV:NLI; SFV:NSPM; SFS:(10009020)(6009001)(346002)(39860400002)(376002)(2980300002)(438002)(189002)(199003)(2950100002)(189998001)(5660300001)(81166006)(54906003)(8676002)(6916009)(8936002)(33646002)(118296001)(50226002)(478600001)(77096006)(106002)(81156014)(356003)(16586007)(36386004)(2906002)(2351001)(305945005)(4326008)(5003940100001)(316002)(63266004)(36756003)(50466002)(9786002)(76176999)(6666003)(47776003)(48376002)(39060400002)(50986999)(106466001)(107986001)(21314002); DIR:OUT; SFP:1101; SCL:1; SRVR:BY2PR02MB1330; H:xsj-pvapsmtpgw01; FPR:; SPF:Pass; PTR:unknown-60-83.xilinx.com; MX:1; A:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BL2NAM02FT006; 1:+VwTlDK+5Biv3O2XTbWnPtsEYMDYYxULhQYLRcgITkemWNIX6H5UPxc6FP+g4ilOzDAHLfwhbGIMhG/sVRNGXfpx2Jw1JLw2V8lTYOujUUNZjWolm45uKPInjDg4L4R7 MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 75ee7acd-6fe2-4050-4f94-08d5170d9011 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001)(2017030254152)(8251501002)(2017052603199)(201703131423075)(201703031133081)(201702281549075); SRVR:BY2PR02MB1330; X-Microsoft-Exchange-Diagnostics: 1; BY2PR02MB1330; 3:Ot0910Tn98CNEbktWYjnJ+QJIZvD8ZHTFyb2UxMw2cG5VqtFlPKFmB9kjk87RQwXJ1BZriCubAdDf9v0+waxr5bG56NiB6YtQVPvghJHDf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yFy/1gsla/kk2zdD3SvbuC+O3hpAm2Opeb++rKIeKt2PeqPZPRnVahJveAk5ljdVVdlJhbogyBTyEul8ZBBcLlYpIqrnmF+YahYEv0Aj+db9NXb9xwOmaVzBscnxliO0v8Z/USa27YDJlplyqs25dCq+CuNeBec4B/m+SuIoG6q2Y2mKC0+AsVK73SmxrRf4UpoaTo/dFmQ6+Hq4DoH2H++CdmtCVys8XxZaXqXsD/nvh2Lh2U+Ua9mV9rkAbI89olpS1Z5+qK/bEKl54bXTJuTaG4HvIbN7pNouy+6t8VMhanRvZOR2DBUGeb3z3KyPBLB5coF/MG9Ur5Du/rae/bnKdIPO3qgYXmeLMTReehM1iXd X-Exchange-Antispam-Report-Test: UriScan:(788757137089)(192813158149592); X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(100000700101)(100105000095)(100000701101)(100105300095)(100000702101)(100105100095)(6040450)(2401047)(5005006)(8121501046)(10201501046)(3002001)(100000703101)(100105400095)(93006095)(93004095)(6055026)(6041248)(20161123558100)(20161123562025)(20161123560025)(20161123564025)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123555025)(6072148)(201708071742011)(100000704101)(100105200095)(100000705101)(100105500095); SRVR:BY2PR02MB1330; BCL:0; PCL:0; RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095); SRVR:BY2PR02MB1330; X-Microsoft-Exchange-Diagnostics: 1; BY2PR02MB1330; 4:QW328974gXEBySgtKsA3yURAluTbVYTSbash7t1DpW08Rj1LRqlmg1P9dNA6SnrUxcId5bkj25hn9nNtk5DiG3oHkq1vK1OKjcKuP04U28JlhHorqFhgjcDQxrJzphyXGsLDT5jenXCgWokWODI61sWCx3F3wLpSc5/SX/kuSK5Jd/yFKR2YxCy79A1MLTlf3PgU/0nY8ni/Fdy/VxvzlLL0zU9wD9wyvAkBcnS1GCZbr+nFNC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DiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: xilinx.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 19 Oct 2017 16:22:15.9360 (UTC) X-MS-Exchange-CrossTenant-Id: 657af505-d5df-48d0-8300-c31994686c5c X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=657af505-d5df-48d0-8300-c31994686c5c; Ip=[149.199.60.83]; Helo=[xsj-pvapsmtpgw01] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BY2PR02MB1330 X-detected-operating-system: by eggs.gnu.org: Windows 7 or 8 [fuzzy] X-Received-From: 104.47.32.43 Subject: [Qemu-devel] [PATCH v3 40/46] hw/watchdog: Replace fprintf(stderr, "*\n" with error_report() 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: alistair23@gmail.com, armbru@redhat.com, alistair.francis@xilinx.com Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" Replace a large number of the fprintf(stderr, "*\n" calls with error_report(). The functions were renamed with these commands and then compiler issues where manually fixed. find ./* -type f -exec sed -i \ 'N;N;N;N;N;N;N;N;N;N;N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2);|Ig}' \ {} + find ./* -type f -exec sed -i \ 'N;N;N;N;N;N;N;N;N;N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2);|Ig}' \ {} + find ./* -type f -exec sed -i \ 'N;N;N;N;N;N;N;N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2);|Ig}' \ {} + find ./* -type f -exec sed -i \ 'N;N;N;N;N;N;N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2);|Ig}' \ {} + find ./* -type f -exec sed -i \ 'N;N;N;N;N;N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2);|Ig}' \ {} + find ./* -type f -exec sed -i \ 'N;N;N;N;N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2);|Ig}' \ {} + find ./* -type f -exec sed -i \ 'N;N;N;N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2);|Ig}' \ {} + find ./* -type f -exec sed -i \ 'N;N;N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2);|Ig}' \ {} + find ./* -type f -exec sed -i \ 'N;N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2);|Ig}' \ {} + find ./* -type f -exec sed -i \ 'N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2);|Ig}' \ {} + find ./* -type f -exec sed -i \ 'N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2);|Ig}' \ {} + Some lines where then manually tweaked to pass checkpatch. Signed-off-by: Alistair Francis --- V2: - Split hw patch into individual directories hw/watchdog/watchdog.c | 9 +++++---- hw/watchdog/wdt_i6300esb.c | 8 +++++--- 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/hw/watchdog/watchdog.c b/hw/watchdog/watchdog.c index 670114ecfe..d6d11ef1e5 100644 --- a/hw/watchdog/watchdog.c +++ b/hw/watchdog/watchdog.c @@ -20,6 +20,7 @@ */ #include "qemu/osdep.h" +#include "qemu/error-report.h" #include "qemu/option.h" #include "qemu/config-file.h" #include "qemu/queue.h" @@ -52,7 +53,7 @@ int select_watchdog(const char *p) /* -watchdog ? lists available devices and exits cleanly. */ if (is_help_option(p)) { QLIST_FOREACH(model, &watchdog_list, entry) { - fprintf(stderr, "\t%s\t%s\n", + error_report("\t%s\t%s", model->wdt_name, model->wdt_description); } return 2; @@ -68,9 +69,9 @@ int select_watchdog(const char *p) } } - fprintf(stderr, "Unknown -watchdog device. Supported devices are:\n"); + error_report("Unknown -watchdog device. Supported devices are:"); QLIST_FOREACH(model, &watchdog_list, entry) { - fprintf(stderr, "\t%s\t%s\n", + error_report("\t%s\t%s", model->wdt_name, model->wdt_description); } return 1; @@ -126,7 +127,7 @@ void watchdog_perform_action(void) case WATCHDOG_ACTION_DEBUG: qapi_event_send_watchdog(WATCHDOG_ACTION_DEBUG, &error_abort); - fprintf(stderr, "watchdog: timer fired\n"); + error_report("watchdog: timer fired"); break; case WATCHDOG_ACTION_NONE: diff --git a/hw/watchdog/wdt_i6300esb.c b/hw/watchdog/wdt_i6300esb.c index e596b0804d..c5f5190e55 100644 --- a/hw/watchdog/wdt_i6300esb.c +++ b/hw/watchdog/wdt_i6300esb.c @@ -20,7 +20,7 @@ */ #include "qemu/osdep.h" - +#include "qemu/error-report.h" #include "qemu-common.h" #include "qemu/timer.h" #include "sysemu/watchdog.h" @@ -186,10 +186,12 @@ static void i6300esb_timer_expired(void *vp) /* What to do at the end of stage 1? */ switch (d->int_type) { case INT_TYPE_IRQ: - fprintf(stderr, "i6300esb_timer_expired: I would send APIC 1 INT 10 here if I knew how (XXX)\n"); + error_report("i6300esb_timer_expired: I would send APIC 1 INT 10" + "here if I knew how (XXX)"); break; case INT_TYPE_SMI: - fprintf(stderr, "i6300esb_timer_expired: I would send SMI here if I knew how (XXX)\n"); + error_report("i6300esb_timer_expired: I would send SMI here if I" + "knew how (XXX)"); break; } From patchwork Thu Oct 19 16:18:14 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alistair Francis X-Patchwork-Id: 828253 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; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=xilinx.onmicrosoft.com header.i=@xilinx.onmicrosoft.com header.b="xvuC17eK"; 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 3yHw6d2f6jz9t44 for ; Fri, 20 Oct 2017 03:55:53 +1100 (AEDT) Received: from localhost ([::1]:50242 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e5E6p-000101-CA for incoming@patchwork.ozlabs.org; Thu, 19 Oct 2017 12:55:51 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:56195) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e5DaQ-00065W-PZ for qemu-devel@nongnu.org; Thu, 19 Oct 2017 12:22:24 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1e5DaN-0002DP-Hg for qemu-devel@nongnu.org; Thu, 19 Oct 2017 12:22:22 -0400 Received: from mail-bn3nam01on0087.outbound.protection.outlook.com ([104.47.33.87]:47712 helo=NAM01-BN3-obe.outbound.protection.outlook.com) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1e5DaN-0002Cy-AC for qemu-devel@nongnu.org; Thu, 19 Oct 2017 12:22:19 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=xilinx.onmicrosoft.com; s=selector1-xilinx-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=71Wdt/wphhdDrtisio0i7kS58N8rD5dg/rHmbHJ8680=; b=xvuC17eKh/aiqDoTezCqKT/MZ0R98SrRXEUTP8IcAyzgQztM564YULC729liW7j3zJO0cseSSpRbC+C5HSZoVHVQZrDWTSkNJbRjmHLgm0J/wW1lwg0jmVRtP4OujoXAgBktxso3nZZWi0m0fZo7D0QOcgn8LXUbfuvJimIFXX8= Received: from CY4PR02CA0034.namprd02.prod.outlook.com (10.175.57.148) by DM5PR02MB3385.namprd02.prod.outlook.com (10.164.152.161) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.77.7; Thu, 19 Oct 2017 16:22:17 +0000 Received: from SN1NAM02FT062.eop-nam02.prod.protection.outlook.com (2a01:111:f400:7e44::209) by CY4PR02CA0034.outlook.office365.com (2603:10b6:903:117::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.77.21 via Frontend Transport; Thu, 19 Oct 2017 16:22:16 +0000 Authentication-Results: spf=pass (sender IP is 149.199.60.100) smtp.mailfrom=xilinx.com; citrix.com; dkim=none (message not signed) header.d=none;citrix.com; dmarc=bestguesspass action=none header.from=xilinx.com; Received-SPF: Pass (protection.outlook.com: domain of xilinx.com designates 149.199.60.100 as permitted sender) receiver=protection.outlook.com; client-ip=149.199.60.100; helo=xsj-pvapsmtpgw02; Received: from xsj-pvapsmtpgw02 (149.199.60.100) by SN1NAM02FT062.mail.protection.outlook.com (10.152.72.208) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.20.77.10 via Frontend Transport; Thu, 19 Oct 2017 16:22:16 +0000 Received: from unknown-38-66.xilinx.com ([149.199.38.66]:39533 helo=xsj-pvapsmtp01) by xsj-pvapsmtpgw02 with esmtp (Exim 4.63) (envelope-from ) id 1e5DaJ-0007yO-H6; Thu, 19 Oct 2017 09:22:15 -0700 Received: from [127.0.0.1] (helo=localhost) by xsj-pvapsmtp01 with smtp (Exim 4.63) (envelope-from ) id 1e5DaJ-0003J5-Dn; Thu, 19 Oct 2017 09:22:15 -0700 Received: from xsj-pvapsmtp01 (smtp2.xilinx.com [149.199.38.66]) by xsj-smtp-dlp1.xlnx.xilinx.com (8.13.8/8.13.1) with ESMTP id v9JGM7X2018304; Thu, 19 Oct 2017 09:22:07 -0700 Received: from [172.19.2.220] (helo=localhost.localdomain) by xsj-pvapsmtp01 with esmtp (Exim 4.63) (envelope-from ) id 1e5DaB-0003H7-2Y; Thu, 19 Oct 2017 09:22:07 -0700 From: Alistair Francis To: Date: Thu, 19 Oct 2017 09:18:14 -0700 Message-ID: <55afe994ca32715382326d5d250231bdaa836f08.1508390588.git.alistair.francis@xilinx.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: References: X-RCIS-Action: ALLOW X-TM-AS-Product-Ver: IMSS-7.1.0.1224-8.1.0.1062-23404.005 X-TM-AS-User-Approved-Sender: Yes;Yes X-EOPAttributedMessage: 0 X-MS-Office365-Filtering-HT: Tenant X-Forefront-Antispam-Report: CIP:149.199.60.100; IPV:NLI; CTRY:US; EFV:NLI; SFV:NSPM; SFS:(10009020)(6009001)(346002)(39860400002)(376002)(2980300002)(438002)(189002)(199003)(8936002)(8666007)(33646002)(106466001)(36756003)(5003940100001)(36386004)(5660300001)(189998001)(4326008)(118296001)(81166006)(47776003)(8676002)(81156014)(63266004)(16586007)(9786002)(2351001)(356003)(106002)(316002)(6916009)(77096006)(50226002)(50986999)(2950100002)(48376002)(76176999)(54906003)(2906002)(478600001)(6666003)(305945005)(39060400002)(50466002)(107986001)(5001870100001); DIR:OUT; SFP:1101; SCL:1; SRVR:DM5PR02MB3385; H:xsj-pvapsmtpgw02; FPR:; SPF:Pass; PTR:unknown-60-100.xilinx.com,xapps1.xilinx.com; MX:1; A:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; SN1NAM02FT062; 1:n2qyQDCQFpkzAfnO/rQzJj8KZVKvMRqEasHiHHR24QMlB6jtn7SuZB9ictGCjy9NwPzg2VLw0fvUCyKLQ972/q7mqdv5j9bD2ho1NgK/6lgicJz2ojOF0bxKQeuDm/qo MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: ee3a2a7b-6ccd-40d9-40ae-08d5170d902d X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001)(2017030254152)(8251501002)(2017052603199)(201703131423075)(201703031133081)(201702281549075); SRVR:DM5PR02MB3385; X-Microsoft-Exchange-Diagnostics: 1; DM5PR02MB3385; 3:CYlOE+CSwl9zzIUhPiOOColiqT3m/nIC201vm0C+M+qOYDNsJUNR3TUG1XHlgZcPobPl9ocr/NXa5WZaBAJgdcYzq0qwLayumZVopBR9oLB2GZhs21S03HsEJMOFIh9Gpc1/cyXxiuMccQO0wr6hVzvvWfMAGvVZy0iqYojVJaNaAZfC4xwvyAc4/893WISfV9ICsNy2v1xxVphGvxNY90y+0XGuMpA3Dkv9qkHHww58rRTCboebuf/YIBq1IA/1QZhJT3eueLoS2AP1+YYOFvCpMHJ48zi7KKEe9tOc/O8Q2GUMbkzD4t1tedpczwT/mks0Dsq8GnH7QWK03S0h6ZHuSZprNtsyHJ8CoziWM70=; 25:1m//g1LUcX/o/yEdqIM4Y++TczqT3e/1mZRIgDcf1W7W/E8g53TRW+MdlJsrgwYuOLI/TkTJby4PVXHs0oUKHZCmKW+L3/Lw3u4GMe1ccpNwLBkJGQWDATZ/D6reIF+K69abUSr/ca/IF16P7sKSaNBRqQBm4TNGnevJENgmAOJQ9HIriu3O49B8Lx7sy+g8vnQtxWugrl2u6/i/1wPdqt5ika3YA5MIq3oqNuJBxw/Te67i0Rhr2PUSgHk6P7eyhMN5P8mRRaB2xBUUmjffIZp+HsFk68syxq6Ooa/m8k25q1+PFeZMduSagOrCoMwgi7mvy+CX+O5vCpgqYYVQvg== X-MS-TrafficTypeDiagnostic: DM5PR02MB3385: X-Microsoft-Exchange-Diagnostics: 1; DM5PR02MB3385; 31:l4ljIDXqv/sQ1dk6RRtgMf+JusOX3hAIMU30wDKPPn3Ae8mTQESR/6al6robY/60dqW4r6Kn2HGR5E0N9g1RI5diHS2c3osDO0ql5EQmwwMSBmSJpqLLPRKp4Nt2vHCJmJAolzl5rWHMcnAcKnuG8RP8oyEBinl33LK5qayanwPjXMyFTk0aelwB1k7D1YiPhcNpzk07lCuJOr30dtVbBQmX3OUASXaE7BjwApUhAm4=; 20:8YskOG46hXzgdsA14M+g0uQsARhzUoumUeDuXPH1xX9/HqNaZ6lHb6UT+ssQ2636rs1nmj3upk6k99jJW5MZdWshq5xfQmJ/5eC6+1tpBXinBJ7YS0ITL5Hvq5QtUQVOpCsZInNOVinqYz4XEaw5p90McjRvL8hBEDaxz34v01WsM6xVrS8Hp9zLzXou+dDdNP5k2h3t7qWvXa36XQ8L8SC9Tsdcx8XmL8AIT/HZsWHl6riNagKzxngTumSqmesa9b5WKaPh+90yEl+JuLl2WhEEeQ2G483mL+eDT691J1h5iy4R8gwrhMJ+PG4RIYhaNuzRbh1JqUzNP5f7mX7KMbo+nWz2ujUlA7+Uxp98IuYra9CySmHRkpASFaK96ZwN4Ijg3j6HYnfcmZa1s3BNh2+dAE4NlkqC+wDkD/wo8/Km9p3/Qs2c0AhuZYkh8IHf2Sjs9ib7+L0Qv+HZh8tc1Wuax85hTxUVqb3cEggmwYvn+nkVEpiwNF93bnKYtndK X-Exchange-Antispam-Report-Test: UriScan:(788757137089)(192813158149592)(70601490899591); X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(100000700101)(100105000095)(100000701101)(100105300095)(100000702101)(100105100095)(6040450)(2401047)(8121501046)(5005006)(3002001)(93006095)(93004095)(100000703101)(100105400095)(10201501046)(6055026)(6041248)(20161123558100)(20161123555025)(20161123560025)(20161123564025)(20161123562025)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(6072148)(201708071742011)(100000704101)(100105200095)(100000705101)(100105500095); SRVR:DM5PR02MB3385; BCL:0; PCL:0; RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095); SRVR:DM5PR02MB3385; X-Microsoft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+t3tTKS510yabhm30Zj9/hk0hUGDiA5q5YXZNpUA0zKfinxZwX4tVfVEdnPPYxpzWF5bqyDENxM0t2m+Ie6vZY4E=; 7:gsS55oVzOdOre42yZphHz3/E/t1iaSbC7Fz3vy7X/UYFYCL9+nbDrQ8HPGtqt/0lEjLGfpaFfvvGLUv4+I+qoRzr2GblBBgyCGCVPe/Y515p1TXTes9JQwUuZYQLNmQtKpwE0GgAdKDJirSosFQ6lQHm5YOkqCWyP8xWW5F/e8h0n0ivgxSDQnVUK3syvE03JS7pTAwrM6DtL/cgEMCzoJdc4FPg3NSlM3Ps3dfpn1k= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: xilinx.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 19 Oct 2017 16:22:16.0722 (UTC) X-MS-Exchange-CrossTenant-Id: 657af505-d5df-48d0-8300-c31994686c5c X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=657af505-d5df-48d0-8300-c31994686c5c; Ip=[149.199.60.100]; Helo=[xsj-pvapsmtpgw02] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM5PR02MB3385 X-detected-operating-system: by eggs.gnu.org: Windows 7 or 8 [fuzzy] X-Received-From: 104.47.33.87 Subject: [Qemu-devel] [PATCH v3 41/46] hw/xen*: Replace fprintf(stderr, "*\n" with error_report() 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: Anthony Perard , alistair23@gmail.com, Stefano Stabellini , armbru@redhat.com, alistair.francis@xilinx.com Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" Replace a large number of the fprintf(stderr, "*\n" calls with error_report(). The functions were renamed with these commands and then compiler issues where manually fixed. find ./* -type f -exec sed -i \ 'N;N;N;N;N;N;N;N;N;N;N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2);|Ig}' \ {} + find ./* -type f -exec sed -i \ 'N;N;N;N;N;N;N;N;N;N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2);|Ig}' \ {} + find ./* -type f -exec sed -i \ 'N;N;N;N;N;N;N;N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2);|Ig}' \ {} + find ./* -type f -exec sed -i \ 'N;N;N;N;N;N;N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2);|Ig}' \ {} + find ./* -type f -exec sed -i \ 'N;N;N;N;N;N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2);|Ig}' \ {} + find ./* -type f -exec sed -i \ 'N;N;N;N;N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2);|Ig}' \ {} + find ./* -type f -exec sed -i \ 'N;N;N;N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2);|Ig}' \ {} + find ./* -type f -exec sed -i \ 'N;N;N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2);|Ig}' \ {} + find ./* -type f -exec sed -i \ 'N;N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2);|Ig}' \ {} + find ./* -type f -exec sed -i \ 'N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2);|Ig}' \ {} + find ./* -type f -exec sed -i \ 'N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2);|Ig}' \ {} + Some lines where then manually tweaked to pass checkpatch. xen_pt_log() was left with an fprintf(stderr, Signed-off-by: Alistair Francis Cc: Stefano Stabellini Cc: Anthony Perard Acked-by: Anthony PERARD --- V3: - Don't change xen_pt_log() V2: - Split hw patch into individual directories hw/xen/xen-common.c | 11 ++++++----- hw/xenpv/xen_domainbuild.c | 24 ++++++++++++------------ hw/xenpv/xen_machine_pv.c | 9 +++++---- 3 files changed, 23 insertions(+), 21 deletions(-) diff --git a/hw/xen/xen-common.c b/hw/xen/xen-common.c index 632a938dcc..42ada2ac05 100644 --- a/hw/xen/xen-common.c +++ b/hw/xen/xen-common.c @@ -9,6 +9,7 @@ */ #include "qemu/osdep.h" +#include "qemu/error-report.h" #include "hw/xen/xen_backend.h" #include "qmp-commands.h" #include "chardev/char.h" @@ -47,19 +48,19 @@ static int store_dev_info(int domid, Chardev *cs, const char *string) /* We now have everything we need to set the xenstore entry. */ xs = xs_open(0); if (xs == NULL) { - fprintf(stderr, "Could not contact XenStore\n"); + error_report("Could not contact XenStore"); goto out; } path = xs_get_domain_path(xs, domid); if (path == NULL) { - fprintf(stderr, "xs_get_domain_path() error\n"); + error_report("xs_get_domain_path() error"); goto out; } newpath = realloc(path, (strlen(path) + strlen(string) + strlen("/tty") + 1)); if (newpath == NULL) { - fprintf(stderr, "realloc error\n"); + error_report("realloc error"); goto out; } path = newpath; @@ -96,13 +97,13 @@ static void xenstore_record_dm_state(struct xs_handle *xs, const char *state) char path[50]; if (xs == NULL) { - fprintf(stderr, "xenstore connection not initialized\n"); + error_report("xenstore connection not initialized"); exit(1); } snprintf(path, sizeof (path), "device-model/%u/state", xen_domid); if (!xs_write(xs, XBT_NULL, path, state, strlen(state))) { - fprintf(stderr, "error recording dm state\n"); + error_report("error recording dm state"); exit(1); } } diff --git a/hw/xenpv/xen_domainbuild.c b/hw/xenpv/xen_domainbuild.c index 027f76fad1..f5514ffec2 100644 --- a/hw/xenpv/xen_domainbuild.c +++ b/hw/xenpv/xen_domainbuild.c @@ -25,22 +25,22 @@ static int xenstore_domain_mkdir(char *path) int i; if (!xs_mkdir(xenstore, 0, path)) { - fprintf(stderr, "%s: xs_mkdir %s: failed\n", __func__, path); - return -1; + error_report("%s: xs_mkdir %s: failed", __func__, path); + return -1; } if (!xs_set_permissions(xenstore, 0, path, perms_ro, 2)) { - fprintf(stderr, "%s: xs_set_permissions failed\n", __func__); - return -1; + error_report("%s: xs_set_permissions failed", __func__); + return -1; } for (i = 0; writable[i]; i++) { snprintf(subpath, sizeof(subpath), "%s/%s", path, writable[i]); if (!xs_mkdir(xenstore, 0, subpath)) { - fprintf(stderr, "%s: xs_mkdir %s: failed\n", __func__, subpath); + error_report("%s: xs_mkdir %s: failed", __func__, subpath); return -1; } if (!xs_set_permissions(xenstore, 0, subpath, perms_rw, 2)) { - fprintf(stderr, "%s: xs_set_permissions failed\n", __func__); + error_report("%s: xs_set_permissions failed", __func__); return -1; } } @@ -235,7 +235,7 @@ int xen_domain_build_pv(const char *kernel, const char *ramdisk, memcpy(uuid, &qemu_uuid, sizeof(uuid)); rc = xen_domain_create(xen_xc, ssidref, uuid, flags, &xen_domid); if (rc < 0) { - fprintf(stderr, "xen: xc_domain_create() failed\n"); + error_report("xen: xc_domain_create() failed"); goto err; } qemu_log("xen: created domain %d\n", xen_domid); @@ -248,21 +248,21 @@ int xen_domain_build_pv(const char *kernel, const char *ramdisk, rc = xc_domain_max_vcpus(xen_xc, xen_domid, smp_cpus); if (rc < 0) { - fprintf(stderr, "xen: xc_domain_max_vcpus() failed\n"); + error_report("xen: xc_domain_max_vcpus() failed"); goto err; } #if 0 rc = xc_domain_setcpuweight(xen_xc, xen_domid, 256); if (rc < 0) { - fprintf(stderr, "xen: xc_domain_setcpuweight() failed\n"); + error_report("xen: xc_domain_setcpuweight() failed"); goto err; } #endif rc = xc_domain_setmaxmem(xen_xc, xen_domid, ram_size >> 10); if (rc < 0) { - fprintf(stderr, "xen: xc_domain_setmaxmem() failed\n"); + error_report("xen: xc_domain_setmaxmem() failed"); goto err; } @@ -275,7 +275,7 @@ int xen_domain_build_pv(const char *kernel, const char *ramdisk, xenstore_port, &xenstore_mfn, console_port, &console_mfn); if (rc < 0) { - fprintf(stderr, "xen: xc_linux_build() failed\n"); + error_report("xen: xc_linux_build() failed"); goto err; } @@ -285,7 +285,7 @@ int xen_domain_build_pv(const char *kernel, const char *ramdisk, qemu_log("xen: unpausing domain %d\n", xen_domid); rc = xc_domain_unpause(xen_xc, xen_domid); if (rc < 0) { - fprintf(stderr, "xen: xc_domain_unpause() failed\n"); + error_report("xen: xc_domain_unpause() failed"); goto err; } diff --git a/hw/xenpv/xen_machine_pv.c b/hw/xenpv/xen_machine_pv.c index 69a52a9f93..44d67b87c4 100644 --- a/hw/xenpv/xen_machine_pv.c +++ b/hw/xenpv/xen_machine_pv.c @@ -23,6 +23,7 @@ */ #include "qemu/osdep.h" +#include "qemu/error-report.h" #include "hw/hw.h" #include "hw/boards.h" #include "hw/xen/xen_backend.h" @@ -36,7 +37,7 @@ static void xen_init_pv(MachineState *machine) /* Initialize backend core & drivers */ if (xen_be_init() != 0) { - fprintf(stderr, "%s: xen backend core setup failed\n", __func__); + error_report("%s: xen backend core setup failed", __func__); exit(1); } @@ -51,18 +52,18 @@ static void xen_init_pv(MachineState *machine) const char *initrd_filename = machine->initrd_filename; if (xen_domain_build_pv(kernel_filename, initrd_filename, kernel_cmdline) < 0) { - fprintf(stderr, "xen pv domain creation failed\n"); + error_report("xen pv domain creation failed"); exit(1); } break; } #endif case XEN_EMULATE: - fprintf(stderr, "xen emulation not implemented (yet)\n"); + error_report("xen emulation not implemented (yet)"); exit(1); break; default: - fprintf(stderr, "unhandled xen_mode %d\n", xen_mode); + error_report("unhandled xen_mode %d", xen_mode); exit(1); break; } From patchwork Thu Oct 19 16:18:17 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Alistair Francis X-Patchwork-Id: 828259 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; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=xilinx.onmicrosoft.com header.i=@xilinx.onmicrosoft.com header.b="tOrlc6ku"; 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 3yHw9Y5PZNz9t4c for ; Fri, 20 Oct 2017 03:58:25 +1100 (AEDT) Received: from localhost ([::1]:50259 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e5E9H-0003MA-QT for incoming@patchwork.ozlabs.org; Thu, 19 Oct 2017 12:58:23 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:56275) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e5Daa-0006Eq-0T for qemu-devel@nongnu.org; Thu, 19 Oct 2017 12:22:35 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1e5DaW-0002NZ-MC for qemu-devel@nongnu.org; Thu, 19 Oct 2017 12:22:32 -0400 Received: from mail-co1nam03on0069.outbound.protection.outlook.com ([104.47.40.69]:4064 helo=NAM03-CO1-obe.outbound.protection.outlook.com) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1e5DaQ-0002EO-Hh; Thu, 19 Oct 2017 12:22:22 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=xilinx.onmicrosoft.com; s=selector1-xilinx-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=Lx8M0hVHclMFrMPQGF2WG/DiYM2feWjDlIobIskpdio=; b=tOrlc6kuxP5pxmG1f3yR/2QA1OIK8+vv5wYfypCj+dxFUr5XCgFVHr2mn4bkVB0F0R5DkQQoCs+xsz+a/uxgCAdNX+aWSeu2z4f1dzPhgCAawrNEFP4i9Iu9xBgT+xrPFpxY59I5Bu4eClhiKgU6QDgTf7v/JR2tWP/ktQahTxA= Received: from MWHPR0201CA0001.namprd02.prod.outlook.com (2603:10b6:301:74::14) by DM2PR02MB1339.namprd02.prod.outlook.com (2a01:111:e400:50c8::26) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.77.7; Thu, 19 Oct 2017 16:22:17 +0000 Received: from CY1NAM02FT040.eop-nam02.prod.protection.outlook.com (2a01:111:f400:7e45::207) by MWHPR0201CA0001.outlook.office365.com (2603:10b6:301:74::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.156.4 via Frontend Transport; Thu, 19 Oct 2017 16:22:17 +0000 Authentication-Results: spf=pass (sender IP is 149.199.60.100) smtp.mailfrom=xilinx.com; nongnu.org; dkim=none (message not signed) header.d=none;nongnu.org; dmarc=bestguesspass action=none header.from=xilinx.com; Received-SPF: Pass (protection.outlook.com: domain of xilinx.com designates 149.199.60.100 as permitted sender) receiver=protection.outlook.com; client-ip=149.199.60.100; helo=xsj-pvapsmtpgw02; Received: from xsj-pvapsmtpgw02 (149.199.60.100) by CY1NAM02FT040.mail.protection.outlook.com (10.152.75.135) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.20.77.10 via Frontend Transport; Thu, 19 Oct 2017 16:22:16 +0000 Received: from unknown-38-66.xilinx.com ([149.199.38.66]:39553 helo=xsj-pvapsmtp01) by xsj-pvapsmtpgw02 with esmtp (Exim 4.63) (envelope-from ) id 1e5DaJ-0007ya-OR; Thu, 19 Oct 2017 09:22:15 -0700 Received: from [127.0.0.1] (helo=localhost) by xsj-pvapsmtp01 with smtp (Exim 4.63) (envelope-from ) id 1e5DaJ-0003J5-Is; Thu, 19 Oct 2017 09:22:15 -0700 Received: from xsj-pvapsmtp01 (smtp2.xilinx.com [149.199.38.66]) by xsj-smtp-dlp1.xlnx.xilinx.com (8.13.8/8.13.1) with ESMTP id v9JGMAc7018318; Thu, 19 Oct 2017 09:22:11 -0700 Received: from [172.19.2.220] (helo=localhost.localdomain) by xsj-pvapsmtp01 with esmtp (Exim 4.63) (envelope-from ) id 1e5DaE-0003Hg-Mp; Thu, 19 Oct 2017 09:22:10 -0700 From: Alistair Francis To: Date: Thu, 19 Oct 2017 09:18:17 -0700 Message-ID: <7f741376b50552aa58c943b710fffa3c24f28b2f.1508390588.git.alistair.francis@xilinx.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: References: MIME-Version: 1.0 X-RCIS-Action: ALLOW X-TM-AS-Product-Ver: IMSS-7.1.0.1224-8.1.0.1062-23404.005 X-TM-AS-User-Approved-Sender: Yes;Yes X-EOPAttributedMessage: 0 X-MS-Office365-Filtering-HT: Tenant X-Forefront-Antispam-Report: CIP:149.199.60.100; IPV:NLI; CTRY:US; EFV:NLI; SFV:NSPM; SFS:(10009020)(6009001)(346002)(39860400002)(376002)(2980300002)(438002)(189002)(199003)(4326008)(47776003)(8676002)(81156014)(8936002)(36386004)(81166006)(36756003)(63266004)(305945005)(76176999)(5820100001)(2351001)(50986999)(77096006)(356003)(316002)(54906003)(575784001)(33646002)(106466001)(189998001)(118296001)(50226002)(23676002)(39060400002)(2950100002)(9786002)(50466002)(6916009)(5660300001)(106002)(478600001)(2906002)(2870700001)(107986001)(5001870100001); DIR:OUT; SFP:1101; SCL:1; SRVR:DM2PR02MB1339; H:xsj-pvapsmtpgw02; FPR:; SPF:Pass; PTR:xapps1.xilinx.com,unknown-60-100.xilinx.com; MX:1; A:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; CY1NAM02FT040; 1:ZIBL7laA4hx7C++EH3/CyMtW6X9kbFTw0LzlShcy72iauxwlKbmCIjI/nQXfbibjvyFw7u893usdQqJGEykoT2KEjp0HW6LgcfRVQsyLtQ+mGhKBKOOBxg6y7M5LjGSs X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 89788bbd-f5c0-45a0-4133-08d5170d907b X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001)(2017030254169)(8251501002)(4534017)(4602075)(4627075)(201703031133081)(201702281549075)(2017052603199)(201703131423092); SRVR:DM2PR02MB1339; X-Microsoft-Exchange-Diagnostics: 1; DM2PR02MB1339; 3:a/kgHRIoxyBp0xD8XC6Iol6h8+mW/g4a6hGjiUNc2vFmQzbMbGLeof/chQTLtV+v40TfM5rqqDqQyQhbr2lZx2bJR/mtmZc+rdGSI0i5rUlAN8AwA2Gl+XMEJTil1Kd3k3+Mo9qTw3BWPfhS5rdqc7XaBZIujD3LnVTs1Hi5o9NLHGK35SbHRqXEwRJUX/PdoFdJCqH/pG2d/lGQA+Wvld+e8nT4a2XEZraOfXuZGgW4nplH/jVo5RJhvTgn05sG/XjP9XBvYQDwkyeKrwTNL6sEw+e5GSexJ+EsurPF3HxBBH5PJYGCGXWi6vbVOD0mgtQn/wywS6SlG3kTMu4ZKqBHm3IzTDbkPN6BZh3//bo=; 25:kHu7/ckZ/9l4mvqF6Cah+lA0TOFpO+JJCHAKS1u9iAHvbN0HkvZTkMbHKJ3ek5Yb33pw1oK0qPt+WtOPfTmq69UijKpy90I0N/2LXlGcOKm1a0wcfPU0UKORLVY1MXOHZCNcrmjfXmjmR2kytk9L/RtE0gCv8XL4YkG7fzuWHwsCDm1Rw9h8gej6fvTchRaOJEXQtZk77NEvn7r5c3UAS45MveSyN5u7WPkvgH9fvVGjiIN8o0lt5mnKXCGcKns8Aa7R1u+cqi16Mmc+sNo2hwy3dG0fvVW21wVfu+fPrTANsP0xGd3FQVX2pdcNHl/Qp0D3KGoxJ0v5Y4HOuwpJhA== X-MS-TrafficTypeDiagnostic: DM2PR02MB1339: X-Microsoft-Exchange-Diagnostics: 1; DM2PR02MB1339; 31:5YIb92hXZdIvey40VbKnROHQj09dYWp3a6wyR0YcQx+7xtqKJSA4k0V7+UK9aWD/+aC7lLFnBxQHIFKFSDseWtulmpsNt7kzmwFKJj2e7Mc+KS8LVWatlmywmRI5OttreHYVRvwpiO3NtGh2leUhKcbqoqlLve8k8ONyYgy+0Wk9/kJfvDqQQ9POorPRbTAPy7N3GINYrZkNx/jM5trsrw0Hnvz9vbnOnyZDc/RpalQ=; 20:nUVEDA3e0auZDqiheHXGL/YCBUCPSawmKd2lQe/vqAVtmaPQOL8SMy9weU0DAof7m7RUY2GKscgjFhp55f0hQtPs/a+3IcpnRT2rsoBrWoTD4WQCQHKPi6Jmj6myvvWxINprEkLQjUxp6B9ddiNtaw60GEruagzUKJT7DTvWam+kB1rv5KfeMnEOqZRp1fPDU2M+y4k5RQYADGhoy1mWkkakMc1t7pyRIoJKA+wmD9H3foSilhzfhf2Cv7WwaiEUGATL0zdlb5pdLg4MzzO44Ey1xM+Hbouczn37fJW5dx6ry8Ps02GDQrObexQHqPoUKk62yDUbUl/amD5h5dD68J+M21MKTLbkJT819gG2QJlbmAsLlRcpA1YYUB5c5GXoynNaHkhwPGoP4EC1T7JVRiSO82tqxceW7f6d5kQww3edLpXDnNzRtYbUSNMwC2pinQRqbAenoWls7DZgHDU07LaPDZNAZ7xCI6aBN+KQpwUoCWgXAO5apCwAMK2LUlRj X-Exchange-Antispam-Report-Test: UriScan:(788757137089)(192813158149592); X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(100000700101)(100105000095)(100000701101)(100105300095)(100000702101)(100105100095)(6040450)(2401047)(5005006)(8121501046)(100000703101)(100105400095)(93006095)(93004095)(3002001)(10201501046)(6055026)(6041248)(20161123560025)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123555025)(20161123564025)(20161123562025)(20161123558100)(6072148)(201708071742011)(100000704101)(100105200095)(100000705101)(100105500095); SRVR:DM2PR02MB1339; BCL:0; PCL:0; RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100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tl9paiXx0hm/ombXqdW7OstS3sUZXxO47AdsJgvJrR/YAY1FbO52zqkIFMV/TH3AKXoN32dBzGApU9FHGcX6k4=; 7:+N4rgZXKqRY4VeWRZBFqgLceS+bvevnIaxMBX3w4rd80PBvmUZEYH0Z4QHndPKKP9IL2wZUOcn2sLpNzbW263VNO1X0FIoKzPtitqVUUc2AW24BpxubO6NySHDIzap65sSQySo61hd/lSDZXDjSeXh89U5herp/cf5jLSJZVXJpjIrxBOZCpOmKVOGHuZezVEiAbzi6Zfrep0lnODSMb0wMpZr+54ucs2YIFGGFU4sw= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: xilinx.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 19 Oct 2017 16:22:16.3334 (UTC) X-MS-Exchange-CrossTenant-Id: 657af505-d5df-48d0-8300-c31994686c5c X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=657af505-d5df-48d0-8300-c31994686c5c; Ip=[149.199.60.100]; Helo=[xsj-pvapsmtpgw02] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM2PR02MB1339 X-detected-operating-system: by eggs.gnu.org: Windows 7 or 8 [fuzzy] X-Received-From: 104.47.40.69 Subject: [Qemu-devel] [PATCH v3 42/46] util: Replace fprintf(stderr, "*\n" with error_report() 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: Kevin Wolf , qemu-block@nongnu.org, Stefan Weil , armbru@redhat.com, alistair.francis@xilinx.com, Paolo Bonzini , alistair23@gmail.com Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" Replace a large number of the fprintf(stderr, "*\n" calls with error_report(). The functions were renamed with these commands and then compiler issues where manually fixed. find ./* -type f -exec sed -i \ 'N;N;N;N;N;N;N;N;N;N;N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2);|Ig}' \ {} + find ./* -type f -exec sed -i \ 'N;N;N;N;N;N;N;N;N;N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2);|Ig}' \ {} + find ./* -type f -exec sed -i \ 'N;N;N;N;N;N;N;N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2);|Ig}' \ {} + find ./* -type f -exec sed -i \ 'N;N;N;N;N;N;N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2);|Ig}' \ {} + find ./* -type f -exec sed -i \ 'N;N;N;N;N;N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2);|Ig}' \ {} + find ./* -type f -exec sed -i \ 'N;N;N;N;N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2);|Ig}' \ {} + find ./* -type f -exec sed -i \ 'N;N;N;N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2);|Ig}' \ {} + find ./* -type f -exec sed -i \ 'N;N;N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2);|Ig}' \ {} + find ./* -type f -exec sed -i \ 'N;N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2);|Ig}' \ {} + find ./* -type f -exec sed -i \ 'N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2);|Ig}' \ {} + find ./* -type f -exec sed -i \ 'N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2);|Ig}' \ {} + Signed-off-by: Alistair Francis Cc: Kevin Wolf Cc: Markus Armbruster Cc: Paolo Bonzini Cc: Stefan Weil Cc: qemu-block@nongnu.org Reviewed-by: Philippe Mathieu-Daudé --- util/aio-posix.c | 5 +++-- util/coroutine-sigaltstack.c | 2 +- util/error.c | 2 +- util/main-loop.c | 2 +- util/mmap-alloc.c | 3 ++- util/module.c | 6 +++--- util/osdep.c | 4 ++-- util/oslib-posix.c | 3 ++- util/oslib-win32.c | 3 ++- util/qemu-coroutine.c | 5 +++-- util/qemu-progress.c | 3 ++- util/qemu-thread-posix.c | 5 +++-- util/qemu-thread-win32.c | 5 +++-- util/qemu-timer-common.c | 3 ++- util/qht.c | 2 +- 15 files changed, 31 insertions(+), 22 deletions(-) diff --git a/util/aio-posix.c b/util/aio-posix.c index 5946ac09f0..29fff51fcf 100644 --- a/util/aio-posix.c +++ b/util/aio-posix.c @@ -15,6 +15,7 @@ #include "qemu/osdep.h" #include "qemu-common.h" +#include "qemu/error-report.h" #include "block/block.h" #include "qemu/rcu_queue.h" #include "qemu/sockets.h" @@ -703,8 +704,8 @@ void aio_context_setup(AioContext *ctx) { /* TODO remove this in final patch submission */ if (getenv("QEMU_AIO_POLL_MAX_NS")) { - fprintf(stderr, "The QEMU_AIO_POLL_MAX_NS environment variable has " - "been replaced with -object iothread,poll-max-ns=NUM\n"); + error_report("The QEMU_AIO_POLL_MAX_NS environment variable has " + "been replaced with -object iothread,poll-max-ns=NUM"); exit(1); } diff --git a/util/coroutine-sigaltstack.c b/util/coroutine-sigaltstack.c index f6fc49a0e5..96a01c2c88 100644 --- a/util/coroutine-sigaltstack.c +++ b/util/coroutine-sigaltstack.c @@ -80,7 +80,7 @@ static void __attribute__((constructor)) coroutine_init(void) ret = pthread_key_create(&thread_state_key, qemu_coroutine_thread_cleanup); if (ret != 0) { - fprintf(stderr, "unable to create leader key: %s\n", strerror(errno)); + error_report("unable to create leader key: %s", strerror(errno)); abort(); } } diff --git a/util/error.c b/util/error.c index 3efdd69162..e423368ca0 100644 --- a/util/error.c +++ b/util/error.c @@ -32,7 +32,7 @@ Error *error_fatal; static void error_handle_fatal(Error **errp, Error *err) { if (errp == &error_abort) { - fprintf(stderr, "Unexpected error in %s() at %s:%d:\n", + error_report("Unexpected error in %s() at %s:%d:", err->func, err->src, err->line); error_report_err(err); abort(); diff --git a/util/main-loop.c b/util/main-loop.c index 7558eb5f53..d8369716b2 100644 --- a/util/main-loop.c +++ b/util/main-loop.c @@ -95,7 +95,7 @@ static int qemu_signal_init(void) sigdelset(&set, SIG_IPI); sigfd = qemu_signalfd(&set); if (sigfd == -1) { - fprintf(stderr, "failed to create signalfd\n"); + error_report("failed to create signalfd"); return -errno; } diff --git a/util/mmap-alloc.c b/util/mmap-alloc.c index 3ec029a9ea..11887aac69 100644 --- a/util/mmap-alloc.c +++ b/util/mmap-alloc.c @@ -11,6 +11,7 @@ */ #include "qemu/osdep.h" +#include "qemu/error-report.h" #include "qemu/mmap-alloc.h" #include "qemu/host-utils.h" @@ -51,7 +52,7 @@ size_t qemu_mempath_getpagesize(const char *mem_path) } while (ret != 0 && errno == EINTR); if (ret != 0) { - fprintf(stderr, "Couldn't statfs() memory path: %s\n", + error_report("Couldn't statfs() memory path: %s", strerror(errno)); exit(1); } diff --git a/util/module.c b/util/module.c index c90973721f..1153e3ebb0 100644 --- a/util/module.c +++ b/util/module.c @@ -124,13 +124,13 @@ static int module_load_file(const char *fname) g_module = g_module_open(fname, G_MODULE_BIND_LAZY | G_MODULE_BIND_LOCAL); if (!g_module) { - fprintf(stderr, "Failed to open module: %s\n", + error_report("Failed to open module: %s", g_module_error()); ret = -EINVAL; goto out; } if (!g_module_symbol(g_module, DSO_STAMP_FUN_STR, (gpointer *)&sym)) { - fprintf(stderr, "Failed to initialize module: %s\n", + error_report("Failed to initialize module: %s", fname); /* Print some info if this is a QEMU module (but from different build), * this will make debugging user problems easier. */ @@ -169,7 +169,7 @@ void module_load_one(const char *prefix, const char *lib_name) static GHashTable *loaded_modules; if (!g_module_supported()) { - fprintf(stderr, "Module is not supported by system.\n"); + error_report("Module is not supported by system."); return; } diff --git a/util/osdep.c b/util/osdep.c index a479fedc4a..62d92c9560 100644 --- a/util/osdep.c +++ b/util/osdep.c @@ -425,7 +425,7 @@ void fips_set_state(bool requested) #endif /* __linux__ */ #ifdef _FIPS_DEBUG - fprintf(stderr, "FIPS mode %s (requested %s)\n", + error_report("FIPS mode %s (requested %s)", (fips_enabled ? "enabled" : "disabled"), (requested ? "enabled" : "disabled")); #endif @@ -452,7 +452,7 @@ int socket_init(void) ret = WSAStartup(MAKEWORD(2, 2), &Data); if (ret != 0) { err = WSAGetLastError(); - fprintf(stderr, "WSAStartup: %d\n", err); + error_report("WSAStartup: %d", err); return -1; } atexit(socket_cleanup); diff --git a/util/oslib-posix.c b/util/oslib-posix.c index 80086c549f..d840692dd7 100644 --- a/util/oslib-posix.c +++ b/util/oslib-posix.c @@ -34,6 +34,7 @@ #include "sysemu/sysemu.h" #include "trace.h" #include "qapi/error.h" +#include "qemu/error-report.h" #include "qemu/sockets.h" #include #include @@ -87,7 +88,7 @@ int qemu_daemon(int nochdir, int noclose) void *qemu_oom_check(void *ptr) { if (ptr == NULL) { - fprintf(stderr, "Failed to allocate memory: %s\n", strerror(errno)); + error_report("Failed to allocate memory: %s", strerror(errno)); abort(); } return ptr; diff --git a/util/oslib-win32.c b/util/oslib-win32.c index 69a6286d50..2197a6a4fc 100644 --- a/util/oslib-win32.c +++ b/util/oslib-win32.c @@ -30,6 +30,7 @@ * see the license comment there. */ #include "qemu/osdep.h" +#include "qemu/error-report.h" #include #include "qapi/error.h" #include "sysemu/sysemu.h" @@ -44,7 +45,7 @@ void *qemu_oom_check(void *ptr) { if (ptr == NULL) { - fprintf(stderr, "Failed to allocate memory: %lu\n", GetLastError()); + error_report("Failed to allocate memory: %lu", GetLastError()); abort(); } return ptr; diff --git a/util/qemu-coroutine.c b/util/qemu-coroutine.c index d6095c1d5a..1f7cce6706 100644 --- a/util/qemu-coroutine.c +++ b/util/qemu-coroutine.c @@ -13,6 +13,7 @@ */ #include "qemu/osdep.h" +#include "qemu/error-report.h" #include "trace.h" #include "qemu-common.h" #include "qemu/thread.h" @@ -110,7 +111,7 @@ void qemu_aio_coroutine_enter(AioContext *ctx, Coroutine *co) trace_qemu_aio_coroutine_enter(ctx, self, co, co->entry_arg); if (co->caller) { - fprintf(stderr, "Co-routine re-entered recursively\n"); + error_report("Co-routine re-entered recursively"); abort(); } @@ -164,7 +165,7 @@ void coroutine_fn qemu_coroutine_yield(void) trace_qemu_coroutine_yield(self, to); if (!to) { - fprintf(stderr, "Co-routine is yielding to no one\n"); + error_report("Co-routine is yielding to no one"); abort(); } diff --git a/util/qemu-progress.c b/util/qemu-progress.c index 3c2223c1a2..84598f0fbb 100644 --- a/util/qemu-progress.c +++ b/util/qemu-progress.c @@ -23,6 +23,7 @@ */ #include "qemu/osdep.h" +#include "qemu/error-report.h" #include "qemu-common.h" struct progress_state { @@ -68,7 +69,7 @@ static void sigusr_print(int signal) static void progress_dummy_print(void) { if (print_pending) { - fprintf(stderr, " (%3.2f/100%%)\n", state.current); + error_report(" (%3.2f/100%%)", state.current); print_pending = 0; } } diff --git a/util/qemu-thread-posix.c b/util/qemu-thread-posix.c index 7306475899..1207ef71d6 100644 --- a/util/qemu-thread-posix.c +++ b/util/qemu-thread-posix.c @@ -11,6 +11,7 @@ * */ #include "qemu/osdep.h" +#include "qemu/error-report.h" #include "qemu/thread.h" #include "qemu/atomic.h" #include "qemu/notify.h" @@ -25,14 +26,14 @@ void qemu_thread_naming(bool enable) #ifndef CONFIG_THREAD_SETNAME_BYTHREAD /* This is a debugging option, not fatal */ if (enable) { - fprintf(stderr, "qemu: thread naming not supported on this host\n"); + error_report("thread naming not supported on this host"); } #endif } static void error_exit(int err, const char *msg) { - fprintf(stderr, "qemu: %s: %s\n", msg, strerror(err)); + error_report("%s: %s", msg, strerror(err)); abort(); } diff --git a/util/qemu-thread-win32.c b/util/qemu-thread-win32.c index 94f3491a87..02b94e22da 100644 --- a/util/qemu-thread-win32.c +++ b/util/qemu-thread-win32.c @@ -16,6 +16,7 @@ #endif #include "qemu/osdep.h" +#include "qemu/error-report.h" #include "qemu-common.h" #include "qemu/thread.h" #include "qemu/notify.h" @@ -29,7 +30,7 @@ void qemu_thread_naming(bool enable) /* But note we don't actually name them on Windows yet */ name_threads = enable; - fprintf(stderr, "qemu: thread naming not supported on this host\n"); + error_report("thread naming not supported on this host"); } static void error_exit(int err, const char *msg) @@ -38,7 +39,7 @@ static void error_exit(int err, const char *msg) FormatMessage(FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_ALLOCATE_BUFFER, NULL, err, 0, (LPTSTR)&pstr, 2, NULL); - fprintf(stderr, "qemu: %s: %s\n", msg, pstr); + error_report("%s: %s", msg, pstr); LocalFree(pstr); abort(); } diff --git a/util/qemu-timer-common.c b/util/qemu-timer-common.c index 06d084d364..ab7b702c4f 100644 --- a/util/qemu-timer-common.c +++ b/util/qemu-timer-common.c @@ -22,6 +22,7 @@ * THE SOFTWARE. */ #include "qemu/osdep.h" +#include "qemu/error-report.h" #include "qemu/timer.h" /***********************************************************/ @@ -37,7 +38,7 @@ static void __attribute__((constructor)) init_get_clock(void) int ret; ret = QueryPerformanceFrequency(&freq); if (ret == 0) { - fprintf(stderr, "Could not calibrate ticks\n"); + error_report("Could not calibrate ticks"); exit(1); } clock_freq = freq.QuadPart; diff --git a/util/qht.c b/util/qht.c index ff4d2e6974..bfab5c7e5e 100644 --- a/util/qht.c +++ b/util/qht.c @@ -154,7 +154,7 @@ static void qht_bucket_debug__locked(struct qht_bucket *b) continue; } if (seen_empty) { - fprintf(stderr, "%s: b: %p, pos: %i, hash: 0x%x, p: %p\n", + error_report("%s: b: %p, pos: %i, hash: 0x%x, p: %p", __func__, b, i, b->hashes[i], b->pointers[i]); corrupt = true; } From patchwork Thu Oct 19 16:18:21 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alistair Francis X-Patchwork-Id: 828243 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; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=xilinx.onmicrosoft.com header.i=@xilinx.onmicrosoft.com header.b="0gs9AQbj"; 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 3yHw2T058Xz9rxj for ; Fri, 20 Oct 2017 03:52:17 +1100 (AEDT) Received: from localhost ([::1]:50228 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e5E3L-00062y-1z for incoming@patchwork.ozlabs.org; Thu, 19 Oct 2017 12:52:15 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:56194) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e5DaQ-00065V-PS for qemu-devel@nongnu.org; Thu, 19 Oct 2017 12:22:25 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1e5DaN-0002DK-HD for qemu-devel@nongnu.org; Thu, 19 Oct 2017 12:22:22 -0400 Received: from mail-sn1nam01on0043.outbound.protection.outlook.com ([104.47.32.43]:65360 helo=NAM01-SN1-obe.outbound.protection.outlook.com) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1e5DaN-0002Ce-7M for qemu-devel@nongnu.org; Thu, 19 Oct 2017 12:22:19 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=xilinx.onmicrosoft.com; s=selector1-xilinx-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=G5IfF4IcxhR9wboSV7kSK6PE790zRa06K36F0SI8tXI=; b=0gs9AQbj/dwe64cu3MmwwXOexsJI5jtvI6vZY93ArAkbqAMT/OlFapTXpzTzQPxU9sGPJTGDEgX6n04fqpSHTXaz/+/saGl13CAzJZM0/RQeKXC3v2AS+L2xKPd6GH4WM7D0oDr7H0wu4YsrunnrsPYDt1hoKuAPBxcF7SoMYXk= Received: from BY2PR02CA0113.namprd02.prod.outlook.com (10.163.44.167) by BY2PR02MB1330.namprd02.prod.outlook.com (10.162.79.25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.77.7; Thu, 19 Oct 2017 16:22:17 +0000 Received: from BL2NAM02FT045.eop-nam02.prod.protection.outlook.com (2a01:111:f400:7e46::207) by BY2PR02CA0113.outlook.office365.com (2a01:111:e400:5261::39) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.77.7 via Frontend Transport; Thu, 19 Oct 2017 16:22:16 +0000 Authentication-Results: spf=pass (sender IP is 149.199.60.100) smtp.mailfrom=xilinx.com; redhat.com; dkim=none (message not signed) header.d=none;redhat.com; dmarc=bestguesspass action=none header.from=xilinx.com; Received-SPF: Pass (protection.outlook.com: domain of xilinx.com designates 149.199.60.100 as permitted sender) receiver=protection.outlook.com; client-ip=149.199.60.100; helo=xsj-pvapsmtpgw02; Received: from xsj-pvapsmtpgw02 (149.199.60.100) by BL2NAM02FT045.mail.protection.outlook.com (10.152.77.16) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.20.77.10 via Frontend Transport; Thu, 19 Oct 2017 16:22:16 +0000 Received: from unknown-38-66.xilinx.com ([149.199.38.66]:39544 helo=xsj-pvapsmtp01) by xsj-pvapsmtpgw02 with esmtp (Exim 4.63) (envelope-from ) id 1e5DaJ-0007yU-KY; Thu, 19 Oct 2017 09:22:15 -0700 Received: from [127.0.0.1] (helo=localhost) by xsj-pvapsmtp01 with smtp (Exim 4.63) (envelope-from ) id 1e5DaJ-0003J5-H8; Thu, 19 Oct 2017 09:22:15 -0700 Received: from xsj-pvapsmtp01 (maildrop.xilinx.com [149.199.38.66]) by xsj-smtp-dlp2.xlnx.xilinx.com (8.13.8/8.13.1) with ESMTP id v9JGMDEf007108; Thu, 19 Oct 2017 09:22:14 -0700 Received: from [172.19.2.220] (helo=localhost.localdomain) by xsj-pvapsmtp01 with esmtp (Exim 4.63) (envelope-from ) id 1e5DaH-0003IE-Pc; Thu, 19 Oct 2017 09:22:13 -0700 From: Alistair Francis To: Date: Thu, 19 Oct 2017 09:18:21 -0700 Message-ID: X-Mailer: git-send-email 2.11.0 In-Reply-To: References: X-RCIS-Action: ALLOW X-TM-AS-Product-Ver: IMSS-7.1.0.1224-8.1.0.1062-23404.005 X-TM-AS-User-Approved-Sender: Yes;Yes X-EOPAttributedMessage: 0 X-MS-Office365-Filtering-HT: Tenant X-Forefront-Antispam-Report: CIP:149.199.60.100; IPV:NLI; CTRY:US; EFV:NLI; SFV:NSPM; SFS:(10009020)(6009001)(346002)(39860400002)(376002)(2980300002)(438002)(189002)(199003)(2950100002)(189998001)(5660300001)(81166006)(54906003)(8676002)(6916009)(8936002)(33646002)(118296001)(50226002)(478600001)(77096006)(106002)(81156014)(356003)(16586007)(36386004)(2906002)(2351001)(305945005)(4326008)(5003940100001)(316002)(63266004)(36756003)(50466002)(9786002)(76176999)(6666003)(47776003)(575784001)(48376002)(39060400002)(50986999)(106466001)(107986001)(5001870100001); DIR:OUT; SFP:1101; SCL:1; SRVR:BY2PR02MB1330; H:xsj-pvapsmtpgw02; FPR:; SPF:Pass; PTR:unknown-60-100.xilinx.com,xapps1.xilinx.com; MX:1; A:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BL2NAM02FT045; 1:WcruRXF/bWn4zg0tAI+hKHdUXxD/7GT9z3j6VUdYR2aMTP8dDFzYyFynSvP4aTnes3R6BtqfXtCXCh+zSBwx7YjANmAwYHTmuEiDwVluB/+Em674gxr6A2bhFGyC9M+f MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 8fd1efdf-c3e5-42ae-c306-08d5170d904f X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001)(2017030254152)(8251501002)(2017052603199)(201703131423075)(201703031133081)(201702281549075); SRVR:BY2PR02MB1330; X-Microsoft-Exchange-Diagnostics: 1; BY2PR02MB1330; 3:W6OALR1uvjzoWk3QopgEePF9AEi9cKxzLe52KZODpbGmuN698Usxf9u0luEq8ctVhm54giKDyuSTkkrrMB3Z9GfovjX042QnNfIcNTwBMmcqkPPN2IvkSLjvt9xIvak1xsmIdFDHqbW9TQejYkw/20qNc51Sgc+SjogHZzdEL8RtQ6UuNL0hDbT4O5AKyYdXSwFFFd2tX6keM2ILOk+aaUyo4kd/VTZZLI+K0zZjhdZcjM4ZetDv1yO1NlzMl+JQHUDLXZfygDmGZbfeIZNaFO/p9tBvgWHa7QMhBy6FPTxXU7x3EMTvAH71ynKLPg5dgKaeqt/VrafEabzY99+v09j+K0RKZnYifGiuvzqEpSI=; 25:Xut70NjCyxZOGcnHAnuk/doGK5fIsIYhFEmekMbP8h8bfVG3p/Zyr7iiM7PCH/5CXK4QJEjQSl4CMQ2sfhDqEV5e+vBbGN1dgd8a9Fb/UlFIkb/UaPl0nkfl52vJutmZj+vkqycINBPNrNhd3n0Xrp+E6UItZ2uFo8beT2+puF5eRrpirgx3TK0iH76RI+C+LlEXLrWB88s+K9q93BAF0gnb8zaq6FWUXwlsfD04dwIXjvQdUSrflhREiGtrW3bgqkaAONZIQEJkWeJwzvXpn/U+RmXE4sDBownCbrpkSReMCuTa5KmdZziTiTq6DpbojlOdRWfml6AEj8OH4Bohrg== X-MS-TrafficTypeDiagnostic: BY2PR02MB1330: X-Microsoft-Exchange-Diagnostics: 1; BY2PR02MB1330; 31:O9O7FIC6eHXCBOSImQsMroVUivovlXhlGr8hP4csP4nGbsfSElIb/N9J1Iv2HELaX5rZYYo693Rws7aLV8pOyabbbOCJca+FSCGr6tQ4MtNOghfoF7IB4LolBQBjgd9bEMpbTa9eKD8gvhkuyKfEf8Z5KQmQfkqi2LFk/AM8xKyq4mEOzuMSUoQ7PP52JGhgruvzFk3PxM76Yjv7x+rmFvG6CgcraaKMShMZptw9HpM=; 20:8ahqlTF1FkPDsXwHnaJAS8Y+eGju1JzUB7EQdzU/yeq/SqSmfAUjEWuAGbaiD2NNRHFNfG+5n9a415freVwMf54SMnQ7FdYPvoIWUM+YnqiNWVOUNesypTYAv7icoF+td8WJ8UMRQOOmr9SnZWAGhhBiWxSfoJQIxGA2GRtHianDuT8ija+zmvuZ+rcHssuAGLuQ7F3Y0l9TAIo5rNNYmUTqIa346Bkg1Kp+CswjmXyl5B7IrkZjH/Wtd5xhII/Wg2p05YSCRPmnPOmN3Ryt16BshbV09LFybcvQnstgLdro1+xwVfGHRtwrJdbfJumbyQj2dJId14Uafi5/kV3vif5QTKmaUWF/Llgvm4F8Zo7ZRJYavlw4dhG4GRVv+eWtQ/5Ww03XKuuRKJnBHWsas9Ht2W0Pa38IuscK4SPETpYDNmdrF8kzmJzJe5owIi1XhQDZ8uofVB3pWeIvCM7CcNRf1Q2WOZ/TK6drP7MRqRPPCKKaDqR10MHKC3iJLAo9 X-Exchange-Antispam-Report-Test: UriScan:(788757137089)(192813158149592); X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(100000700101)(100105000095)(100000701101)(100105300095)(100000702101)(100105100095)(6040450)(2401047)(5005006)(8121501046)(10201501046)(3002001)(100000703101)(100105400095)(93006095)(93004095)(6055026)(6041248)(20161123558100)(20161123562025)(20161123560025)(20161123564025)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123555025)(6072148)(201708071742011)(100000704101)(100105200095)(100000705101)(100105500095); SRVR:BY2PR02MB1330; BCL:0; PCL:0; RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095); SRVR:BY2PR02MB1330; X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sLROrirlgmv21zX25IpRwZ7i4F82A7uFFuar2gw+nBqaKEJA8BXL0n++sxZvw=; 7:i4h66QfZs35AQw0mzyVQMWAYcu6ptIAkuJEmO+IyLjlujJadgGDQwqk4HH/ZIddiG9nXb5jVh/E9CRLLdZEcOp9NLSTVNaz0qiSf/IAU3RZUrJRRIPx7Y/vHX16QTLCYv4PAT5PVtqLDtqmAzR8PE/IXbNRO/WLx+zOO5OSkTuanJ6PVMqvDMooSkqd3xy08sc8pBRreFsHpyOlBfas9gUIG8QRryAG01LW3KMB3AKM= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: xilinx.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 19 Oct 2017 16:22:16.2515 (UTC) X-MS-Exchange-CrossTenant-Id: 657af505-d5df-48d0-8300-c31994686c5c X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=657af505-d5df-48d0-8300-c31994686c5c; Ip=[149.199.60.100]; Helo=[xsj-pvapsmtpgw02] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BY2PR02MB1330 X-detected-operating-system: by eggs.gnu.org: Windows 7 or 8 [fuzzy] X-Received-From: 104.47.32.43 Subject: [Qemu-devel] [PATCH v3 43/46] ui: Replace fprintf(stderr, "*\n" with error_report() 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: Peter Maydell , alistair23@gmail.com, Gerd Hoffmann , armbru@redhat.com, alistair.francis@xilinx.com Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" Replace a large number of the fprintf(stderr, "*\n" calls with error_report(). The functions were renamed with these commands and then compiler issues where manually fixed. find ./* -type f -exec sed -i \ 'N;N;N;N;N;N;N;N;N;N;N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2);|Ig}' \ {} + find ./* -type f -exec sed -i \ 'N;N;N;N;N;N;N;N;N;N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2);|Ig}' \ {} + find ./* -type f -exec sed -i \ 'N;N;N;N;N;N;N;N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2);|Ig}' \ {} + find ./* -type f -exec sed -i \ 'N;N;N;N;N;N;N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2);|Ig}' \ {} + find ./* -type f -exec sed -i \ 'N;N;N;N;N;N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2);|Ig}' \ {} + find ./* -type f -exec sed -i \ 'N;N;N;N;N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2);|Ig}' \ {} + find ./* -type f -exec sed -i \ 'N;N;N;N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2);|Ig}' \ {} + find ./* -type f -exec sed -i \ 'N;N;N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2);|Ig}' \ {} + find ./* -type f -exec sed -i \ 'N;N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2);|Ig}' \ {} + find ./* -type f -exec sed -i \ 'N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2);|Ig}' \ {} + find ./* -type f -exec sed -i \ 'N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2);|Ig}' \ {} + Signed-off-by: Alistair Francis Cc: Peter Maydell Cc: Gerd Hoffmann --- ui/cocoa.m | 6 +++--- ui/console.c | 2 +- ui/curses.c | 2 +- ui/cursor.c | 10 +++++----- ui/gtk.c | 10 +++++----- ui/input-linux.c | 3 ++- ui/keymaps.c | 4 ++-- ui/sdl.c | 14 +++++++------- ui/sdl2.c | 8 ++++---- ui/sdl_zoom.c | 3 ++- ui/shader.c | 9 +++++---- ui/spice-display.c | 10 +++++----- ui/vnc-enc-tight.c | 4 ++-- ui/vnc-enc-zlib.c | 4 ++-- ui/vnc-enc-zrle.c | 4 ++-- ui/vnc.c | 2 +- 16 files changed, 49 insertions(+), 46 deletions(-) diff --git a/ui/cocoa.m b/ui/cocoa.m index 93e56d0518..62c021c5d3 100644 --- a/ui/cocoa.m +++ b/ui/cocoa.m @@ -235,7 +235,7 @@ const int mac_to_qkeycode_map[] = { static int cocoa_keycode_to_qemu(int keycode) { if (ARRAY_SIZE(mac_to_qkeycode_map) <= keycode) { - fprintf(stderr, "(cocoa) warning unknown keycode 0x%x\n", keycode); + error_report("(cocoa) warning unknown keycode 0x%x", keycode); return 0; } return mac_to_qkeycode_map[keycode]; @@ -908,7 +908,7 @@ QemuCocoaView *cocoaView; // create a view and add it to the window cocoaView = [[QemuCocoaView alloc] initWithFrame:NSMakeRect(0.0, 0.0, 640.0, 480.0)]; if(!cocoaView) { - fprintf(stderr, "(cocoa) can't create a view\n"); + error_report("(cocoa) can't create a view"); exit(1); } @@ -917,7 +917,7 @@ QemuCocoaView *cocoaView; styleMask:NSWindowStyleMaskTitled|NSWindowStyleMaskMiniaturizable|NSWindowStyleMaskClosable backing:NSBackingStoreBuffered defer:NO]; if(!normalWindow) { - fprintf(stderr, "(cocoa) can't create window\n"); + error_report("(cocoa) can't create window"); exit(1); } [normalWindow setAcceptsMouseMovedEvents:YES]; diff --git a/ui/console.c b/ui/console.c index b82c27960a..56d0ebcb50 100644 --- a/ui/console.c +++ b/ui/console.c @@ -1417,7 +1417,7 @@ void register_displaychangelistener(DisplayChangeListener *dcl) /* display has opengl support */ assert(dcl->con); if (dcl->con->gl) { - fprintf(stderr, "can't register two opengl displays (%s, %s)\n", + error_report("can't register two opengl displays (%s, %s)", dcl->ops->dpy_name, dcl->con->gl->ops->dpy_name); exit(1); } diff --git a/ui/curses.c b/ui/curses.c index 85503876c0..11c862520f 100644 --- a/ui/curses.c +++ b/ui/curses.c @@ -438,7 +438,7 @@ void curses_display_init(DisplayState *ds, int full_screen) { #ifndef _WIN32 if (!isatty(1)) { - fprintf(stderr, "We need a terminal output\n"); + error_report("We need a terminal output"); exit(1); } #endif diff --git a/ui/cursor.c b/ui/cursor.c index f3da0cee79..9d847031ec 100644 --- a/ui/cursor.c +++ b/ui/cursor.c @@ -18,12 +18,12 @@ static QEMUCursor *cursor_parse_xpm(const char *xpm[]) /* parse header line: width, height, #colors, #chars */ if (sscanf(xpm[line], "%u %u %u %u", &width, &height, &colors, &chars) != 4) { - fprintf(stderr, "%s: header parse error: \"%s\"\n", - __func__, xpm[line]); + error_report("%s: header parse error: \"%s\"", + __func__, xpm[line]); return NULL; } if (chars != 1) { - fprintf(stderr, "%s: chars != 1 not supported\n", __func__); + error_report("%s: chars != 1 not supported", __func__); return NULL; } line++; @@ -40,7 +40,7 @@ static QEMUCursor *cursor_parse_xpm(const char *xpm[]) continue; } } - fprintf(stderr, "%s: color parse error: \"%s\"\n", + error_report("%s: color parse error: \"%s\"", __func__, xpm[line]); return NULL; } @@ -75,7 +75,7 @@ void cursor_print_ascii_art(QEMUCursor *c, const char *prefix) fprintf(stderr, "o"); /* other */ } } - fprintf(stderr, "|\n"); + error_report("|"); } } diff --git a/ui/gtk.c b/ui/gtk.c index 342e96fbe9..91b269d9d0 100644 --- a/ui/gtk.c +++ b/ui/gtk.c @@ -1254,7 +1254,7 @@ static gboolean gd_win_grab(void *opaque) { VirtualConsole *vc = opaque; - fprintf(stderr, "%s: %s\n", __func__, vc->label); + error_report("%s: %s", __func__, vc->label); if (vc->s->ptr_owner) { gd_ungrab_pointer(vc->s); } else { @@ -2215,12 +2215,12 @@ static void gd_set_keycode_type(GtkDisplayState *s) keycodes = XGetAtomName(x11_display, desc->names->keycodes); } if (keycodes == NULL) { - fprintf(stderr, "could not lookup keycode name\n"); + error_report("could not lookup keycode name"); } else if (strstart(keycodes, "evdev", NULL)) { s->has_evdev = true; } else if (!strstart(keycodes, "xfree86", NULL)) { - fprintf(stderr, "unknown keycodes `%s', please report to " - "qemu-devel@nongnu.org\n", keycodes); + error_report("unknown keycodes `%s', please report to " + "qemu-devel@nongnu.org", keycodes); } if (desc) { @@ -2244,7 +2244,7 @@ void gtk_display_init(DisplayState *ds, bool full_screen, bool grab_on_hover) GdkDisplay *window_display; if (!gtkinit) { - fprintf(stderr, "gtk initialization failed\n"); + error_report("gtk initialization failed"); exit(1); } diff --git a/ui/input-linux.c b/ui/input-linux.c index 9720333b2c..edc5273476 100644 --- a/ui/input-linux.c +++ b/ui/input-linux.c @@ -5,6 +5,7 @@ */ #include "qemu/osdep.h" +#include "qemu/error-report.h" #include "qapi/error.h" #include "qemu-common.h" #include "qemu/config-file.h" @@ -241,7 +242,7 @@ static void input_linux_event(void *opaque) rc = read(il->fd, &p[il->read_offset], read_size); if (rc != read_size) { if (rc < 0 && errno != EAGAIN) { - fprintf(stderr, "%s: read: %s\n", __func__, strerror(errno)); + error_report("%s: read: %s", __func__, strerror(errno)); qemu_set_fd_handler(il->fd, NULL, NULL, NULL); close(il->fd); } else if (rc > 0) { diff --git a/ui/keymaps.c b/ui/keymaps.c index f9762d1497..41c5e42553 100644 --- a/ui/keymaps.c +++ b/ui/keymaps.c @@ -105,7 +105,7 @@ static kbd_layout_t *parse_keyboard_layout(const name2keysym_t *table, f = filename ? fopen(filename, "r") : NULL; g_free(filename); if (!f) { - fprintf(stderr, "Could not read keymap file: '%s'\n", language); + error_report("Could not read keymap file: '%s'", language); return NULL; } @@ -150,7 +150,7 @@ static kbd_layout_t *parse_keyboard_layout(const name2keysym_t *table, if (strstr(rest, "numlock")) { add_to_key_range(&k->keypad_range, keycode); add_to_key_range(&k->numlock_range, keysym); - /* fprintf(stderr, "keypad keysym %04x keycode %d\n", + /* error_report("keypad keysym %04x keycode %d", keysym, keycode); */ } diff --git a/ui/sdl.c b/ui/sdl.c index 7b71a9ac58..29db4c68ad 100644 --- a/ui/sdl.c +++ b/ui/sdl.c @@ -91,7 +91,7 @@ static void sdl_update(DisplayChangeListener *dcl, SDL_BlitSurface(guest_screen, &rec, real_screen, &rec); } else { if (sdl_zoom_blit(guest_screen, real_screen, SMOOTHING_ON, &rec) < 0) { - fprintf(stderr, "Zoom blit failed\n"); + error_report("Zoom blit failed"); exit(1); } } @@ -120,7 +120,7 @@ static void do_sdl_resize(int width, int height, int bpp) tmp_screen = SDL_SetVideoMode(width, height, bpp, flags); if (!real_screen) { if (!tmp_screen) { - fprintf(stderr, "Could not open SDL display (%dx%dx%d): %s\n", + error_report("Could not open SDL display (%dx%dx%d): %s", width, height, bpp, SDL_GetError()); exit(1); } @@ -130,7 +130,7 @@ static void do_sdl_resize(int width, int height, int bpp) * resolution failed. */ if (!tmp_screen) { - fprintf(stderr, "Failed to set SDL display (%dx%dx%d): %s\n", + error_report("Failed to set SDL display (%dx%dx%d): %s", width, height, bpp, SDL_GetError()); return; } @@ -241,12 +241,12 @@ static int check_for_evdev(void) XkbKeycodesNameMask, desc) == Success)) { keycodes = XGetAtomName(info.info.x11.display, desc->names->keycodes); if (keycodes == NULL) { - fprintf(stderr, "could not lookup keycode name\n"); + error_report("could not lookup keycode name"); } else if (strstart(keycodes, "evdev", NULL)) { has_evdev = 1; } else if (!strstart(keycodes, "xfree86", NULL)) { - fprintf(stderr, "unknown keycodes `%s', please report to " - "qemu-devel@nongnu.org\n", keycodes); + error_report("unknown keycodes `%s', please report to " + "qemu-devel@nongnu.org", keycodes); } } @@ -988,7 +988,7 @@ void sdl_display_init(DisplayState *ds, int full_screen, int no_frame) flags = SDL_INIT_VIDEO | SDL_INIT_NOPARACHUTE; if (SDL_Init (flags)) { - fprintf(stderr, "Could not initialize SDL(%s) - exiting\n", + error_report("Could not initialize SDL(%s) - exiting", SDL_GetError()); exit(1); } diff --git a/ui/sdl2.c b/ui/sdl2.c index 53dd447fd2..f6700e70f5 100644 --- a/ui/sdl2.c +++ b/ui/sdl2.c @@ -400,7 +400,7 @@ static void handle_keydown(SDL_Event *ev) 160); height = (surface_height(scon->surface) * width) / surface_width(scon->surface); - fprintf(stderr, "%s: scale to %dx%d\n", + error_report("%s: scale to %dx%d", __func__, width, height); sdl_scale(scon, width, height); sdl2_redraw(scon); @@ -686,13 +686,13 @@ static void sdl_mouse_define(DisplayChangeListener *dcl, 0xff0000, 0x00ff00, 0xff, 0xff000000); if (!guest_sprite_surface) { - fprintf(stderr, "Failed to make rgb surface from %p\n", c); + error_report("Failed to make rgb surface from %p", c); return; } guest_sprite = SDL_CreateColorCursor(guest_sprite_surface, c->hot_x, c->hot_y); if (!guest_sprite) { - fprintf(stderr, "Failed to make color cursor from %p\n", c); + error_report("Failed to make color cursor from %p", c); return; } if (guest_cursor && @@ -783,7 +783,7 @@ void sdl_display_init(DisplayState *ds, int full_screen, int no_frame) flags = SDL_INIT_VIDEO | SDL_INIT_NOPARACHUTE; if (SDL_Init(flags)) { - fprintf(stderr, "Could not initialize SDL(%s) - exiting\n", + error_report("Could not initialize SDL(%s) - exiting", SDL_GetError()); exit(1); } diff --git a/ui/sdl_zoom.c b/ui/sdl_zoom.c index b96196bac5..bf73d1f1f9 100644 --- a/ui/sdl_zoom.c +++ b/ui/sdl_zoom.c @@ -12,6 +12,7 @@ */ #include "qemu/osdep.h" +#include "qemu/error-report.h" #include "sdl_zoom.h" static void sdl_zoom_rgb16(SDL_Surface *src, SDL_Surface *dst, int smooth, @@ -81,7 +82,7 @@ int sdl_zoom_blit(SDL_Surface *src_sfc, SDL_Surface *dst_sfc, int smooth, else if (src_sfc->format->BitsPerPixel == 16) sdl_zoom_rgb16(src_sfc, dst_sfc, smooth, &zoom); else { - fprintf(stderr, "pixel format not supported\n"); + error_report("pixel format not supported"); return -1; } diff --git a/ui/shader.c b/ui/shader.c index 1ffddbef3b..cecaa4876f 100644 --- a/ui/shader.c +++ b/ui/shader.c @@ -25,6 +25,7 @@ * THE SOFTWARE. */ #include "qemu/osdep.h" +#include "qemu/error-report.h" #include "qemu-common.h" #include "ui/shader.h" @@ -85,9 +86,9 @@ GLuint qemu_gl_create_compile_shader(GLenum type, const GLchar *src) glGetShaderiv(shader, GL_INFO_LOG_LENGTH, &length); errmsg = g_malloc(length); glGetShaderInfoLog(shader, length, &length, errmsg); - fprintf(stderr, "%s: compile %s error\n%s\n", __func__, - (type == GL_VERTEX_SHADER) ? "vertex" : "fragment", - errmsg); + error_report("%s: compile %s error: %s", __func__, + (type == GL_VERTEX_SHADER) ? "vertex" : "fragment", + errmsg); g_free(errmsg); return 0; } @@ -110,7 +111,7 @@ GLuint qemu_gl_create_link_program(GLuint vert, GLuint frag) glGetProgramiv(program, GL_INFO_LOG_LENGTH, &length); errmsg = g_malloc(length); glGetProgramInfoLog(program, length, &length, errmsg); - fprintf(stderr, "%s: link program: %s\n", __func__, errmsg); + error_report("%s: link program: %s", __func__, errmsg); g_free(errmsg); return 0; } diff --git a/ui/spice-display.c b/ui/spice-display.c index 346fff44f4..8cf126e7b0 100644 --- a/ui/spice-display.c +++ b/ui/spice-display.c @@ -630,13 +630,13 @@ static int interface_req_cursor_notification(QXLInstance *sin) static void interface_notify_update(QXLInstance *sin, uint32_t update_id) { - fprintf(stderr, "%s: abort()\n", __func__); + error_report("%s: abort()", __func__); abort(); } static int interface_flush_resources(QXLInstance *sin) { - fprintf(stderr, "%s: abort()\n", __func__); + error_report("%s: abort()", __func__); abort(); return 0; } @@ -646,7 +646,7 @@ static void interface_update_area_complete(QXLInstance *sin, QXLRect *dirty, uint32_t num_updated_rects) { /* should never be called, used in qxl native mode only */ - fprintf(stderr, "%s: abort()\n", __func__); + error_report("%s: abort()", __func__); abort(); } @@ -671,7 +671,7 @@ static void interface_async_complete(QXLInstance *sin, uint64_t cookie_token) #endif default: /* should never be called, used in qxl native mode only */ - fprintf(stderr, "%s: abort()\n", __func__); + error_report("%s: abort()", __func__); abort(); } g_free(cookie); @@ -955,7 +955,7 @@ static void qemu_spice_gl_scanout_texture(DisplayChangeListener *dcl, assert(tex_id); fd = egl_get_fd_for_texture(tex_id, &stride, &fourcc); if (fd < 0) { - fprintf(stderr, "%s: failed to get fd for texture\n", __func__); + error_report("%s: failed to get fd for texture", __func__); return; } dprint(1, "%s: %dx%d (stride %d, fourcc 0x%x)\n", __func__, diff --git a/ui/vnc-enc-tight.c b/ui/vnc-enc-tight.c index f38aceb4da..7ac957057d 100644 --- a/ui/vnc-enc-tight.c +++ b/ui/vnc-enc-tight.c @@ -800,7 +800,7 @@ static int tight_init_stream(VncState *vs, int stream_id, MAX_MEM_LEVEL, strategy); if (err != Z_OK) { - fprintf(stderr, "VNC: error initializing zlib\n"); + error_report("VNC: error initializing zlib"); return -1; } @@ -865,7 +865,7 @@ static int tight_compress_data(VncState *vs, int stream_id, size_t bytes, /* start encoding */ if (deflate(zstream, Z_SYNC_FLUSH) != Z_OK) { - fprintf(stderr, "VNC: error during tight compression\n"); + error_report("VNC: error during tight compression"); return -1; } diff --git a/ui/vnc-enc-zlib.c b/ui/vnc-enc-zlib.c index 33e9df2f6a..437cfb1307 100644 --- a/ui/vnc-enc-zlib.c +++ b/ui/vnc-enc-zlib.c @@ -80,7 +80,7 @@ static int vnc_zlib_stop(VncState *vs) MAX_MEM_LEVEL, Z_DEFAULT_STRATEGY); if (err != Z_OK) { - fprintf(stderr, "VNC: error initializing zlib\n"); + error_report("VNC: error initializing zlib"); return -1; } @@ -109,7 +109,7 @@ static int vnc_zlib_stop(VncState *vs) // start encoding if (deflate(zstream, Z_SYNC_FLUSH) != Z_OK) { - fprintf(stderr, "VNC: error during zlib compression\n"); + error_report("VNC: error during zlib compression"); return -1; } diff --git a/ui/vnc-enc-zrle.c b/ui/vnc-enc-zrle.c index fd63d4f688..a3af8a1c5d 100644 --- a/ui/vnc-enc-zrle.c +++ b/ui/vnc-enc-zrle.c @@ -85,7 +85,7 @@ static int zrle_compress_data(VncState *vs, int level) MAX_MEM_LEVEL, Z_DEFAULT_STRATEGY); if (err != Z_OK) { - fprintf(stderr, "VNC: error initializing zlib\n"); + error_report("VNC: error initializing zlib"); return -1; } @@ -104,7 +104,7 @@ static int zrle_compress_data(VncState *vs, int level) /* start encoding */ if (deflate(zstream, Z_SYNC_FLUSH) != Z_OK) { - fprintf(stderr, "VNC: error during zrle compression\n"); + error_report("VNC: error during zrle compression"); return -1; } diff --git a/ui/vnc.c b/ui/vnc.c index 9f8d5a1b1f..05fd3922a5 100644 --- a/ui/vnc.c +++ b/ui/vnc.c @@ -71,7 +71,7 @@ static void vnc_set_share_mode(VncState *vs, VncShareMode mode) [VNC_SHARE_MODE_EXCLUSIVE] = "exclusive", [VNC_SHARE_MODE_DISCONNECTED] = "disconnected", }; - fprintf(stderr, "%s/%p: %s -> %s\n", __func__, + error_report("%s/%p: %s -> %s", __func__, vs->ioc, mn[vs->share_mode], mn[mode]); #endif From patchwork Thu Oct 19 16:18:24 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alistair Francis X-Patchwork-Id: 828217 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; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=xilinx.onmicrosoft.com header.i=@xilinx.onmicrosoft.com header.b="hc4mpubo"; 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 3yHvg50N5Rz9t7p for ; Fri, 20 Oct 2017 03:35:28 +1100 (AEDT) Received: from localhost ([::1]:50134 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e5Dn3-0008JI-Jt for incoming@patchwork.ozlabs.org; Thu, 19 Oct 2017 12:35:25 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:56304) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e5Dac-0006HT-UF for qemu-devel@nongnu.org; Thu, 19 Oct 2017 12:22:36 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1e5DaZ-0002QK-MC for qemu-devel@nongnu.org; Thu, 19 Oct 2017 12:22:34 -0400 Received: from mail-bn3nam01on0069.outbound.protection.outlook.com ([104.47.33.69]:8016 helo=NAM01-BN3-obe.outbound.protection.outlook.com) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1e5DaZ-0002PZ-Fg for qemu-devel@nongnu.org; Thu, 19 Oct 2017 12:22:31 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=xilinx.onmicrosoft.com; s=selector1-xilinx-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=8WTy4Bp7MB1phlcW2JO2XuAmQx4JK3cD1W6YMgrjPzY=; b=hc4mpubo0vHk1sjWw11fYFcvV4Sy/PaSGFm54NhbgCLZRVUO8/qa8jZUvZ7qXw+ZzHTpydfjum/fKFIwxD3LNTuSwfFirO5gwFXCoZb2g7TabxYdbW5az5umDL9uhhuIf4ky5Cv0VKPy9kGxZrHUF9HEEqoZUceI4oIZSv0wuUU= Received: from SN4PR0201CA0053.namprd02.prod.outlook.com (10.171.31.143) by DM5PR02MB3385.namprd02.prod.outlook.com (10.164.152.161) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.77.7; Thu, 19 Oct 2017 16:22:27 +0000 Received: from CY1NAM02FT057.eop-nam02.prod.protection.outlook.com (2a01:111:f400:7e45::204) by SN4PR0201CA0053.outlook.office365.com (2603:10b6:803:20::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.77.21 via Frontend Transport; Thu, 19 Oct 2017 16:22:27 +0000 Authentication-Results: spf=pass (sender IP is 149.199.60.83) smtp.mailfrom=xilinx.com; weilnetz.de; dkim=none (message not signed) header.d=none;weilnetz.de; dmarc=bestguesspass action=none header.from=xilinx.com; Received-SPF: Pass (protection.outlook.com: domain of xilinx.com designates 149.199.60.83 as permitted sender) receiver=protection.outlook.com; client-ip=149.199.60.83; helo=xsj-pvapsmtpgw01; Received: from xsj-pvapsmtpgw01 (149.199.60.83) by CY1NAM02FT057.mail.protection.outlook.com (10.152.75.110) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.20.77.10 via Frontend Transport; Thu, 19 Oct 2017 16:22:26 +0000 Received: from unknown-38-66.xilinx.com ([149.199.38.66] helo=xsj-pvapsmtp01) by xsj-pvapsmtpgw01 with esmtp (Exim 4.63) (envelope-from ) id 1e5DaT-00006v-Us; Thu, 19 Oct 2017 09:22:25 -0700 Received: from [127.0.0.1] (helo=localhost) by xsj-pvapsmtp01 with smtp (Exim 4.63) (envelope-from ) id 1e5DaT-0003Nz-Rw; Thu, 19 Oct 2017 09:22:25 -0700 Received: from xsj-pvapsmtp01 (mailman.xilinx.com [149.199.38.66]) by xsj-smtp-dlp2.xlnx.xilinx.com (8.13.8/8.13.1) with ESMTP id v9JGMGr9007121; Thu, 19 Oct 2017 09:22:17 -0700 Received: from [172.19.2.220] (helo=localhost.localdomain) by xsj-pvapsmtp01 with esmtp (Exim 4.63) (envelope-from ) id 1e5DaK-0003Me-O5; Thu, 19 Oct 2017 09:22:16 -0700 From: Alistair Francis To: Date: Thu, 19 Oct 2017 09:18:24 -0700 Message-ID: <32ea025cd38b461217986a00fa3c8e20e0440385.1508390588.git.alistair.francis@xilinx.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: References: X-RCIS-Action: ALLOW X-TM-AS-Product-Ver: IMSS-7.1.0.1224-8.1.0.1062-23404.005 X-TM-AS-User-Approved-Sender: Yes;Yes X-EOPAttributedMessage: 0 X-MS-Office365-Filtering-HT: Tenant X-Forefront-Antispam-Report: CIP:149.199.60.83; IPV:NLI; CTRY:US; EFV:NLI; SFV:NSPM; SFS:(10009020)(6009001)(346002)(39860400002)(376002)(2980300002)(438002)(189002)(199003)(8936002)(33646002)(106466001)(36756003)(5003940100001)(36386004)(5660300001)(189998001)(4326008)(118296001)(81166006)(47776003)(8676002)(81156014)(63266004)(16586007)(9786002)(2351001)(356003)(106002)(316002)(6916009)(77096006)(50226002)(50986999)(2950100002)(48376002)(76176999)(54906003)(2906002)(478600001)(6666003)(305945005)(39060400002)(50466002)(107986001); DIR:OUT; SFP:1101; SCL:1; SRVR:DM5PR02MB3385; H:xsj-pvapsmtpgw01; FPR:; SPF:Pass; PTR:unknown-60-83.xilinx.com; MX:1; A:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; CY1NAM02FT057; 1:tkkIWYpE7P5TvMxTsOJ8QscXqWHA/jsPw4Ato6BsAVdZWviBgukydkbOXzH4a4ZQVRPwnMgJwyH6TdySJal9rDN50XQc1eio9RPc4Tg6APLQq+BY5Heq+l+lnaLa3Wdx MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 0504b207-809c-4877-b557-08d5170d966d X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001)(2017030254152)(8251501002)(2017052603199)(201703131423075)(201703031133081)(201702281549075); SRVR:DM5PR02MB3385; X-Microsoft-Exchange-Diagnostics: 1; DM5PR02MB3385; 3:MeMkPqcINSXJOggy9umXHUDelXUdsC084oS88CMGoH6nhAk846czmGdaMQm7ta8AT0ESMyjcDCPNm6bD+Jb6SMQ9ECexkR5JfLqeBeWT0JkQk9W/X4NVROHvclgKbGvKHMQraHu+dyMm8L5l7VnL0mWmRpWOP2uO4VAXJ85J+igwxM/fXA0H0CqCXkhQpYoQn6/ex69Rl9x+/QxQ1hvAqC6R1BScCyl1iqf4BmFBCMjm/SdKPsKjHE7nLeDOneifYpapvJAoxgzyhEIeNTdM7/F4LA/1638WhelvgyqGECOBzbm2j6y8KYtNkAovD90D954uCy7L4fATqmW41nWVemKNjqyYCO9A+emh1F37F9k=; 25:yqYKF0J78Yf7IRGmOVl3Neu/FJ8Yr4MuZZU+fsttJhv/dM/sSb8oYgJ9OxXod9uu7we7E14A5LM2sMNQwEdUavpt1BMlW4ZAswoH9kP1cPtqwI1RgUsayHyY3YhjKARxnmpqacxtT0vJNY189klua8UjKme+lCgCdJWUs3satczV3HysPRQpQzrZeuBlAp4nt9YxQOiDaQp7SodZroM6T032eviPpPT/0R5LDrGYwc0P4tGDVLx5WwB7+5WrGOXDElwvU+0VhoB8675nARdbP7cO/QZFwr0H4igaF/9EbBMqstd4r8zsWp3gmTqvK4z0LKVdQcs2S5StOgxWysW47A== X-MS-TrafficTypeDiagnostic: DM5PR02MB3385: X-Microsoft-Exchange-Diagnostics: 1; DM5PR02MB3385; 31:n3PmShff3y5U1eeAOPo4JBNATwTpIIoKM+z+SDTByrtJRmHbDFRKU+ObcWdmiSxMnmU+HMChHF+lI7DQjgsC5Ds65DURaku3PGS8Wv+cWbOwQ2sTZyt896BHWxm5MqeIFJACj4ldvghqSg6/8oL34sD0Rob4fKiJ036K2OeaYmNDENVnZk9iwx4X0uWlnEG+bxvw/6tKNVp4WNDbmI13RHSkyVSqHv8SC+PYIorYLmc=; 20:XU3dokaPWXLaXelaWALP99lh8pZScNsuwu+8OdE25zyKI4oih8sRi+ir2WVl//w4vYVFCLySfcQ5uIasaTeJMR+PV+Z0LRo0yHzdxDIYLgVzpi4kQbTxNOGz1IECAyL1X29esaiiIPxa1XNw9J7cqqEJTW+Ae5Qvf5QYPs6WJMUbUFA5VoBMNNqkndacz/NV9p8YdcA4Dt9CGdk6a+oAOKCg3T5BmV5KUlTWggUdj8PqqKWrpbcege3DdNOGiCaq0UyLS8LtcsJzSYlLWhTsYQQBLSzefhQWD0twv4ainkkakbHbzJR0Pvoq1jDWwEmhpnqS0QaDyLl/RpjEe6hTH5l4nUUaX0dSK/S9REvB5sOvRNbfUlHOpAvXP7iNxlAaOZW1+z+l02W2ImVbDWyFCf095ZRogRWecwoHkaa+vGovXXbYNS2TgEiIkx5tzoTDF+kvpICKFlkV16+oNasMe2Gkt+3a//pSmxERmGAhs3llQxuW/om84L3xA8myXIDQ X-Exchange-Antispam-Report-Test: UriScan:(788757137089)(192813158149592); X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(100000700101)(100105000095)(100000701101)(100105300095)(100000702101)(100105100095)(6040450)(2401047)(8121501046)(5005006)(3002001)(93006095)(93004095)(100000703101)(100105400095)(10201501046)(6055026)(6041248)(20161123558100)(20161123555025)(20161123560025)(20161123564025)(20161123562025)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(6072148)(201708071742011)(100000704101)(100105200095)(100000705101)(100105500095); SRVR:DM5PR02MB3385; BCL:0; PCL:0; RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095); SRVR:DM5PR02MB3385; X-Microsoft-Exchange-Diagnostics: 1; DM5PR02MB3385; 4:VV+L+/Gl7s9hO2jWR016gs/jZ03DEs1mEgZOO3TJC+ArQZ5miF8pfRqZ7hSdta1UoVmlDeQ+5Q4yQmD9qrnzYpss8Fy2lu3W5IlfhixFb6KP26NVT3ShMTwy/2jgycrEFCM/CzG3POrV68yIWWXhDi5sEIaDnWNa0ahtUxMSx6cwpcUBiNLBkFREvLMcEjzpcyY38EskAR4kLEhwwps3L3tqny1JB9pfAliBEucCOLdV1IokAp827isTfYSKCMrjuUGAqpl4xaZyIdZ4Ar2oQ7ZaHuHNixk6k5HnHeX1M52AGcumQOTunAogkTZQK8UpcbzRJb4cmuzHzxjpaQgYWw== X-Forefront-PRVS: 0465429B7F X-Microsoft-Exchange-Diagnostics: =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mSw7DpazaMQZjOK5QUOgiLDE= X-Microsoft-Exchange-Diagnostics: 1; DM5PR02MB3385; 6:hSRRkDoqiQo4qZ8V4Ahfb3CVVJ/XHz06CXHHrElWlmPVvELq4m5EYpHwI4AMp75AcD72wa2T2qAEaBP+F8kcHBc1vThQSBRQE1lpTWNBA+ngPNirWTjSvoN4BfQvpPjkvnOsospl7VDB0eLiIZ6KcUNnjoQniaGU0vDj3l1nHdcRbgZE/4JBRy0uwiTceUczhfvdhabc6vzLHcujzqjKPWmBpLWkQIkYHU5B6K2zzGrpKLTmVQGa3KLTi/5AYA4eypb+7xlqEtiCb7pyEbarvE8hcDwXCNsYnaq1I+4IWnWozoPnaKa3NIDZ5L3rD2En+gL8lUhohiFRn5ziCB4Dww==; 5:seQqy2RLn5he8mIrp+an4kvYjCqIBdv+mqt9f3dzKz9msm1MQ5/oYU7Y3nymIHA2r4uXxXMsU2yGt4/3CIpDele9y6jgv3CL8q3LamItqMMEjw0rahY6Hx7aNIR1OHnY0VbM6ttAASk9UIhVtpOirQ==; 24:w867mD/4SSceJdda22+0jFY/NDM3w2pOj/3rYzK8bUcpJuspTRqAgSUgCpEJ8WlNM+n4SG/WoNULscbS9jLL0UQxYLGTn94frCXVB7+m9sU=; 7:d8mPFH4ExSMGBImZ3KrRt7E70QudQsqbAcsGy9ewb4hOOKEghXTYZiaLERcqQ1izcpsLQGhP6pVCi1i4ojsiCKaX+Elz4DuH05BwV1Ha+a4CiQp9dNxFXHGW8RzrhAvDCFGEdgxZgQnCidhtj1uklElIJWnSPP+fC8+MfLkDQsn/dztjv5vwNZ4Ur5AcDksehuYjy0Ms4Ov8HmVnNJu2FcA/5ErsW3wqPxiBAH8tSwY= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: xilinx.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 19 Oct 2017 16:22:26.3422 (UTC) X-MS-Exchange-CrossTenant-Id: 657af505-d5df-48d0-8300-c31994686c5c X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=657af505-d5df-48d0-8300-c31994686c5c; Ip=[149.199.60.83]; Helo=[xsj-pvapsmtpgw01] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM5PR02MB3385 X-detected-operating-system: by eggs.gnu.org: Windows 7 or 8 [fuzzy] X-Received-From: 104.47.33.69 Subject: [Qemu-devel] [PATCH v3 44/46] tcg: Replace fprintf(stderr, "*\n" with error_report() 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: Peter Crosthwaite , Stefan Weil , armbru@redhat.com, alistair.francis@xilinx.com, Paolo Bonzini , alistair23@gmail.com, Richard Henderson Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" Replace a large number of the fprintf(stderr, "*\n" calls with error_report(). The functions were renamed with these commands and then compiler issues where manually fixed. find ./* -type f -exec sed -i \ 'N;N;N;N;N;N;N;N;N;N;N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2);|Ig}' \ {} + find ./* -type f -exec sed -i \ 'N;N;N;N;N;N;N;N;N;N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2);|Ig}' \ {} + find ./* -type f -exec sed -i \ 'N;N;N;N;N;N;N;N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2);|Ig}' \ {} + find ./* -type f -exec sed -i \ 'N;N;N;N;N;N;N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2);|Ig}' \ {} + find ./* -type f -exec sed -i \ 'N;N;N;N;N;N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2);|Ig}' \ {} + find ./* -type f -exec sed -i \ 'N;N;N;N;N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2);|Ig}' \ {} + find ./* -type f -exec sed -i \ 'N;N;N;N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2);|Ig}' \ {} + find ./* -type f -exec sed -i \ 'N;N;N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2);|Ig}' \ {} + find ./* -type f -exec sed -i \ 'N;N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2);|Ig}' \ {} + find ./* -type f -exec sed -i \ 'N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2);|Ig}' \ {} + find ./* -type f -exec sed -i \ 'N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2);|Ig}' \ {} + Signed-off-by: Alistair Francis Cc: Paolo Bonzini Cc: Peter Crosthwaite Cc: Richard Henderson Cc: Stefan Weil Acked-by: Richard Henderson --- cpus.c | 8 ++++---- exec.c | 14 +++++++------- tcg/optimize.c | 8 ++++---- tcg/tcg.c | 2 +- tcg/tcg.h | 3 ++- tcg/tci.c | 2 +- tcg/tci/tcg-target.inc.c | 4 ++-- vl.c | 2 +- 8 files changed, 22 insertions(+), 21 deletions(-) diff --git a/cpus.c b/cpus.c index c9a624003a..784cee4848 100644 --- a/cpus.c +++ b/cpus.c @@ -258,7 +258,7 @@ int64_t cpu_get_icount_raw(void) if (cpu && cpu->running) { if (!cpu->can_do_io) { - fprintf(stderr, "Bad icount read\n"); + error_report("Bad icount read"); exit(1); } /* Take into account what has run */ @@ -1113,7 +1113,7 @@ static void *qemu_kvm_cpu_thread_fn(void *arg) r = kvm_init_vcpu(cpu); if (r < 0) { - fprintf(stderr, "kvm_init_vcpu failed: %s\n", strerror(-r)); + error_report("kvm_init_vcpu failed: %s", strerror(-r)); exit(1); } @@ -1143,7 +1143,7 @@ static void *qemu_kvm_cpu_thread_fn(void *arg) static void *qemu_dummy_cpu_thread_fn(void *arg) { #ifdef _WIN32 - fprintf(stderr, "qtest is not supported under Windows\n"); + error_report("qtest is not supported under Windows"); exit(1); #else CPUState *cpu = arg; @@ -1525,7 +1525,7 @@ static void qemu_cpu_kick_thread(CPUState *cpu) #else /* _WIN32 */ if (!qemu_cpu_is_self(cpu)) { if (!QueueUserAPC(dummy_apc_func, cpu->hThread, 0)) { - fprintf(stderr, "%s: QueueUserAPC failed with error %lu\n", + error_report("%s: QueueUserAPC failed with error %lu", __func__, GetLastError()); exit(1); } diff --git a/exec.c b/exec.c index 6378714a2b..9626fb3566 100644 --- a/exec.c +++ b/exec.c @@ -1043,7 +1043,7 @@ static RAMBlock *qemu_get_ram_block(ram_addr_t addr) } } - fprintf(stderr, "Bad ram offset %" PRIx64 "\n", (uint64_t)addr); + error_report("Bad ram offset %" PRIx64 "", (uint64_t)addr); abort(); found: @@ -1656,7 +1656,7 @@ static ram_addr_t find_ram_offset(ram_addr_t size) } if (offset == RAM_ADDR_MAX) { - fprintf(stderr, "Failed to find gap of requested size: %" PRIu64 "\n", + error_report("Failed to find gap of requested size: %" PRIu64 "", (uint64_t)size); abort(); } @@ -1686,8 +1686,8 @@ static void qemu_ram_setup_dump(void *addr, ram_addr_t size) ret = qemu_madvise(addr, size, QEMU_MADV_DONTDUMP); if (ret) { perror("qemu_madvise"); - fprintf(stderr, "madvise doesn't support MADV_DONTDUMP, " - "but dump_guest_core=off specified\n"); + error_report("madvise doesn't support MADV_DONTDUMP, " + "but dump_guest_core=off specified"); } } } @@ -1723,7 +1723,7 @@ void qemu_ram_set_idstr(RAMBlock *new_block, const char *name, DeviceState *dev) RAMBLOCK_FOREACH(block) { if (block != new_block && !strcmp(block->idstr, new_block->idstr)) { - fprintf(stderr, "RAMBlock \"%s\" already registered, abort!\n", + error_report("RAMBlock \"%s\" already registered, abort!", new_block->idstr); abort(); } @@ -2151,8 +2151,8 @@ void qemu_ram_remap(ram_addr_t addr, ram_addr_t length) flags, -1, 0); } if (area != vaddr) { - fprintf(stderr, "Could not remap addr: " - RAM_ADDR_FMT "@" RAM_ADDR_FMT "\n", + error_report("Could not remap addr: " + RAM_ADDR_FMT "@" RAM_ADDR_FMT "", length, addr); exit(1); } diff --git a/tcg/optimize.c b/tcg/optimize.c index adfc56ce62..31b15b508d 100644 --- a/tcg/optimize.c +++ b/tcg/optimize.c @@ -96,8 +96,8 @@ static TCGOpcode op_to_mov(TCGOpcode op) case 64: return INDEX_op_mov_i64; default: - fprintf(stderr, "op_to_mov: unexpected return value of " - "function op_bits.\n"); + error_report("op_to_mov: unexpected return value of " + "function op_bits."); tcg_abort(); } } @@ -110,8 +110,8 @@ static TCGOpcode op_to_movi(TCGOpcode op) case 64: return INDEX_op_movi_i64; default: - fprintf(stderr, "op_to_movi: unexpected return value of " - "function op_bits.\n"); + error_report("op_to_movi: unexpected return value of " + "function op_bits."); tcg_abort(); } } diff --git a/tcg/tcg.c b/tcg/tcg.c index 4492e1eb3f..6654644c7e 100644 --- a/tcg/tcg.c +++ b/tcg/tcg.c @@ -675,7 +675,7 @@ static void tcg_temp_free_internal(int idx) #if defined(CONFIG_DEBUG_TCG) s->temps_in_use--; if (s->temps_in_use < 0) { - fprintf(stderr, "More temporaries freed than allocated!\n"); + error_report("More temporaries freed than allocated!"); } #endif diff --git a/tcg/tcg.h b/tcg/tcg.h index b2d42e3136..589ec4aa74 100644 --- a/tcg/tcg.h +++ b/tcg/tcg.h @@ -29,6 +29,7 @@ #include "cpu.h" #include "exec/tb-context.h" #include "qemu/bitops.h" +#include "qemu/error-report.h" #include "tcg-mo.h" #include "tcg-target.h" @@ -895,7 +896,7 @@ typedef struct TCGTargetOpDef { #define tcg_abort() \ do {\ - fprintf(stderr, "%s:%d: tcg fatal error\n", __FILE__, __LINE__);\ + error_report("%s:%d: tcg fatal error", __FILE__, __LINE__);\ abort();\ } while (0) diff --git a/tcg/tci.c b/tcg/tci.c index 63f2cd54ab..6c851d3450 100644 --- a/tcg/tci.c +++ b/tcg/tci.c @@ -35,7 +35,7 @@ /* Marker for missing code. */ #define TODO() \ do { \ - fprintf(stderr, "TODO %s:%u: %s()\n", \ + error_report("TODO %s:%u: %s()", \ __FILE__, __LINE__, __func__); \ tcg_abort(); \ } while (0) diff --git a/tcg/tci/tcg-target.inc.c b/tcg/tci/tcg-target.inc.c index 913c3802a3..2f4b56d3ba 100644 --- a/tcg/tci/tcg-target.inc.c +++ b/tcg/tci/tcg-target.inc.c @@ -29,7 +29,7 @@ /* Marker for missing code. */ #define TODO() \ do { \ - fprintf(stderr, "TODO %s:%u: %s()\n", \ + error_report("TODO %s:%u: %s()", \ __FILE__, __LINE__, __func__); \ tcg_abort(); \ } while (0) @@ -403,7 +403,7 @@ static const char *target_parse_constraint(TCGArgConstraint *ct, void tci_disas(uint8_t opc) { const TCGOpDef *def = &tcg_op_defs[opc]; - fprintf(stderr, "TCG %s %u, %u, %u\n", + error_report("TCG %s %u, %u, %u", def->name, def->nb_oargs, def->nb_iargs, def->nb_cargs); } #endif diff --git a/vl.c b/vl.c index 0723835bbf..c04a87458f 100644 --- a/vl.c +++ b/vl.c @@ -2232,7 +2232,7 @@ static DisplayType select_display(const char *p) display_opengl = 1; display = DT_EGL; #else - fprintf(stderr, "egl support is disabled\n"); + error_report("egl support is disabled"); exit(1); #endif } else if (strstart(p, "curses", &opts)) { From patchwork Thu Oct 19 16:18:27 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alistair Francis X-Patchwork-Id: 828249 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; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=xilinx.onmicrosoft.com header.i=@xilinx.onmicrosoft.com header.b="t7imkYRI"; 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 3yHw5f2zb5z9t44 for ; Fri, 20 Oct 2017 03:55:01 +1100 (AEDT) Received: from localhost ([::1]:50238 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e5E5z-0008PE-NA for incoming@patchwork.ozlabs.org; Thu, 19 Oct 2017 12:54:59 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:56295) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e5Dac-0006Gf-1R for qemu-devel@nongnu.org; Thu, 19 Oct 2017 12:22:35 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1e5DaY-0002PY-Qh for qemu-devel@nongnu.org; Thu, 19 Oct 2017 12:22:34 -0400 Received: from mail-co1nam03on0088.outbound.protection.outlook.com ([104.47.40.88]:63760 helo=NAM03-CO1-obe.outbound.protection.outlook.com) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1e5DaY-0002P3-Eb for qemu-devel@nongnu.org; Thu, 19 Oct 2017 12:22:30 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=xilinx.onmicrosoft.com; s=selector1-xilinx-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=t1slnHvscJz4Pc7dYXtW7rFYqL9ejpw8xWN3itrkodw=; b=t7imkYRIgnrhbWkgZ5xvHAcVWC0W3GKZRRYxelm3IxQ3A8WtPDYjOBkuRJLMbC+X5Fj1a6wRXGftSh/NTEOfbvdH0tvf3vboepiDSx7mjF2jNxrqHYRA5eM2qcL7V+fRdpDzI/tYsJvrPtJzu/Q7PL1Y0qGQW9xowY+2yKIsZXA= Received: from MWHPR02CA0050.namprd02.prod.outlook.com (2603:10b6:301:60::39) by DM2PR02MB1339.namprd02.prod.outlook.com (2a01:111:e400:50c8::26) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.77.7; Thu, 19 Oct 2017 16:22:27 +0000 Received: from BL2NAM02FT003.eop-nam02.prod.protection.outlook.com (2a01:111:f400:7e46::202) by MWHPR02CA0050.outlook.office365.com (2603:10b6:301:60::39) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.77.7 via Frontend Transport; Thu, 19 Oct 2017 16:22:27 +0000 Authentication-Results: spf=pass (sender IP is 149.199.60.83) smtp.mailfrom=xilinx.com; redhat.com; dkim=none (message not signed) header.d=none;redhat.com; dmarc=bestguesspass action=none header.from=xilinx.com; Received-SPF: Pass (protection.outlook.com: domain of xilinx.com designates 149.199.60.83 as permitted sender) receiver=protection.outlook.com; client-ip=149.199.60.83; helo=xsj-pvapsmtpgw01; Received: from xsj-pvapsmtpgw01 (149.199.60.83) by BL2NAM02FT003.mail.protection.outlook.com (10.152.76.204) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.20.77.10 via Frontend Transport; Thu, 19 Oct 2017 16:22:26 +0000 Received: from unknown-38-66.xilinx.com ([149.199.38.66] helo=xsj-pvapsmtp01) by xsj-pvapsmtpgw01 with esmtp (Exim 4.63) (envelope-from ) id 1e5DaT-00006n-U4; Thu, 19 Oct 2017 09:22:25 -0700 Received: from [127.0.0.1] (helo=localhost) by xsj-pvapsmtp01 with smtp (Exim 4.63) (envelope-from ) id 1e5DaT-0003Nz-Pc; Thu, 19 Oct 2017 09:22:25 -0700 Received: from xsj-pvapsmtp01 (smtp2.xilinx.com [149.199.38.66]) by xsj-smtp-dlp2.xlnx.xilinx.com (8.13.8/8.13.1) with ESMTP id v9JGMJIP007141; Thu, 19 Oct 2017 09:22:20 -0700 Received: from [172.19.2.220] (helo=localhost.localdomain) by xsj-pvapsmtp01 with esmtp (Exim 4.63) (envelope-from ) id 1e5DaN-0003NH-PY; Thu, 19 Oct 2017 09:22:19 -0700 From: Alistair Francis To: Date: Thu, 19 Oct 2017 09:18:27 -0700 Message-ID: <44428b086df78ccd0cb030593290bc3a7c2b8a1d.1508390588.git.alistair.francis@xilinx.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: References: X-RCIS-Action: ALLOW X-TM-AS-Product-Ver: IMSS-7.1.0.1224-8.1.0.1062-23404.005 X-TM-AS-User-Approved-Sender: Yes;Yes X-EOPAttributedMessage: 0 X-MS-Office365-Filtering-HT: Tenant X-Forefront-Antispam-Report: CIP:149.199.60.83; IPV:NLI; CTRY:US; EFV:NLI; SFV:NSPM; SFS:(10009020)(6009001)(346002)(39860400002)(376002)(2980300002)(438002)(189002)(199003)(4326008)(47776003)(8676002)(81156014)(8936002)(36386004)(81166006)(36756003)(63266004)(305945005)(76176999)(2351001)(50986999)(77096006)(356003)(316002)(54906003)(16586007)(6666003)(33646002)(106466001)(189998001)(118296001)(50226002)(48376002)(39060400002)(2950100002)(9786002)(5003940100001)(50466002)(6916009)(5660300001)(106002)(478600001)(2906002)(107986001); DIR:OUT; SFP:1101; SCL:1; SRVR:DM2PR02MB1339; H:xsj-pvapsmtpgw01; FPR:; SPF:Pass; PTR:unknown-60-83.xilinx.com; MX:1; A:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BL2NAM02FT003; 1:z/S3MLJb28stwF8n4+9U/3K2PPrxd55YZQ4D03rimH/LLJq0faQ0LfkyEpzOCitzrjJqY2PxqhSXBIzWMeudorZXlibgwLexJW6HcTmkfpc7GQfLs3UsKbIjXjE0trIO MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 09b6adc5-0e57-446f-7fdd-08d5170d967c X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001)(2017030254169)(8251501002)(4534017)(4602075)(4627075)(201703031133081)(201702281549075)(2017052603199)(201703131423092); SRVR:DM2PR02MB1339; X-Microsoft-Exchange-Diagnostics: 1; DM2PR02MB1339; 3:BUOO89ggvla+dxi3rRMtTVwJ9LR8jXkj3zYUNtmbW69P/5fQbqBMHn1bUt2loZtIQMGt03zGzcq4N0TQzEtzDe+C4P4s6Ar9BXd2yxPp2NgryMxdOuyXAXTNTOMBrXmG5lNXiZdeMGis321v8NsGFUP7dL88jNpYSVtTt6bNy5v+gbgj01bRycYmDjYry2EERBkhe6S36vum/n1bTd/C0z1Z9604XpgThLenFCfDiFBZt9IoHLjsX47R2xtLRk2mU//+G3ebBrRBz6CW7dAJUgbyYTiqIobJznKeNH3v9RGZekcU55I75VkxP/aByfDh22PozeYrm5rismPhXe2Ukt4kNRymCL/YvNjJzdYlRvc=; 25:A/yMZ4l3wRqmxClBZr0L3uc4d2LT62vPrw6laKpYQ1h6fMdFAWzguUzqcjNtjR+9D+oWnZ2IxUu2CBSOR2dmZ1LxWGGJip+tIS/wcWOCwGW7we/8PdhDAEnrJFINuhSR9b2UESCnj+EaeD2sXCHhpkKqx2K9zpCn4quuq6I77LWsTfK2ppFRFASpZQadAdaUun2KEDrTEdrYl8kAccc8+Ix8nrwsX5jbgqOmQHjO5jsVC1pK6ZprejEGk+YbU5NPpwGHk/KTU6YBIQD7Hy0c68M29EHF42qHbwg0Tr7cgrDlXg0JJICyh+FdB2Iv9PArkKwjFEFTr7y+4Uv3plYvYw== X-MS-TrafficTypeDiagnostic: DM2PR02MB1339: X-Microsoft-Exchange-Diagnostics: 1; DM2PR02MB1339; 31:ztGtqsUJuko9Uxi5YcOuFwjWFNVA3hVPG40unlNPNAYBeunVmTMcE8ObK83hDSprg+aczVc//NyvnhVYlhf8xqAfVRz8kQQKLg9Bo3340XCg2uhwhov4Hjq6igxIegdTvQPeJwWeLyWAw0s3JwKZmhik7D9Bm4sw4fsWZ72bDLTBMiFozCrCflcww/NU+mTD+i56BpMTgj7NnpDlirpT4fWe8qDk5av6ihcDuKe2L7g=; 20:JGScZ5BSpPFmibXGEde6lZeKlqZt7rB96clwHsOqAFgxn28OIKU+mTuR9ux6yAfTnuOfWA8Nwu0SGvkdHy0RAyOwKGChnxG9/zcPMl863ZPRqnegZflX28zmkdEj07QSZ7ZvSiub7bSKYlHOZ/eaWmVHaZBTNyTLFWR7oQIrzup6H5JEZAj23jZBl/OJgxEzWodswWW2SbKU96Iuh/DncqRO/4J4EdbAfskObl/2sEXHk3NZ6PDTNUXFS4DDJWZgQDkD1J4wZx5J8g9SWQ/ou8IM+Awa7QVrrO4lkVgm9zvn+wT73h+1oNZ52HcHDi/TMeWEsdAUbOG3a7O+qJmUM92KKhPQeUH9KMbxCA5GRqw8PIgncXV3uBaM6/cBRj4drzK4GP4XliajdAa8fYM66ateZ985Ys3SS4/zBp05uf4mPfTNoY8CwoGO7a65Pmve6fSEvp5vYf9McRmaDO+UWLvZR2xHxwIlLdKuYqE+B+A1TqTOeXQS0ZXPC8TIPBIr X-Exchange-Antispam-Report-Test: UriScan:(192813158149592); X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(100000700101)(100105000095)(100000701101)(100105300095)(100000702101)(100105100095)(6040450)(2401047)(5005006)(8121501046)(100000703101)(100105400095)(93006095)(93004095)(3002001)(10201501046)(6055026)(6041248)(20161123560025)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123555025)(20161123564025)(20161123562025)(20161123558100)(6072148)(201708071742011)(100000704101)(100105200095)(100000705101)(100105500095); SRVR:DM2PR02MB1339; BCL:0; PCL:0; RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095); SRVR:DM2PR02MB1339; X-Microsoft-Exchange-Diagnostics: 1; DM2PR02MB1339; 4:woRABhjpeAUMf26c1T9fjdS3HDpb7dNI9PLbf5wo0tcbln2WchkW6HFMi/NXlpU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UPBd/1bO6ROSBDfK7gElzq+d+28VAcvOxfZYzEiz/e2TY3cK2tgvK/kRnkRzehmVShPnfpHjFzgqUlesygTxIBgrnS0kLstE70Q= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: xilinx.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 19 Oct 2017 16:22:26.7048 (UTC) X-MS-Exchange-CrossTenant-Id: 657af505-d5df-48d0-8300-c31994686c5c X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=657af505-d5df-48d0-8300-c31994686c5c; Ip=[149.199.60.83]; Helo=[xsj-pvapsmtpgw01] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM2PR02MB1339 X-detected-operating-system: by eggs.gnu.org: Windows 7 or 8 [fuzzy] X-Received-From: 104.47.40.88 Subject: [Qemu-devel] [PATCH v3 45/46] target: Use qemu_log() instead of fprintf(stderr, ...) 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: alistair23@gmail.com, armbru@redhat.com, alistair.francis@xilinx.com Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" Signed-off-by: Alistair Francis --- target/cris/translate.c | 2 +- target/ppc/translate.c | 22 +++++++++++----------- target/sh4/translate.c | 4 ++-- target/unicore32/translate.c | 2 +- 4 files changed, 15 insertions(+), 15 deletions(-) diff --git a/target/cris/translate.c b/target/cris/translate.c index 38a999e6f1..e04aa2ae2b 100644 --- a/target/cris/translate.c +++ b/target/cris/translate.c @@ -138,7 +138,7 @@ typedef struct DisasContext { static void gen_BUG(DisasContext *dc, const char *file, int line) { - fprintf(stderr, "BUG: pc=%x %s %d\n", dc->pc, file, line); + qemu_log("BUG: pc=%x %s %d\n", dc->pc, file, line); if (qemu_log_separate()) { qemu_log("BUG: pc=%x %s %d\n", dc->pc, file, line); } diff --git a/target/ppc/translate.c b/target/ppc/translate.c index a81ff69d75..ed77d293c1 100644 --- a/target/ppc/translate.c +++ b/target/ppc/translate.c @@ -3955,11 +3955,11 @@ static inline void gen_op_mfspr(DisasContext *ctx) * allowing userland application to read the PVR */ if (sprn != SPR_PVR) { - fprintf(stderr, "Trying to read privileged spr %d (0x%03x) at " - TARGET_FMT_lx "\n", sprn, sprn, ctx->nip - 4); + qemu_log("Trying to read privileged spr %d (0x%03x) at " + TARGET_FMT_lx "\n", sprn, sprn, ctx->nip - 4); if (qemu_log_separate()) { qemu_log("Trying to read privileged spr %d (0x%03x) at " - TARGET_FMT_lx "\n", sprn, sprn, ctx->nip - 4); + TARGET_FMT_lx "\n", sprn, sprn, ctx->nip - 4); } } gen_priv_exception(ctx, POWERPC_EXCP_PRIV_REG); @@ -3972,8 +3972,8 @@ static inline void gen_op_mfspr(DisasContext *ctx) return; } /* Not defined */ - fprintf(stderr, "Trying to read invalid spr %d (0x%03x) at " - TARGET_FMT_lx "\n", sprn, sprn, ctx->nip - 4); + qemu_log("Trying to read invalid spr %d (0x%03x) at " + TARGET_FMT_lx "\n", sprn, sprn, ctx->nip - 4); if (qemu_log_separate()) { qemu_log("Trying to read invalid spr %d (0x%03x) at " TARGET_FMT_lx "\n", sprn, sprn, ctx->nip - 4); @@ -4118,8 +4118,8 @@ static void gen_mtspr(DisasContext *ctx) (*write_cb)(ctx, sprn, rS(ctx->opcode)); } else { /* Privilege exception */ - fprintf(stderr, "Trying to write privileged spr %d (0x%03x) at " - TARGET_FMT_lx "\n", sprn, sprn, ctx->nip - 4); + qemu_log("Trying to write privileged spr %d (0x%03x) at " + TARGET_FMT_lx "\n", sprn, sprn, ctx->nip - 4); if (qemu_log_separate()) { qemu_log("Trying to write privileged spr %d (0x%03x) at " TARGET_FMT_lx "\n", sprn, sprn, ctx->nip - 4); @@ -4139,8 +4139,8 @@ static void gen_mtspr(DisasContext *ctx) qemu_log("Trying to write invalid spr %d (0x%03x) at " TARGET_FMT_lx "\n", sprn, sprn, ctx->nip - 4); } - fprintf(stderr, "Trying to write invalid spr %d (0x%03x) at " - TARGET_FMT_lx "\n", sprn, sprn, ctx->nip - 4); + qemu_log("Trying to write invalid spr %d (0x%03x) at " + TARGET_FMT_lx "\n", sprn, sprn, ctx->nip - 4); /* The behaviour depends on MSR:PR and SPR# bit 0x10, @@ -7382,8 +7382,8 @@ void gen_intermediate_code(CPUState *cs, struct TranslationBlock *tb) break; } if (tcg_check_temp_count()) { - fprintf(stderr, "Opcode %02x %02x %02x %02x (%08x) leaked " - "temporaries\n", opc1(ctx.opcode), opc2(ctx.opcode), + qemu_log("Opcode %02x %02x %02x %02x (%08x) leaked " + "temporaries\n", opc1(ctx.opcode), opc2(ctx.opcode), opc3(ctx.opcode), opc4(ctx.opcode), ctx.opcode); exit(1); } diff --git a/target/sh4/translate.c b/target/sh4/translate.c index 8db9fba26e..0c5796ff91 100644 --- a/target/sh4/translate.c +++ b/target/sh4/translate.c @@ -438,7 +438,7 @@ static void _decode_opc(DisasContext * ctx) } #if 0 - fprintf(stderr, "Translating opcode 0x%04x\n", ctx->opcode); + qemu_log("Translating opcode 0x%04x\n", ctx->opcode); #endif switch (ctx->opcode) { @@ -1799,7 +1799,7 @@ static void _decode_opc(DisasContext * ctx) break; } #if 0 - fprintf(stderr, "unknown instruction 0x%04x at pc 0x%08x\n", + qemu_log_mask(LOG_UNIMP, "unknown instruction 0x%04x at pc 0x%08x\n", ctx->opcode, ctx->pc); fflush(stderr); #endif diff --git a/target/unicore32/translate.c b/target/unicore32/translate.c index 6c094d59d7..1bd7827ee8 100644 --- a/target/unicore32/translate.c +++ b/target/unicore32/translate.c @@ -1940,7 +1940,7 @@ void gen_intermediate_code(CPUState *cs, TranslationBlock *tb) disas_uc32_insn(env, dc); if (num_temps) { - fprintf(stderr, "Internal resource leak before %08x\n", dc->pc); + qemu_log("Internal resource leak before %08x\n", dc->pc); num_temps = 0; } From patchwork Thu Oct 19 16:18:30 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alistair Francis X-Patchwork-Id: 828257 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; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=xilinx.onmicrosoft.com header.i=@xilinx.onmicrosoft.com header.b="phkwt2BM"; 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 3yHw9L45Thz9t4c for ; Fri, 20 Oct 2017 03:58:14 +1100 (AEDT) Received: from localhost ([::1]:50256 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e5E96-00038i-MM for incoming@patchwork.ozlabs.org; Thu, 19 Oct 2017 12:58:12 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:56544) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e5Db5-0006f5-4H for qemu-devel@nongnu.org; Thu, 19 Oct 2017 12:23:08 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1e5Daz-0002cV-Bk for qemu-devel@nongnu.org; Thu, 19 Oct 2017 12:23:03 -0400 Received: from mail-sn1nam01on0066.outbound.protection.outlook.com ([104.47.32.66]:28240 helo=NAM01-SN1-obe.outbound.protection.outlook.com) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1e5Dab-0002Ql-3I; Thu, 19 Oct 2017 12:22:33 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=xilinx.onmicrosoft.com; s=selector1-xilinx-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=Cha1IxSg30xJkDxy8pA58Dk6WSDYPqvSUkSt9rM8Jrs=; b=phkwt2BME6cQxFlybxH5sEuxywbGSetoiLnVcALBZ4oYzRyb61LDfasYIp/lPBFO7qyYwJ2lDKVS7caKlmKdUrAGlWusAEegb+wxxQSWx1wq+dx57XvWUqh05k/VkkQJYWs9lUPvJv7zsGOSQznHquyV1WgvSxZ3L2QZYbQJGfk= Received: from SN4PR0201CA0071.namprd02.prod.outlook.com (2603:10b6:803:20::33) by DM2PR02MB1337.namprd02.prod.outlook.com (2a01:111:e400:50c8::24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.77.7; Thu, 19 Oct 2017 16:22:27 +0000 Received: from SN1NAM02FT024.eop-nam02.prod.protection.outlook.com (2a01:111:f400:7e44::204) by SN4PR0201CA0071.outlook.office365.com (2603:10b6:803:20::33) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.77.7 via Frontend Transport; Thu, 19 Oct 2017 16:22:27 +0000 Authentication-Results: spf=pass (sender IP is 149.199.60.83) smtp.mailfrom=xilinx.com; nongnu.org; dkim=none (message not signed) header.d=none;nongnu.org; dmarc=bestguesspass action=none header.from=xilinx.com; Received-SPF: Pass (protection.outlook.com: domain of xilinx.com designates 149.199.60.83 as permitted sender) receiver=protection.outlook.com; client-ip=149.199.60.83; helo=xsj-pvapsmtpgw01; Received: from xsj-pvapsmtpgw01 (149.199.60.83) by SN1NAM02FT024.mail.protection.outlook.com (10.152.72.127) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.20.77.10 via Frontend Transport; Thu, 19 Oct 2017 16:22:26 +0000 Received: from unknown-38-66.xilinx.com ([149.199.38.66] helo=xsj-pvapsmtp01) by xsj-pvapsmtpgw01 with esmtp (Exim 4.63) (envelope-from ) id 1e5DaT-00006l-T7; Thu, 19 Oct 2017 09:22:25 -0700 Received: from [127.0.0.1] (helo=localhost) by xsj-pvapsmtp01 with smtp (Exim 4.63) (envelope-from ) id 1e5DaT-0003Nz-OC; Thu, 19 Oct 2017 09:22:25 -0700 Received: from xsj-pvapsmtp01 (xsj-mail.xilinx.com [149.199.38.66]) by xsj-smtp-dlp2.xlnx.xilinx.com (8.13.8/8.13.1) with ESMTP id v9JGMMTS007149; Thu, 19 Oct 2017 09:22:23 -0700 Received: from [172.19.2.220] (helo=localhost.localdomain) by xsj-pvapsmtp01 with esmtp (Exim 4.63) (envelope-from ) id 1e5DaQ-0003Na-Rx; Thu, 19 Oct 2017 09:22:22 -0700 From: Alistair Francis To: Date: Thu, 19 Oct 2017 09:18:30 -0700 Message-ID: <9aee5a95c03d6cb4f4ba6359828809ceab535bfb.1508390588.git.alistair.francis@xilinx.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: References: X-RCIS-Action: ALLOW X-TM-AS-Product-Ver: IMSS-7.1.0.1224-8.1.0.1062-23404.005 X-TM-AS-User-Approved-Sender: Yes;Yes X-EOPAttributedMessage: 0 X-MS-Office365-Filtering-HT: Tenant X-Forefront-Antispam-Report: CIP:149.199.60.83; IPV:NLI; CTRY:US; EFV:NLI; SFV:NSPM; SFS:(10009020)(6009001)(39860400002)(376002)(346002)(2980300002)(438002)(199003)(189002)(305945005)(6666003)(48376002)(50226002)(6916009)(2950100002)(50466002)(316002)(53946003)(16200700003)(36756003)(33646002)(5003940100001)(54906003)(8676002)(2906002)(356003)(36386004)(16586007)(77096006)(81156014)(575784001)(81166006)(106002)(39060400002)(2351001)(47776003)(5660300001)(7416002)(106466001)(551934003)(50986999)(478600001)(76176999)(118296001)(4326008)(8936002)(63266004)(9786002)(189998001)(21314002)(107986001)(579004)(569006); DIR:OUT; SFP:1101; SCL:1; SRVR:DM2PR02MB1337; H:xsj-pvapsmtpgw01; FPR:; SPF:Pass; PTR:unknown-60-83.xilinx.com; A:1; MX:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; SN1NAM02FT024; 1:2IYSFFwHqn5qhKe9Ac8Uojqt9dZegacIbeThh6M7q/OUO4GRkhQoVyqBsoPemZTw9ZzAxWAGW4h3TR4k1OaQbLHrrSAPf+QPQE1gtqUH6bU7TRRr8TpBRCv3J5Nmum6N MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 7340dafa-087b-4837-ad27-08d5170d9694 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001)(2017030254169)(8251501002)(4534017)(4602075)(4627075)(201703031133081)(201702281549075)(2017052603199)(201703131423092); SRVR:DM2PR02MB1337; X-Microsoft-Exchange-Diagnostics: 1; DM2PR02MB1337; 3:1pMCsEg81wbfyhjG4UjqdDihPJxIQvhluiVKHUsTK3moz7pgiWYwaHxJ22AhvE5YadeSjSxuo0Gm7xviki0HMr3KgM2YaA9Oc1c2Y3ExMoe+WY54d3nmV/2IgEDGs6YiQYZrA2CLQ6c9QhkkYjUnz0D4mqhOYAZksM4ylyOdYZYpS+81NhviLU5MQpWR2VME8lapYv4QhMSKjtTb+5d43xxQ9vHJ70gcCyvlDmL312SNj85h+wEW8QlMdC7oEXtOLqIqfp9xUeYx7Znk/hm1EyvdbGF6XeBnTzaCPX8itN8XMAmyKticZdiN8Bn1TIe1whgYpOCBOxRt4HVD2FeyHiv9TanrvW+aZVOf6+gTfWw=; 25:kqjlRp6Q+a9pmAST1unHPtvhCiUEiu5qqFREaDlcorhT2wiVa1j3XAPjkuwLapH5+IiMN+HotquqNUiMVLmRHYeu9rIAhZpd8JdSp87KJGQQ3Jxun+Uv+Rp6kAV4RtpJcm/ABK8ccuzEIfrKJLC2WV0rXRWtjBYwr94xzihbEGcsZvdWEuHUO2W61NWpPOzlQXtnmzhysw3+9EnV2aIi1qs/Zqs8JqMvBUAmzi4nP9FI9lIjLBY4D++7SSyX3vpzUEO1DhMQlbBdb5n8MU+e0pI71IKXS273Berzj9aT7Rzmrin2J9cxv/Fv+knkjwABJnf0ifeUvbSbxQMs+J1oCw== X-MS-TrafficTypeDiagnostic: DM2PR02MB1337: X-Microsoft-Exchange-Diagnostics: 1; DM2PR02MB1337; 31:ra2ao5+VAouVGPnQsHVdD52UtIW5M2MKOnJLDX89lpl+St+G5ePuuEN0x2EATKDXhTeiHUnMpSrQ4KR90n6hh1ienC4A2FKndqObjtGheBC25tonYFRC1Mb5oK7VYGA8PRcHwAfbLtwnSmjNnz24+VAmKpM3mEIfVsLHsUEHOzPjsYpl4tjsDopeXmJOr9vH9D80vG3thmWCNMBrDmYqJp03mM0Z2sg+5tBTeeAzfzw=; 20:g3VoZn2XnCXlfeVQJgTFKPaSqHH8d9oCWjlrtn2T25L6VBw86+M17kKPjS/f5FqPk/psHONPSrno/o94vOYhwaC0PRfRIpOGkbEzRjfW2yEC8409SLYCQvtYg9sHx2+gzkqMfIQOinyQZWLWKNYRNzpRmWk6pqbONyEg1bYseJ3amDAOy/P5V1rd/UShEkiM65HtmwufwPM5DKAfHbVSKOxuX+1fTGvA6DsZQHi950rejRbJS6byr9EoTt62fNzrcuQOczG8wVrUx/MCxR87Ca2XHGPmvemF5QsyijKEvHtd5TPlv7FiYDlWchQRTfwANlV1OnEZR1jaPdAXczXr7Y9pEujU0usM7IZO+MmLc/pf/FMVmvF3a0nHeNNg370ysv5svT7ZkqnTt3hL8233xL2fZQi9OMQ8pWeEc5pTS4PyicWOXYNUG+AsFjDEtPO3IpXt/unrRrA4z57KOkKMMOAPP3hy/nVnn9FxeOHBq5Gh2ja6qOD/m+GZs7NLv1d5 X-Exchange-Antispam-Report-Test: UriScan:(788757137089)(190383065149520)(192813158149592)(104084551191319)(21532816269658); X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(100000700101)(100105000095)(100000701101)(100105300095)(100000702101)(100105100095)(6040450)(2401047)(8121501046)(5005006)(3002001)(100000703101)(100105400095)(10201501046)(93006095)(93004095)(6055026)(6041248)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123564025)(20161123562025)(20161123560025)(20161123558100)(20161123555025)(6072148)(201708071742011)(100000704101)(100105200095)(100000705101)(100105500095); SRVR:DM2PR02MB1337; BCL:0; PCL:0; RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095); SRVR:DM2PR02MB1337; X-Microsoft-Exchange-Diagnostics: 1; DM2PR02MB1337; 4:G3pall6a2XNujVcksiVJoYx3/8qwIZ3S/ObscoB8Eii5BPWNSkG58Ra0f2DpYwWfnS+QSavA0M8bKLzXct50PZ1KHb34YcHrtgfVGyYu41ZlSry1IJJo8iyyv9eEXfDJFRvGHLJ1f2l+/VK4EWoTvXsBngFx1Et0iCfD1d/qx9qGf0Zz3IdE+CN9/T0SvBU680fsv0ulSA1z2APPMX7pJfUoQ+/+CsOf/kSYyv47H9agYFm9KwwUWQL31YQfJE/Icb+k9ptej6iWOiMsRAnehgSWDnKBi9SibLDqadieOgtLiWg1FYjUw0xhLb21C9GJel8OiVdnVTroqMxGiYxpwFEUglRijdTJD6DxyK1oce5pO7e0zmE3J4mtHU1YCWQ9iQi6ZZl8129zJYCrzy8JMXjbGKLqt+Ml4CQmqbn1P4OVBja/eeoRwxNGtCHL9kQj X-Forefront-PRVS: 0465429B7F X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; DM2PR02MB1337; 23:DUk33V+fsrfJ9IDa6ll+YIhqBofJsWBnx2vnfN14y?= N9Kkq/e3/01x008aizurRhMO3EGGlsrdiz5F9mamLfOF2D2bY2DJfDzGJq4bKRLgQi3HGbJ6SrWS2nYPAwdTccl8lowikcj/i4OJmhsH1xI8FQiN4gDpnwL5kGkpUiTBFWGk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PR02MB1337; 6:IqykZxqaPxnsLIEpW0+Ayqi0tPrjYoyCDBts6FAuAJr/A75enJtPBQ0ytC2soqexkTMb/qhjcQxdeLdQoF7eYssIwo2pk2Gy0gdjU6hZyR9V6UOGJxrU6XMjYjBhKA2t84B69AIZUAxstMgh02dib+R19l46gKYlNp6vmkU/G6Q8QRuJQYf+9cw6jEPrjwOBnqp7FmAOXn6z3pBTpPVjdK2jjHwNsg9LP8pPr+tBoZ+fTMgTpcPX3d9HEy2PllcK9cKIbFoyxz4mPZPPiz9LdoxOvvpKk7+lnHDoo08xbkDY/4/Q6cSb3PAz+kT1+kLdoBoHhApZfMDuZ65ve5fF2w==; 5:2c+sdtYBNBOIvNcljUpFzmD0CZc5f4Dk0caPHEeKg+jr344oV6Slcw8jIw/XQHQMDGW9yN2QQyhUoOez3CbGxANXs8L8cmBrH36BS+VO+JHGMmblp2Nobb3yCH2V8PoSWP62/S9lSIhxEggQUlsW6w==; 24:nn38Tx6xvE98MHsDz0YCPL9twuNJn38YSvfhktDejs5kBDZlsM0JPKCC9yR2VLMZ7D1kOuHJY8ONE7hu4BDLmckjp8nULRx6shuu3QpKOFo=; 7:DsbWCEQfyvdCY2l0XCHodiXZPNCq7Lwss3DytlXJ6hB0SX9rerHV+M7noK5Vmnp6LnDDugVJz5PbHyNAqd5Gczu7K5E5rgLNEE9oSoNBeF23e0Qf47Mbcs1JRbmyb13CHIoB2CjBBX3KfFxzzQmXVFGsDl+/CUEnWbYliDa1e3Ep6wPKD8soGEPPlGQoFb8BzzmrRd28Sxf6AGi7pznhCbQHStkrfSk5BXsf6rQ8rlI= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: xilinx.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 19 Oct 2017 16:22:26.3632 (UTC) X-MS-Exchange-CrossTenant-Id: 657af505-d5df-48d0-8300-c31994686c5c X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=657af505-d5df-48d0-8300-c31994686c5c; Ip=[149.199.60.83]; Helo=[xsj-pvapsmtpgw01] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM2PR02MB1337 X-detected-operating-system: by eggs.gnu.org: Windows 7 or 8 [fuzzy] X-Received-From: 104.47.32.66 Subject: [Qemu-devel] [PATCH v3 46/46] target: Replace fprintf(stderr, "*\n" with error_report() 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: Cornelia Huck , Eduardo Habkost , Marcelo Tosatti , "Edgar E. Iglesias" , armbru@redhat.com, alistair.francis@xilinx.com, Christian Borntraeger , Michael Walle , qemu-arm@nongnu.org, qemu-ppc@nongnu.org, Paolo Bonzini , Yongbok Kim , alistair23@gmail.com, Guan Xuetao , Aurelien Jarno , Richard Henderson Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" Replace a large number of the fprintf(stderr, "*\n" calls with error_report(). The functions were renamed with these commands and then compiler issues where manually fixed. find ./* -type f -exec sed -i \ 'N;N;N;N;N;N;N;N;N;N;N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2);|Ig}' \ {} + find ./* -type f -exec sed -i \ 'N;N;N;N;N;N;N;N;N;N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2);|Ig}' \ {} + find ./* -type f -exec sed -i \ 'N;N;N;N;N;N;N;N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2);|Ig}' \ {} + find ./* -type f -exec sed -i \ 'N;N;N;N;N;N;N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2);|Ig}' \ {} + find ./* -type f -exec sed -i \ 'N;N;N;N;N;N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2);|Ig}' \ {} + find ./* -type f -exec sed -i \ 'N;N;N;N;N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2);|Ig}' \ {} + find ./* -type f -exec sed -i \ 'N;N;N;N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2);|Ig}' \ {} + find ./* -type f -exec sed -i \ 'N;N;N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2);|Ig}' \ {} + find ./* -type f -exec sed -i \ 'N;N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2);|Ig}' \ {} + find ./* -type f -exec sed -i \ 'N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2);|Ig}' \ {} + find ./* -type f -exec sed -i \ 'N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2);|Ig}' \ {} + Some lines where then manually tweaked to pass checkpatch. Signed-off-by: Alistair Francis Cc: "Edgar E. Iglesias" Cc: Paolo Bonzini Cc: Richard Henderson Cc: Eduardo Habkost Cc: Marcelo Tosatti Cc: Michael Walle Cc: Aurelien Jarno Cc: Yongbok Kim Cc: Christian Borntraeger Cc: Cornelia Huck Cc: Guan Xuetao Cc: qemu-arm@nongnu.org Cc: qemu-ppc@nongnu.org Acked-by: Cornelia Huck (s390x part) --- target/arm/arm-powerctl.c | 5 +++-- target/arm/arm-semi.c | 3 ++- target/arm/helper.c | 4 ++-- target/arm/kvm.c | 16 ++++++------- target/arm/kvm32.c | 2 +- target/arm/kvm64.c | 2 +- target/arm/translate-a64.c | 4 ++-- target/arm/translate.c | 2 +- target/cris/helper.c | 2 +- target/i386/hax-all.c | 53 ++++++++++++++++++++++---------------------- target/i386/hax-darwin.c | 26 +++++++++++----------- target/i386/hax-mem.c | 4 ++-- target/i386/hax-windows.c | 43 +++++++++++++++++------------------ target/i386/kvm.c | 38 +++++++++++++++---------------- target/i386/misc_helper.c | 12 +++++----- target/lm32/op_helper.c | 4 ++-- target/mips/mips-semi.c | 3 ++- target/mips/translate.c | 2 +- target/ppc/excp_helper.c | 4 ++-- target/ppc/kvm.c | 34 ++++++++++++++-------------- target/ppc/mmu-hash64.c | 2 +- target/ppc/mmu_helper.c | 2 +- target/ppc/translate_init.c | 53 ++++++++++++++++++++++---------------------- target/s390x/kvm.c | 20 ++++++++--------- target/s390x/misc_helper.c | 2 +- target/unicore32/translate.c | 2 +- 26 files changed, 175 insertions(+), 169 deletions(-) diff --git a/target/arm/arm-powerctl.c b/target/arm/arm-powerctl.c index 25207cb850..2d56d5d579 100644 --- a/target/arm/arm-powerctl.c +++ b/target/arm/arm-powerctl.c @@ -9,6 +9,7 @@ */ #include "qemu/osdep.h" +#include "qemu/error-report.h" #include "cpu.h" #include "cpu-qom.h" #include "internals.h" @@ -24,7 +25,7 @@ #define DPRINTF(fmt, args...) \ do { \ if (DEBUG_ARM_POWERCTL) { \ - fprintf(stderr, "[ARM]%s: " fmt , __func__, ##args); \ + error_report("[ARM]%s: " fmt , __func__, ##args); \ } \ } while (0) @@ -32,7 +33,7 @@ CPUState *arm_get_cpu_by_id(uint64_t id) { CPUState *cpu; - DPRINTF("cpu %" PRId64 "\n", id); + DPRINTF("cpu %" PRId64 "", id); CPU_FOREACH(cpu) { ARMCPU *armcpu = ARM_CPU(cpu); diff --git a/target/arm/arm-semi.c b/target/arm/arm-semi.c index 7cac8734c7..754299184d 100644 --- a/target/arm/arm-semi.c +++ b/target/arm/arm-semi.c @@ -19,6 +19,7 @@ */ #include "qemu/osdep.h" +#include "qemu/error-report.h" #include "cpu.h" #include "exec/semihost.h" @@ -649,7 +650,7 @@ target_ulong do_arm_semihosting(CPUARMState *env) } /* fall through -- invalid for A32/T32 */ default: - fprintf(stderr, "qemu: Unsupported SemiHosting SWI 0x%02x\n", nr); + error_report("Unsupported SemiHosting SWI 0x%02x", nr); cpu_dump_state(cs, stderr, fprintf, 0); abort(); } diff --git a/target/arm/helper.c b/target/arm/helper.c index 96113fe989..3a816fc302 100644 --- a/target/arm/helper.c +++ b/target/arm/helper.c @@ -5481,9 +5481,9 @@ static void add_cpreg_to_hashtable(ARMCPU *cpu, const ARMCPRegInfo *r, ARMCPRegInfo *oldreg; oldreg = g_hash_table_lookup(cpu->cp_regs, key); if (oldreg && !(oldreg->type & ARM_CP_OVERRIDE)) { - fprintf(stderr, "Register redefined: cp=%d %d bit " + error_report("Register redefined: cp=%d %d bit " "crn=%d crm=%d opc1=%d opc2=%d, " - "was %s, now %s\n", r2->cp, 32 + 32 * is64, + "was %s, now %s", r2->cp, 32 + 32 * is64, r2->crn, r2->crm, r2->opc1, r2->opc2, oldreg->name, r2->name); g_assert_not_reached(); diff --git a/target/arm/kvm.c b/target/arm/kvm.c index 211a7bf7be..0165960405 100644 --- a/target/arm/kvm.c +++ b/target/arm/kvm.c @@ -139,7 +139,7 @@ static void kvm_arm_host_cpu_class_init(ObjectClass *oc, void *data) * TCG CPUs. */ if (!kvm_arm_get_host_cpu_features(ahcc)) { - fprintf(stderr, "Failed to retrieve host CPU features!\n"); + error_report("Failed to retrieve host CPU features!"); abort(); } } @@ -256,7 +256,7 @@ static void kvm_arm_set_device_addr(KVMDevice *kd) } if (ret < 0) { - fprintf(stderr, "Failed to set device address: %s\n", + error_report("Failed to set device address: %s", strerror(-ret)); abort(); } @@ -352,7 +352,7 @@ int kvm_arm_init_cpreg_list(ARMCPU *cpu) case KVM_REG_SIZE_U64: break; default: - fprintf(stderr, "Can't handle size of register in kernel list\n"); + error_report("Can't handle size of register in kernel list"); ret = -EINVAL; goto out; } @@ -383,7 +383,7 @@ int kvm_arm_init_cpreg_list(ARMCPU *cpu) /* Shouldn't happen unless kernel is inconsistent about * what registers exist. */ - fprintf(stderr, "Initial read of kernel register state failed\n"); + error_report("Initial read of kernel register state failed"); ret = -EINVAL; goto out; } @@ -478,11 +478,11 @@ void kvm_arm_reset_vcpu(ARMCPU *cpu) */ ret = kvm_arm_vcpu_init(CPU(cpu)); if (ret < 0) { - fprintf(stderr, "kvm_arm_vcpu_init failed: %s\n", strerror(-ret)); + error_report("kvm_arm_vcpu_init failed: %s", strerror(-ret)); abort(); } if (!write_kvmstate_to_list(cpu)) { - fprintf(stderr, "write_kvmstate_to_list failed\n"); + error_report("write_kvmstate_to_list failed"); abort(); } } @@ -499,7 +499,7 @@ int kvm_arm_sync_mpstate_to_kvm(ARMCPU *cpu) }; int ret = kvm_vcpu_ioctl(CPU(cpu), KVM_SET_MP_STATE, &mp_state); if (ret) { - fprintf(stderr, "%s: failed to set MP_STATE %d/%s\n", + error_report("%s: failed to set MP_STATE %d/%s", __func__, ret, strerror(-ret)); return -1; } @@ -517,7 +517,7 @@ int kvm_arm_sync_mpstate_to_qemu(ARMCPU *cpu) struct kvm_mp_state mp_state; int ret = kvm_vcpu_ioctl(CPU(cpu), KVM_GET_MP_STATE, &mp_state); if (ret) { - fprintf(stderr, "%s: failed to get MP_STATE %d/%s\n", + error_report("%s: failed to get MP_STATE %d/%s", __func__, ret, strerror(-ret)); abort(); } diff --git a/target/arm/kvm32.c b/target/arm/kvm32.c index f925a21481..97d36a174d 100644 --- a/target/arm/kvm32.c +++ b/target/arm/kvm32.c @@ -191,7 +191,7 @@ int kvm_arch_init_vcpu(CPUState *cs) ARMCPU *cpu = ARM_CPU(cs); if (cpu->kvm_target == QEMU_KVM_ARM_TARGET_NONE) { - fprintf(stderr, "KVM is not supported for this guest CPU type\n"); + error_report("KVM is not supported for this guest CPU type"); return -EINVAL; } diff --git a/target/arm/kvm64.c b/target/arm/kvm64.c index 6554c30007..b3e1484069 100644 --- a/target/arm/kvm64.c +++ b/target/arm/kvm64.c @@ -502,7 +502,7 @@ int kvm_arch_init_vcpu(CPUState *cs) if (cpu->kvm_target == QEMU_KVM_ARM_TARGET_NONE || !object_dynamic_cast(OBJECT(cpu), TYPE_AARCH64_CPU)) { - fprintf(stderr, "KVM is not supported for this guest CPU type\n"); + error_report("KVM is not supported for this guest CPU type"); return -EINVAL; } diff --git a/target/arm/translate-a64.c b/target/arm/translate-a64.c index a39b9d3633..9c736481f6 100644 --- a/target/arm/translate-a64.c +++ b/target/arm/translate-a64.c @@ -505,8 +505,8 @@ static inline void assert_fp_access_checked(DisasContext *s) { #ifdef CONFIG_DEBUG_TCG if (unlikely(!s->fp_access_checked || s->fp_excp_el)) { - fprintf(stderr, "target-arm: FP access check missing for " - "instruction 0x%08x\n", s->insn); + error_report("target-arm: FP access check missing for " + "instruction 0x%08x", s->insn); abort(); } #endif diff --git a/target/arm/translate.c b/target/arm/translate.c index 4da1a4cbc6..55bdcad97e 100644 --- a/target/arm/translate.c +++ b/target/arm/translate.c @@ -861,7 +861,7 @@ void arm_test_cc(DisasCompare *cmp, int cc) goto no_invert; default: - fprintf(stderr, "Bad condition code 0x%x\n", cc); + error_report("Bad condition code 0x%x", cc); abort(); } diff --git a/target/cris/helper.c b/target/cris/helper.c index af78cca8b9..ba9ce538c3 100644 --- a/target/cris/helper.c +++ b/target/cris/helper.c @@ -282,7 +282,7 @@ hwaddr cris_cpu_get_phys_page_debug(CPUState *cs, vaddr addr) if (!miss) { phy = res.phy; } - D(fprintf(stderr, "%s %x -> %x\n", __func__, addr, phy)); + D(error_report("%s %x -> %x", __func__, addr, phy)); return phy; } #endif diff --git a/target/i386/hax-all.c b/target/i386/hax-all.c index 3ce6950296..0aeeb7c906 100644 --- a/target/i386/hax-all.c +++ b/target/i386/hax-all.c @@ -28,6 +28,7 @@ #include "exec/address-spaces.h" #include "exec/exec-all.h" #include "exec/ioport.h" +#include "qemu/error-report.h" #include "qemu-common.h" #include "strings.h" @@ -100,13 +101,13 @@ static int hax_get_capability(struct hax_state *hax) } if (!(cap->winfo & HAX_CAP_UG)) { - fprintf(stderr, "UG mode is not supported by the hardware.\n"); + error_report("UG mode is not supported by the hardware."); return -ENOTSUP; } if (cap->wstatus & HAX_CAP_MEMQUOTA) { if (cap->mem_quota < hax->mem_quota) { - fprintf(stderr, "The VM memory needed exceeds the driver limit.\n"); + error_report("The VM memory needed exceeds the driver limit."); return -ENOSPC; } } @@ -126,13 +127,13 @@ static int hax_version_support(struct hax_state *hax) if (hax_min_version > version.cur_version) { fprintf(stderr, "Incompatible HAX module version %d,", version.cur_version); - fprintf(stderr, "requires minimum version %d\n", hax_min_version); + error_report("requires minimum version %d", hax_min_version); return 0; } if (hax_cur_version < version.compat_version) { fprintf(stderr, "Incompatible QEMU HAX API version %x,", hax_cur_version); - fprintf(stderr, "requires minimum HAX API version %x\n", + error_report("requires minimum HAX API version %x", version.compat_version); return 0; } @@ -146,18 +147,18 @@ int hax_vcpu_create(int id) int ret; if (!hax_global.vm) { - fprintf(stderr, "vcpu %x created failed, vm is null\n", id); + error_report("vcpu %x created failed, vm is null", id); return -1; } if (hax_global.vm->vcpus[id]) { - fprintf(stderr, "vcpu %x allocated already\n", id); + error_report("vcpu %x allocated already", id); return 0; } vcpu = g_malloc(sizeof(struct hax_vcpu_state)); if (!vcpu) { - fprintf(stderr, "Failed to alloc vcpu state\n"); + error_report("Failed to alloc vcpu state"); return -ENOMEM; } @@ -165,14 +166,14 @@ int hax_vcpu_create(int id) ret = hax_host_create_vcpu(hax_global.vm->fd, id); if (ret) { - fprintf(stderr, "Failed to create vcpu %x\n", id); + error_report("Failed to create vcpu %x", id); goto error; } vcpu->vcpu_id = id; vcpu->fd = hax_host_open_vcpu(hax_global.vm->id, id); if (hax_invalid_fd(vcpu->fd)) { - fprintf(stderr, "Failed to open the vcpu\n"); + error_report("Failed to open the vcpu"); ret = -ENODEV; goto error; } @@ -181,7 +182,7 @@ int hax_vcpu_create(int id) ret = hax_host_setup_vcpu_channel(vcpu); if (ret) { - fprintf(stderr, "Invalid hax tunnel size\n"); + error_report("Invalid hax tunnel size"); ret = -EINVAL; goto error; } @@ -203,7 +204,7 @@ int hax_vcpu_destroy(CPUState *cpu) struct hax_vcpu_state *vcpu = cpu->hax_vcpu; if (!hax_global.vm) { - fprintf(stderr, "vcpu %x destroy failed, vm is null\n", vcpu->vcpu_id); + error_report("vcpu %x destroy failed, vm is null", vcpu->vcpu_id); return -1; } @@ -227,7 +228,7 @@ int hax_init_vcpu(CPUState *cpu) ret = hax_vcpu_create(cpu->cpu_index); if (ret < 0) { - fprintf(stderr, "Failed to create HAX vcpu\n"); + error_report("Failed to create HAX vcpu"); exit(-1); } @@ -258,13 +259,13 @@ struct hax_vm *hax_vm_create(struct hax_state *hax) memset(vm, 0, sizeof(struct hax_vm)); ret = hax_host_create_vm(hax, &vm_id); if (ret) { - fprintf(stderr, "Failed to create vm %x\n", ret); + error_report("Failed to create vm %x", ret); goto error; } vm->id = vm_id; vm->fd = hax_host_open_vm(hax, vm_id); if (hax_invalid_fd(vm->fd)) { - fprintf(stderr, "Failed to open vm %d\n", vm_id); + error_report("Failed to open vm %d", vm_id); goto error; } @@ -283,7 +284,7 @@ int hax_vm_destroy(struct hax_vm *vm) for (i = 0; i < HAX_MAX_VCPU; i++) if (vm->vcpus[i]) { - fprintf(stderr, "VCPU should be cleaned before vm clean\n"); + error_report("VCPU should be cleaned before vm clean"); return -1; } hax_close_fd(vm->fd); @@ -335,7 +336,7 @@ static int hax_init(ram_addr_t ram_size) hax->vm = hax_vm_create(hax); if (!hax->vm) { - fprintf(stderr, "Failed to create HAX VM\n"); + error_report("Failed to create HAX VM"); ret = -EINVAL; goto error; } @@ -364,7 +365,7 @@ static int hax_accel_init(MachineState *ms) int ret = hax_init(ms->ram_size); if (ret && (ret != -ENOSPC)) { - fprintf(stderr, "No accelerator found.\n"); + error_report("No accelerator found."); } else { fprintf(stdout, "HAX is %s and emulator runs in %s mode.\n", !ret ? "working" : "not working", @@ -526,7 +527,7 @@ static int hax_vcpu_hax_exec(CPUArchState *env) } if (hax_ret < 0) { - fprintf(stderr, "vcpu run failed for vcpu %x\n", vcpu->vcpu_id); + error_report("vcpu run failed for vcpu %x", vcpu->vcpu_id); abort(); } switch (ht->_exit_status) { @@ -546,7 +547,7 @@ static int hax_vcpu_hax_exec(CPUArchState *env) ret = 1; break; case HAX_EXIT_UNKNOWN_VMEXIT: - fprintf(stderr, "Unknown VMX exit %x from guest\n", + error_report("Unknown VMX exit %x from guest", ht->_exit_reason); qemu_system_reset_request(SHUTDOWN_CAUSE_GUEST_RESET); hax_vcpu_sync_state(env, 0); @@ -569,16 +570,16 @@ static int hax_vcpu_hax_exec(CPUArchState *env) break; case HAX_EXIT_MMIO: /* Should not happen on UG system */ - fprintf(stderr, "HAX: unsupported MMIO emulation\n"); + error_report("HAX: unsupported MMIO emulation"); ret = -1; break; case HAX_EXIT_REAL: /* Should not happen on UG system */ - fprintf(stderr, "HAX: unimplemented real mode emulation\n"); + error_report("HAX: unimplemented real mode emulation"); ret = -1; break; default: - fprintf(stderr, "Unknown exit %x from HAX\n", ht->_exit_status); + error_report("Unknown exit %x from HAX", ht->_exit_status); qemu_system_reset_request(SHUTDOWN_CAUSE_GUEST_RESET); hax_vcpu_sync_state(env, 0); cpu_dump_state(cpu, stderr, fprintf, 0); @@ -662,7 +663,7 @@ int hax_smp_cpu_exec(CPUState *cpu) fatal = hax_vcpu_hax_exec(env); if (fatal) { - fprintf(stderr, "Unsupported HAX vcpu return\n"); + error_report("Unsupported HAX vcpu return"); abort(); } } @@ -1079,17 +1080,17 @@ static int hax_arch_set_registers(CPUArchState *env) ret = hax_sync_vcpu_register(env, 1); if (ret < 0) { - fprintf(stderr, "Failed to sync vcpu reg\n"); + error_report("Failed to sync vcpu reg"); return ret; } ret = hax_set_fpu(env); if (ret < 0) { - fprintf(stderr, "FPU failed\n"); + error_report("FPU failed"); return ret; } ret = hax_set_msrs(env); if (ret < 0) { - fprintf(stderr, "MSR failed\n"); + error_report("MSR failed"); return ret; } diff --git a/target/i386/hax-darwin.c b/target/i386/hax-darwin.c index 1c5bbd0a2d..768521b6d0 100644 --- a/target/i386/hax-darwin.c +++ b/target/i386/hax-darwin.c @@ -24,7 +24,7 @@ hax_fd hax_mod_open(void) { int fd = open("/dev/HAX", O_RDWR); if (fd == -1) { - fprintf(stderr, "Failed to open the hax module\n"); + error_report("Failed to open the hax module"); } fcntl(fd, F_SETFD, FD_CLOEXEC); @@ -38,7 +38,7 @@ int hax_populate_ram(uint64_t va, uint32_t size) struct hax_alloc_ram_info info; if (!hax_global.vm || !hax_global.vm->fd) { - fprintf(stderr, "Allocate memory before vm create?\n"); + error_report("Allocate memory before vm create?"); return -EINVAL; } @@ -46,7 +46,7 @@ int hax_populate_ram(uint64_t va, uint32_t size) info.va = va; ret = ioctl(hax_global.vm->fd, HAX_VM_IOCTL_ALLOC_RAM, &info); if (ret < 0) { - fprintf(stderr, "Failed to allocate %x memory\n", size); + error_report("Failed to allocate %x memory", size); return ret; } return 0; @@ -75,7 +75,7 @@ int hax_capability(struct hax_state *hax, struct hax_capabilityinfo *cap) ret = ioctl(hax->fd, HAX_IOCTL_CAPABILITY, cap); if (ret == -1) { - fprintf(stderr, "Failed to get HAX capability\n"); + error_report("Failed to get HAX capability"); return -errno; } @@ -88,7 +88,7 @@ int hax_mod_version(struct hax_state *hax, struct hax_module_version *version) ret = ioctl(hax->fd, HAX_IOCTL_VERSION, version); if (ret == -1) { - fprintf(stderr, "Failed to get HAX version\n"); + error_report("Failed to get HAX version"); return -errno; } @@ -100,7 +100,7 @@ static char *hax_vm_devfs_string(int vm_id) char *name; if (vm_id > MAX_VM_ID) { - fprintf(stderr, "Too big VM id\n"); + error_report("Too big VM id"); return NULL; } @@ -119,7 +119,7 @@ static char *hax_vcpu_devfs_string(int vm_id, int vcpu_id) char *name; if (vm_id > MAX_VM_ID || vcpu_id > MAX_VCPU_ID) { - fprintf(stderr, "Too big vm id %x or vcpu id %x\n", vm_id, vcpu_id); + error_report("Too big vm id %x or vcpu id %x", vm_id, vcpu_id); return NULL; } @@ -181,7 +181,7 @@ int hax_notify_qemu_version(hax_fd vm_fd, struct hax_qemu_version *qversion) ret = ioctl(vm_fd, HAX_VM_IOCTL_NOTIFY_QEMU_VERSION, qversion); if (ret < 0) { - fprintf(stderr, "Failed to notify qemu API version\n"); + error_report("Failed to notify qemu API version"); return ret; } return 0; @@ -196,7 +196,7 @@ int hax_host_create_vcpu(hax_fd vm_fd, int vcpuid) ret = ioctl(vm_fd, HAX_VM_IOCTL_VCPU_CREATE, &vcpuid); if (ret < 0) { - fprintf(stderr, "Failed to create vcpu %x\n", vcpuid); + error_report("Failed to create vcpu %x", vcpuid); } return ret; @@ -209,14 +209,14 @@ hax_fd hax_host_open_vcpu(int vmid, int vcpuid) devfs_path = hax_vcpu_devfs_string(vmid, vcpuid); if (!devfs_path) { - fprintf(stderr, "Failed to get the devfs\n"); + error_report("Failed to get the devfs"); return -EINVAL; } fd = open(devfs_path, O_RDWR); g_free(devfs_path); if (fd < 0) { - fprintf(stderr, "Failed to open the vcpu devfs\n"); + error_report("Failed to open the vcpu devfs"); } fcntl(fd, F_SETFD, FD_CLOEXEC); return fd; @@ -229,12 +229,12 @@ int hax_host_setup_vcpu_channel(struct hax_vcpu_state *vcpu) ret = ioctl(vcpu->fd, HAX_VCPU_IOCTL_SETUP_TUNNEL, &info); if (ret) { - fprintf(stderr, "Failed to setup the hax tunnel\n"); + error_report("Failed to setup the hax tunnel"); return ret; } if (!valid_hax_tunnel_size(info.size)) { - fprintf(stderr, "Invalid hax tunnel size %x\n", info.size); + error_report("Invalid hax tunnel size %x", info.size); ret = -EINVAL; return ret; } diff --git a/target/i386/hax-mem.c b/target/i386/hax-mem.c index 27a0d214f2..e1388bb003 100644 --- a/target/i386/hax-mem.c +++ b/target/i386/hax-mem.c @@ -247,8 +247,8 @@ static void hax_transaction_commit(MemoryListener *listener) } if (hax_set_ram(entry->start_pa, entry->size, entry->host_va, entry->flags)) { - fprintf(stderr, "%s: Failed mapping @0x%016" PRIx64 "+0x%" - PRIx32 " flags %02x\n", __func__, entry->start_pa, + error_report("%s: Failed mapping @0x%016" PRIx64 "+0x%" + PRIx32 " flags %02x", __func__, entry->start_pa, entry->size, entry->flags); } QTAILQ_REMOVE(&mappings, entry, entry); diff --git a/target/i386/hax-windows.c b/target/i386/hax-windows.c index 15a180b646..9a8c160acc 100644 --- a/target/i386/hax-windows.c +++ b/target/i386/hax-windows.c @@ -11,6 +11,7 @@ */ #include "qemu/osdep.h" +#include "qemu/error-report.h" #include "cpu.h" #include "exec/exec-all.h" #include "hax-i386.h" @@ -33,7 +34,7 @@ static int hax_open_device(hax_fd *fd) 0, NULL, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL); if (hDevice == INVALID_HANDLE_VALUE) { - fprintf(stderr, "Failed to open the HAX device!\n"); + error_report("Failed to open the HAX device!"); errNum = GetLastError(); if (errNum == ERROR_FILE_NOT_FOUND) { return -1; @@ -52,7 +53,7 @@ static int hax_open_device(hax_fd *fd) ret = hax_open_device(&fd); if (ret != 0) { - fprintf(stderr, "Open HAX device failed\n"); + error_report("Open HAX device failed"); } return fd; @@ -66,7 +67,7 @@ int hax_populate_ram(uint64_t va, uint32_t size) DWORD dSize = 0; if (!hax_global.vm || !hax_global.vm->fd) { - fprintf(stderr, "Allocate memory before vm create?\n"); + error_report("Allocate memory before vm create?"); return -EINVAL; } @@ -81,7 +82,7 @@ int hax_populate_ram(uint64_t va, uint32_t size) (LPOVERLAPPED) NULL); if (!ret) { - fprintf(stderr, "Failed to allocate %x memory\n", size); + error_report("Failed to allocate %x memory", size); return ret; } @@ -119,7 +120,7 @@ int hax_capability(struct hax_state *hax, struct hax_capabilityinfo *cap) DWORD err = 0; if (hax_invalid_fd(hDevice)) { - fprintf(stderr, "Invalid fd for hax device!\n"); + error_report("Invalid fd for hax device!"); return -ENODEV; } @@ -129,9 +130,9 @@ int hax_capability(struct hax_state *hax, struct hax_capabilityinfo *cap) if (!ret) { err = GetLastError(); if (err == ERROR_INSUFFICIENT_BUFFER || err == ERROR_MORE_DATA) { - fprintf(stderr, "hax capability is too long to hold.\n"); + error_report("hax capability is too long to hold."); } - fprintf(stderr, "Failed to get Hax capability:%luu\n", err); + error_report("Failed to get Hax capability:%luu", err); return -EFAULT; } else { return 0; @@ -146,7 +147,7 @@ int hax_mod_version(struct hax_state *hax, struct hax_module_version *version) DWORD err = 0; if (hax_invalid_fd(hDevice)) { - fprintf(stderr, "Invalid fd for hax device!\n"); + error_report("Invalid fd for hax device!"); return -ENODEV; } @@ -159,9 +160,9 @@ int hax_mod_version(struct hax_state *hax, struct hax_module_version *version) if (!ret) { err = GetLastError(); if (err == ERROR_INSUFFICIENT_BUFFER || err == ERROR_MORE_DATA) { - fprintf(stderr, "hax module verion is too long to hold.\n"); + error_report("hax module verion is too long to hold."); } - fprintf(stderr, "Failed to get Hax module version:%lu\n", err); + error_report("Failed to get Hax module version:%lu", err); return -EFAULT; } else { return 0; @@ -173,7 +174,7 @@ static char *hax_vm_devfs_string(int vm_id) char *name; if (vm_id > MAX_VM_ID) { - fprintf(stderr, "Too big VM id\n"); + error_report("Too big VM id"); return NULL; } @@ -192,7 +193,7 @@ static char *hax_vcpu_devfs_string(int vm_id, int vcpu_id) char *name; if (vm_id > MAX_VM_ID || vcpu_id > MAX_VCPU_ID) { - fprintf(stderr, "Too big vm id %x or vcpu id %x\n", vm_id, vcpu_id); + error_report("Too big vm id %x or vcpu id %x", vm_id, vcpu_id); return NULL; } @@ -226,7 +227,7 @@ int hax_host_create_vm(struct hax_state *hax, int *vmid) NULL, 0, &vm_id, sizeof(vm_id), &dSize, (LPOVERLAPPED) NULL); if (!ret) { - fprintf(stderr, "Failed to create VM. Error code: %lu\n", + error_report("Failed to create VM. Error code: %lu", GetLastError()); return -1; } @@ -241,7 +242,7 @@ hax_fd hax_host_open_vm(struct hax_state *hax, int vm_id) vm_name = hax_vm_devfs_string(vm_id); if (!vm_name) { - fprintf(stderr, "Failed to open VM. VM name is null\n"); + error_report("Failed to open VM. VM name is null"); return INVALID_HANDLE_VALUE; } @@ -249,7 +250,7 @@ hax_fd hax_host_open_vm(struct hax_state *hax, int vm_id) GENERIC_READ | GENERIC_WRITE, 0, NULL, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL); if (hDeviceVM == INVALID_HANDLE_VALUE) { - fprintf(stderr, "Open the vm device error:%s, ec:%lu\n", + error_report("Open the vm device error:%s, ec:%lu", vm_name, GetLastError()); } @@ -269,7 +270,7 @@ int hax_notify_qemu_version(hax_fd vm_fd, struct hax_qemu_version *qversion) qversion, sizeof(struct hax_qemu_version), NULL, 0, &dSize, (LPOVERLAPPED) NULL); if (!ret) { - fprintf(stderr, "Failed to notify qemu API version\n"); + error_report("Failed to notify qemu API version"); return -1; } return 0; @@ -285,7 +286,7 @@ int hax_host_create_vcpu(hax_fd vm_fd, int vcpuid) &vcpuid, sizeof(vcpuid), NULL, 0, &dSize, (LPOVERLAPPED) NULL); if (!ret) { - fprintf(stderr, "Failed to create vcpu %x\n", vcpuid); + error_report("Failed to create vcpu %x", vcpuid); return -1; } @@ -299,7 +300,7 @@ hax_fd hax_host_open_vcpu(int vmid, int vcpuid) devfs_path = hax_vcpu_devfs_string(vmid, vcpuid); if (!devfs_path) { - fprintf(stderr, "Failed to get the devfs\n"); + error_report("Failed to get the devfs"); return INVALID_HANDLE_VALUE; } @@ -309,7 +310,7 @@ hax_fd hax_host_open_vcpu(int vmid, int vcpuid) NULL); if (hDeviceVCPU == INVALID_HANDLE_VALUE) { - fprintf(stderr, "Failed to open the vcpu devfs\n"); + error_report("Failed to open the vcpu devfs"); } g_free(devfs_path); return hDeviceVCPU; @@ -327,12 +328,12 @@ int hax_host_setup_vcpu_channel(struct hax_vcpu_state *vcpu) NULL, 0, &info, sizeof(info), &dSize, (LPOVERLAPPED) NULL); if (!ret) { - fprintf(stderr, "Failed to setup the hax tunnel\n"); + error_report("Failed to setup the hax tunnel"); return -1; } if (!valid_hax_tunnel_size(info.size)) { - fprintf(stderr, "Invalid hax tunnel size %x\n", info.size); + error_report("Invalid hax tunnel size %x", info.size); ret = -EINVAL; return ret; } diff --git a/target/i386/kvm.c b/target/i386/kvm.c index b1e32e95d3..d7cf10ae11 100644 --- a/target/i386/kvm.c +++ b/target/i386/kvm.c @@ -219,7 +219,7 @@ static struct kvm_cpuid2 *try_get_cpuid(KVMState *s, int max) g_free(cpuid); return NULL; } else { - fprintf(stderr, "KVM_GET_SUPPORTED_CPUID failed: %s\n", + error_report("KVM_GET_SUPPORTED_CPUID failed: %s", strerror(-r)); exit(1); } @@ -470,7 +470,7 @@ static void kvm_mce_inject(X86CPU *cpu, hwaddr paddr, int code) static void hardware_memory_error(void) { - fprintf(stderr, "Hardware memory error!\n"); + error_report("Hardware memory error!"); exit(1); } @@ -497,8 +497,8 @@ void kvm_arch_on_sigbus_vcpu(CPUState *c, int code, void *addr) return; } - fprintf(stderr, "Hardware memory error for memory used by " - "QEMU itself instead of guest system!\n"); + error_report("Hardware memory error for memory used by " + "QEMU itself instead of guest system!"); } if (code == BUS_MCEERR_AR) { @@ -666,7 +666,7 @@ static int hyperv_handle_properties(CPUState *cs) if (!has_msr_hv_synic || kvm_vcpu_enable_cap(cs, KVM_CAP_HYPERV_SYNIC, 0)) { - fprintf(stderr, "Hyper-V SynIC is not supported by kernel\n"); + error_report("Hyper-V SynIC is not supported by kernel"); return -ENOSYS; } @@ -678,7 +678,7 @@ static int hyperv_handle_properties(CPUState *cs) } if (cpu->hyperv_stimer) { if (!has_msr_hv_stimer) { - fprintf(stderr, "Hyper-V timers aren't supported by kernel\n"); + error_report("Hyper-V timers aren't supported by kernel"); return -ENOSYS; } env->features[FEAT_HYPERV_EAX] |= HV_SYNTIMERS_AVAILABLE; @@ -811,7 +811,7 @@ int kvm_arch_init_vcpu(CPUState *cs) for (i = 0; i <= limit; i++) { if (cpuid_i == KVM_MAX_CPUID_ENTRIES) { - fprintf(stderr, "unsupported level value: 0x%x\n", limit); + error_report("unsupported level value: 0x%x", limit); abort(); } c = &cpuid_data.entries[cpuid_i++]; @@ -829,8 +829,8 @@ int kvm_arch_init_vcpu(CPUState *cs) for (j = 1; j < times; ++j) { if (cpuid_i == KVM_MAX_CPUID_ENTRIES) { - fprintf(stderr, "cpuid_data is full, no space for " - "cpuid(eax:2):eax & 0xf = 0x%x\n", times); + error_report("cpuid_data is full, no space for " + "cpuid(eax:2):eax & 0xf = 0x%x", times); abort(); } c = &cpuid_data.entries[cpuid_i++]; @@ -862,8 +862,8 @@ int kvm_arch_init_vcpu(CPUState *cs) continue; } if (cpuid_i == KVM_MAX_CPUID_ENTRIES) { - fprintf(stderr, "cpuid_data is full, no space for " - "cpuid(eax:0x%x,ecx:0x%x)\n", i, j); + error_report("cpuid_data is full, no space for " + "cpuid(eax:0x%x,ecx:0x%x)", i, j); abort(); } c = &cpuid_data.entries[cpuid_i++]; @@ -899,7 +899,7 @@ int kvm_arch_init_vcpu(CPUState *cs) for (i = 0x80000000; i <= limit; i++) { if (cpuid_i == KVM_MAX_CPUID_ENTRIES) { - fprintf(stderr, "unsupported xlevel value: 0x%x\n", limit); + error_report("unsupported xlevel value: 0x%x", limit); abort(); } c = &cpuid_data.entries[cpuid_i++]; @@ -915,7 +915,7 @@ int kvm_arch_init_vcpu(CPUState *cs) for (i = 0xC0000000; i <= limit; i++) { if (cpuid_i == KVM_MAX_CPUID_ENTRIES) { - fprintf(stderr, "unsupported xlevel2 value: 0x%x\n", limit); + error_report("unsupported xlevel2 value: 0x%x", limit); abort(); } c = &cpuid_data.entries[cpuid_i++]; @@ -1245,7 +1245,7 @@ int kvm_arch_init(MachineState *ms, KVMState *s) /* Tell fw_cfg to notify the BIOS to reserve the range. */ ret = e820_add_entry(identity_base, 0x4000, E820_RESERVED); if (ret < 0) { - fprintf(stderr, "e820_add_entry() table is full\n"); + error_report("e820_add_entry() table is full"); return ret; } qemu_register_reset(kvm_unpoison_all, NULL); @@ -2733,7 +2733,7 @@ void kvm_arch_pre_run(CPUState *cpu, struct kvm_run *run) DPRINTF("injected NMI\n"); ret = kvm_vcpu_ioctl(cpu, KVM_NMI); if (ret < 0) { - fprintf(stderr, "KVM: injection failed, NMI lost (%s)\n", + error_report("KVM: injection failed, NMI lost (%s)", strerror(-ret)); } } @@ -2744,7 +2744,7 @@ void kvm_arch_pre_run(CPUState *cpu, struct kvm_run *run) DPRINTF("injected SMI\n"); ret = kvm_vcpu_ioctl(cpu, KVM_SMI); if (ret < 0) { - fprintf(stderr, "KVM: injection failed, SMI lost (%s)\n", + error_report("KVM: injection failed, SMI lost (%s)", strerror(-ret)); } } @@ -3141,7 +3141,7 @@ int kvm_arch_handle_exit(CPUState *cs, struct kvm_run *run) break; case KVM_EXIT_FAIL_ENTRY: code = run->fail_entry.hardware_entry_failure_reason; - fprintf(stderr, "KVM: entry failed, hardware error 0x%" PRIx64 "\n", + error_report("KVM: entry failed, hardware error 0x%" PRIx64 "", code); if (host_supports_vmx() && code == VMX_INVALID_GUEST_STATE) { fprintf(stderr, @@ -3157,7 +3157,7 @@ int kvm_arch_handle_exit(CPUState *cs, struct kvm_run *run) ret = -1; break; case KVM_EXIT_EXCEPTION: - fprintf(stderr, "KVM: exception %d exit (error code 0x%x)\n", + error_report("KVM: exception %d exit (error code 0x%x)", run->ex.exception, run->ex.error_code); ret = -1; break; @@ -3175,7 +3175,7 @@ int kvm_arch_handle_exit(CPUState *cs, struct kvm_run *run) ret = 0; break; default: - fprintf(stderr, "KVM: unknown exit reason %d\n", run->exit_reason); + error_report("KVM: unknown exit reason %d", run->exit_reason); ret = -1; break; } diff --git a/target/i386/misc_helper.c b/target/i386/misc_helper.c index 628f64aad5..115e80217e 100644 --- a/target/i386/misc_helper.c +++ b/target/i386/misc_helper.c @@ -28,7 +28,7 @@ void helper_outb(CPUX86State *env, uint32_t port, uint32_t data) { #ifdef CONFIG_USER_ONLY - fprintf(stderr, "outb: port=0x%04x, data=%02x\n", port, data); + error_report("outb: port=0x%04x, data=%02x", port, data); #else address_space_stb(&address_space_io, port, data, cpu_get_mem_attrs(env), NULL); @@ -38,7 +38,7 @@ void helper_outb(CPUX86State *env, uint32_t port, uint32_t data) target_ulong helper_inb(CPUX86State *env, uint32_t port) { #ifdef CONFIG_USER_ONLY - fprintf(stderr, "inb: port=0x%04x\n", port); + error_report("inb: port=0x%04x", port); return 0; #else return address_space_ldub(&address_space_io, port, @@ -49,7 +49,7 @@ target_ulong helper_inb(CPUX86State *env, uint32_t port) void helper_outw(CPUX86State *env, uint32_t port, uint32_t data) { #ifdef CONFIG_USER_ONLY - fprintf(stderr, "outw: port=0x%04x, data=%04x\n", port, data); + error_report("outw: port=0x%04x, data=%04x", port, data); #else address_space_stw(&address_space_io, port, data, cpu_get_mem_attrs(env), NULL); @@ -59,7 +59,7 @@ void helper_outw(CPUX86State *env, uint32_t port, uint32_t data) target_ulong helper_inw(CPUX86State *env, uint32_t port) { #ifdef CONFIG_USER_ONLY - fprintf(stderr, "inw: port=0x%04x\n", port); + error_report("inw: port=0x%04x", port); return 0; #else return address_space_lduw(&address_space_io, port, @@ -70,7 +70,7 @@ target_ulong helper_inw(CPUX86State *env, uint32_t port) void helper_outl(CPUX86State *env, uint32_t port, uint32_t data) { #ifdef CONFIG_USER_ONLY - fprintf(stderr, "outw: port=0x%04x, data=%08x\n", port, data); + error_report("outw: port=0x%04x, data=%08x", port, data); #else address_space_stl(&address_space_io, port, data, cpu_get_mem_attrs(env), NULL); @@ -80,7 +80,7 @@ void helper_outl(CPUX86State *env, uint32_t port, uint32_t data) target_ulong helper_inl(CPUX86State *env, uint32_t port) { #ifdef CONFIG_USER_ONLY - fprintf(stderr, "inl: port=0x%04x\n", port); + error_report("inl: port=0x%04x", port); return 0; #else return address_space_ldl(&address_space_io, port, diff --git a/target/lm32/op_helper.c b/target/lm32/op_helper.c index 2177c8ad12..34bfc3fb3b 100644 --- a/target/lm32/op_helper.c +++ b/target/lm32/op_helper.c @@ -40,9 +40,9 @@ void HELPER(ill)(CPULM32State *env) { #ifndef CONFIG_USER_ONLY CPUState *cs = CPU(lm32_env_get_cpu(env)); - fprintf(stderr, "VM paused due to illegal instruction. " + error_report("VM paused due to illegal instruction. " "Connect a debugger or switch to the monitor console " - "to find out more.\n"); + "to find out more."); vm_stop(RUN_STATE_PAUSED); cs->halted = 1; raise_exception(env, EXCP_HALTED); diff --git a/target/mips/mips-semi.c b/target/mips/mips-semi.c index a7aefbaefc..c1f35f8f5a 100644 --- a/target/mips/mips-semi.c +++ b/target/mips/mips-semi.c @@ -18,6 +18,7 @@ */ #include "qemu/osdep.h" +#include "qemu/error-report.h" #include "cpu.h" #include "qemu/log.h" #include "exec/helper-proto.h" @@ -366,7 +367,7 @@ void helper_do_semihosting(CPUMIPSState *env) break; #endif default: - fprintf(stderr, "Unknown UHI operation %d\n", op); + error_report("Unknown UHI operation %d", op); abort(); } uhi_done: diff --git a/target/mips/translate.c b/target/mips/translate.c index ac05f3aa09..13e6a2ba78 100644 --- a/target/mips/translate.c +++ b/target/mips/translate.c @@ -10886,7 +10886,7 @@ static void gen_branch(DisasContext *ctx, int insn_bytes) tcg_gen_lookup_and_goto_ptr(); break; default: - fprintf(stderr, "unknown branch 0x%x\n", proc_hflags); + error_report("unknown branch 0x%x", proc_hflags); abort(); } } diff --git a/target/ppc/excp_helper.c b/target/ppc/excp_helper.c index e6009e70e5..a142e81a0f 100644 --- a/target/ppc/excp_helper.c +++ b/target/ppc/excp_helper.c @@ -200,8 +200,8 @@ static inline void powerpc_excp(PowerPCCPU *cpu, int excp_model, int excp) /* Machine check exception is not enabled. * Enter checkstop state. */ - fprintf(stderr, "Machine check while not allowed. " - "Entering checkstop state\n"); + error_report("Machine check while not allowed. " + "Entering checkstop state"); if (qemu_log_separate()) { qemu_log("Machine check while not allowed. " "Entering checkstop state\n"); diff --git a/target/ppc/kvm.c b/target/ppc/kvm.c index 9d57debf0e..b87f3d6f84 100644 --- a/target/ppc/kvm.c +++ b/target/ppc/kvm.c @@ -159,8 +159,8 @@ int kvm_arch_init(MachineState *ms, KVMState *s) cap_ppc_pvr_compat = false; if (!cap_interrupt_level) { - fprintf(stderr, "KVM: Couldn't find level irq capability. Expect the " - "VM to stall at times!\n"); + error_report("KVM: Couldn't find level irq capability. Expect the " + "VM to stall at times!"); } kvm_ppc_register_host_cpu_type(ms); @@ -188,7 +188,7 @@ static int kvm_arch_sync_sregs(PowerPCCPU *cpu) return 0; } else { if (!cap_segstate) { - fprintf(stderr, "kvm error: missing PVR setting capability\n"); + error_report("kvm error: missing PVR setting capability"); return -ENOSYS; } } @@ -237,7 +237,7 @@ static int kvm_booke206_tlb_init(PowerPCCPU *cpu) ret = kvm_vcpu_enable_cap(cs, KVM_CAP_SW_TLB, 0, (uintptr_t)&cfg); if (ret < 0) { - fprintf(stderr, "%s: couldn't enable KVM_CAP_SW_TLB: %s\n", + error_report("%s: couldn't enable KVM_CAP_SW_TLB: %s", __func__, strerror(-ret)); return ret; } @@ -552,7 +552,7 @@ static void kvmppc_hw_debug_points_init(CPUPPCState *cenv) } if ((max_hw_breakpoint + max_hw_watchpoint) > MAX_HW_BKPTS) { - fprintf(stderr, "Error initializing h/w breakpoints\n"); + error_report("Error initializing h/w breakpoints"); return; } } @@ -623,7 +623,7 @@ static void kvm_sw_tlb_put(PowerPCCPU *cpu) ret = kvm_vcpu_ioctl(cs, KVM_DIRTY_TLB, &dirty_tlb); if (ret) { - fprintf(stderr, "%s: KVM_DIRTY_TLB: %s\n", + error_report("%s: KVM_DIRTY_TLB: %s", __func__, strerror(-ret)); } @@ -1480,7 +1480,7 @@ static int kvmppc_handle_halt(PowerPCCPU *cpu) static int kvmppc_handle_dcr_read(CPUPPCState *env, uint32_t dcrn, uint32_t *data) { if (ppc_dcr_read(env->dcr_env, dcrn, data) < 0) - fprintf(stderr, "Read to unhandled DCR (0x%x)\n", dcrn); + error_report("Read to unhandled DCR (0x%x)", dcrn); return 0; } @@ -1488,7 +1488,7 @@ static int kvmppc_handle_dcr_read(CPUPPCState *env, uint32_t dcrn, uint32_t *dat static int kvmppc_handle_dcr_write(CPUPPCState *env, uint32_t dcrn, uint32_t data) { if (ppc_dcr_write(env->dcr_env, dcrn, data) < 0) - fprintf(stderr, "Write to unhandled DCR (0x%x)\n", dcrn); + error_report("Write to unhandled DCR (0x%x)", dcrn); return 0; } @@ -1799,7 +1799,7 @@ int kvm_arch_handle_exit(CPUState *cs, struct kvm_run *run) break; default: - fprintf(stderr, "KVM: unknown exit reason %d\n", run->exit_reason); + error_report("KVM: unknown exit reason %d", run->exit_reason); ret = -1; break; } @@ -1863,7 +1863,7 @@ int kvmppc_booke_watchdog_enable(PowerPCCPU *cpu) ret = kvm_vcpu_enable_cap(cs, KVM_CAP_PPC_BOOKE_WATCHDOG, 0); if (ret < 0) { - fprintf(stderr, "%s: couldn't enable KVM_CAP_PPC_BOOKE_WATCHDOG: %s\n", + error_report("%s: couldn't enable KVM_CAP_PPC_BOOKE_WATCHDOG: %s", __func__, strerror(-ret)); return ret; } @@ -2198,7 +2198,7 @@ off_t kvmppc_alloc_rma(void **rma) fd = kvm_vm_ioctl(kvm_state, KVM_ALLOCATE_RMA, &ret); if (fd < 0) { - fprintf(stderr, "KVM: Error on KVM_ALLOCATE_RMA: %s\n", + error_report("KVM: Error on KVM_ALLOCATE_RMA: %s", strerror(errno)); return -1; } @@ -2207,7 +2207,7 @@ off_t kvmppc_alloc_rma(void **rma) *rma = mmap(NULL, size, PROT_READ|PROT_WRITE, MAP_SHARED, fd, 0); if (*rma == MAP_FAILED) { - fprintf(stderr, "KVM: Error mapping RMA: %s\n", strerror(errno)); + error_report("KVM: Error mapping RMA: %s", strerror(errno)); return -1; }; @@ -2309,7 +2309,7 @@ void *kvmppc_create_spapr_tce(uint32_t liobn, uint32_t page_shift, } fd = kvm_vm_ioctl(kvm_state, KVM_CREATE_SPAPR_TCE, &args); if (fd < 0) { - fprintf(stderr, "KVM: Failed to create TCE table for liobn 0x%x\n", + error_report("KVM: Failed to create TCE table for liobn 0x%x", liobn); return NULL; } @@ -2322,7 +2322,7 @@ void *kvmppc_create_spapr_tce(uint32_t liobn, uint32_t page_shift, table = mmap(NULL, len, PROT_READ|PROT_WRITE, MAP_SHARED, fd, 0); if (table == MAP_FAILED) { - fprintf(stderr, "KVM: Failed to map TCE table for liobn 0x%x\n", + error_report("KVM: Failed to map TCE table for liobn 0x%x", liobn); close(fd); return NULL; @@ -2584,7 +2584,7 @@ int kvmppc_save_htab(QEMUFile *f, int fd, size_t bufsize, int64_t max_ns) do { rc = read(fd, buf, bufsize); if (rc < 0) { - fprintf(stderr, "Error reading data from KVM HTAB fd: %s\n", + error_report("Error reading data from KVM HTAB fd: %s", strerror(errno)); return rc; } else if (rc) { @@ -2629,13 +2629,13 @@ int kvmppc_load_htab_chunk(QEMUFile *f, int fd, uint32_t index, rc = write(fd, buf, chunksize); if (rc < 0) { - fprintf(stderr, "Error writing KVM hash table: %s\n", + error_report("Error writing KVM hash table: %s", strerror(errno)); return rc; } if (rc != chunksize) { /* We should never get a short write on a single chunk */ - fprintf(stderr, "Short write, restoring KVM hash table\n"); + error_report("Short write, restoring KVM hash table"); return -1; } return 0; diff --git a/target/ppc/mmu-hash64.c b/target/ppc/mmu-hash64.c index 14d34e512f..8713ed6682 100644 --- a/target/ppc/mmu-hash64.c +++ b/target/ppc/mmu-hash64.c @@ -377,7 +377,7 @@ static int ppc_hash64_amr_prot(PowerPCCPU *cpu, ppc_hash_pte64_t pte) key = HPTE64_R_KEY(pte.pte1); amrbits = (env->spr[SPR_AMR] >> 2*(31 - key)) & 0x3; - /* fprintf(stderr, "AMR protection: key=%d AMR=0x%" PRIx64 "\n", key, */ + /* error_report("AMR protection: key=%d AMR=0x%" PRIx64 "", key, */ /* env->spr[SPR_AMR]); */ /* diff --git a/target/ppc/mmu_helper.c b/target/ppc/mmu_helper.c index 2a1f9902c9..cbf5187ff8 100644 --- a/target/ppc/mmu_helper.c +++ b/target/ppc/mmu_helper.c @@ -2600,7 +2600,7 @@ void helper_booke206_tlbwe(CPUPPCState *env) if (((env->spr[SPR_BOOKE_MAS0] & MAS0_ATSEL) == MAS0_ATSEL_LRAT) && !msr_gs) { /* XXX we don't support direct LRAT setting yet */ - fprintf(stderr, "cpu: don't support LRAT setting yet\n"); + error_report("cpu: don't support LRAT setting yet"); return; } diff --git a/target/ppc/translate_init.c b/target/ppc/translate_init.c index 7b9bf6a773..70547ea060 100644 --- a/target/ppc/translate_init.c +++ b/target/ppc/translate_init.c @@ -1778,7 +1778,7 @@ static void gen_spr_BookE(CPUPPCState *env, uint64_t ivor_mask) for (i = 0; i < 64; i++) { if (ivor_mask & (1ULL << i)) { if (ivor_sprn[i] == SPR_BOOKE_IVORxx) { - fprintf(stderr, "ERROR: IVOR %d SPR is not defined\n", i); + error_report("ERROR: IVOR %d SPR is not defined", i); exit(1); } spr_register(env, ivor_sprn[i], ivor_names[i], @@ -9037,13 +9037,13 @@ static void init_ppc_proc(PowerPCCPU *cpu) case POWERPC_FLAG_VRE: break; default: - fprintf(stderr, "PowerPC MSR definition inconsistency\n" - "Should define POWERPC_FLAG_SPE or POWERPC_FLAG_VRE\n"); + error_report("PowerPC MSR definition inconsistency " + "Should define POWERPC_FLAG_SPE or POWERPC_FLAG_VRE"); exit(1); } } else if (env->flags & (POWERPC_FLAG_SPE | POWERPC_FLAG_VRE)) { - fprintf(stderr, "PowerPC MSR definition inconsistency\n" - "Should not define POWERPC_FLAG_SPE nor POWERPC_FLAG_VRE\n"); + error_report("PowerPC MSR definition inconsistency " + "Should not define POWERPC_FLAG_SPE nor POWERPC_FLAG_VRE"); exit(1); } if (env->msr_mask & (1 << 17)) { @@ -9052,13 +9052,13 @@ static void init_ppc_proc(PowerPCCPU *cpu) case POWERPC_FLAG_CE: break; default: - fprintf(stderr, "PowerPC MSR definition inconsistency\n" - "Should define POWERPC_FLAG_TGPR or POWERPC_FLAG_CE\n"); + error_report("PowerPC MSR definition inconsistency " + "Should define POWERPC_FLAG_TGPR or POWERPC_FLAG_CE"); exit(1); } } else if (env->flags & (POWERPC_FLAG_TGPR | POWERPC_FLAG_CE)) { - fprintf(stderr, "PowerPC MSR definition inconsistency\n" - "Should not define POWERPC_FLAG_TGPR nor POWERPC_FLAG_CE\n"); + error_report("PowerPC MSR definition inconsistency " + "Should not define POWERPC_FLAG_TGPR nor POWERPC_FLAG_CE"); exit(1); } if (env->msr_mask & (1 << 10)) { @@ -9069,16 +9069,16 @@ static void init_ppc_proc(PowerPCCPU *cpu) case POWERPC_FLAG_UBLE: break; default: - fprintf(stderr, "PowerPC MSR definition inconsistency\n" - "Should define POWERPC_FLAG_SE or POWERPC_FLAG_DWE or " - "POWERPC_FLAG_UBLE\n"); + error_report("PowerPC MSR definition inconsistency " + "Should define POWERPC_FLAG_SE or POWERPC_FLAG_DWE or " + "POWERPC_FLAG_UBLE"); exit(1); } } else if (env->flags & (POWERPC_FLAG_SE | POWERPC_FLAG_DWE | POWERPC_FLAG_UBLE)) { - fprintf(stderr, "PowerPC MSR definition inconsistency\n" - "Should not define POWERPC_FLAG_SE nor POWERPC_FLAG_DWE nor " - "POWERPC_FLAG_UBLE\n"); + error_report("PowerPC MSR definition inconsistency " + "Should not define POWERPC_FLAG_SE nor POWERPC_FLAG_DWE" + " nor POWERPC_FLAG_UBLE"); exit(1); } if (env->msr_mask & (1 << 9)) { @@ -9087,13 +9087,13 @@ static void init_ppc_proc(PowerPCCPU *cpu) case POWERPC_FLAG_DE: break; default: - fprintf(stderr, "PowerPC MSR definition inconsistency\n" - "Should define POWERPC_FLAG_BE or POWERPC_FLAG_DE\n"); + error_report("PowerPC MSR definition inconsistency " + "Should define POWERPC_FLAG_BE or POWERPC_FLAG_DE"); exit(1); } } else if (env->flags & (POWERPC_FLAG_BE | POWERPC_FLAG_DE)) { - fprintf(stderr, "PowerPC MSR definition inconsistency\n" - "Should not define POWERPC_FLAG_BE nor POWERPC_FLAG_DE\n"); + error_report("PowerPC MSR definition inconsistency " + "Should not define POWERPC_FLAG_BE nor POWERPC_FLAG_DE"); exit(1); } if (env->msr_mask & (1 << 2)) { @@ -9102,18 +9102,19 @@ static void init_ppc_proc(PowerPCCPU *cpu) case POWERPC_FLAG_PMM: break; default: - fprintf(stderr, "PowerPC MSR definition inconsistency\n" - "Should define POWERPC_FLAG_PX or POWERPC_FLAG_PMM\n"); + error_report("PowerPC MSR definition inconsistency " + "Should define POWERPC_FLAG_PX or POWERPC_FLAG_PMM"); exit(1); } } else if (env->flags & (POWERPC_FLAG_PX | POWERPC_FLAG_PMM)) { - fprintf(stderr, "PowerPC MSR definition inconsistency\n" - "Should not define POWERPC_FLAG_PX nor POWERPC_FLAG_PMM\n"); + error_report("PowerPC MSR definition inconsistency " + "Should not define POWERPC_FLAG_PX nor POWERPC_FLAG_PMM"); exit(1); } if ((env->flags & (POWERPC_FLAG_RTC_CLK | POWERPC_FLAG_BUS_CLK)) == 0) { - fprintf(stderr, "PowerPC flags inconsistency\n" - "Should define the time-base and decrementer clock source\n"); + error_report("PowerPC MSR definition inconsistency " + "Should define the time-base and decrementer clock" + " source"); exit(1); } /* Allocate TLBs buffer when needed */ @@ -10372,7 +10373,7 @@ static void ppc_cpu_reset(CPUState *s) #if !defined(TARGET_WORDS_BIGENDIAN) msr |= (target_ulong)1 << MSR_LE; /* Little-endian user mode */ if (!((env->msr_mask >> MSR_LE) & 1)) { - fprintf(stderr, "Selected CPU does not support little-endian.\n"); + error_report("Selected CPU does not support little-endian."); exit(1); } #endif diff --git a/target/s390x/kvm.c b/target/s390x/kvm.c index d3700fc2c2..e9223aff7c 100644 --- a/target/s390x/kvm.c +++ b/target/s390x/kvm.c @@ -1001,13 +1001,13 @@ static void inject_vcpu_irq_legacy(CPUState *cs, struct kvm_s390_irq *irq) r = s390_kvm_irq_to_interrupt(irq, &kvmint); if (r < 0) { - fprintf(stderr, "%s called with bogus interrupt\n", __func__); + error_report("%s called with bogus interrupt", __func__); exit(1); } r = kvm_vcpu_ioctl(cs, KVM_S390_INTERRUPT, &kvmint); if (r < 0) { - fprintf(stderr, "KVM failed to inject interrupt\n"); + error_report("KVM failed to inject interrupt"); exit(1); } } @@ -1036,13 +1036,13 @@ static void __kvm_s390_floating_interrupt(struct kvm_s390_irq *irq) r = s390_kvm_irq_to_interrupt(irq, &kvmint); if (r < 0) { - fprintf(stderr, "%s called with bogus interrupt\n", __func__); + error_report("%s called with bogus interrupt", __func__); exit(1); } r = kvm_vm_ioctl(kvm_state, KVM_S390_INTERRUPT, &kvmint); if (r < 0) { - fprintf(stderr, "KVM failed to inject interrupt\n"); + error_report("KVM failed to inject interrupt"); exit(1); } } @@ -1150,14 +1150,14 @@ static int handle_b2(S390CPU *cpu, struct kvm_run *run, uint8_t ipa1) break; case PRIV_B2_TSCH: /* We should only get tsch via KVM_EXIT_S390_TSCH. */ - fprintf(stderr, "Spurious tsch intercept\n"); + error_report("Spurious tsch intercept"); break; case PRIV_B2_CHSC: ioinst_handle_chsc(cpu, run->s390_sieic.ipb); break; case PRIV_B2_TPI: /* This should have been handled by kvm already. */ - fprintf(stderr, "Spurious tpi intercept\n"); + error_report("Spurious tpi intercept"); break; case PRIV_B2_SCHM: ioinst_handle_schm(cpu, env->regs[1], env->regs[2], @@ -2106,15 +2106,15 @@ static int handle_intercept(S390CPU *cpu) } break; case ICPT_SOFT_INTERCEPT: - fprintf(stderr, "KVM unimplemented icpt SOFT\n"); + error_report("KVM unimplemented icpt SOFT"); exit(1); break; case ICPT_IO: - fprintf(stderr, "KVM unimplemented icpt IO\n"); + error_report("KVM unimplemented icpt IO"); exit(1); break; default: - fprintf(stderr, "Unknown intercept code: %d\n", icpt_code); + error_report("Unknown intercept code: %d", icpt_code); exit(1); break; } @@ -2271,7 +2271,7 @@ int kvm_arch_handle_exit(CPUState *cs, struct kvm_run *run) ret = kvm_arch_handle_debug_exit(cpu); break; default: - fprintf(stderr, "Unknown KVM exit: %d\n", run->exit_reason); + error_report("Unknown KVM exit: %d", run->exit_reason); break; } qemu_mutex_unlock_iothread(); diff --git a/target/s390x/misc_helper.c b/target/s390x/misc_helper.c index 0b93381188..39dcee495c 100644 --- a/target/s390x/misc_helper.c +++ b/target/s390x/misc_helper.c @@ -354,7 +354,7 @@ uint32_t HELPER(sigp)(CPUS390XState *env, uint64_t order_code, uint32_t r1, #endif default: /* unknown sigp */ - fprintf(stderr, "XXX unknown sigp: 0x%" PRIx64 "\n", order_code); + error_report("XXX unknown sigp: 0x%" PRIx64 "", order_code); cc = SIGP_CC_NOT_OPERATIONAL; } diff --git a/target/unicore32/translate.c b/target/unicore32/translate.c index 1bd7827ee8..5b8a3b0094 100644 --- a/target/unicore32/translate.c +++ b/target/unicore32/translate.c @@ -515,7 +515,7 @@ static void gen_test_cc(int cc, TCGLabel *label) tcg_gen_brcondi_i32(TCG_COND_LT, tmp, 0, label); break; default: - fprintf(stderr, "Bad condition code 0x%x\n", cc); + error_report("Bad condition code 0x%x", cc); abort(); } dead_tmp(tmp);