linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: samirweng1979 <samirweng1979@163.com>
To: krzysztof.kozlowski@canonical.com, davem@davemloft.net,
	dinghao.liu@zju.edu.cn
Cc: linux-nfc@lists.01.org, netdev@vger.kernel.org,
	linux-kernel@vger.kernel.org,
	wengjianfeng <wengjianfeng@yulong.com>
Subject: [PATCH] NFC: st95hf: remove unnecessary assignment and label
Date: Tue, 25 May 2021 14:38:01 +0800	[thread overview]
Message-ID: <20210525063801.11840-1-samirweng1979@163.com> (raw)

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(-)

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;
 }
 
-- 
1.9.1


             reply	other threads:[~2021-05-25  6:38 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-05-25  6:38 samirweng1979 [this message]
2021-05-25 11:38 ` [PATCH] NFC: st95hf: remove unnecessary assignment and label Krzysztof Kozlowski

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210525063801.11840-1-samirweng1979@163.com \
    --to=samirweng1979@163.com \
    --cc=davem@davemloft.net \
    --cc=dinghao.liu@zju.edu.cn \
    --cc=krzysztof.kozlowski@canonical.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-nfc@lists.01.org \
    --cc=netdev@vger.kernel.org \
    --cc=wengjianfeng@yulong.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).