From patchwork Mon Jan 27 21:37:15 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Dr. David Alan Gilbert" X-Patchwork-Id: 13951737 Received: from mx.treblig.org (mx.treblig.org [46.235.229.95]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 55BF91D7E47; Mon, 27 Jan 2025 21:37:31 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=46.235.229.95 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1738013854; cv=none; b=oKSy/amdaCokPrjKEcLTTZGYbzRd8EqYahiCmag8aXIOkMmt7pH412nmCjtNJkHy6wpg9caK/u2OS/HQ+SrBQK7DFhJbhSWJCe34nyDzo50kBhKzl4XRYv1ewFRyvihhQgZSyWRvGgd0Jp+tqp+xvPl8VQmY3XjTThvbn3UKBBI= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1738013854; c=relaxed/simple; bh=FQjxcukhBSRKyXDHqUoaoy0lmOtZ76UZ/VFTLM0hQwI=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=A+dHrdwKvQVKVzImlm4wZCv5kqyL1i0fQ2/bua5uk/Tp94XwYmJA19N1mynV2dR5RI4oqs82vd0k8P1NzZ9sBMSKkKz/7EIv3WZadF5jw78lEmBH5c3+R+sF+BDm0DEhNJ4YHE0lh5lMnysVw1JyBQ0LIbh3eVEseY5/+yplMRg= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=treblig.org; spf=pass smtp.mailfrom=treblig.org; dkim=pass (2048-bit key) header.d=treblig.org header.i=@treblig.org header.b=Z1hsLN9Z; arc=none smtp.client-ip=46.235.229.95 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=treblig.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=treblig.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=treblig.org header.i=@treblig.org header.b="Z1hsLN9Z" DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=treblig.org ; s=bytemarkmx; h=MIME-Version:Message-ID:Date:Subject:From:Content-Type:From :Subject; bh=Q8DeE6I21KdBtXf2UfwnvRGRhf/hWXsyOW9lcfV/klU=; b=Z1hsLN9ZabpWcSwL DqYivA9Tj6o0TsyKsvprHs3XDDQP96dN4lf2UbzKrrEjbDs2yRK9+Ucabtoti0Ca5yfvz5cWlKQVS yKyGNZHI9dbaeNTMpkf2Ir9UxByypCVdqXJAifMPKphmGtANWXCzJfkrC0JqRvlW9/5Gq4rEJ5vLE uuUoip3O/FVExVpMBRgmOEXgAlt2MxXVg9q3TIYkR2nymmlc/1Oo1NsiIrvHNFcG2jolZFlm7vXP8 IbxnXGMZWUQiHGeLd2z85HxgOlUvRMmtnPXd1EJu+4oRX07jO7Rhi96cocoMTawx0DMSwBzNrzeje 76HXdVsStVUYbsZzgA==; Received: from localhost ([127.0.0.1] helo=dalek.home.treblig.org) by mx.treblig.org with esmtp (Exim 4.96) (envelope-from ) id 1tcWnF-00CMm7-2I; Mon, 27 Jan 2025 21:37:17 +0000 From: linux@treblig.org To: marcel@holtmann.org, johan.hedberg@gmail.com, luiz.dentz@gmail.com Cc: davem@davemloft.net, edumazet@google.com, kuba@kernel.org, pabeni@redhat.com, horms@kernel.org, linux-bluetooth@vger.kernel.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, "Dr. David Alan Gilbert" Subject: [PATCH 1/2] Bluetooth: MGMT: Remove unused mgmt_pending_find_data Date: Mon, 27 Jan 2025 21:37:15 +0000 Message-ID: <20250127213716.232551-2-linux@treblig.org> X-Mailer: git-send-email 2.48.1 In-Reply-To: <20250127213716.232551-1-linux@treblig.org> References: <20250127213716.232551-1-linux@treblig.org> Precedence: bulk X-Mailing-List: linux-bluetooth@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 From: "Dr. David Alan Gilbert" 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 Reviewed-by: Simon Horman --- 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); From patchwork Mon Jan 27 21:37:16 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Dr. David Alan Gilbert" X-Patchwork-Id: 13951736 Received: from mx.treblig.org (mx.treblig.org [46.235.229.95]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 127AD1D7E47; Mon, 27 Jan 2025 21:37:24 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=46.235.229.95 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1738013846; cv=none; b=cIo/5OmmQgEaE1/cmRenZLTGImuLx+ZMKIoJ0WCH7nNxXf10eeq54ID3J3fCa5Ols9+DXkYc46V2DbpLvOURySVtEsPatW3KaVIXoY3wl2V8sa8zGCD3Y58dFHboFydXlRt3LiAKtIRF+D72BUBvRSBNyUSJ64fph3BgpXxAZ0U= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1738013846; c=relaxed/simple; bh=ud1EoghHPONQvTg+/ZBFUPpQ5VF+GOAO6G9iW/s/QIQ=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=Fc5Rahxpdv9VvNz8MjzqJH38F8lLgzirFVWAu8yw8fufZ49/6JNoshb7glFYsNzP5Z2bdfwx5zUXC4t9YHysshM3+4nNKY5pBAI7fSgJOsxqABUZdukeiVv94Pz14uh6eXu8A8dJ+DbXMPOLjP+3wWF0NaZteXkFWXLxwalYOIU= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=treblig.org; spf=pass smtp.mailfrom=treblig.org; dkim=pass (2048-bit key) header.d=treblig.org header.i=@treblig.org header.b=H/MX8uMX; arc=none smtp.client-ip=46.235.229.95 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=treblig.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=treblig.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=treblig.org header.i=@treblig.org header.b="H/MX8uMX" DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=treblig.org ; s=bytemarkmx; h=MIME-Version:Message-ID:Date:Subject:From:Content-Type:From :Subject; bh=t1/PWq3W3jycJ6pu6roZnq585fZAq85K5WbfAwoVbGE=; b=H/MX8uMXQK+EDcW4 cE1EE+KR4ZNX7KVuiXqjVQxy0E3U1iUxtN+W+HLd+dpyhtm5stpb8uNQuZlyjKPV3ktEC44A1TJPf Ayga9Gtw9jvElhvnV1/gUwohvEL3n5fBPRvGe7+4VnnqsRWefsbV4NUvGFEA9qvg66caqttnfssqX Ek98DC40KIXrJfnMTtxMB0WdxVA/fuQWcX1nk8M0eogkTXY6xFwE8qYcYr5kv5KQXmRzjMgyb55s0 Lte3lq8I8BQ1jb6g/MwIeK3Mcw59lMHVSfXuLH+FsiT7EGzgSRcNbN+BN/YfdWc6dammKkumKlm3S RLikH14GhcobtdZJGQ==; Received: from localhost ([127.0.0.1] helo=dalek.home.treblig.org) by mx.treblig.org with esmtp (Exim 4.96) (envelope-from ) id 1tcWnG-00CMm7-1E; Mon, 27 Jan 2025 21:37:18 +0000 From: linux@treblig.org To: marcel@holtmann.org, johan.hedberg@gmail.com, luiz.dentz@gmail.com Cc: davem@davemloft.net, edumazet@google.com, kuba@kernel.org, pabeni@redhat.com, horms@kernel.org, linux-bluetooth@vger.kernel.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, "Dr. David Alan Gilbert" Subject: [PATCH 2/2] Bluetooth: MGMT: Remove unused mgmt_*_discovery_complete Date: Mon, 27 Jan 2025 21:37:16 +0000 Message-ID: <20250127213716.232551-3-linux@treblig.org> X-Mailer: git-send-email 2.48.1 In-Reply-To: <20250127213716.232551-1-linux@treblig.org> References: <20250127213716.232551-1-linux@treblig.org> Precedence: bulk X-Mailing-List: linux-bluetooth@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 From: "Dr. David Alan Gilbert" 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 Reviewed-by: Simon Horman --- 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;