]> git.baikalelectronics.ru Git - kernel.git/commitdiff
nfc: st95hf: remove unnecessary assignment and label
authorwengjianfeng <wengjianfeng@yulong.com>
Wed, 26 May 2021 00:56:51 +0000 (08:56 +0800)
committerJakub Kicinski <kuba@kernel.org>
Wed, 26 May 2021 20:09:56 +0000 (13:09 -0700)
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>
drivers/nfc/st95hf/core.c

index 4578547659839983dfbbe9491374b641a1d36880..88924be8decb629490d858c25bb823bbcfd052eb 100644 (file)
@@ -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;
 }