From: Zijun Hu <zijun_hu@icloud.com>
To: Marcel Holtmann <marcel@holtmann.org>,
Johan Hedberg <johan.hedberg@gmail.com>,
Luiz Augusto von Dentz <luiz.dentz@gmail.com>
Cc: Zijun Hu <zijun_hu@icloud.com>,
linux-bluetooth@vger.kernel.org, linux-kernel@vger.kernel.org,
Zijun Hu <zijun.hu@oss.qualcomm.com>
Subject: [PATCH 3/4] Bluetooth: hci_core: Eliminate an unnecessary goto label in hci_find_irk_by_addr()
Date: Mon, 23 Jun 2025 20:31:18 +0800 [thread overview]
Message-ID: <20250623-bt_cleanup-v1-3-5d3d171e3822@oss.qualcomm.com> (raw)
In-Reply-To: <20250623-bt_cleanup-v1-0-5d3d171e3822@oss.qualcomm.com>
From: Zijun Hu <zijun.hu@oss.qualcomm.com>
Eliminate an unnecessary goto label by using break instead of goto to
exit the loop in hci_find_irk_by_addr().
Signed-off-by: Zijun Hu <zijun.hu@oss.qualcomm.com>
---
net/bluetooth/hci_core.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/net/bluetooth/hci_core.c b/net/bluetooth/hci_core.c
index ce1d8c997a31529996ad98f22ec0997ed3ac9b36..9af4d7345e4df1d715fdab7427a700007303f65e 100644
--- a/net/bluetooth/hci_core.c
+++ b/net/bluetooth/hci_core.c
@@ -1256,12 +1256,10 @@ struct smp_irk *hci_find_irk_by_addr(struct hci_dev *hdev, bdaddr_t *bdaddr,
if (addr_type == irk->addr_type &&
bacmp(bdaddr, &irk->bdaddr) == 0) {
irk_to_return = irk;
- goto done;
+ break;
}
}
-done:
-
if (irk_to_return && hci_is_blocked_key(hdev, HCI_BLOCKED_KEY_TYPE_IRK,
irk_to_return->val)) {
bt_dev_warn_ratelimited(hdev, "Identity key blocked for %pMR",
--
2.34.1
next prev parent reply other threads:[~2025-06-23 12:31 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-06-23 12:31 [PATCH 0/4] Bluetooth: Trivial cleanup Zijun Hu
2025-06-23 12:31 ` [PATCH 1/4] Bluetooth: hci_sock: Reset cookie to zero in hci_sock_free_cookie() Zijun Hu
2025-06-23 12:31 ` [PATCH 2/4] Bluetooth: hci_sync: Use bt_dev_err() to log error message in hci_update_event_filter_sync() Zijun Hu
2025-06-23 12:31 ` Zijun Hu [this message]
2025-06-23 12:31 ` [PATCH 4/4] Bluetooth: hci_event: Correct comment about HCI_EV_EXTENDED_INQUIRY_RESULT Zijun Hu
2025-06-23 19:10 ` [PATCH 0/4] Bluetooth: Trivial cleanup 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=20250623-bt_cleanup-v1-3-5d3d171e3822@oss.qualcomm.com \
--to=zijun_hu@icloud.com \
--cc=johan.hedberg@gmail.com \
--cc=linux-bluetooth@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=luiz.dentz@gmail.com \
--cc=marcel@holtmann.org \
--cc=zijun.hu@oss.qualcomm.com \
/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
all inboxes | Powered by JetHome®