From 9c23bb412cfa8625c5e86518d89a2337c742226b Mon Sep 17 00:00:00 2001 From: Zijun Hu Date: Thu, 25 Jun 2026 22:19:54 -0700 Subject: [PATCH] Bluetooth: hci_sync: Simplify hci_reset_sync() Return the reset command status directly instead of storing it in a local variable and using an if/return pattern. Reviewed-by: Bartosz Golaszewski Signed-off-by: Zijun Hu Signed-off-by: Luiz Augusto von Dentz --- net/bluetooth/hci_sync.c | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/net/bluetooth/hci_sync.c b/net/bluetooth/hci_sync.c index 00857fc3235b..7779d9d1663a 100644 --- a/net/bluetooth/hci_sync.c +++ b/net/bluetooth/hci_sync.c @@ -3754,16 +3754,10 @@ static const struct hci_init_stage hci_init0[] = { int hci_reset_sync(struct hci_dev *hdev) { - int err; - set_bit(HCI_RESET, &hdev->flags); - err = __hci_cmd_sync_status(hdev, HCI_OP_RESET, 0, NULL, - HCI_CMD_TIMEOUT); - if (err) - return err; - - return 0; + return __hci_cmd_sync_status(hdev, HCI_OP_RESET, 0, NULL, + HCI_CMD_TIMEOUT); } /* Send a raw HCI reset for use by vendor drivers */