From patchwork Wed Nov 8 22:56:46 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alistair Francis X-Patchwork-Id: 836040 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="mfcCyge2"; 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 3yXMMY2hKnz9s72 for ; Thu, 9 Nov 2017 10:05:13 +1100 (AEDT) Received: from localhost ([::1]:34322 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eCZPD-00026E-Do for incoming@patchwork.ozlabs.org; Wed, 08 Nov 2017 18:05:11 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:33977) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eCZLB-0007Zv-1r for qemu-devel@nongnu.org; Wed, 08 Nov 2017 18:01:07 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eCZL7-00032O-Re for qemu-devel@nongnu.org; Wed, 08 Nov 2017 18:01:01 -0500 Received: from mail-sn1nam01on0042.outbound.protection.outlook.com ([104.47.32.42]:45518 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 1eCZL7-00031u-HK for qemu-devel@nongnu.org; Wed, 08 Nov 2017 18:00:57 -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=8wMs+DfEvqgrI3GKRc0/e1nuwQojSyMI5/sMmtYuwsc=; b=mfcCyge2ACuj6/0h77Bb8Y2GLpIHOzl6+wvs9LTUwwc7pOJ07bAuyGNSG0CxNjgicQSeDAcTjqzd93olbZbx7O5ntHWf6R/WT6s2sdVjMzIVGYt4pS8tBTIJeM+uvXVCTCSELRNRoNjml2z9iVn4TGu7suxxhm/wyO0xUtlbmNA= Received: from BY2PR02CA0008.namprd02.prod.outlook.com (10.163.44.146) 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.197.13; Wed, 8 Nov 2017 23:00:54 +0000 Received: from CY1NAM02FT057.eop-nam02.prod.protection.outlook.com (2a01:111:f400:7e45::201) by BY2PR02CA0008.outlook.office365.com (2a01:111:e400:5261::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.197.13 via Frontend Transport; Wed, 8 Nov 2017 23:00: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 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.197.9 via Frontend Transport; Wed, 8 Nov 2017 23:00:52 +0000 Received: from unknown-38-66.xilinx.com ([149.199.38.66]:60166 helo=xsj-pvapsmtp01) by xsj-pvapsmtpgw02 with esmtp (Exim 4.63) (envelope-from ) id 1eCZL2-0003wk-BH; Wed, 08 Nov 2017 15:00:52 -0800 Received: from [127.0.0.1] (helo=localhost) by xsj-pvapsmtp01 with smtp (Exim 4.63) (envelope-from ) id 1eCZL2-0002Id-70; Wed, 08 Nov 2017 15:00:52 -0800 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 vA8N0jun008475; Wed, 8 Nov 2017 15:00:45 -0800 Received: from [172.19.2.220] (helo=xsjalistai50.xilinx.com) by xsj-pvapsmtp01 with esmtp (Exim 4.63) (envelope-from ) id 1eCZKv-0002G3-10; Wed, 08 Nov 2017 15:00:45 -0800 From: Alistair Francis To: Date: Wed, 8 Nov 2017 14:56:46 -0800 Message-ID: <389cacd55d717f1b540c94c0c95eddffd8316fc6.1510181732.git.alistair.francis@xilinx.com> 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.100; IPV:NLI; CTRY:US; EFV:NLI; SFV:NSPM; SFS:(10009020)(6009001)(376002)(39860400002)(346002)(2980300002)(438002)(199003)(189002)(81166006)(33646002)(9786002)(36386004)(356003)(478600001)(189998001)(5660300001)(106466001)(2351001)(106002)(551934003)(2906002)(305945005)(39060400002)(63266004)(2950100002)(4326008)(6916009)(77096006)(8936002)(16586007)(81156014)(48376002)(50466002)(47776003)(54906003)(36756003)(575784001)(118296001)(76176999)(316002)(5003940100001)(8676002)(50986999)(50226002)(107986001)(5001870100001); DIR:OUT; SFP:1101; SCL:1; SRVR:CY1PR02MB1335; 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; CY1NAM02FT057; 1:DowC3XC5RgDN9VQlDIT233ISq0HDBAqC109oHpzSqNBwB0ZavvFrHkL7AJNpnbXS8gg3gGjhPY1jXDY3KEsBSqrsFY/1Jiu5ccmqdDh3ZZJM7A3TBRGSWNJdnRKzAFvi MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 10cbac14-b12a-4e9b-301a-08d526fc8fdc X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001)(8251501002)(4534020)(4602075)(4627115)(201703031133081)(201702281549075)(2017052603249); SRVR:CY1PR02MB1335; X-Microsoft-Exchange-Diagnostics: 1; CY1PR02MB1335; 3:gZ9npry5I0m48tVB0Aco5MM75B4pT+HsvAOkO5UQc04jAx6eB8ho0sZwKjoVuDpbLHH6lS8MdGPNBRQg9KL9s2O8DqnE/p7G2MchQIO2DE5xxcMzgEEvh9XpKgfhNZsCoyXOnEN2D88E02Xn956/NAU//E9sIdW5WVu6NOFDjKeexqzJrxhnv3augqb/EDkpIBVp1hLZ4s6G25cuByL0wVLsl8XVyDOYjn2eO0oWYNzxL8QmO4rffZPcluAfQT5goi7Sjq2v4prhxAT+OFUUh4DT/kJN/viCdMc70PqQFGN233IlTO7cgkDrw+jfl1CV0HOFYSAEuYKcqi9W8h+XvuroRUTzYhXkgBnYAz3xKlM=; 25:Ci0nw7YH3pPIdFau4Ec9UjwxvEkBO/vYqCe5XeO4Bq3kJCNh6J9ItcbcSVj+abjGwmPzmKdN5i24Vm/YaZl9lAOxzthsdDsWG/1Gha6s0OQQhVsfHDn97ozVPnuBTvGnGHI2zmpcB9vcqOVIiGGaYTItIPXwBOgochM2atBpMOk1l8wd14QRrRHHOn5elWwJGrxb0dezgxqw2fRKiIgBIiCMAo8/siJsGS060srCwwlV0I29a6tIJ/yUuxwb9RxT8IqCZqeNo2UTu9SA1gCWd27OFaxwHjos19/s5tDHJMWMYhSf/h8MugktTKjghwNzDoK3QxkD2XzJzqaHuYoVJw== X-MS-TrafficTypeDiagnostic: CY1PR02MB1335: X-Microsoft-Exchange-Diagnostics: 1; CY1PR02MB1335; 31:t4daxXgdDNnbs6QDn3viQmkK8sBqVg/Ikmnio4UditMMJxxBKKMw/j+TCqGqV6zwIJxEXSN2NM1vaONr5mdsn377HF9HBdOvH3kIENdyx4xE87SDsPcmaFOwFISUyP+2/F0DPwe5ouNQpQAckg8AGdiyKQ22YUVIW5nASG3bkv0JTxd2PKg/n30Xms0gfXkyN76anBJUTgQGIZDhHVhP1K9kj3uzypPDa0tUxYEIHlQ=; 20:spig4ElommpMH2eHfOzInyNUAGgCiV9xoZYXhylDcX9JuDxxyuuVNSWPoxVlBV3MjPF9Ecwf3NCriK2B/O/aZXuHLT/vM2kARiIPCyJqAGn8GQF9E6XO56qkyWEiKTJOR8TwkEYhSssGPCvKY0spRd7mhJWaF4bquxJwesdr30sB4YV+kNpjtfUoO3vSxdG86KwAMFVYmzdhX//wCGF0YLBsP/XGLQfAjvDjFMHFv8bDGjp/AMUABiTVPYAdzq9qYWkh1YybwmybAGO+3dcrewmij64qwDjylY3Q4KiR+ID46Vy681z6YFPD7vSt5erbBMD42zBXZ7JaxQ0xcB8Cuh/iDo3VIiAu6aj+6pT8H1G6RHqYvVOtiQdZeYF3r9WB3Xchd2z5ADMz71CbvQPR7pfQTGMcQKyUFyA7W5w1U0BJs6bL4Lj0+hGiYXsE/dxJNx5Rl9YvhyJy8VUCdZ0r/Kw8OiZcnaXIJnUSsFpSrRJDhtffEehUT9nLco1p6ng5 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)(3002001)(3231021)(100000703101)(100105400095)(6055026)(6041248)(20161123558100)(20161123555025)(20161123562025)(20161123564025)(20161123560025)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(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:vHSqpk0bGDOTr213eQgr4hCwH2DvHJFfDvRvxx//1Ml4MqZCWxnpdSUIBG/FnNa3WDP1wInggX/8hiqSauNhaa4Beaok7RpKXoqj4iMS8XaxDyFLVk5farN8XSwaHAHicPJ8+mCJ6Ja/+n4n9/qy3tfqaj50Wqef+S95IeQ27TmOA2E3/gKT/mOqJnkA3jA5WIcLqxcZowPYQcLFpqMwCHidMxEXMbNvwRRHmEGepkc6Z4gr/WpQV/EfjRtj4GlCM4vtNnGU59KcHvC3QyXqHzivvW+kSs1G+aM3Od+PB3iu/CaD/mMyrkGBA2jYI6cGxVmKQoof0DnnHf5nQTvtsg== X-Forefront-PRVS: 0485417665 X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; CY1PR02MB1335; 23:g0rVGrVKqKrLHg2aQ8oxgTmP8f9fmeYC9mT48KTZE?= pyyHsNzeq4Uj0Gqrzd91eJyraUfdrr/C7Ya0pl6nW6wOK+fB0FFgb4oa0XMYvkXo8shhE40UDaSYNq4Mhb1TY4itkjYtKHxOl4AHZLgTXR3yPtKrBq7pJS6Ao+BOBtlPo2Ahya5mD7bz5I16fgzZVh1Bc5mLCBaviWEDqupqDibqcO8zP3LoG52eiy2oSrtZo1OplrNMqEYnadAlZtPXipLVLxeLp5966kNWN1K5HXpS9sDhk7AA0TRhn+W/Mz2hPoi4vmISEwVj/NRLDe6nOYN2UHfuAZ9Gs865pZdJJXR0iigmFnZVBWPrRo93Y6/Gafbg/8Zk/M1/zFoODkIUvq52bb9qboc35lb9I7rTATJK0Jm8CfZo+1lqlHC79t+G5sTS13yk6uqa4TNzFBhm2Fdq6FOO0YXIeA7nON5Tq+7dmMIMiN9bngxtT3U09OhpIQIB8s0p2emtWPdXsfzdL8KBgZSdsxM1gEyYbSGGnBC4Od7yhOgUSxqLj+j3R/bpTJH5z0RzHKTUvrX0+c/EhqiTcwa4Zf4T53QnkTLjKnsH859wCv56zASsjJZxbp1ZhzqTRGni/j9okKqpdXA4PxKkVwU9OBVrvMMHn+KalGrcMv17EHtBqnJ4UMg8KoWYpTgnfiK20SYMbjFPSj1t9JloIlTdYCi/QGXHz5kD/IeNKPnjmDEC25/pBJSAh2BXrZsxOfUcgJzd8Ke8WkAyQmfz8Q9c4M0ckSrzGaQvLVlP7NwUQgfy5X0eBkclqDqHETIXSrtTqVVPYU1S1YGammegYn8vgAQCW3zJATtxLI7qc0kxneVYPEx6eSiq2ecA86Gi+vC3+BUPiNs2qxnLtmbqsJaGmcMwsrcEvW5my4u1Wi9OztbsZGExEygEIY3/NxkxlJXvXPoXHytppDDdHuDAvlSe3wiROPhQFAYrKnW2Bj7Ro7cVncE+A3ppBhuUVQuUnpJnlhiyP9u4gBvqf4LW416vuOT/Z+g+1JhvltGofo2BhuQORr/ONhcGUx2FvL3tLAAo0uK4V1wWYAOw0WxIEsiJvrG0S0H1K72uiXGQQifoC4EaQN8JJfLgdX6k0c= X-Microsoft-Exchange-Diagnostics: 1; CY1PR02MB1335; 6:H+DCJ4YBsWTQuZPM0xyxzLZ3BwymFWBBgXtCzwY5L9GkbYxffpFg7fn4rebZTU8CDledO1XQPJlZNCYnmSV5gGwBjGeAEO7m69LxN5E+3oMF5X77itIlhr0+hJW0v5ZTkACTRvF3h4ayr9o3SPmrbQwDvRgIt12dA22w39uaPMVjDbcoOsEaj1KgJDMSmIxK/CgYXgjt4ZaMVpRnq7/OfUtMhgnX7SaX+C6Cm9x9GElQpFKpvJMJ04d2zEb5cmZaaE9bZ4JS7rGFMtXlPkTVTVCLz7D4ki2p3QnXQldWVqWE5LO2eK0t5TUETEnmyrR4VdrZzHYOHnyqwiNsHEq3mKN+u6tVu//YMpG8Bu9B7XU=; 5:pPuYXHq0XwiEOHSrhY2dPbrlaESszxuWpcLZRfbdE35q1JUAGFm+bFTI5MFMLct1r/l8PqhVfAnD17jZC5GB8Pz86AkWKNg3oWPgQSt7N7OF61CMZkGbKimqynupJe3RdkssiHinp0B+LaiaxqghAIPXFzqEHXAWfHMuT+hbs0s=; 24:KQmHSXZimsaDKE3/8opxI242fOrCDhh7UfQ2D24GSo8qpPwTDozFCrgaJRuTlrYfsmNJmV1qZ0jGxkPoDb010coq0BknJ8XOxxoNcOqcTe8=; 7:0oqG/Uf/F0cjld9wdoR5YDuxYPUID7pyLaTiUD1LV2IMHGvPqsEVWVL29xzFALMGJPlHi3BXrGOfhSeawL3H4bRvn2p8ELrsLxNeyzKhoSA++uraCDOH/dNi3UoFuXh6J5HS2rZ+pIA0QOj/T69Km/gZZed1mbitIr5Mz7QrAua//Nr1RZCcJEjT3kIM0vXxfpKv1NJA16VyKZp3KryDlqRb/6ChR+kQgRP+Kqd3yY4G/PygUhAGFJetp60FWYsv SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: xilinx.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 08 Nov 2017 23:00:52.6229 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 10cbac14-b12a-4e9b-301a-08d526fc8fdc 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: CY1PR02MB1335 X-detected-operating-system: by eggs.gnu.org: Windows 7 or 8 [fuzzy] X-Received-From: 104.47.32.42 Subject: [Qemu-devel] [PATCH v4 07/45] 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;