diff mbox series

NFC: st95hf: remove unnecessary assignment and label

Message ID 20210525063801.11840-1-samirweng1979@163.com (mailing list archive)
State Changes Requested
Delegated to: Netdev Maintainers
Headers show
Series NFC: st95hf: remove unnecessary assignment and 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 success CCed 4 of 4 maintainers
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, 19 lines checked
netdev/build_allmodconfig_warn success Errors and warnings before: 0 this patch: 0
netdev/header_inline success Link

Commit Message

samirweng1979 May 25, 2021, 6:38 a.m. UTC
From: wengjianfeng <wengjianfeng@yulong.com>

In function st95hf_in_send_cmd, the variable rc is assigned then goto
error label, which just return rc, so we use return to replace it. and
error label only used once in the function, so we remove error label.

Signed-off-by: wengjianfeng <wengjianfeng@yulong.com>
---
 drivers/nfc/st95hf/core.c | 7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)

Comments

Krzysztof Kozlowski May 25, 2021, 11:38 a.m. UTC | #1
On 25/05/2021 02:38, samirweng1979 wrote:
> From: wengjianfeng <wengjianfeng@yulong.com>
> 
> In function st95hf_in_send_cmd, the variable rc is assigned then goto
> error label, which just return rc, so we use return to replace it. and

s/return/returns/
s/. and/. Since/ (don't start sentences with "and", neither with
lowercase letter).

> error label only used once in the function, so we remove error label.

With these fixes and subject prefix fix to "nfc" (lowercase):

Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@canonical.com>

Best regards,
Krzysztof
diff mbox series

Patch

diff --git a/drivers/nfc/st95hf/core.c b/drivers/nfc/st95hf/core.c
index 4578547..88924be 100644
--- a/drivers/nfc/st95hf/core.c
+++ b/drivers/nfc/st95hf/core.c
@@ -926,10 +926,8 @@  static int st95hf_in_send_cmd(struct nfc_digital_dev *ddev,
 	int len_data_to_tag = 0;
 
 	skb_resp = nfc_alloc_recv_skb(MAX_RESPONSE_BUFFER_SIZE, GFP_KERNEL);
-	if (!skb_resp) {
-		rc = -ENOMEM;
-		goto error;
-	}
+	if (!skb_resp)
+		return -ENOMEM;
 
 	switch (stcontext->current_rf_tech) {
 	case NFC_DIGITAL_RF_TECH_106A:
@@ -986,7 +984,6 @@  static int st95hf_in_send_cmd(struct nfc_digital_dev *ddev,
 
 free_skb_resp:
 	kfree_skb(skb_resp);
-error:
 	return rc;
 }