From: Luiz Augusto von Dentz <luiz.dentz@gmail.com>
To: linux-bluetooth@vger.kernel.org
Subject: [PATCH BlueZ v2 5/5] shared/micp: Use util_iov_pull_mem instead of a local helper
Date: Wed, 11 Nov 2026 15:39:49 -0500 [thread overview]
Message-ID: <20261111203949.3874673-6-luiz.dentz@gmail.com> (raw)
In-Reply-To: <20261111203949.3874673-1-luiz.dentz@gmail.com>
From: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
Drop the local iov_pull_mem, which duplicates util_iov_pull_mem.
Assisted-by: OpenCode:claude-sonnet-5.5
---
src/shared/micp.c | 19 +++----------------
1 file changed, 3 insertions(+), 16 deletions(-)
diff --git a/src/shared/micp.c b/src/shared/micp.c
index 7df8f8346f55..ebc21eb3c8b0 100644
--- a/src/shared/micp.c
+++ b/src/shared/micp.c
@@ -79,19 +79,6 @@ struct bt_micp_notify {
void *user_data;
};
-static void *iov_pull_mem(struct iovec *iov, size_t len)
-{
- void *data = iov->iov_base;
-
- if (iov->iov_len < len)
- return NULL;
-
- iov->iov_base += len;
- iov->iov_len -= len;
-
- return data;
-}
-
static struct bt_micp_db *micp_get_mdb(struct bt_micp *micp)
{
if (!micp)
@@ -397,9 +384,9 @@ static void mics_mute_write(struct gatt_db_attribute *attrib,
goto respond;
}
- micp_op = iov_pull_mem(&iov, sizeof(*micp_op));
+ micp_op = util_iov_pull_mem(&iov, sizeof(*micp_op));
if (!micp_op) {
- DBG(micp, "iov_pull_mem() returned NULL");
+ DBG(micp, "util_iov_pull_mem() returned NULL");
goto respond;
}
@@ -746,7 +733,7 @@ static void read_mute_state(struct bt_micp *micp, bool success,
return;
}
- mute_state = iov_pull_mem(&iov, sizeof(uint8_t));
+ mute_state = util_iov_pull_mem(&iov, sizeof(uint8_t));
if (mute_state == NULL) {
DBG(micp, "Unable to get Mute state");
return;
--
2.56.0
next prev parent reply other threads:[~2026-11-11 20:39 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-11 20:39 [PATCH BlueZ v2 0/5] shared: Use util_iov helpers in gatt-db, hog, asha and micp Luiz Augusto von Dentz
2026-11-11 20:39 ` [PATCH BlueZ v2 1/5] shared/gatt-db: Use util_iov helpers to build and parse values Luiz Augusto von Dentz
2026-11-12 2:09 ` shared: Use util_iov helpers in gatt-db, hog, asha and micp bluez.test.bot
2026-11-11 20:39 ` [PATCH BlueZ v2 2/5] shared/hog: Use util_iov helpers to parse characteristic values Luiz Augusto von Dentz
2026-11-11 20:39 ` [PATCH BlueZ v2 3/5] shared/asha: " Luiz Augusto von Dentz
2026-11-11 20:39 ` [PATCH BlueZ v2 4/5] shared/micp: Fix reading Mute State from an empty notification Luiz Augusto von Dentz
2026-11-11 20:39 ` Luiz Augusto von Dentz [this message]
2026-11-12 17:50 ` [PATCH BlueZ v2 0/5] shared: Use util_iov helpers in gatt-db, hog, asha and micp patchwork-bot+bluetooth
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=20261111203949.3874673-6-luiz.dentz@gmail.com \
--to=luiz.dentz@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