From nobody Fri Dec 19 21:50:27 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (208.118.235.17 [208.118.235.17]) by mx.zohomail.com with SMTPS id 1508430161844750.5658936903169; Thu, 19 Oct 2017 09:22:41 -0700 (PDT) Received: from localhost ([::1]:50071 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e5Dad-0005rN-Tt for importer@patchew.org; Thu, 19 Oct 2017 12:22:35 -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 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 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 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= 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 (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; 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; 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:GCo4cgLqxFWwEV6VindHVauGROGCyNXrbWWyeW6l2sErxSm2VW4M/vZAnSRf64Jw3F/Idj/WCnlnLJ7VNBEZ6YW7lhFVUTgbMwMEbOv+BtDY8mEnrKkTS3segYULyaMeRXSMol9IUSJLEdxqM+gmTm54z1xP3bv6QZXf0+99DZAzI3WGw/DffhB8gvfznSLfXYJi0Qi1Cba4DSTGVh+JV2+QrVw/aEPqWCVPmE27GwvId5QT4IJwd4So66uXtT+XeQNeDBYgbEZHjWzZSaEdG2wi2XJRT/pox5kJKBglUre/1CeGa9KALtamzAslTXQV X-Forefront-PRVS: 0465429B7F X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; DM2PR02MB1338; 23:3VY8b8y0Y3eEoI8PsGyeDK8rldD/ve3p6qTxRCWmZ?= =?us-ascii?Q?ZG5E8MTzFalW4iV8KQdjTqq0EDrUb1KKjVeJqBe1VfD1byT4M/MB92pypTcY?= =?us-ascii?Q?hP8LclT2oFYUe1Lu9EctlzJNTUWxmmR1cL3x5Iq176731Us0dipf0GLd8Sn2?= =?us-ascii?Q?g9sdW6LWmcaCPCODQrIYUwsVPG56r4xWM5qEQG5iKDbQXmkf6h8NgREVaUZ8?= =?us-ascii?Q?jVktMesBgVsRHshOwfLcy5I+zE6ziokM71/ZhIsEHA/ugl7x04/2Oz3icVgf?= =?us-ascii?Q?GTu0dn3Yq1gk+anK1RGSdi2ctRLXluOerc6jrsTW5MLvBvaPN2/jAea2Yd5Q?= =?us-ascii?Q?qxmPSKJNbwwrI0nX4HGxwucjXAoYHvnrkX8R1lGije8hNwu0LRberub7qDfs?= =?us-ascii?Q?tcZjVNhTB12no6ee+eqkPYyIP8kL6QKeS629WKgsnCZbpqSU8gpx/Yw46HGC?= =?us-ascii?Q?4pRnRvkXI4ULCNcUUCoYeRrP/Bc8YFMMPptmeqyWfwrtXr6niNEiWL8w/auw?= =?us-ascii?Q?FdTOEgs0GsquV76mtYEz8Ck4Og9bMHr1JqW+QPI4b/MuKmMLy+WNt4GFpieb?= =?us-ascii?Q?FIRfPiTBHt5oz/KRVyrseyIuzdY1rP1TIO+fjwCkbfb7//HWEuccTYFJ+bzQ?= =?us-ascii?Q?ERml8M1qhIMjQE6QcJSoRKzAP1gyL5fUnV6OLIpEjZ2kAuQS/NiokfiUdsaz?= =?us-ascii?Q?fiUwKE3QMLJp+j4OymytzpvKGbvpjDEoeiQc86Llt4TVdTDhhzKzddXXIv6R?= =?us-ascii?Q?UbPaujcJS3zg8L9iOmzd2OsZGvVmMQGsh4Hol0SHqQbPPoL5ktfU/H++tl3k?= =?us-ascii?Q?YW3vOtAImr8hoKxNbQ8O7fuCbQReyw7ObNs8ygJ3Sy8pSMd/5w9OVyy+bEBx?= =?us-ascii?Q?83ymURCCC4T/xV2ehifKfnQ9HPzcLTvIWM/9ixxHMV9FIqDBe9tfZDe3p1U4?= =?us-ascii?Q?dI3Hgg7uAc22vushGN6+f7sNUHk1yGh0D4xyjVvDbhUo4nUbZNZXqBlrFCdT?= =?us-ascii?Q?CdcA+2uROYB9/P4OLBX1vJ04ZAL//IBSVRqdW80vDnQz6C6vtdT5EUVV4W52?= =?us-ascii?Q?2eF3YL2AoB3ZEIMtowfZmPpR8w3lbL4Fs4ryPI1tLB1n0uvn9cgPdXkZDRe1?= =?us-ascii?Q?BILzHCcNGtynfYopOyVTEloVts4xGre?= X-Microsoft-Exchange-Diagnostics: 1; DM2PR02MB1338; 6:mQY4KwORNJ8Mex15WHYmNYF0FCFWSYvBdf15vkms9ANat7M+NxnSUvNBUx9i8yCbFveepSOcWV8Vi9A+HrquQWOlgIpXR+wzloMfezqrW75mPKxJNXAPrYr81To8A3YVScEvb91ED4tVvcfJA1fJdBjkRV3IuUEeuUEY13mCEieNC4/IYLxE0Q/xyaHaubBbdtj1a0yiqVazwW3bHo2StvIebl/NpPSBRdEj2iEqWZCSFefvKdACXN2l8RPM0XrWKgW6fTjdRB9FfsM6z9Qw2E7OB3wpTANYYC1jz4wh9MqEv07c2cL+wPGWTa8DX2ZcCvk5EWv3TTxCZdqbHxygHQ==; 5:Mbj4capFq0EBbufx6XDrothXy//dlcTNr/09VO8hSC+qdJGr1t52q8G0dSNl2+Pmx/Mz2khrEUn476hW1ywCway3rVDUdn+o2WqxaxcG1nzsNL3WC9oJbOrOTiI9HBwE9v136y2RkHnBM0SKLHOeCg==; 24:8jeykOm9FeAwGYNr4Zz8n33R4ThLZJDxzrKs4to2FKO45huI2KO/ZiSWxR+AiHvzk/I09w6hSc8ulZEwlD6iBGg1ltXMkR5dYbu5UyceOD0=; 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+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZohoMail: RDKM_2 RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" 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_re= port("\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 @@ */ =20 #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); } =20 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); } =20 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); } =20 @@ -113,8 +112,8 @@ void bt_device_done(struct bt_device_s *dev) while (*p && *p !=3D dev) p =3D &(*p)->next; if (*p !=3D 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); } =20 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 @@ */ =20 #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) =20 if (off < FIFO_LEN) { if (off + len > FIFO_LEN && (s->out_size =3D 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; } =20 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); } =20 @@ -168,10 +169,10 @@ static void csrhci_in_packet_vendor(struct csrhci_s *= s, int ocf, s->bd_addr.b[5] =3D data[offset + 2]; =20 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]= ); } =20 rpkt =3D 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; =20 default: - fprintf(stderr, "%s: got a bad CMD packet\n", __func__); + error_report("%s: got a bad CMD packet", __func__); return; } =20 @@ -226,7 +227,7 @@ static void csrhci_in_packet(struct csrhci_s *s, uint8_= t *pkt) case H4_NEG_PKT: if (s->in_hdr !=3D 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 +=3D 2; @@ -241,7 +242,7 @@ static void csrhci_in_packet(struct csrhci_s *s, uint8_= t *pkt) =20 case H4_ALIVE_PKT: if (s->in_hdr !=3D 4 || pkt[1] !=3D 0x55 || pkt[2] !=3D 0x00) { - fprintf(stderr, "%s: got a bad ALIVE packet\n", __func__); + error_report("%s: got a bad ALIVE packet", __func__); return; } =20 @@ -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; } =20 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 @@ */ =20 #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; =20 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); } =20 @@ -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; =20 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 */ =20 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; =20 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; } =20 @@ -2041,16 +2039,15 @@ static void bt_submit_acl(struct HCIInfo *info, length -=3D HCI_ACL_HDR_SIZE; =20 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 &=3D ~HCI_HANDLE_OFFSET; =20 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; } =20 @@ -2060,8 +2057,8 @@ static void bt_submit_acl(struct HCIInfo *info, if (!hci->asb_handle) hci->asb_handle =3D handle; else if (handle !=3D 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 =3D handle; else if (handle !=3D 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 -=3D 3; =20 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; } =20 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; } =20 @@ -2223,7 +2219,7 @@ struct HCIInfo *hci_init(const char *str) return bt_new_hci(vlan); } =20 - fprintf(stderr, "qemu: Unknown bluetooth HCI `%s'.\n", str); + error_report("Unknown bluetooth HCI `%s'.", str); =20 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 ui= nt8_t *data, int len) =20 return; bad: - fprintf(stderr, "%s: bad transaction on Interrupt channel.\n", + error_report("%s: bad transaction on Interrupt channel.", __func__); } =20 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 @@ */ =20 #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, =20 if (likely(ch)) { if (ch->remote_cid !=3D 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; } =20 @@ -790,7 +791,7 @@ static void l2cap_command(struct l2cap_instance_s *l2ca= p, int code, int id, #if 0 /* TODO: do the IDs really have to be in sequence? */ if (!id || (id !=3D l2cap->last_id && id !=3D 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 *l2ca= p, int code, int id, } =20 /* 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; =20 case L2CAP_CONN_REQ: @@ -836,8 +837,8 @@ static void l2cap_command(struct l2cap_instance_s *l2ca= p, int code, int id, } =20 /* 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; =20 case L2CAP_CONF_REQ: @@ -865,8 +866,8 @@ static void l2cap_command(struct l2cap_instance_s *l2ca= p, 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; =20 case L2CAP_DISCONN_REQ: @@ -887,8 +888,8 @@ static void l2cap_command(struct l2cap_instance_s *l2ca= p, int code, int id, } =20 /* 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; =20 case L2CAP_ECHO_REQ: @@ -897,8 +898,8 @@ static void l2cap_command(struct l2cap_instance_s *l2ca= p, int code, int id, =20 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; =20 case L2CAP_INFO_REQ: @@ -917,8 +918,8 @@ static void l2cap_command(struct l2cap_instance_s *l2ca= p, int code, int id, } =20 /* 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; =20 default: @@ -1066,8 +1067,8 @@ static void l2cap_frame_in(struct l2cap_instance_s *l= 2cap, uint16_t len =3D le16_to_cpu(frame->len); =20 if (unlikely(cid >=3D 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; } =20 @@ -1128,9 +1129,9 @@ static uint8_t *l2cap_bframe_out(struct bt_l2cap_conn= _params_s *parm, int len) struct l2cap_chan_s *chan =3D (struct l2cap_chan_s *) parm; =20 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); } =20 @@ -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 =3D l2cap_psm(dev, psm); =20 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); } =20 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 @@ */ =20 #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 uin= t8_t *data, int len) int rsp_len =3D 0; =20 if (len < 5) { - fprintf(stderr, "%s: short SDP PDU (%iB).\n", __func__, len); + error_report("%s: short SDP PDU (%iB).", __func__, len); return; } =20 @@ -517,7 +518,7 @@ static void bt_l2cap_sdp_sdu_in(void *opaque, const uin= t8_t *data, int len) len -=3D 5; =20 if (len !=3D plen) { - fprintf(stderr, "%s: wrong SDP PDU length (%iB !=3D %iB).\n", + error_report("%s: wrong SDP PDU length (%iB !=3D %iB).", __func__, plen, len); err =3D SDP_INVALID_PDU_SIZE; goto respond; @@ -544,7 +545,7 @@ static void bt_l2cap_sdp_sdu_in(void *opaque, const uin= t8_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 =3D SDP_INVALID_SYNTAX; break; --=20 2.11.0