Received: by 2002:a05:6358:5282:b0:b5:90e7:25cb with SMTP id g2csp3093464rwa; Mon, 22 Aug 2022 21:22:38 -0700 (PDT) X-Google-Smtp-Source: AA6agR6rx04OhRxvXmEepjqpzlDrRUT96IwkdXvMeJ70ENAGyYv14VEEc2A3GuQ4XdGv/PecD/ut X-Received: by 2002:a63:e412:0:b0:41d:9c6a:7e with SMTP id a18-20020a63e412000000b0041d9c6a007emr19508299pgi.575.1661228558293; Mon, 22 Aug 2022 21:22:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1661228558; cv=none; d=google.com; s=arc-20160816; b=TMrjyzuQeGK/H/5NtieuLDz6rbhW9byLSoQCxLvsQhV6AlnRIYjoleuF0Zyi2yfFfO fXDLflxlKh+a0XsW+WKB+g0Ze6G4RIST4vPdJTyTkF1fGJ1CyZ5sqp56vislhiFS9e+G FThm6oY+Xe6F7tlYbLa/cPXEUQVrDe0gCVKTbKcIOkeUmSIomAX3no+Y0nY6NnwdadJ0 WN/2ZcsUQfaRssROV6jidXEuNg0eiCmzeCwRkZadHQAbxEf9PX7PU/8HfPT56Xhx4kOI O42Fu4sF7nwmJp+v2Q7Iu9apgnSZZOhnhdmLmOmhdRQnw4Hu9RxTR5Uo8xLqQUeswy7l 1vNQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:message-id:date:subject:cc:to:from; bh=+Pzj4KtXgEVyUvpvyvFGGbNIbfNSRYT32fCVwcySZh8=; b=gACbcWodY6c2/1gWBDc0kLRrePw1ZZ0KDKQy8m5zgNx5DfZ0d1xpu/9pXLUMnSuCj/ SoMhbJfKvKNstA9XKzl2i0YucG/djWdmjpRYPIydwXvqhNFpbbGB1bqYfiHvn2NWe4W7 VMPzhH7Fxj5v1jSYr6ErWTMHukXbOFtcS96NGllHjRWpML0xuOMQGM+uGeiKNwzjLRG5 b1XoP8flGu6ozIiPXqVDYXVSJq8J77aVPgg3RVp3/t0LV5n2v55fJFp92+kVDTcucqM0 MXZf3GNOfhTSlNPnPrppObH7ue8MJdBRJV+dQnxaqjABT5SKreEx4uqX1l+3HDX4MpZ5 LpOA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id nb17-20020a17090b35d100b001fb05ee5d16si7192686pjb.99.2022.08.22.21.22.26; Mon, 22 Aug 2022 21:22:38 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240184AbiHWDlW (ORCPT + 99 others); Mon, 22 Aug 2022 23:41:22 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37048 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234003AbiHWDlT (ORCPT ); Mon, 22 Aug 2022 23:41:19 -0400 Received: from mail.nfschina.com (unknown [IPv6:2400:dd01:100f:2:72e2:84ff:fe10:5f45]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 661475B058; Mon, 22 Aug 2022 20:41:18 -0700 (PDT) Received: from localhost (unknown [127.0.0.1]) by mail.nfschina.com (Postfix) with ESMTP id E37A61E80CE3; Tue, 23 Aug 2022 11:37:30 +0800 (CST) X-Virus-Scanned: amavisd-new at test.com Received: from mail.nfschina.com ([127.0.0.1]) by localhost (mail.nfschina.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id m13xGaTeu_Iz; Tue, 23 Aug 2022 11:37:28 +0800 (CST) Received: from localhost.localdomain (unknown [219.141.250.2]) (Authenticated sender: zhoujie@nfschina.com) by mail.nfschina.com (Postfix) with ESMTPA id 248401E80CBF; Tue, 23 Aug 2022 11:37:28 +0800 (CST) From: Zhou jie To: marcel@holtmann.org, johan.hedberg@gmail.com, luiz.dentz@gmail.com Cc: linux-bluetooth@vger.kernel.org, linux-kernel@vger.kernel.org, Zhou jie Subject: [PATCH] bluetooth/btbcm: Remove goto in btbcm_patchram function Date: Tue, 23 Aug 2022 11:41:10 +0800 Message-Id: <20220823034110.8295-1-zhoujie@nfschina.com> X-Mailer: git-send-email 2.18.2 X-Spam-Status: No, score=-1.1 required=5.0 tests=BAYES_00,RDNS_NONE, SPF_HELO_NONE,SPF_NONE,T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Remove the goto statement in the btbcm_patchram function to optimize program execution efficiency. Signed-off-by: Zhou jie --- drivers/bluetooth/btbcm.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/drivers/bluetooth/btbcm.c b/drivers/bluetooth/btbcm.c index d9ceca7a7935..60827593ba36 100644 --- a/drivers/bluetooth/btbcm.c +++ b/drivers/bluetooth/btbcm.c @@ -175,7 +175,7 @@ int btbcm_patchram(struct hci_dev *hdev, const struct firmware *fw) err = PTR_ERR(skb); bt_dev_err(hdev, "BCM: Download Minidrv command failed (%d)", err); - goto done; + return err; } kfree_skb(skb); @@ -194,8 +194,7 @@ int btbcm_patchram(struct hci_dev *hdev, const struct firmware *fw) if (fw_size < cmd->plen) { bt_dev_err(hdev, "BCM: Patch is corrupted"); - err = -EINVAL; - goto done; + return -EINVAL; } cmd_param = fw_ptr; @@ -210,7 +209,7 @@ int btbcm_patchram(struct hci_dev *hdev, const struct firmware *fw) err = PTR_ERR(skb); bt_dev_err(hdev, "BCM: Patch command %04x failed (%d)", opcode, err); - goto done; + return err; } kfree_skb(skb); } @@ -218,7 +217,6 @@ int btbcm_patchram(struct hci_dev *hdev, const struct firmware *fw) /* 250 msec delay after Launch Ram completes */ msleep(250); -done: return err; } EXPORT_SYMBOL(btbcm_patchram); -- 2.18.2