From: Andrei Emeltchenko <Andrei.Emeltchenko.news@gmail.com>
To: linux-bluetooth@vger.kernel.org
Subject: [PATCHv3 06/12] android/ipc: Use error printing error messages
Date: Thu, 8 May 2014 11:01:37 +0300 [thread overview]
Message-ID: <1399536103-19052-7-git-send-email-Andrei.Emeltchenko.news@gmail.com> (raw)
In-Reply-To: <1399536103-19052-1-git-send-email-Andrei.Emeltchenko.news@gmail.com>
From: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
This helps to identify problem since DBG is not printed by default.
---
android/ipc.c | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/android/ipc.c b/android/ipc.c
index 8cd34ea..89fff8d 100644
--- a/android/ipc.c
+++ b/android/ipc.c
@@ -96,31 +96,31 @@ static int ipc_handle_msg(struct service_handler *handlers, size_t max_index,
const struct ipc_handler *handler;
if (len < (ssize_t) sizeof(*msg)) {
- DBG("message too small (%zd bytes)", len);
+ error("message too small (%zd bytes)", len);
return -EBADMSG;
}
if (len != (ssize_t) (sizeof(*msg) + msg->len)) {
- DBG("message malformed (%zd bytes)", len);
+ error("message malformed (%zd bytes)", len);
return -EBADMSG;
}
/* if service is valid */
if (msg->service_id > max_index) {
- DBG("unknown service (0x%x)", msg->service_id);
+ error("unknown service (0x%x)", msg->service_id);
return -EOPNOTSUPP;
}
/* if service is registered */
if (!handlers[msg->service_id].handler) {
- DBG("service not registered (0x%x)", msg->service_id);
+ error("service not registered (0x%x)", msg->service_id);
return -EOPNOTSUPP;
}
/* if opcode is valid */
if (msg->opcode == IPC_OP_STATUS ||
msg->opcode > handlers[msg->service_id].size) {
- DBG("invalid opcode 0x%x for service 0x%x", msg->opcode,
+ error("invalid opcode 0x%x for service 0x%x", msg->opcode,
msg->service_id);
return -EOPNOTSUPP;
}
@@ -131,7 +131,7 @@ static int ipc_handle_msg(struct service_handler *handlers, size_t max_index,
/* if payload size is valid */
if ((handler->var_len && handler->data_len > msg->len) ||
(!handler->var_len && handler->data_len != msg->len)) {
- DBG("invalid size for opcode 0x%x service 0x%x",
+ error("invalid size for opcode 0x%x service 0x%x",
msg->opcode, msg->service_id);
return -EMSGSIZE;
}
--
1.8.3.2
next prev parent reply other threads:[~2014-05-08 8:01 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-05-08 8:01 [PATCHv3 00/12] SCO Audio interface for Android Andrei Emeltchenko
2014-05-08 8:01 ` [PATCHv3 01/12] android/hal-sco: Add audio HAL for SCO handling Andrei Emeltchenko
2014-05-08 8:55 ` Andrei Emeltchenko
2014-05-08 9:02 ` Andrei Emeltchenko
2014-05-08 9:14 ` Szymon Janc
2014-05-08 9:35 ` Andrei Emeltchenko
2014-05-08 8:01 ` [PATCHv3 02/12] android/hal-audio-hsp: Add open_output_stream() Andrei Emeltchenko
2014-05-08 11:24 ` Luiz Augusto von Dentz
2014-05-08 11:50 ` Andrei Emeltchenko
2014-05-08 8:01 ` [PATCHv3 03/12] android/audio: Add Audio SCO message API Andrei Emeltchenko
2014-05-08 8:01 ` [PATCHv3 04/12] android/handsfree: Add SCO Audio IPC Andrei Emeltchenko
2014-05-08 8:01 ` [PATCHv3 05/12] android/hal-sco: Implement Audio IPC on Audio HAL Andrei Emeltchenko
2014-05-08 8:01 ` Andrei Emeltchenko [this message]
2014-05-08 8:01 ` [PATCHv3 07/12] android/haltest: Add testinng for audio SCO HAL Andrei Emeltchenko
2014-05-08 8:01 ` [PATCHv3 08/12] android/audio: Add resampler support Andrei Emeltchenko
2014-05-08 8:01 ` [PATCHv3 09/12] audio/haltest: Make audio_stream static Andrei Emeltchenko
2014-05-08 8:01 ` [PATCHv3 10/12] android/audio: Add downmix support to audio SCO HAL Andrei Emeltchenko
2014-05-08 8:01 ` [PATCHv3 11/12] android/audio: Use resampler interface to resample SCO Andrei Emeltchenko
2014-05-08 8:01 ` [PATCHv3 12/12] android/audio: Add write to SCO Andrei Emeltchenko
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1399536103-19052-7-git-send-email-Andrei.Emeltchenko.news@gmail.com \
--to=andrei.emeltchenko.news@gmail.com \
--cc=linux-bluetooth@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox