[<prev] [next>] [day] [month] [year] [list]
Message-Id: <20220823034110.8295-1-zhoujie@nfschina.com>
Date: Tue, 23 Aug 2022 11:41:10 +0800
From: Zhou jie <zhoujie@...china.com>
To: marcel@...tmann.org, johan.hedberg@...il.com, luiz.dentz@...il.com
Cc: linux-bluetooth@...r.kernel.org, linux-kernel@...r.kernel.org,
Zhou jie <zhoujie@...china.com>
Subject: [PATCH] bluetooth/btbcm: Remove goto in btbcm_patchram function
Remove the goto statement in the btbcm_patchram function to optimize
program execution efficiency.
Signed-off-by: Zhou jie <zhoujie@...china.com>
---
drivers/bluetooth/btbcm.c | 8 +++-----
1 file changed, 3 insertions(+), 5 deletions(-)
diff --git a/drivers/bluetooth/btbcm.c b/drivers/bluetooth/btbcm.c
index d9ceca7a7935..60827593ba36 100644
--- a/drivers/bluetooth/btbcm.c
+++ b/drivers/bluetooth/btbcm.c
@@ -175,7 +175,7 @@ int btbcm_patchram(struct hci_dev *hdev, const struct firmware *fw)
err = PTR_ERR(skb);
bt_dev_err(hdev, "BCM: Download Minidrv command failed (%d)",
err);
- goto done;
+ return err;
}
kfree_skb(skb);
@@ -194,8 +194,7 @@ int btbcm_patchram(struct hci_dev *hdev, const struct firmware *fw)
if (fw_size < cmd->plen) {
bt_dev_err(hdev, "BCM: Patch is corrupted");
- err = -EINVAL;
- goto done;
+ return -EINVAL;
}
cmd_param = fw_ptr;
@@ -210,7 +209,7 @@ int btbcm_patchram(struct hci_dev *hdev, const struct firmware *fw)
err = PTR_ERR(skb);
bt_dev_err(hdev, "BCM: Patch command %04x failed (%d)",
opcode, err);
- goto done;
+ return err;
}
kfree_skb(skb);
}
@@ -218,7 +217,6 @@ int btbcm_patchram(struct hci_dev *hdev, const struct firmware *fw)
/* 250 msec delay after Launch Ram completes */
msleep(250);
-done:
return err;
}
EXPORT_SYMBOL(btbcm_patchram);
--
2.18.2
Powered by blists - more mailing lists