[PATCH v2] nfc: st-nci: remove unnecessary labels

Subsystems: nfc subsystem, the rest

STALE1899d LANDED

Landed in mainline as c7a551b2e44a on 2021-05-26.

3 messages, 3 authors, 2021-05-26 · open the first message on its own page

[PATCH v2] nfc: st-nci: remove unnecessary labels

From: samirweng1979 <hidden>
Date: 2021-05-26 01:16:53

From: wengjianfeng <redacted>

Some labels are only used once, so we delete them and use the
return statement instead of the goto statement.

Signed-off-by: wengjianfeng <redacted>
---
 drivers/nfc/st-nci/vendor_cmds.c | 15 +++++----------
 1 file changed, 5 insertions(+), 10 deletions(-)
diff --git a/drivers/nfc/st-nci/vendor_cmds.c b/drivers/nfc/st-nci/vendor_cmds.c
index c6a9d30..94b6000 100644
--- a/drivers/nfc/st-nci/vendor_cmds.c
+++ b/drivers/nfc/st-nci/vendor_cmds.c
@@ -98,7 +98,7 @@ static int st_nci_hci_dm_get_info(struct nfc_dev *dev, void *data,
 	r = nci_hci_send_cmd(ndev, ST_NCI_DEVICE_MGNT_GATE, ST_NCI_HCI_DM_GETINFO,
 			     data, data_len, &skb);
 	if (r)
-		goto exit;
+		return r;
 
 	msg = nfc_vendor_cmd_alloc_reply_skb(dev, ST_NCI_VENDOR_OUI,
 					     HCI_DM_GET_INFO, skb->len);
@@ -117,7 +117,6 @@ static int st_nci_hci_dm_get_info(struct nfc_dev *dev, void *data,
 
 free_skb:
 	kfree_skb(skb);
-exit:
 	return r;
 }
 
@@ -131,7 +130,7 @@ static int st_nci_hci_dm_get_data(struct nfc_dev *dev, void *data,
 	r = nci_hci_send_cmd(ndev, ST_NCI_DEVICE_MGNT_GATE, ST_NCI_HCI_DM_GETDATA,
 			     data, data_len, &skb);
 	if (r)
-		goto exit;
+		return r;
 
 	msg = nfc_vendor_cmd_alloc_reply_skb(dev, ST_NCI_VENDOR_OUI,
 					     HCI_DM_GET_DATA, skb->len);
@@ -150,7 +149,6 @@ static int st_nci_hci_dm_get_data(struct nfc_dev *dev, void *data,
 
 free_skb:
 	kfree_skb(skb);
-exit:
 	return r;
 }
 
@@ -216,7 +214,7 @@ static int st_nci_hci_get_param(struct nfc_dev *dev, void *data,
 
 	r = nci_hci_get_param(ndev, param->gate, param->data, &skb);
 	if (r)
-		goto exit;
+		return r;
 
 	msg = nfc_vendor_cmd_alloc_reply_skb(dev, ST_NCI_VENDOR_OUI,
 					     HCI_GET_PARAM, skb->len);
@@ -235,7 +233,6 @@ static int st_nci_hci_get_param(struct nfc_dev *dev, void *data,
 
 free_skb:
 	kfree_skb(skb);
-exit:
 	return r;
 }
 
@@ -262,7 +259,7 @@ static int st_nci_hci_dm_vdc_measurement_value(struct nfc_dev *dev, void *data,
 			     ST_NCI_HCI_DM_VDC_MEASUREMENT_VALUE,
 			     data, data_len, &skb);
 	if (r)
-		goto exit;
+		return r;
 
 	msg = nfc_vendor_cmd_alloc_reply_skb(dev, ST_NCI_VENDOR_OUI,
 				HCI_DM_VDC_MEASUREMENT_VALUE, skb->len);
@@ -281,7 +278,6 @@ static int st_nci_hci_dm_vdc_measurement_value(struct nfc_dev *dev, void *data,
 
 free_skb:
 	kfree_skb(skb);
-exit:
 	return r;
 }
 
@@ -299,7 +295,7 @@ static int st_nci_hci_dm_vdc_value_comparison(struct nfc_dev *dev, void *data,
 			     ST_NCI_HCI_DM_VDC_VALUE_COMPARISON,
 			     data, data_len, &skb);
 	if (r)
-		goto exit;
+		return r;
 
 	msg = nfc_vendor_cmd_alloc_reply_skb(dev, ST_NCI_VENDOR_OUI,
 					HCI_DM_VDC_VALUE_COMPARISON, skb->len);
@@ -318,7 +314,6 @@ static int st_nci_hci_dm_vdc_value_comparison(struct nfc_dev *dev, void *data,
 
 free_skb:
 	kfree_skb(skb);
-exit:
 	return r;
 }
 
-- 
1.9.1

Re: [PATCH v2] nfc: st-nci: remove unnecessary labels

From: Krzysztof Kozlowski <hidden>
Date: 2021-05-26 13:57:01

On 25/05/2021 21:16, samirweng1979 wrote:
From: wengjianfeng <redacted>

Some labels are only used once, so we delete them and use the
return statement instead of the goto statement.

Signed-off-by: wengjianfeng <redacted>
---
 drivers/nfc/st-nci/vendor_cmds.c | 15 +++++----------
 1 file changed, 5 insertions(+), 10 deletions(-)

Reviewed-by: Krzysztof Kozlowski <redacted>

Best regards,
Krzysztof

Re: [PATCH v2] nfc: st-nci: remove unnecessary labels

From: patchwork-bot+netdevbpf@kernel.org
Date: 2021-05-26 20:20:18

Hello:

This patch was applied to netdev/net-next.git (refs/heads/master):

On Wed, 26 May 2021 09:16:24 +0800 you wrote:
From: wengjianfeng <redacted>

Some labels are only used once, so we delete them and use the
return statement instead of the goto statement.

Signed-off-by: wengjianfeng <redacted>

[...]
Here is the summary with links:
  - [v2] nfc: st-nci: remove unnecessary labels
    https://git.kernel.org/netdev/net-next/c/c7a551b2e44a

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

Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help