net: hns3: Change return type of hnae3_register_ae_algo
authorFuyun Liang <liangfuyun1@huawei.com>
Tue, 15 May 2018 18:20:09 +0000 (19:20 +0100)
committerDavid S. Miller <davem@davemloft.net>
Wed, 16 May 2018 15:33:07 +0000 (11:33 -0400)
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>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/hisilicon/hns3/hnae3.c
drivers/net/ethernet/hisilicon/hns3/hnae3.h
drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c
drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c

index cb93295c9f629152bbc76fe0377ffa7ee1e71bd6..3b1c3966b7d4643d948260dea70e7f28c8c452c8 100644 (file)
@@ -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);
 
index ea6e6ead28a1e86635b5ac753e4d1faeb5a4375f..2f266ef9658259404dfebfabb9d3aae4a2e7144f 100644 (file)
@@ -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);
index c2501b1ec8196cc5d574879462e363fde7db4077..d060903f47e003af38c6355e7ed998dc0da858c5 100644 (file)
@@ -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)
index b7578c695d1c27fc20889054a8a7ddcde9c795ca..f1f4a17340a514ed5eca3383f8893d219c3c446f 100644 (file)
@@ -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)