lkml.org 
[lkml]   [2021]   [May]   [23]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH] nfc: st-nci: remove unnecessary assignment and label
Date
From: wengjianfeng <wengjianfeng@yulong.com>

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 <wengjianfeng@yulong.com>
---
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

\
 
 \ /
  Last update: 2021-05-24 04:13    [W:0.031 / U:0.032 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site