mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] Bluetooth: btbcm: remove done label in btbcm_patchram
@ 2026-02-03  7:10 Dongyang Jin
  2026-02-03  8:55 ` Paul Menzel
  2026-02-11 19:40 ` patchwork-bot+bluetooth
  0 siblings, 2 replies; 3+ messages in thread
From: Dongyang Jin @ 2026-02-03  7:10 UTC (permalink / raw)
  To: marcel, luiz.dentz; +Cc: linux-bluetooth, linux-kernel, Dongyang Jin

There is no point in having the label since all it does is return the
value in the 'err' variable. Instead make every goto return directly
and remove the label.

Signed-off-by: Dongyang Jin <jindongyang@kylinos.cn>
---
 drivers/bluetooth/btbcm.c | 10 ++++------
 1 file changed, 4 insertions(+), 6 deletions(-)

diff --git a/drivers/bluetooth/btbcm.c b/drivers/bluetooth/btbcm.c
index d33cc70eec66..dccfbeee4721 100644
--- a/drivers/bluetooth/btbcm.c
+++ b/drivers/bluetooth/btbcm.c
@@ -223,7 +223,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);
 
@@ -242,8 +242,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;
@@ -258,7 +257,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);
 	}
@@ -266,8 +265,7 @@ int btbcm_patchram(struct hci_dev *hdev, const struct firmware *fw)
 	/* 250 msec delay after Launch Ram completes */
 	msleep(250);
 
-done:
-	return err;
+	return 0;
 }
 EXPORT_SYMBOL(btbcm_patchram);
 
-- 
2.25.1


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] Bluetooth: btbcm: remove done label in btbcm_patchram
  2026-02-03  7:10 [PATCH] Bluetooth: btbcm: remove done label in btbcm_patchram Dongyang Jin
@ 2026-02-03  8:55 ` Paul Menzel
  2026-02-11 19:40 ` patchwork-bot+bluetooth
  1 sibling, 0 replies; 3+ messages in thread
From: Paul Menzel @ 2026-02-03  8:55 UTC (permalink / raw)
  To: Dongyang Jin; +Cc: marcel, luiz.dentz, linux-bluetooth, linux-kernel

Dear Dongyang,


Thank you for your patch.

Am 03.02.26 um 08:10 schrieb Dongyang Jin:
> There is no point in having the label since all it does is return the
> value in the 'err' variable. Instead make every goto return directly
> and remove the label.
> 
> Signed-off-by: Dongyang Jin <jindongyang@kylinos.cn>
> ---
>   drivers/bluetooth/btbcm.c | 10 ++++------
>   1 file changed, 4 insertions(+), 6 deletions(-)
> 
> diff --git a/drivers/bluetooth/btbcm.c b/drivers/bluetooth/btbcm.c
> index d33cc70eec66..dccfbeee4721 100644
> --- a/drivers/bluetooth/btbcm.c
> +++ b/drivers/bluetooth/btbcm.c
> @@ -223,7 +223,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);
>   
> @@ -242,8 +242,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;
> @@ -258,7 +257,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);
>   	}
> @@ -266,8 +265,7 @@ int btbcm_patchram(struct hci_dev *hdev, const struct firmware *fw)
>   	/* 250 msec delay after Launch Ram completes */
>   	msleep(250);
>   
> -done:
> -	return err;
> +	return 0;
>   }
>   EXPORT_SYMBOL(btbcm_patchram);
>   

Reviewed-by: Paul Menzel <pmenzel@molgen.mpg.de>


Kind regards,

Paul


PS: Do you have a device to test *btbcm*?

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] Bluetooth: btbcm: remove done label in btbcm_patchram
  2026-02-03  7:10 [PATCH] Bluetooth: btbcm: remove done label in btbcm_patchram Dongyang Jin
  2026-02-03  8:55 ` Paul Menzel
@ 2026-02-11 19:40 ` patchwork-bot+bluetooth
  1 sibling, 0 replies; 3+ messages in thread
From: patchwork-bot+bluetooth @ 2026-02-11 19:40 UTC (permalink / raw)
  To: Dongyang Jin; +Cc: marcel, luiz.dentz, linux-bluetooth, linux-kernel

Hello:

This patch was applied to bluetooth/bluetooth-next.git (master)
by Luiz Augusto von Dentz <luiz.von.dentz@intel.com>:

On Tue,  3 Feb 2026 15:10:48 +0800 you wrote:
> There is no point in having the label since all it does is return the
> value in the 'err' variable. Instead make every goto return directly
> and remove the label.
> 
> Signed-off-by: Dongyang Jin <jindongyang@kylinos.cn>
> ---
>  drivers/bluetooth/btbcm.c | 10 ++++------
>  1 file changed, 4 insertions(+), 6 deletions(-)

Here is the summary with links:
  - Bluetooth: btbcm: remove done label in btbcm_patchram
    https://git.kernel.org/bluetooth/bluetooth-next/c/7351872d71d8

You are awesome, thank you!
-- 
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html



^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2026-02-11 19:40 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-02-03  7:10 [PATCH] Bluetooth: btbcm: remove done label in btbcm_patchram Dongyang Jin
2026-02-03  8:55 ` Paul Menzel
2026-02-11 19:40 ` patchwork-bot+bluetooth

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®