[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <1658488552-24691-1-git-send-email-quic_zijuhu@quicinc.com>
Date: Fri, 22 Jul 2022 19:15:52 +0800
From: Zijun Hu <quic_zijuhu@...cinc.com>
To: <marcel@...tmann.org>, <johan.hedberg@...il.com>,
<luiz.dentz@...il.com>, <davem@...emloft.net>,
<edumazet@...gle.com>, <kuba@...nel.org>, <pabeni@...hat.com>,
<luiz.von.dentz@...el.com>, <quic_zijuhu@...cinc.com>
CC: <linux-kernel@...r.kernel.org>, <linux-bluetooth@...r.kernel.org>,
<netdev@...r.kernel.org>
Subject: [PATCH v5] Bluetooth: hci_sync: Remove redundant func definition
both hci_request.c and hci_sync.c have the same definition for
disconnected_accept_list_entries(), so remove a redundant copy.
Signed-off-by: Zijun Hu <quic_zijuhu@...cinc.com>
---
v4->v5
-move the func declaration from hci_request.h to hci_request.c
v2->v4
-optimize commit message
v1->v2
-remove the func copy within hci_request.c instead of hci_sync.c
net/bluetooth/hci_request.c | 20 ++------------------
net/bluetooth/hci_sync.c | 2 +-
2 files changed, 3 insertions(+), 19 deletions(-)
diff --git a/net/bluetooth/hci_request.c b/net/bluetooth/hci_request.c
index 635cc5fb451e..69e30217c4e4 100644
--- a/net/bluetooth/hci_request.c
+++ b/net/bluetooth/hci_request.c
@@ -32,6 +32,8 @@
#include "msft.h"
#include "eir.h"
+extern bool disconnected_accept_list_entries(struct hci_dev *hdev);
+
void hci_req_init(struct hci_request *req, struct hci_dev *hdev)
{
skb_queue_head_init(&req->cmd_q);
@@ -1784,24 +1786,6 @@ int hci_update_random_address(struct hci_request *req, bool require_privacy,
return 0;
}
-static bool disconnected_accept_list_entries(struct hci_dev *hdev)
-{
- struct bdaddr_list *b;
-
- list_for_each_entry(b, &hdev->accept_list, list) {
- struct hci_conn *conn;
-
- conn = hci_conn_hash_lookup_ba(hdev, ACL_LINK, &b->bdaddr);
- if (!conn)
- return true;
-
- if (conn->state != BT_CONNECTED && conn->state != BT_CONFIG)
- return true;
- }
-
- return false;
-}
-
void __hci_req_update_scan(struct hci_request *req)
{
struct hci_dev *hdev = req->hdev;
diff --git a/net/bluetooth/hci_sync.c b/net/bluetooth/hci_sync.c
index 3067d94e7a8e..b44d0b4143e6 100644
--- a/net/bluetooth/hci_sync.c
+++ b/net/bluetooth/hci_sync.c
@@ -2425,7 +2425,7 @@ int hci_write_fast_connectable_sync(struct hci_dev *hdev, bool enable)
return err;
}
-static bool disconnected_accept_list_entries(struct hci_dev *hdev)
+bool disconnected_accept_list_entries(struct hci_dev *hdev)
{
struct bdaddr_list *b;
--
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum, a Linux Foundation Collaborative Project
Powered by blists - more mailing lists