From: Bastien Nocera <hadess@hadess.net>
To: linux-bluetooth@vger.kernel.org
Cc: Bastien Nocera <hadess@hadess.net>
Subject: [PATCH BlueZ v4 1/8] error: Rename device error helper to match retval
Date: Tue, 1 Jul 2025 12:14:22 +0200 [thread overview]
Message-ID: <20250701101520.459452-2-hadess@hadess.net> (raw)
In-Reply-To: <20250701101520.459452-1-hadess@hadess.net>
Rename the helper to show that it outputs a string, and not an error
DbusMessage as the other functions do.
---
src/device.c | 10 +++++-----
src/error.c | 4 ++--
src/error.h | 4 ++--
3 files changed, 9 insertions(+), 9 deletions(-)
diff --git a/src/device.c b/src/device.c
index e4d5d79ee18b..709052d301b7 100644
--- a/src/device.c
+++ b/src/device.c
@@ -2341,7 +2341,7 @@ done:
g_dbus_send_message(dbus_conn,
btd_error_failed(dev->connect,
- btd_error_bredr_conn_from_errno(err)));
+ btd_error_str_bredr_conn_from_errno(err)));
} else {
/* Start passive SDP discovery to update known services */
if (dev->bredr && !dev->svc_refreshed && dev->refresh_discovery)
@@ -2699,7 +2699,7 @@ static DBusMessage *connect_profiles(struct btd_device *dev, uint8_t bdaddr_type
if (err == -EALREADY)
return dbus_message_new_method_return(msg);
return btd_error_failed(msg,
- btd_error_bredr_conn_from_errno(err));
+ btd_error_str_bredr_conn_from_errno(err));
}
dev->connect = dbus_message_ref(msg);
@@ -3004,8 +3004,8 @@ static void browse_request_complete(struct browse_req *req, uint8_t type,
}
reply = btd_error_failed(req->msg,
bdaddr_type == BDADDR_BREDR ?
- btd_error_bredr_conn_from_errno(err) :
- btd_error_le_conn_from_errno(err));
+ btd_error_str_bredr_conn_from_errno(err) :
+ btd_error_str_le_conn_from_errno(err));
goto done;
}
@@ -6283,7 +6283,7 @@ done:
if (device->connect) {
if (err < 0)
reply = btd_error_failed(device->connect,
- btd_error_le_conn_from_errno(err));
+ btd_error_str_le_conn_from_errno(err));
else
reply = dbus_message_new_method_return(device->connect);
diff --git a/src/error.c b/src/error.c
index f179e6cda0e8..d82c2f2e1520 100644
--- a/src/error.c
+++ b/src/error.c
@@ -134,7 +134,7 @@ DBusMessage *btd_error_failed(DBusMessage *msg, const char *str)
".Failed", "%s", str);
}
-const char *btd_error_bredr_conn_from_errno(int errno_code)
+const char *btd_error_str_bredr_conn_from_errno(int errno_code)
{
switch (-errno_code) {
case EALREADY:
@@ -178,7 +178,7 @@ const char *btd_error_bredr_conn_from_errno(int errno_code)
}
}
-const char *btd_error_le_conn_from_errno(int errno_code)
+const char *btd_error_str_le_conn_from_errno(int errno_code)
{
switch (-errno_code) {
case EINVAL:
diff --git a/src/error.h b/src/error.h
index 83206cb48a66..5b49400fbb92 100644
--- a/src/error.h
+++ b/src/error.h
@@ -87,5 +87,5 @@ DBusMessage *btd_error_not_ready(DBusMessage *msg);
DBusMessage *btd_error_not_ready_str(DBusMessage *msg, const char *str);
DBusMessage *btd_error_failed(DBusMessage *msg, const char *str);
-const char *btd_error_bredr_conn_from_errno(int errno_code);
-const char *btd_error_le_conn_from_errno(int errno_code);
+const char *btd_error_str_bredr_conn_from_errno(int errno_code);
+const char *btd_error_str_le_conn_from_errno(int errno_code);
--
2.50.0
next prev parent reply other threads:[~2025-07-01 10:15 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-07-01 10:14 [PATCH BlueZ v4 0/8] Better connect debug and error reporting Bastien Nocera
2025-07-01 10:14 ` Bastien Nocera [this message]
2025-07-01 11:41 ` bluez.test.bot
2025-07-01 10:14 ` [PATCH BlueZ v4 2/8] error: Add helper to return DbusMessage errors from errno Bastien Nocera
2025-07-01 10:14 ` [PATCH BlueZ v4 3/8] device: Use new DbusMessage error helper Bastien Nocera
2025-07-01 10:14 ` [PATCH BlueZ v4 4/8] error: Make errno to string helpers private Bastien Nocera
2025-07-01 10:14 ` [PATCH BlueZ v4 5/8] device: Better error when no BR/EDR profiles can be connected to Bastien Nocera
2025-07-01 10:14 ` [PATCH BlueZ v4 6/8] device: Better "Connect" debug Bastien Nocera
2025-07-01 20:19 ` Luiz Augusto von Dentz
2025-07-01 10:14 ` [PATCH BlueZ v4 7/8] device: Better error when the link key is missing Bastien Nocera
2025-07-01 20:22 ` Luiz Augusto von Dentz
2025-07-01 10:14 ` [PATCH BlueZ v4 8/8] device: Better error when the adapter is not powered Bastien Nocera
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=20250701101520.459452-2-hadess@hadess.net \
--to=hadess@hadess.net \
--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