From patchwork Fri Jul 15 07:45:02 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: quic_zijuhu X-Patchwork-Id: 12918889 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 561B9C433EF for ; Fri, 15 Jul 2022 07:45:13 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229983AbiGOHpM (ORCPT ); Fri, 15 Jul 2022 03:45:12 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44842 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230151AbiGOHpM (ORCPT ); Fri, 15 Jul 2022 03:45:12 -0400 Received: from alexa-out-sd-01.qualcomm.com (alexa-out-sd-01.qualcomm.com [199.106.114.38]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E6C987C1B0; Fri, 15 Jul 2022 00:45:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; i=@quicinc.com; q=dns/txt; s=qcdkim; t=1657871111; x=1689407111; h=from:to:cc:subject:date:message-id:mime-version; bh=cAWB2gvkwfL1+i+RY7OasDLomscjFUmMo/Lsjsnp0B8=; b=l9DhfHcctup4rbPqdpLiVIDs76oO3sLjlegsS/Lw1EW4VQHlS0SNkhJM 4K3EEREao1nxHpvvy/duDPN4U3rxsxo8bu5X0Ja59QBxOHeM1Q1juTGzs W6wVHODLhzFOKZIBNjn450pHrmznC5niG1/fOv8KDclvnmCvAaa8mo8U9 Y=; Received: from unknown (HELO ironmsg01-sd.qualcomm.com) ([10.53.140.141]) by alexa-out-sd-01.qualcomm.com with ESMTP; 15 Jul 2022 00:45:10 -0700 X-QCInternal: smtphost Received: from unknown (HELO nasanex01a.na.qualcomm.com) ([10.52.223.231]) by ironmsg01-sd.qualcomm.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 15 Jul 2022 00:45:10 -0700 Received: from zijuhu-gv.qualcomm.com (10.80.80.8) by nasanex01a.na.qualcomm.com (10.52.223.231) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.22; Fri, 15 Jul 2022 00:45:06 -0700 From: Zijun Hu To: , , , , , , , , CC: , , , Subject: [PATCH v4] Bluetooth: hci_sync: Remove redundant func definition Date: Fri, 15 Jul 2022 15:45:02 +0800 Message-ID: <1657871102-26907-1-git-send-email-quic_zijuhu@quicinc.com> X-Mailer: git-send-email 2.7.4 MIME-Version: 1.0 X-Originating-IP: [10.80.80.8] X-ClientProxiedBy: nasanex01b.na.qualcomm.com (10.46.141.250) To nasanex01a.na.qualcomm.com (10.52.223.231) Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org 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 --- v3->v4 -use 75 characters per line for Linux commit message bodies v2->v3 -remove table char to solve gitlint checking failure v1->v2 -remove the func copy within hci_request.c instead of hci_sync.c net/bluetooth/hci_request.c | 18 ------------------ net/bluetooth/hci_request.h | 2 ++ net/bluetooth/hci_sync.c | 2 +- 3 files changed, 3 insertions(+), 19 deletions(-) diff --git a/net/bluetooth/hci_request.c b/net/bluetooth/hci_request.c index 635cc5fb451e..edec0447aaa7 100644 --- a/net/bluetooth/hci_request.c +++ b/net/bluetooth/hci_request.c @@ -1784,24 +1784,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_request.h b/net/bluetooth/hci_request.h index 7f8df258e295..e80b500878d9 100644 --- a/net/bluetooth/hci_request.h +++ b/net/bluetooth/hci_request.h @@ -120,6 +120,8 @@ void __hci_req_update_scan(struct hci_request *req); int hci_update_random_address(struct hci_request *req, bool require_privacy, bool use_rpa, u8 *own_addr_type); +bool disconnected_accept_list_entries(struct hci_dev *hdev); + int hci_abort_conn(struct hci_conn *conn, u8 reason); void __hci_abort_conn(struct hci_request *req, struct hci_conn *conn, u8 reason); diff --git a/net/bluetooth/hci_sync.c b/net/bluetooth/hci_sync.c index 212b0cdb25f5..48a262f0ae49 100644 --- a/net/bluetooth/hci_sync.c +++ b/net/bluetooth/hci_sync.c @@ -2419,7 +2419,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;