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: 10017723 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id BD6CB60224 for ; Thu, 19 Oct 2017 16:45:31 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id AE25428DA3 for ; Thu, 19 Oct 2017 16:45:31 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id A2E1828DAD; Thu, 19 Oct 2017 16:45:31 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=2.0 tests=BAD_ENC_HEADER,BAYES_00, DKIM_SIGNED, RCVD_IN_DNSWL_HI, T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 6C58728DA3 for ; Thu, 19 Oct 2017 16:45:30 +0000 (UTC) Received: from localhost ([::1]:50181 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e5Dwn-0007li-Ih for patchwork-qemu-devel@patchwork.kernel.org; Thu, 19 Oct 2017 12:45:29 -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+6dY3DAysfWmU3W3XLBb9o93toEqMG9DfY6fas65fUVlNct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Ljie+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; BN6PR02MB3379; 4:sGHmr4rf/R39lSEQQsGrJGZepijL7zt8s5peELgdKdb6dDhOCEIEP5Nud5BfOs+/c//CipKJtJcS5RNPsCNbvgvHx9xk7plgKA8BZ0xhtQ2X7URNf5PSe5uyACWI67WKmPPu7qgZ8niWg1bYNFRMQlCIprl5ScU4Uq3GU76SIlxjXh5br/HBs62/hpatORT0QGfE6vYwezgNgIhYbdllZRqGONAIbNHDaqFYfG6G3/bQ34SFQQKoWpeYAnG5+Y5Z5mJDx/a04gYUqhxaXIwW8/gRAkOx/gZdhmB6OSQUdU2Q4C+/IPfbCyAacDdoevfyWlJpzJUAzpGP0Y0SJz93hA== X-Forefront-PRVS: 0465429B7F X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; BN6PR02MB3379; 23:MXQd9Ae2NVlDthpExjzLJNEsXQuUQd4JgOWKFMN3f?= =?us-ascii?Q?jV4stMmPsX3nzKTkhFt31t+g73izR1GpuDpWJz7T076pUNSIwckc1+m2vjeL?= =?us-ascii?Q?KfLHeVV8D2rJEJJBYU9FQBmmHB6hrw9nVmRnBBuAvghtJ9df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rhJ8Bp2vYLHZq8VxuUvXONZQZBYFVFtw+1Q3yj6KsJISRXsFkxbTIA?= =?us-ascii?Q?JclFZrh9DqR50PibdN8IjaVgl1W?= X-Microsoft-Exchange-Diagnostics: 1; BN6PR02MB3379; 6:8Bd6dbvGLBh7tNHCUlf6ev16yJv18AalxX7UfmQgljw2ODfx1MpVrHpNoQ+ElsVA39u80oIQvhd1aimHMrqe9k3kdqhYooAXu9tf9V+ET+3ZM8dxr40OGfDm8VUrzL3T4xhBWG/q6aCGOYm0ZH2FE+bZTj/OM1UDP6n1VhzHyhgBsUMSIPFJ9fQ1b1ovpCq5X3n4nqtV13OjDzawyZ08LYqgBeJDVvDaMrbMiyVORTyqaBjR1iF891o3iao7hLxXfR/euzIcKkRZehtCoWGxyvveiNH3bV4CfNM+wl1UmfyUFFJlqXdMZ414Gz3r83plmgZOgLQag368rWvjQpaxuw==; 5:je05oD0ujTdp05+uAJNTMBoXI1vSzjkrb64jJiPUQgAMwZXnfSURatGCoLMS1pEanIxmW21PlsiuZikcsMpUMiFNMnEXW85/C0797waum5oCzcP8OEdo6A+EsR7yek4dk6wcHakKI9lhJYFVeoSnFA==; 24:pJ90tDcFme4U1tzke4bLrXEOoKiVtNo3M44Bmf4q7lNiRzEZwSFfDeLoOYffvVdfhKCoQr5nqwH2RjdyUZd5J1jamwhz/2uYn9ENfdVXnmQ=; 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+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP 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(); }