diff mbox series

nfc: s3fwrn5: remove unnecessary label

Message ID 20210402121548.3260-1-samirweng1979@163.com (mailing list archive)
State Superseded
Delegated to: Netdev Maintainers
Headers show
Series nfc: s3fwrn5: remove unnecessary label | expand

Checks

Context Check Description
netdev/cover_letter success Link
netdev/fixes_present success Link
netdev/patch_count success Link
netdev/tree_selection success Guessed tree name to be net-next
netdev/subject_prefix warning Target tree name not specified in the subject
netdev/cc_maintainers warning 1 maintainers not CCed: krzk@kernel.org
netdev/source_inline success Was 0 now: 0
netdev/verify_signedoff success Link
netdev/module_param success Was 0 now: 0
netdev/build_32bit success Errors and warnings before: 0 this patch: 0
netdev/kdoc success Errors and warnings before: 0 this patch: 0
netdev/verify_fixes success Link
netdev/checkpatch success total: 0 errors, 0 warnings, 0 checks, 29 lines checked
netdev/build_allmodconfig_warn success Errors and warnings before: 0 this patch: 0
netdev/header_inline success Link

Commit Message

samirweng1979 April 2, 2021, 12:15 p.m. UTC
From: wengjianfeng <wengjianfeng@yulong.com>

In function s3fwrn5_nci_post_setup, The variable ret is assigned to 0,
then goto out label, but just return ret in out label, so we use
return 0 to replace it. and other goto sentences are similar, we use
return sentences to replace it and delete out label.

Signed-off-by: wengjianfeng <wengjianfeng@yulong.com>
---
 drivers/nfc/s3fwrn5/core.c | 12 ++++--------
 1 file changed, 4 insertions(+), 8 deletions(-)

Comments

Krzysztof Kozlowski April 2, 2021, 4:28 p.m. UTC | #1
On 02/04/2021 14:15, samirweng1979 wrote:
> From: wengjianfeng <wengjianfeng@yulong.com>
> 
> In function s3fwrn5_nci_post_setup, The variable ret is assigned to 0,
> then goto out label, but just return ret in out label, so we use
> return 0 to replace it. and other goto sentences are similar, we use
> return sentences to replace it and delete out label.

The message is difficult to understand - you created one long sentence
with mixing tenses and subjects. "The" starts capital in the middle of
sentence but "and" starts after full stop.

Please rephrase it.

The code itself looks ok.

Best regards,
Krzysztof
diff mbox series

Patch

diff --git a/drivers/nfc/s3fwrn5/core.c b/drivers/nfc/s3fwrn5/core.c
index c00b7a0..865d3e3 100644
--- a/drivers/nfc/s3fwrn5/core.c
+++ b/drivers/nfc/s3fwrn5/core.c
@@ -124,13 +124,12 @@  static int s3fwrn5_nci_post_setup(struct nci_dev *ndev)
 
 	if (s3fwrn5_firmware_init(info)) {
 		//skip bootloader mode
-		ret = 0;
-		goto out;
+		return 0;
 	}
 
 	ret = s3fwrn5_firmware_update(info);
 	if (ret < 0)
-		goto out;
+		return ret;
 
 	/* NCI core reset */
 
@@ -139,12 +138,9 @@  static int s3fwrn5_nci_post_setup(struct nci_dev *ndev)
 
 	ret = nci_core_reset(info->ndev);
 	if (ret < 0)
-		goto out;
-
-	ret = nci_core_init(info->ndev);
+		return ret;
 
-out:
-	return ret;
+	return nci_core_init(info->ndev);
 }
 
 static struct nci_ops s3fwrn5_nci_ops = {