From patchwork Mon Jan 22 11:27:04 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Huth X-Patchwork-Id: 10178305 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 540EB602B7 for ; Mon, 22 Jan 2018 11:35:49 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 348C926223 for ; Mon, 22 Jan 2018 11:35:49 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 27EB02623C; Mon, 22 Jan 2018 11:35:49 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id D210126223 for ; Mon, 22 Jan 2018 11:35:47 +0000 (UTC) Received: from localhost ([::1]:36707 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1edaOB-0000vy-7m for patchwork-qemu-devel@patchwork.kernel.org; Mon, 22 Jan 2018 06:35:47 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:42621) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1edaG5-0002tW-E1 for qemu-devel@nongnu.org; Mon, 22 Jan 2018 06:27:27 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1edaG0-0007JJ-Eu for qemu-devel@nongnu.org; Mon, 22 Jan 2018 06:27:25 -0500 Received: from mx1.redhat.com ([209.132.183.28]:33624) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1edaG0-0007Io-59 for qemu-devel@nongnu.org; Mon, 22 Jan 2018 06:27:20 -0500 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 5C7BE4666C; Mon, 22 Jan 2018 11:27:19 +0000 (UTC) Received: from thh440s.redhat.com (ovpn-116-91.ams2.redhat.com [10.36.116.91]) by smtp.corp.redhat.com (Postfix) with ESMTP id 4A94B7901B; Mon, 22 Jan 2018 11:27:18 +0000 (UTC) From: Thomas Huth To: qemu-devel@nongnu.org, Peter Maydell Date: Mon, 22 Jan 2018 12:27:04 +0100 Message-Id: <1516620426-18530-8-git-send-email-thuth@redhat.com> In-Reply-To: <1516620426-18530-1-git-send-email-thuth@redhat.com> References: <1516620426-18530-1-git-send-email-thuth@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.30]); Mon, 22 Jan 2018 11:27:19 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PULL 7/9] 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: Alistair Francis Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP From: Alistair Francis 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 Reviewed-by: Thomas Huth [THH: Changed one missing fprintf into an error_report, too] Signed-off-by: Thomas Huth --- 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 c1806b7..78370e6 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__); + error_report("%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 ac067b8..0341ded 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 df05f07..c6b2cc1 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 09d1732..056291f 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 3e53dd0..9cf27f0 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 7c0d38b..f4aba9d 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;