Received: by 2002:ac0:a594:0:0:0:0:0 with SMTP id m20-v6csp942896imm; Tue, 15 May 2018 11:24:37 -0700 (PDT) X-Google-Smtp-Source: AB8JxZpb7G9iyKK7HwQldgmHY8N4LNmlPYisp603if8a6G71EUtOX98Ds7Nn6qw7NKqUwOlH8shH X-Received: by 2002:a63:3c56:: with SMTP id i22-v6mr13169268pgn.309.1526408677109; Tue, 15 May 2018 11:24:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1526408677; cv=none; d=google.com; s=arc-20160816; b=rojCJaRl1S6vjlyWjSPxcwdctui/qjDooOCMhEKuXpSLBVtSXlAalvLrlK6ArnzZYC BLm/qwUq2ppGHYcRtOB/ASpIqBB63q6WlH8zbaeHy/27JTyV309+9+w9jO9e1j6UIh/x n5RbqsG7jAkMOExBbolsloYXJjq8ggWi2qz+UdQcmTzZbxSoiDQ/HYvhEATeoSKTm41+ nrpEqADchryNqDZf8W1mvBlVIVk/aqg3QlWQCc11ZxUFdlPmWcoFBhJ5STRBjomoS37n /piCx0Fbg6WLOxWjP4yj8/Vb1QUQWH+KS9n0l1XPRZAzAlM/wh6d6ppbzdcKWLV3HAwV 2hZA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:arc-authentication-results; bh=fjj/AJfwJ0i2r6vDc4sGHAEmtW6dcFNw5bzw15WG5m4=; b=RVsD2dVpUfd/Ez8ym1We1laynlHpZtisYlHCAsSPCgSYLUcVoEpovJxCTK5/Jswq1F gzSeyJtZRWJpTp+LUOoCekxG9tjKxIoxaPQUgjj75nTpoZW0f0LNt1Aa8HB7yJJd9uQy gAYRu0YwD2Sn39ZnJlOkmHOfj5/RXx5SXIdIvGPrRUPvlaaqU3xdLti8Hb73zRD9O4na QMRBvYIUZcotv1NyjsjxNKW7E9DXfa9Q/Dfv8sBPuLfBwvgk3siCjX7E4VC60yJOZ2EX e1IM9ZdBij5z3LU16wvRf2ndlpATm6lck7u11BoaVz0aB6eacUhm2HTUkmQDE7mCLiFj 7D3w== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id g3-v6si478113pgc.251.2018.05.15.11.24.22; Tue, 15 May 2018 11:24:37 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753391AbeEOSVX (ORCPT + 99 others); Tue, 15 May 2018 14:21:23 -0400 Received: from szxga07-in.huawei.com ([45.249.212.35]:59900 "EHLO huawei.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1752836AbeEOSVV (ORCPT ); Tue, 15 May 2018 14:21:21 -0400 Received: from DGGEMS403-HUB.china.huawei.com (unknown [172.30.72.59]) by Forcepoint Email with ESMTP id 20A21184560DA; Wed, 16 May 2018 02:21:17 +0800 (CST) Received: from S00293818-DELL1.china.huawei.com (10.202.227.234) by DGGEMS403-HUB.china.huawei.com (10.3.19.203) with Microsoft SMTP Server id 14.3.382.0; Wed, 16 May 2018 02:21:10 +0800 From: Salil Mehta To: CC: , , , , , , , Fuyun Liang Subject: [PATCH net-next 05/10] net: hns3: Change return type of hnae3_register_ae_algo Date: Tue, 15 May 2018 19:20:09 +0100 Message-ID: <20180515182014.42196-6-salil.mehta@huawei.com> X-Mailer: git-send-email 2.8.3 In-Reply-To: <20180515182014.42196-1-salil.mehta@huawei.com> References: <20180515182014.42196-1-salil.mehta@huawei.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.202.227.234] X-CFilter-Loop: Reflected Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Fuyun Liang The ae_algo is used by many ae_devs. It is not only belong to just a ae_dev. Initializing ae_dev failed does not represent registering ae_algo failed. Because the action of registering ae_algo just is adding ae_algo to the ae_algo list and it is always is true, it make no sense to define return type as int. This patch changes the return type of hnae3_register_ae_algo from int to void. Signed-off-by: Fuyun Liang Signed-off-by: Peng Li Signed-off-by: Salil Mehta --- drivers/net/ethernet/hisilicon/hns3/hnae3.c | 4 +--- drivers/net/ethernet/hisilicon/hns3/hnae3.h | 2 +- drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c | 4 +++- drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c | 4 +++- 4 files changed, 8 insertions(+), 6 deletions(-) diff --git a/drivers/net/ethernet/hisilicon/hns3/hnae3.c b/drivers/net/ethernet/hisilicon/hns3/hnae3.c index cb93295..3b1c396 100644 --- a/drivers/net/ethernet/hisilicon/hns3/hnae3.c +++ b/drivers/net/ethernet/hisilicon/hns3/hnae3.c @@ -121,7 +121,7 @@ EXPORT_SYMBOL(hnae3_unregister_client); * @ae_algo: AE algorithm * NOTE: the duplicated name will not be checked */ -int hnae3_register_ae_algo(struct hnae3_ae_algo *ae_algo) +void hnae3_register_ae_algo(struct hnae3_ae_algo *ae_algo) { const struct pci_device_id *id; struct hnae3_ae_dev *ae_dev; @@ -160,8 +160,6 @@ int hnae3_register_ae_algo(struct hnae3_ae_algo *ae_algo) } mutex_unlock(&hnae3_common_lock); - - return ret; } EXPORT_SYMBOL(hnae3_register_ae_algo); diff --git a/drivers/net/ethernet/hisilicon/hns3/hnae3.h b/drivers/net/ethernet/hisilicon/hns3/hnae3.h index ea6e6ea..2f266ef 100644 --- a/drivers/net/ethernet/hisilicon/hns3/hnae3.h +++ b/drivers/net/ethernet/hisilicon/hns3/hnae3.h @@ -519,7 +519,7 @@ void hnae3_register_ae_dev(struct hnae3_ae_dev *ae_dev); void hnae3_unregister_ae_dev(struct hnae3_ae_dev *ae_dev); void hnae3_unregister_ae_algo(struct hnae3_ae_algo *ae_algo); -int hnae3_register_ae_algo(struct hnae3_ae_algo *ae_algo); +void hnae3_register_ae_algo(struct hnae3_ae_algo *ae_algo); void hnae3_unregister_client(struct hnae3_client *client); int hnae3_register_client(struct hnae3_client *client); diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c index c2501b1..d060903 100644 --- a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c +++ b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c @@ -6250,7 +6250,9 @@ static int hclge_init(void) { pr_info("%s is initializing\n", HCLGE_NAME); - return hnae3_register_ae_algo(&ae_algo); + hnae3_register_ae_algo(&ae_algo); + + return 0; } static void hclge_exit(void) diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c b/drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c index b7578c6..f1f4a17 100644 --- a/drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c +++ b/drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c @@ -1852,7 +1852,9 @@ static int hclgevf_init(void) { pr_info("%s is initializing\n", HCLGEVF_NAME); - return hnae3_register_ae_algo(&ae_algovf); + hnae3_register_ae_algo(&ae_algovf); + + return 0; } static void hclgevf_exit(void) -- 2.7.4