[PATCH] nfc: st-nci: remove unnecessary assignment and label

Subsystems: nfc subsystem, the rest

STALE1900d

2 messages, 2 authors, 2021-05-24 · open the first message on its own page

[PATCH] nfc: st-nci: remove unnecessary assignment and label

From: samirweng1979 <hidden>
Date: 2021-05-24 02:12:53

From: wengjianfeng <redacted>

In function st_nci_hci_network_init, the variable r is assigned then
goto exit label, which just return r, so we use return to replace it.
and exit label only used once at here, so we remove exit label.

Signed-off-by: wengjianfeng <redacted>
---
 drivers/nfc/st-nci/se.c | 8 ++------
 1 file changed, 2 insertions(+), 6 deletions(-)
diff --git a/drivers/nfc/st-nci/se.c b/drivers/nfc/st-nci/se.c
index 1cba8f6..8657e02 100644
--- a/drivers/nfc/st-nci/se.c
+++ b/drivers/nfc/st-nci/se.c
@@ -534,10 +534,8 @@ static int st_nci_hci_network_init(struct nci_dev *ndev)
 	dest_params =
 		kzalloc(sizeof(struct core_conn_create_dest_spec_params) +
 			sizeof(struct dest_spec_params), GFP_KERNEL);
-	if (dest_params == NULL) {
-		r = -ENOMEM;
-		goto exit;
-	}
+	if (dest_params == NULL)
+		return -ENOMEM;
 
 	dest_params->type = NCI_DESTINATION_SPECIFIC_PARAM_NFCEE_TYPE;
 	dest_params->length = sizeof(struct dest_spec_params);
@@ -594,8 +592,6 @@ static int st_nci_hci_network_init(struct nci_dev *ndev)
 
 free_dest_params:
 	kfree(dest_params);
-
-exit:
 	return r;
 }
 
-- 
1.9.1

Re: [PATCH] nfc: st-nci: remove unnecessary assignment and label

From: patchwork-bot+netdevbpf@kernel.org
Date: 2021-05-24 20:20:17

Hello:

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

On Mon, 24 May 2021 10:11:23 +0800 you wrote:
From: wengjianfeng <redacted>

In function st_nci_hci_network_init, the variable r is assigned then
goto exit label, which just return r, so we use return to replace it.
and exit label only used once at here, so we remove exit label.

Signed-off-by: wengjianfeng <redacted>

[...]
Here is the summary with links:
  - nfc: st-nci: remove unnecessary assignment and label
    https://git.kernel.org/netdev/net-next/c/62f148d8dde6

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