From patchwork Wed Nov 8 22:57: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: 836058 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="FLTBbKJ7"; 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 3yXMcz1SZ7z9s3w for ; Thu, 9 Nov 2017 10:16:51 +1100 (AEDT) Received: from localhost ([::1]:34382 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eCZaS-0003X4-Cv for incoming@patchwork.ozlabs.org; Wed, 08 Nov 2017 18:16:48 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:34263) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eCZLm-00089h-Me for qemu-devel@nongnu.org; Wed, 08 Nov 2017 18:01:41 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eCZLj-0003Hd-HO for qemu-devel@nongnu.org; Wed, 08 Nov 2017 18:01:38 -0500 Received: from mail-sn1nam02on0061.outbound.protection.outlook.com ([104.47.36.61]:61327 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 1eCZLj-0003H9-7B for qemu-devel@nongnu.org; Wed, 08 Nov 2017 18:01:35 -0500 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=AKG68PZssRB8hQxzxwk2sZFvK+P5C2nw7J5cSvfycbM=; b=FLTBbKJ7fOqlOoayQbbYAQGn4hLE05oMJDrDR+30wU5SWBs0edyFMCooHqfBSSRJHs5bVBFGGILkwu33/qxIQUhBrw3gYmX26vU6dO6p7L9QiOpCSjZcqMXfRU8VVj4UKNhEjNW4V74bej3PuOy4/SkvhC5cJku/bywKHHxhHU8= Received: from BLUPR0201CA0024.namprd02.prod.outlook.com (10.163.116.34) 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.197.13; Wed, 8 Nov 2017 23:01:27 +0000 Received: from CY1NAM02FT052.eop-nam02.prod.protection.outlook.com (2a01:111:f400:7e45::208) by BLUPR0201CA0024.outlook.office365.com (2a01:111:e400:52e7::34) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.218.12 via Frontend Transport; Wed, 8 Nov 2017 23:01:26 +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 CY1NAM02FT052.mail.protection.outlook.com (10.152.74.123) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.20.197.9 via Frontend Transport; Wed, 8 Nov 2017 23:01:25 +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 1eCZLZ-0001Lk-5i; Wed, 08 Nov 2017 15:01:25 -0800 Received: from [127.0.0.1] (helo=localhost) by xsj-pvapsmtp01 with smtp (Exim 4.63) (envelope-from ) id 1eCZLZ-0002lU-1s; Wed, 08 Nov 2017 15:01:25 -0800 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 vA8N1Ioa009497; Wed, 8 Nov 2017 15:01:18 -0800 Received: from [172.19.2.220] (helo=xsjalistai50.xilinx.com) by xsj-pvapsmtp01 with esmtp (Exim 4.63) (envelope-from ) id 1eCZLS-0002jT-KE; Wed, 08 Nov 2017 15:01:18 -0800 From: Alistair Francis To: Date: Wed, 8 Nov 2017 14:57:20 -0800 Message-ID: X-Mailer: git-send-email 2.14.1 In-Reply-To: References: X-RCIS-Action: ALLOW X-TM-AS-Product-Ver: IMSS-7.1.0.1224-8.1.0.1062-23450.000 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)(106466001)(16586007)(77096006)(47776003)(478600001)(54906003)(6916009)(2950100002)(575784001)(39060400002)(4326008)(2351001)(33646002)(50466002)(356003)(48376002)(106002)(36756003)(6666003)(316002)(5003940100001)(50226002)(76176999)(63266004)(50986999)(8936002)(305945005)(9786002)(8676002)(2906002)(36386004)(81166006)(81156014)(5660300001)(118296001)(189998001)(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; CY1NAM02FT052; 1:OcQkmoujyzDYwIwPSQGd1aFEUbTGnasVZ4zqsoRSo8X6v3zBnsTmE+RVwAELhOY9GNkTs9JDAymzr/vcINuFu1drKWoIXRXf5E96VKAqdqXT31o5+c4okvyHDv42W7p9 MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 89b0d87a-5b6a-4cdb-c12f-08d526fca3af X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001)(8251501002)(4534020)(4602075)(4627115)(201703031133081)(201702281549075)(2017052603249); SRVR:DM5PR02MB3386; X-Microsoft-Exchange-Diagnostics: 1; DM5PR02MB3386; 3:3EzRoQzOtNCHvoLyvwt26huw5jN0Vi0/klt/iJHcCkXW4UqygWP+fbv/NRW87VUhcRS1EtzXBbjGkjaJnShhK942rtPopjyQnF4oyFlm/LJhqxQKhhm/N+biYZcFsob0T4L+LPuFqp6doPnHYj+7nqR4n5Hpb6N+5Hj2xCHeDBgZpk9/lC63R686oQqJAINUoYivjACJ/UN70LKrevYKwn5B/c559fa8DYJhw7Sv78V7zmWdfGz/UEha9zNkaA90iNEPYFa7VyBraA08UuRpykVqiT7GA7e2ST979kLXOTB+uFPea+iJq6O/LuZGq4rkhPq4pNM5VvagTMQJ07cxQAVcwSHNP17FZfGJ72dERmI=; 25:BbSIg/bV9gDKFYKhKni1J5dJibWkTPge0lPEinyH67hhRlUJJsE4fGlFtl4y6u4CtAKORUfDPPMa5LAQ/ltH7t2ApArLiCt1NqZ/ieTM5PeYWUqDAJvIFnrdWW1LpWlTctfg9cmPHjsxRWvKZoxHeg8nfLY4jj0hU+0CN3BjRuH1ZLmO10jqAMnWAKr3UhH5yoMgMCDeXWHyyMYmimw8+djbECs06PXlXGUSgEMcDjk1VzWcIBSIlKaG+Dvf47mlGSxS/vuYRG6nHuOTZnwZcGRVR5pl9EEb5dgINWUtP/8WyWvIaRCpJ7W5WjnMqTvCNgEQaH8mwnHo4kZFQ9Ibdw== X-MS-TrafficTypeDiagnostic: DM5PR02MB3386: X-Microsoft-Exchange-Diagnostics: 1; DM5PR02MB3386; 31:4zUJuojhbh6v/i3av8UkrR1vnVG2OQ81wb2z6/Vv2zc15aZequf6cqyshMTzXT4t2B0iB2b837i8C9Al/SNX9J+JbsuqsXRP/STZ2nYxJ3mXFhxhi0A9eMkxddTypRk+egPA8ObF3KlpR6Cta93UM6osnOPybGmirA+nqUoIv4LD609p3zyhkKGxm4ca0fapBGOaN86zLdD6dKjh3sGQY+NiS0nHMANlDqPSDhe2gPM=; 20:WyhQVpnGLcsk3c2hZZXMenfOGvhyLZ19bMJZ5+Z0zWGvw1zBGqSyBE8KzACnUn63qEbZEnG65i4g4727if2xJo7iL8QPppTckX3tVDU7Zmiftc9h99tmCTgqnIUdf/LNG2X0d2yAcr8GXedR26r7ES3yPhVGUQtDWw/xZlvk6rzudfuG+cwQzRTdoZh4brWxRESR4csols0Vvow0RKf2kKAGq9Xi/O9ueAKNbiGyFlvZeOZjIW9avUxZxQm7A5VbxLTR8n/m7z0KBtih1nobsoj8sHx0hHurK6GBPu73/JwDIxsR4o63IVzt0NtyfWugxefk+gLDJWRwsCbgZ+S7Y12NB9wKLDFZOHNhauLTmJ1W0ac5a35xOQNruteopuFdx5EGu6x5QtXQn65Resc76UMGFsS4IHUyf3M8WLLUP/lJtb783lHv7uFJ0+ZN5fTk9hR1IRPCIslYylMrk6CnMycar7EqydNNcj5P21gTxf0P/usnwNSTQOksqPNpFqXG 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)(3231021)(3002001)(6055026)(6041248)(20161123564025)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123562025)(20161123560025)(20161123558100)(20161123555025)(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:CvkjAzku2n88jZ3S3aclQTcCv0geYUqVvoJQUc8qKSR6u0oRoa/rGvVztNxFP44b7gSbkz3HS2m5NRxC4buB9Opaod2/C3uq3abvPBbuN8BeQuHWdtzf9wsKceuevT3gF7uG/8ArYl3lhgP6Cji8Xt9lKPDLlpBaEwrx2OLm/MVr8UVbxR2j6YNRsEcdRbDGbF+Ie16ChEdRBdk+KjAmk9M4Fp6kJ9tEO3hEsbmNFr+g3M9b9foZrUzBYRxEU0tpJgKu1GbdfOWh/qcrcKvsBr7KT1Zjgt7PxumZTi919uD3kZfiJjU6HMrhWYzZulfi8e9yTl4E1kGpadL/f9wBwQ== X-Forefront-PRVS: 0485417665 X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; DM5PR02MB3386; 23:vm2x4LwsHEmsvGqpvK8BZ8NVkZNdsPNE+6mm3tVvK?= r0FsykhiIWT/pPWilqSvpbd0tnPJyw7XW7YWuTxS3ZqDAia2RzaSLJPnJhGbwO3FQLvitn6C5KWLFWgeVzqlEVm+zzE492mbrtAilhnyRst2izap19kA+BXJipqwqPFpoYiPaqhTgKjUW10mUWOFXpuS4ZSfxVM5H3IuWOkJe2wGDCg3ppa568Y90CLtZKlcT5ATY/A+TVyNDuYZwnY0TRogFR+2hCBnfg7jfF/04VKYbKVkLecegpQUXVDxU/IgTesGaRXWQEGhrtxdP8sB6Aawu2NfgsvpV6ITL57GphCO3EYJQGaIpH0l8hxcu2zAkd7ti+QHPTzqt6ids5F8Fxena3N6kkyPyUUr+bpRt/FYVvuj+0uoAqQPEidYNiz35CMFoL1OWD3Qo4xDeh2hT3Pn7anVAbpd190SA7j7/rcC2baX6MQZ8Epi5Xf2EzAuyb4spUH3yPIhVpUCXkcMEDbJP0eq24RSPXrSbKfM+mIE0SlpAiGvYyEYIW3mzHCwBWzdhdsNHcq/3nj3sMg/wCTZ+ZrCWgi0xOMowMlon8jKj/IMT5JiojLuswbj68Km5ixYL0Dq+m8uJzYdx2r+I1YMV5ygnYILXSFpFfC+IZWS1jmIZVbpNza6KbnmHyPYmTRb9qL5cXaFupELwVBiE33E5fFjcoIQ0W6fI+odTNLHIPTVBdBuo9HwsHo70K3dvxVzCyltIJlLEZ5bQeOnXckYtUGOm3EzZf4JDK7zIvmzdc3Ck16fVCz75sc5VkIRlGT5su/Fr2Q85jlecYnZPFOJmjlzkRjJQs4MeZrYrQPM2TSpzoWDunOvLkVQ9mC0HkNog/9vlqj7pxjTyTSH0aWeyjJJvq2cIa3dNIVmSiZ84bKdfinGmuiN8Z69qXSbUimFhFLUDwPP4TGTGoNjtgbu+7s+0t5LpjQdTRCSZ9D6+L3LP9GkRjOZsI7Mixj/XBV5HqLKBJGkLldDTQ/k9MCke4Bd2CPG9YlN2j0be+Z5xmKA90qgRJzR3Os3KWCNW8j3IxfUclJx62vTvaba6N0 X-Microsoft-Exchange-Diagnostics: 1; DM5PR02MB3386; 6:RjdW8e2hFvza5/U95RmqH+FIo/jQElCAFKbFDDh2qmVT0aFsoS14tBWq0VAB2p397D/X0plJVZfZ8vM/kaadNjiL8YajKB4uZOZQcqUfVAVhR+mVX/SJWypZP5I43qzG6IPZTjv0gCt56w6pg0pB1GDtFIZE1YbgeVFFRRUpd73fPzUe1v/gF88qGQehsCrV6guiVzqmm2FMr8Ggjbnqf//JubIOygufvfbTrkpgCkfG4BusuMS4G/YumEJyINPtJAvwr5h90BUGPvP2FZFwE7V0VhHsiFGqL7T6FSmFq5qWcuJF1lpV63Z91zH6ElXDq31mvy/g7LbGFTNYRTPFt0B2qgFB/3v98bGAq68rCho=; 5:nIIvp9/NwQb4ZMp3Ihd2iDI1uTj1FpaW9hmtRZt0TSIFYyzRby9E9BKGUFuGhk9tNLk/Jr9hWMZTT2img76ijqEJ3oshy0YhuhwWkxdN0vaFuUq8857j0VKaR+SZDx3KdZdR9iywxsvRwpuBH/h5jkJiRPrY2hevxCiGINIosoA=; 24:Qsx5mn35kupZZC3Aknz2+/m8GlIHFoosQZ1ykij0x+77GNI2yW9F2bknip1iJfO7y2iBGv8RiOsiBWZRv9KyHN2u/+88WLYGuhfcJMmUBCU=; 7:jY7gFBrYAQ83E1VEi+SmEN7scJ9DUfCCxreuH3vQzerpTM6MTn3Zb8lwmHzaJIXH2CHLKIP3xH6oCEII7WP+vlFQ8roa/LK2QP+L000VVlE1Hxo0o3Olwn/rpRTp9IGoA7zWDQ9ZHPXBd7jfTfg6EXCUeLmFa+is2DBIEgAcfheH7CVhwy7Xu9HSTZ1GjnWDw0cJ6mFPm3uEYE6BTxQ70ygqxQA/kfOWcHqZcrjyKwYuyynTIjeA9TWrzRaibMmD SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: xilinx.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 08 Nov 2017 23:01:25.7924 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 89b0d87a-5b6a-4cdb-c12f-08d526fca3af 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.36.61 Subject: [Qemu-devel] [PATCH v4 17/45] 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(); }