[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <5980dba5-1323-e08b-252c-8d5365584db6@huawei.com>
Date: Thu, 10 Nov 2022 10:00:29 +0800
From: Yuan Can <yuancan@...wei.com>
To: Francois Romieu <romieu@...zoreil.com>
CC: <davem@...emloft.net>, <edumazet@...gle.com>, <kuba@...nel.org>,
<pabeni@...hat.com>, <mqaio@...ux.alibaba.com>,
<shaozhengchao@...wei.com>, <christophe.jaillet@...adoo.fr>,
<gustavoars@...nel.org>, <luobin9@...wei.com>,
<netdev@...r.kernel.org>
Subject: Re: [PATCH] net: hinic: Fix error handling in hinic_module_init()
在 2022/11/10 1:56, Francois Romieu 写道:
> Yuan Can <yuancan@...wei.com> :
> [...]
>> diff --git a/drivers/net/ethernet/huawei/hinic/hinic_main.c b/drivers/net/ethernet/huawei/hinic/hinic_main.c
>> index e1f54a2f28b2..b2fcd83d58fa 100644
>> --- a/drivers/net/ethernet/huawei/hinic/hinic_main.c
>> +++ b/drivers/net/ethernet/huawei/hinic/hinic_main.c
>> @@ -1474,8 +1474,17 @@ static struct pci_driver hinic_driver = {
>>
>> static int __init hinic_module_init(void)
>> {
>> + int ret;
>> +
>> hinic_dbg_register_debugfs(HINIC_DRV_NAME);
>> - return pci_register_driver(&hinic_driver);
>> +
>> + ret = pci_register_driver(&hinic_driver);
>> + if (ret) {
>> + hinic_dbg_unregister_debugfs();
>> + return ret;
>> + }
>> +
>> + return 0;
>> }
> You can remove some fat:
>
> ret = pci_register_driver(&hinic_driver);
> if (ret)
> hinic_dbg_unregister_debugfs();
>
> return ret;
Thanks for the suggestion! I will change to this style.
--
Best regards,
Yuan Can
Powered by blists - more mailing lists