Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 854cf33a authored by Fuyun Liang's avatar Fuyun Liang Committed by David S. Miller
Browse files

net: hns3: Change return type of hnae3_register_ae_algo



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: default avatarFuyun Liang <liangfuyun1@huawei.com>
Signed-off-by: default avatarPeng Li <lipeng321@huawei.com>
Signed-off-by: default avatarSalil Mehta <salil.mehta@huawei.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 50fbc237
Loading
Loading
Loading
Loading
+1 −3
Original line number Diff line number Diff line
@@ -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);

+1 −1
Original line number Diff line number Diff line
@@ -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);
+3 −1
Original line number Diff line number Diff line
@@ -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)
+3 −1
Original line number Diff line number Diff line
@@ -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)