From nobody Tue Feb 10 02:01:41 2026 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@gnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 150673115065625.67101253628698; Fri, 29 Sep 2017 17:25:50 -0700 (PDT) Received: from localhost ([::1]:37509 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dy5b8-0000VO-3u for importer@patchew.org; Fri, 29 Sep 2017 20:25:38 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:59999) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dy5V4-0003nQ-0s for qemu-devel@nongnu.org; Fri, 29 Sep 2017 20:19:24 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dy5V0-0004IH-Ov for qemu-devel@nongnu.org; Fri, 29 Sep 2017 20:19:22 -0400 Received: from mail-bl2nam02on0089.outbound.protection.outlook.com ([104.47.38.89]:12330 helo=NAM02-BL2-obe.outbound.protection.outlook.com) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1dy5V0-0004Hk-Fo for qemu-devel@nongnu.org; Fri, 29 Sep 2017 20:19:18 -0400 Received: from SN4PR0201CA0068.namprd02.prod.outlook.com (2603:10b6:803:20::30) by BY1PR02MB1129.namprd02.prod.outlook.com (2a01:111:e400:52a7::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.77.7; Sat, 30 Sep 2017 00:19:16 +0000 Received: from SN1NAM02FT018.eop-nam02.prod.protection.outlook.com (2a01:111:f400:7e44::203) by SN4PR0201CA0068.outlook.office365.com (2603:10b6:803:20::30) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.56.11 via Frontend Transport; Sat, 30 Sep 2017 00:19:16 +0000 Received: from xsj-pvapsmtpgw02 (149.199.60.100) by SN1NAM02FT018.mail.protection.outlook.com (10.152.72.122) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.20.56.11 via Frontend Transport; Sat, 30 Sep 2017 00:19:15 +0000 Received: from unknown-38-66.xilinx.com ([149.199.38.66]:39994 helo=xsj-pvapsmtp01) by xsj-pvapsmtpgw02 with esmtp (Exim 4.63) (envelope-from ) id 1dy5Uw-0000DO-Sf; Fri, 29 Sep 2017 17:19:14 -0700 Received: from [127.0.0.1] (helo=localhost) by xsj-pvapsmtp01 with smtp (Exim 4.63) (envelope-from ) id 1dy5Uw-0006u8-PU; Fri, 29 Sep 2017 17:19:14 -0700 Received: from xsj-pvapsmtp01 (xsj-smtp.xilinx.com [149.199.38.66]) by xsj-smtp-dlp1.xlnx.xilinx.com (8.13.8/8.13.1) with ESMTP id v8U0J9M6030519; Fri, 29 Sep 2017 17:19:09 -0700 Received: from [172.19.2.220] (helo=localhost.localdomain) by xsj-pvapsmtp01 with esmtp (Exim 4.63) (envelope-from ) id 1dy5Ur-0006td-2p; Fri, 29 Sep 2017 17:19:09 -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=cm7BCXMAOLc1JGwHgZ8IS/7l1y+yyYDWW9uPM3BudCQ=; b=ZPYpCe/FpyfwxeV1T1urpboiQ90eSBUy750S3NUlS3pe1xFYzfBnvmjldLIhehS0gqvXnVl7/1CNJqr8usp94h5sC5hdqmpo7IIAUUmFflCfZ/n8qiOua5mQUYN54w/XRbOTiEykR1wdyZpkvbMKJcW1p6+UZO3LTmW/Rk6XcFA= 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@gnu.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: Fri, 29 Sep 2017 17:15:21 -0700 Message-ID: <3400959d36218ad30e914439ab5d893ed9c87aae.1506730372.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-23358.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)(106466001)(4326008)(551934003)(478600001)(36756003)(36386004)(77096006)(39060400002)(2351001)(575784001)(6666003)(9786002)(305945005)(5660300001)(81166006)(5003940100001)(81156014)(76176999)(63266004)(8676002)(50986999)(2906002)(356003)(48376002)(50466002)(189998001)(2950100002)(54906003)(316002)(33646002)(6916009)(47776003)(8936002)(50226002)(118296001)(106002)(16586007)(107986001)(5001870100001); DIR:OUT; SFP:1101; SCL:1; SRVR:BY1PR02MB1129; 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; SN1NAM02FT018; 1:i1zUJJR5m32aYaCAafJrYvjTDmX90t5ErNwLsdXiSOW3dvLfuVFeAPTZ8Lpr2bXr08P9Gc+nHHs1O8Qf/CfXBgAfcNCtNOC5NFFrW0aWze9mP8ZL1yoTjqFIyGxgWwCc MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: d3ad9dd2-2718-47f4-72d9-08d50798e278 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001)(2017030254152)(8251501002)(2017052603199)(201703131423075)(201703031133081)(201702281549075); SRVR:BY1PR02MB1129; X-Microsoft-Exchange-Diagnostics: 1; BY1PR02MB1129; 3:waXbfVOqpJkCQhcqCX1H+YezSGplCWPoOcLHdtpwl19ukjyWAasACUgVF1NUOgjcFiP9UZGBo4tbvvZ6sKHtYYzDCljdddIS/NqmwnnvvP6Uu3Oju3gxexI5FuYxhdI+t/Im7ISmYDOKr4yRBf6QIact2LUEVrBJY5c0iSzmlFhNczjlnwvF61cXVovOWCVyyjDCyJdk4SdjL+Wi4l1hjs4o6xx3TWhdZM+FT3zB7U7I1rZYHtOH9LDFM1JjbcuXbGKmiWKHSfheFv9oh9briTb7Z9G9McIbSmzMs0XIy3lgJJzBBGzFQzjRXDuwSp78kYaY3/U/53JxhSCXYIh5ccZsGtgSjHPW3xnDhWz4bFg=; 25:oeDKmY10McDCpjLuObErytbr8xzYqetHNp2hJwD/0G6ykbQI/mkzmpxh1JlUs61dWr7hyKh6Z083JigwFofl1B/FF60tBdWICchWJS8Ch8Z5I8eBv0e9Yk6CtV4vZMNJIrgToRLhc4fLqwJJPtq5gCJxSXLXd49Lywvz0SuMvjD0yI1wuHOCrDKKbm0Okd9xnyjtET2rV/NbCswEmxDdR9W4OM2rl2DRs0SgenUKXAIi4EHvE//EzFyHAQLqXqSts0xO8D8je0p6YNi+UCHVszD8hPhwLIoSNwIgZusCMbsFYXbj90xRHK+fujTK1WeHMJHrI9yibed0WZsvMb8bRA== X-MS-TrafficTypeDiagnostic: BY1PR02MB1129: X-Microsoft-Exchange-Diagnostics: 1; BY1PR02MB1129; 31:gOp0ejjkKpXhJEXLW1B3AHYJtC3ke816wJFeY5x/nuDwbFq/tXsd39w98NnGzCKoy3YDDdRzvCvLSmRc3Ibpcv1gD6FaGTeUBxbN5GPqAECNhmOPTZ+YHecSU68gZcIA6L2SXxzceCkp6JaCcHaWtPxk/Es00DxzF8WxKBonNjw8hHcxc7OwtnMZNQ9hFjdgHMdDkc2gzTLswuClEYnZayQ9oXpQArQlTiMY0N26JrM=; 20:r1Wxb49nwnvr0P1/GGyZDWwLd6VS0DWYPr7tWbO4xQM23il6N0xnqdhmLJmhcSAruZ+TQUnMTgwPrwhqaGBvZi93CMKQP3JvmdsC1wzFpfIB4LHk0x5x+vvqsoEI+0tXgebB2SEYIs2xon6zNvekxUHsaMlM57lyYmB9QvEaRpYYPreHnGb+PTcU3QFVYVAPxJ7tHIKGygb0g2BloeTvBECwreHIk55m8Jv8YShlAzvVrwyZtNg76Us8Jg/6H+SUX0C9OCh6OlPtvOvgCLhrIuNJSPd5O86zjesZ2VjBCsZriDHEQ9dG5J0sRB+lw1xx0oWJR8Kk+NByUGdbIWYxsBW+G10syabpRPoKt8fcc2ioRvJvdaDRHpSZaS8roZ6HI7fRs1IxWkvXm488drk8nBH/ictjJ46fg4POBOwp282T80yNWpWAsAsajihu0132YnhXFyMMmL/tU/wh7E8NTSZz5DKeKHzKDdl9CNvwEqd5UQJ7DiV8OOyGhqLbX+n0 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)(10201501046)(93006095)(93004095)(100000703101)(100105400095)(6055026)(6041248)(20161123560025)(20161123558100)(20161123562025)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123555025)(20161123564025)(6072148)(201708071742011)(100000704101)(100105200095)(100000705101)(100105500095); SRVR:BY1PR02MB1129; BCL:0; PCL:0; RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095); SRVR:BY1PR02MB1129; X-Microsoft-Exchange-Diagnostics: 1; BY1PR02MB1129; 4:BSOEfrFeiFpZ1ssTbl7UKQj1jOAaLI0WJ3Zl4dFzlQjr+Ba4mQ0cSNsHG1iwSSR3RcdhRquToMcIaEFb0fxg97KEHfcsbjiZe2MXvpAHI96/ZysUFv8YSczf/TYd9pZBIBptPqiiKLvGkodk/P7q77Ct54mrgkLuJC+RpdQa/TpewEBtesk8QzAVA82MfapCFTO7TcuaiJ+MrcYOYqnPNACfATz4XjTX1Tm5QJtiTl0wvnoPMdVcISczdvFUM5hMzRXLILWY062KxajZWDpCjUEbO4whwSbVhnYCaOXpNHa3YTurELBv9F7Xs6JbgDEG6Qxu57UY0p6h4/Wa7sylLQ== X-Forefront-PRVS: 0446F0FCE1 X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; BY1PR02MB1129; 23:G4xeFIEOVnvJTRMFM6rGpAxVzBQxMVmfrMLHrwJRE?= =?us-ascii?Q?0Pu/zz54O0MuvgPU7GqiuZn/MGCVn54VY3VqyNjOqQwJbcfdDXpH5k9g46X2?= =?us-ascii?Q?JNbYt745UEyc5VbmwU6H2b6+CTRyP+cmNNo7F4HouOKSKiicYWmt+lzi4tgZ?= =?us-ascii?Q?6isFfJkp22yi5KdXQXhNCWRStv3475GWcYnta9bjiCRk1AV2r+3rB/4VQhD5?= =?us-ascii?Q?xCuhSJaEzYQD0JVM9HsaOn1VIW+kgML4R/itERg8SyZ5Cmo9y+2RyRU94w9m?= =?us-ascii?Q?eMZYRlUO3gn5Rn1X27ZlJMX0lt0yLdzLJ95feafefqqKOtMGPsij5MJxc7lH?= =?us-ascii?Q?crA1lo9sI3yyFbFAlod5gQO7n6iRmoJ048cd3YmAvXoVX3NiTtIOhXeyOCfA?= =?us-ascii?Q?ABslMHG4wHUwNuEDsvoS6MwUlgKBh2qwDVlCEccdh9UbC2GJMduBuDSBcjvZ?= =?us-ascii?Q?VVjjLME2pzYH5uewOi5rvBmyXLyxr7ALudiiVR4UAPQSPtoWlqD0SC+ejLNU?= =?us-ascii?Q?TQJsMysOty+AHHQA/uX3nVkA6s2M6SbpFPNEpxbK2JpwOkOKX5tGKw8KkY2Y?= =?us-ascii?Q?oSFp6xfmpuZkCRMzWm185BLnLgTgYCesowgEbHB8rSnrts8pmbwYZlbr4tyH?= =?us-ascii?Q?BmzIADvdRD9TZbdk9eXZ1ottz4NoY0bIczmT5RroTKhbM1MsBWi2Au418rmx?= =?us-ascii?Q?LKP+5hAmUxYJMgTOG5C9QLdYagJcwx/GmRe+ta5L2VF6Yd7EBJ14Tl1RlMaV?= =?us-ascii?Q?8pOeaHqIKCYjwYw9NoIA9equnZMgf9QNixt17IzU1NzsBPM8u9Zc+8Y1dM2z?= =?us-ascii?Q?Ke9Ryf0nO0bB0FmeQozoO64d+/AE35+CWPX0kEYobSHpMZ5X8G3X0brGIl0Y?= =?us-ascii?Q?eXB8oXpdgO2VM2hjIpfFzkGf+vXwnph1y4h+wzw5oD0nbsSlcg385XoB7QYB?= =?us-ascii?Q?Ef8aEjLVt4yOMTCNLkq/JnHCC+3bqeradzlhsOBjRSs95QFpeEJ0LVsdzwDT?= =?us-ascii?Q?c8vti1++VdCb2LRplsdOFoxJwe0t5k5fwyI7eXr6s4VJU2MHaC+Pfjt4q+Ew?= =?us-ascii?Q?sdiH3IqXQWl49xs3h1iC+WJ6DljA+ZzsN++x1ZCuTKVMrIctf+5FfgZ78C1J?= =?us-ascii?Q?NtYXI0gE1h4tZkBx4rICN8qQJNeT0vl?= X-Microsoft-Exchange-Diagnostics: 1; BY1PR02MB1129; 6:MHVOyY+2mupIFHR8fPEnYNsj5GW4mepqdCUaVNNYETv9UzGixZ6s2CpS6TFfgGCNRFOyNn9LbG62+BB0lWrr0VsclYb84HRLxonw233a3oyJgwqK7dHngX7xyvDY7ZF0akWw+b0r7hEB3sicku/TUrU+mvhGNK/wheHLaOKHVq0FpH7FSmFuaw6npL/hydIVYWHCR+1W/8/Ta34y9hMEFSgyZjqrRslmbfn50Jw0JQ9f7srtQ/qWWda2AOsR0WEWjBHQ1KJwq+IRDhATENDqam/Cv9gvkyoZtkm0LkithIaFK7nk4z6I8CLkdLZJAd0U1YKv/v44YOzUTYsZRf62gA==; 5:I7SfYeEO2eHV9GeYfhWMAgGJcf1cGLjXEv2znLidw4YpmYNPF9Ej4oibQBwRxL63ebD11uE0rAdl7IUVZMBKpnnXaeJLi1TNvlnbql4FSZ6MF7lFRcdfx/5nXdECBIfUcMSVXHzG14m++Ptw620xQeobXgfEvytFnyYu962IlJw=; 24:PZLJYIjjsX/OVV+0dnG2FYF00geII8hDcmvM8kpXzFrXCCa1SiaHirugwjgRkufUNVLWYbxwbJuen2+aZZwI0fRFDIjvsCq+7MonqD5HLvA=; 7:Nn3aRmhkq7BvUnakPKc0poToqaYg5N/VvlOCBcQk3uVj9O0VLzon0eHK2/hg1k3GZ2g0uPRkOQSaw4hAzkQngPiM45KMBfU06RlAWfhuDrJZ7DGIs4ngt8ZI/hzi8xUcqQAZYHXYa/HkXuJwX4UD8FGf4u0DxZttuK3Upb30ozG+tnR9r/xeAXeDBXjx3sErEWCYXztrygXhJHEkMqT9+OBNV1aVEYFtEFYTJZEZBBQ= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: xilinx.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 30 Sep 2017 00:19:15.5636 (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: BY1PR02MB1129 X-detected-operating-system: by eggs.gnu.org: Windows 7 or 8 [fuzzy] X-Received-From: 104.47.38.89 Subject: [Qemu-devel] [PATCH v2 07/47] hw/bt: Replace fprintf(stderr, "*\n" with error_report() X-BeenThere: qemu-devel@gnu.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@gnu.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 | 17 +++++++++-------- hw/bt/hci.c | 30 +++++++++++++++--------------- hw/bt/hid.c | 2 +- hw/bt/l2cap.c | 47 ++++++++++++++++++++++++----------------------- hw/bt/sdp.c | 7 ++++--- 6 files changed, 61 insertions(+), 57 deletions(-) diff --git a/hw/bt/core.c b/hw/bt/core.c index c1806b71a3..a6e9bf2a3e 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,24 @@ 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,7 +114,7 @@ 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__, + 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..6a171a54b7 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,8 +169,8 @@ 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__, + 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]); } @@ -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..ac9394daf0 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,7 +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", + error_report("%s: HCI event params too long (%ib)", __func__, len); exit(-1); } @@ -589,7 +590,7 @@ static void bt_hci_inquiry_result(struct bt_hci_s *hci, bt_hci_inquiry_result_with_rssi(hci, slave); return; default: - fprintf(stderr, "%s: bad inquiry mode %02x\n", __func__, + error_report("%s: bad inquiry mode %02x", __func__, hci->lm.inquiry_mode); exit(-1); } @@ -1971,7 +1972,7 @@ static void bt_submit_hci(struct HCIInfo *info, break; =20 short_hci: - fprintf(stderr, "%s: HCI packet too short (%iB)\n", + error_report("%s: HCI packet too short (%iB)", __func__, length); bt_hci_event_status(hci, HCI_INVALID_PARAMETERS); break; @@ -1991,7 +1992,7 @@ 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", + error_report("%s: can't take ACL packets %i bytes long", __func__, len); return; } @@ -2029,7 +2030,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", + error_report("%s: ACL packet too short (%iB)", __func__, length); return; } @@ -2041,15 +2042,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", + fprintf(stderr, "%s: ACL packet too short (%iB < %iB)", __func__, length, datalen); return; } @@ -2060,7 +2061,7 @@ 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", + error_report("%s: Bad handle %03x in Active Slave Broadcast", __func__, handle); /* TODO: signal an error */ return; @@ -2073,7 +2074,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 +2106,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 +2223,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("qemu: 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