* [PATCH 1/2] Bluetooth: MGMT: Remove unused mgmt_pending_find_data
2025-01-27 21:37 [PATCH 0/2] Bluetooth: MGMT: Deadcode cleanup linux
@ 2025-01-27 21:37 ` linux
2025-01-28 16:30 ` Simon Horman
2025-01-27 21:37 ` [PATCH 2/2] Bluetooth: MGMT: Remove unused mgmt_*_discovery_complete linux
2025-01-28 20:30 ` [PATCH 0/2] Bluetooth: MGMT: Deadcode cleanup patchwork-bot+bluetooth
2 siblings, 1 reply; 6+ messages in thread
From: linux @ 2025-01-27 21:37 UTC (permalink / raw)
To: marcel, johan.hedberg, luiz.dentz
Cc: davem, edumazet, kuba, pabeni, horms, linux-bluetooth, netdev,
linux-kernel, Dr. David Alan Gilbert
From: "Dr. David Alan Gilbert" <linux@treblig.org>
mgmt_pending_find_data() last use was removed in 2021 by
commit 5a7501374664 ("Bluetooth: hci_sync: Convert MGMT_OP_GET_CLOCK_INFO")
Remove it.
Signed-off-by: Dr. David Alan Gilbert <linux@treblig.org>
---
net/bluetooth/mgmt_util.c | 17 -----------------
net/bluetooth/mgmt_util.h | 4 ----
2 files changed, 21 deletions(-)
diff --git a/net/bluetooth/mgmt_util.c b/net/bluetooth/mgmt_util.c
index 17ab909a7c07..e5ff65e424b5 100644
--- a/net/bluetooth/mgmt_util.c
+++ b/net/bluetooth/mgmt_util.c
@@ -229,23 +229,6 @@ struct mgmt_pending_cmd *mgmt_pending_find(unsigned short channel, u16 opcode,
return NULL;
}
-struct mgmt_pending_cmd *mgmt_pending_find_data(unsigned short channel,
- u16 opcode,
- struct hci_dev *hdev,
- const void *data)
-{
- struct mgmt_pending_cmd *cmd;
-
- list_for_each_entry(cmd, &hdev->mgmt_pending, list) {
- if (cmd->user_data != data)
- continue;
- if (cmd->opcode == opcode)
- return cmd;
- }
-
- return NULL;
-}
-
void mgmt_pending_foreach(u16 opcode, struct hci_dev *hdev,
void (*cb)(struct mgmt_pending_cmd *cmd, void *data),
void *data)
diff --git a/net/bluetooth/mgmt_util.h b/net/bluetooth/mgmt_util.h
index bdf978605d5a..f2ba994ab1d8 100644
--- a/net/bluetooth/mgmt_util.h
+++ b/net/bluetooth/mgmt_util.h
@@ -54,10 +54,6 @@ int mgmt_cmd_complete(struct sock *sk, u16 index, u16 cmd, u8 status,
struct mgmt_pending_cmd *mgmt_pending_find(unsigned short channel, u16 opcode,
struct hci_dev *hdev);
-struct mgmt_pending_cmd *mgmt_pending_find_data(unsigned short channel,
- u16 opcode,
- struct hci_dev *hdev,
- const void *data);
void mgmt_pending_foreach(u16 opcode, struct hci_dev *hdev,
void (*cb)(struct mgmt_pending_cmd *cmd, void *data),
void *data);
--
2.48.1
^ permalink raw reply related [flat|nested] 6+ messages in thread* [PATCH 2/2] Bluetooth: MGMT: Remove unused mgmt_*_discovery_complete
2025-01-27 21:37 [PATCH 0/2] Bluetooth: MGMT: Deadcode cleanup linux
2025-01-27 21:37 ` [PATCH 1/2] Bluetooth: MGMT: Remove unused mgmt_pending_find_data linux
@ 2025-01-27 21:37 ` linux
2025-01-28 16:30 ` Simon Horman
2025-01-28 20:30 ` [PATCH 0/2] Bluetooth: MGMT: Deadcode cleanup patchwork-bot+bluetooth
2 siblings, 1 reply; 6+ messages in thread
From: linux @ 2025-01-27 21:37 UTC (permalink / raw)
To: marcel, johan.hedberg, luiz.dentz
Cc: davem, edumazet, kuba, pabeni, horms, linux-bluetooth, netdev,
linux-kernel, Dr. David Alan Gilbert
From: "Dr. David Alan Gilbert" <linux@treblig.org>
mgmt_start_discovery_complete() and mgmt_stop_discovery_complete() last
uses were removed in 2022 by
commit ec2904c259c5 ("Bluetooth: Remove dead code from hci_request.c")
Remove them.
Signed-off-by: Dr. David Alan Gilbert <linux@treblig.org>
---
include/net/bluetooth/hci_core.h | 2 --
net/bluetooth/mgmt.c | 40 --------------------------------
2 files changed, 42 deletions(-)
diff --git a/include/net/bluetooth/hci_core.h b/include/net/bluetooth/hci_core.h
index f756fac95488..05919848ea95 100644
--- a/include/net/bluetooth/hci_core.h
+++ b/include/net/bluetooth/hci_core.h
@@ -2386,8 +2386,6 @@ void mgmt_auth_enable_complete(struct hci_dev *hdev, u8 status);
void mgmt_set_class_of_dev_complete(struct hci_dev *hdev, u8 *dev_class,
u8 status);
void mgmt_set_local_name_complete(struct hci_dev *hdev, u8 *name, u8 status);
-void mgmt_start_discovery_complete(struct hci_dev *hdev, u8 status);
-void mgmt_stop_discovery_complete(struct hci_dev *hdev, u8 status);
void mgmt_device_found(struct hci_dev *hdev, bdaddr_t *bdaddr, u8 link_type,
u8 addr_type, u8 *dev_class, s8 rssi, u32 flags,
u8 *eir, u16 eir_len, u8 *scan_rsp, u8 scan_rsp_len,
diff --git a/net/bluetooth/mgmt.c b/net/bluetooth/mgmt.c
index f53304cb09db..e8533167aa88 100644
--- a/net/bluetooth/mgmt.c
+++ b/net/bluetooth/mgmt.c
@@ -5743,29 +5743,6 @@ static int remove_remote_oob_data(struct sock *sk, struct hci_dev *hdev,
return err;
}
-void mgmt_start_discovery_complete(struct hci_dev *hdev, u8 status)
-{
- struct mgmt_pending_cmd *cmd;
-
- bt_dev_dbg(hdev, "status %u", status);
-
- hci_dev_lock(hdev);
-
- cmd = pending_find(MGMT_OP_START_DISCOVERY, hdev);
- if (!cmd)
- cmd = pending_find(MGMT_OP_START_SERVICE_DISCOVERY, hdev);
-
- if (!cmd)
- cmd = pending_find(MGMT_OP_START_LIMITED_DISCOVERY, hdev);
-
- if (cmd) {
- cmd->cmd_complete(cmd, mgmt_status(status));
- mgmt_pending_remove(cmd);
- }
-
- hci_dev_unlock(hdev);
-}
-
static bool discovery_type_is_valid(struct hci_dev *hdev, uint8_t type,
uint8_t *mgmt_status)
{
@@ -6018,23 +5995,6 @@ static int start_service_discovery(struct sock *sk, struct hci_dev *hdev,
return err;
}
-void mgmt_stop_discovery_complete(struct hci_dev *hdev, u8 status)
-{
- struct mgmt_pending_cmd *cmd;
-
- bt_dev_dbg(hdev, "status %u", status);
-
- hci_dev_lock(hdev);
-
- cmd = pending_find(MGMT_OP_STOP_DISCOVERY, hdev);
- if (cmd) {
- cmd->cmd_complete(cmd, mgmt_status(status));
- mgmt_pending_remove(cmd);
- }
-
- hci_dev_unlock(hdev);
-}
-
static void stop_discovery_complete(struct hci_dev *hdev, void *data, int err)
{
struct mgmt_pending_cmd *cmd = data;
--
2.48.1
^ permalink raw reply related [flat|nested] 6+ messages in thread* Re: [PATCH 0/2] Bluetooth: MGMT: Deadcode cleanup
2025-01-27 21:37 [PATCH 0/2] Bluetooth: MGMT: Deadcode cleanup linux
2025-01-27 21:37 ` [PATCH 1/2] Bluetooth: MGMT: Remove unused mgmt_pending_find_data linux
2025-01-27 21:37 ` [PATCH 2/2] Bluetooth: MGMT: Remove unused mgmt_*_discovery_complete linux
@ 2025-01-28 20:30 ` patchwork-bot+bluetooth
2 siblings, 0 replies; 6+ messages in thread
From: patchwork-bot+bluetooth @ 2025-01-28 20:30 UTC (permalink / raw)
To: Dr. David Alan Gilbert
Cc: marcel, johan.hedberg, luiz.dentz, davem, edumazet, kuba, pabeni,
horms, linux-bluetooth, netdev, linux-kernel
Hello:
This series was applied to bluetooth/bluetooth-next.git (master)
by Luiz Augusto von Dentz <luiz.von.dentz@intel.com>:
On Mon, 27 Jan 2025 21:37:14 +0000 you wrote:
> From: "Dr. David Alan Gilbert" <linux@treblig.org>
>
> Hi,
> A couple of deadcode removal patches.
>
> They're both strictly function removals, no internal changes
> to a function.
>
> [...]
Here is the summary with links:
- [1/2] Bluetooth: MGMT: Remove unused mgmt_pending_find_data
https://git.kernel.org/bluetooth/bluetooth-next/c/f694e720fddd
- [2/2] Bluetooth: MGMT: Remove unused mgmt_*_discovery_complete
https://git.kernel.org/bluetooth/bluetooth-next/c/55b8d4c01dde
You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html
^ permalink raw reply [flat|nested] 6+ messages in thread