LKML Archive on lore.kernel.org help / color / mirror / Atom feed
From: Salil Mehta <salil.mehta@huawei.com> To: <davem@davemloft.net> Cc: <salil.mehta@huawei.com>, <yisen.zhuang@huawei.com>, <lipeng321@huawei.com>, <mehta.salil@opnsrc.net>, <netdev@vger.kernel.org>, <linux-kernel@vger.kernel.org>, <linuxarm@huawei.com>, Fuyun Liang <liangfuyun1@huawei.com> 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 [thread overview] Message-ID: <20180515182014.42196-6-salil.mehta@huawei.com> (raw) In-Reply-To: <20180515182014.42196-1-salil.mehta@huawei.com> From: Fuyun Liang <liangfuyun1@huawei.com> 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 <liangfuyun1@huawei.com> Signed-off-by: Peng Li <lipeng321@huawei.com> Signed-off-by: Salil Mehta <salil.mehta@huawei.com> --- 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
next prev parent reply other threads:[~2018-05-15 18:21 UTC|newest] Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top 2018-05-15 18:20 [PATCH net-next 00/10] Misc. Bug Fixes and clean-ups for HNS3 Driver Salil Mehta 2018-05-15 18:20 ` [PATCH net-next 01/10] net: hns3: Fix for deadlock problem occurring when unregistering ae_algo Salil Mehta 2018-05-15 18:20 ` [PATCH net-next 02/10] net: hns3: Fix for the null pointer problem occurring when initializing ae_dev failed Salil Mehta 2018-05-15 18:20 ` [PATCH net-next 03/10] net: hns3: Add a check for client instance init state Salil Mehta 2018-05-15 18:20 ` [PATCH net-next 04/10] net: hns3: Change return type of hnae3_register_ae_dev Salil Mehta 2018-05-15 18:20 ` Salil Mehta [this message] 2018-05-15 18:20 ` [PATCH net-next 06/10] net: hns3: Change return value in hnae3_register_client Salil Mehta 2018-05-15 18:20 ` [PATCH net-next 07/10] net: hns3: Fixes the back pressure setting When sriov is enabled Salil Mehta 2018-05-15 18:20 ` [PATCH net-next 08/10] net: hns3: Fix for fiber link up problem Salil Mehta 2018-05-15 18:20 ` [PATCH net-next 09/10] net: hns3: Add support of .sriov_configure in HNS3 driver Salil Mehta 2018-05-16 19:47 ` kbuild test robot 2018-05-16 19:47 ` [RFC PATCH] net: hns3: hns3_pci_sriov_configure() can be static kbuild test robot 2018-05-15 18:20 ` [PATCH net-next 10/10] net: hns3: Fixes the missing PCI iounmap for various legs Salil Mehta 2018-05-16 15:33 ` [PATCH net-next 00/10] Misc. Bug Fixes and clean-ups for HNS3 Driver David Miller
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=20180515182014.42196-6-salil.mehta@huawei.com \ --to=salil.mehta@huawei.com \ --cc=davem@davemloft.net \ --cc=liangfuyun1@huawei.com \ --cc=linux-kernel@vger.kernel.org \ --cc=linuxarm@huawei.com \ --cc=lipeng321@huawei.com \ --cc=mehta.salil@opnsrc.net \ --cc=netdev@vger.kernel.org \ --cc=yisen.zhuang@huawei.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: linkBe 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).