summaryrefslogtreecommitdiff
path: root/drivers/nfc/st95hf
diff options
context:
space:
mode:
authorwengjianfeng <wengjianfeng@yulong.com>2021-05-26 03:56:51 +0300
committerJakub Kicinski <kuba@kernel.org>2021-05-26 23:09:56 +0300
commit568e7142a15f821867a39797f5b098070df4a9c8 (patch)
tree0964f5b8d3837cacf8ce0bf71c44304c5ba288f9 /drivers/nfc/st95hf
parente4e92ee78702b13ad55118d8b66f06e1aef62586 (diff)
downloadlinux-568e7142a15f821867a39797f5b098070df4a9c8.tar.xz
nfc: st95hf: remove unnecessary assignment and label
In function st95hf_in_send_cmd, the variable rc is assigned then goto error label, which just returns rc, so we use return to replace it. Since error label only used once in the function, so we remove error label. Signed-off-by: wengjianfeng <wengjianfeng@yulong.com> Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@canonical.com> Link: https://lore.kernel.org/r/20210526005651.12652-1-samirweng1979@163.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Diffstat (limited to 'drivers/nfc/st95hf')
-rw-r--r--drivers/nfc/st95hf/core.c7
1 files changed, 2 insertions, 5 deletions
diff --git a/drivers/nfc/st95hf/core.c b/drivers/nfc/st95hf/core.c
index 457854765983..88924be8decb 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;
}