linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Re: [PATCH 02/12] net: hns3: Destroy a mutex after initialisation failure in hclge_init_ad_dev()
@ 2020-05-28 18:42 Markus Elfring
  2020-05-29  1:56 ` tanhuazhong
  0 siblings, 1 reply; 4+ messages in thread
From: Markus Elfring @ 2020-05-28 18:42 UTC (permalink / raw)
  To: Huazhong Tan, netdev
  Cc: linux-kernel, linuxarm, David S. Miller, Jakub Kicinski,
	Salil Mehta, Yisen Zhuang

> Add a mutex destroy call in hclge_init_ae_dev() when fails.

How do you think about a wording variant like the following?

   Change description:
   The function “mutex_init” was called before a call of
   the function “hclge_pci_init”.
   But the function “mutex_destroy” was not called after initialisation
   steps failed.
   Thus add the missed function call for the completion of
   the exception handling.


Would you like to add the tag “Fixes” to the commit message?


…
> +++ b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c
> @@ -10108,6 +10108,7 @@ static int hclge_init_ae_dev(struct hnae3_ae_dev *ae_dev)
>  	pci_release_regions(pdev);
>  	pci_disable_device(pdev);
>  out:
> +	mutex_destroy(&hdev->vport_lock);
>  	return ret;
>  }

How do you think about to use the label “destroy_mutex” instead?

Regards,
Markus

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH 02/12] net: hns3: Destroy a mutex after initialisation failure in hclge_init_ad_dev()
  2020-05-28 18:42 [PATCH 02/12] net: hns3: Destroy a mutex after initialisation failure in hclge_init_ad_dev() Markus Elfring
@ 2020-05-29  1:56 ` tanhuazhong
  2020-05-29  5:04   ` [02/12] net: hns3: Destroy a mutex after initialisation failure in hclge_init_ae_dev() Markus Elfring
  2020-05-29  9:00   ` Markus Elfring
  0 siblings, 2 replies; 4+ messages in thread
From: tanhuazhong @ 2020-05-29  1:56 UTC (permalink / raw)
  To: Markus Elfring, netdev
  Cc: linux-kernel, linuxarm, David S. Miller, Jakub Kicinski,
	Salil Mehta, Yisen Zhuang



On 2020/5/29 2:42, Markus Elfring wrote:
>> Add a mutex destroy call in hclge_init_ae_dev() when fails.
> 
> How do you think about a wording variant like the following?
> 
>     Change description:
>     The function “mutex_init” was called before a call of
>     the function “hclge_pci_init”.
>     But the function “mutex_destroy” was not called after initialisation
>     steps failed.
>     Thus add the missed function call for the completion of
>     the exception handling.
> 

It looks better. I will try to improve the skill of patch description
and make as many as people can understand the patch.

Thanks for help.

> 
> Would you like to add the tag “Fixes” to the commit message?
> 

Since it seems not a very urgent issue, so i send it to the -next
and make it as a code optimization.

Thanks:)

> 
> …
>> +++ b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c
>> @@ -10108,6 +10108,7 @@ static int hclge_init_ae_dev(struct hnae3_ae_dev *ae_dev)
>>   	pci_release_regions(pdev);
>>   	pci_disable_device(pdev);
>>   out:
>> +	mutex_destroy(&hdev->vport_lock);
>>   	return ret;
>>   }
> 
> How do you think about to use the label “destroy_mutex” instead?

Will use label 'destroy_mutex‘ instead if there is another patch need to 
modify this code, which is more readable.

Thanks for your comments.

> 
> Regards,
> Markus
> 
> 


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [02/12] net: hns3: Destroy a mutex after initialisation failure in hclge_init_ae_dev()
  2020-05-29  1:56 ` tanhuazhong
@ 2020-05-29  5:04   ` Markus Elfring
  2020-05-29  9:00   ` Markus Elfring
  1 sibling, 0 replies; 4+ messages in thread
From: Markus Elfring @ 2020-05-29  5:04 UTC (permalink / raw)
  To: Huazhong Tan, netdev
  Cc: linux-kernel, linuxarm, David S. Miller, Jakub Kicinski,
	Salil Mehta, Yisen Zhuang

>>> Add a mutex destroy call in hclge_init_ae_dev() when fails.
>>
>> How do you think about a wording variant like the following?
> It looks better. I will try to improve the skill of patch description
> and make as many as people can understand the patch.

Thanks for your positive feedback.

I suggest to avoid also a typo in the function name of the patch subject.

Regards,
Markus

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [02/12] net: hns3: Destroy a mutex after initialisation failure in hclge_init_ae_dev()
  2020-05-29  1:56 ` tanhuazhong
  2020-05-29  5:04   ` [02/12] net: hns3: Destroy a mutex after initialisation failure in hclge_init_ae_dev() Markus Elfring
@ 2020-05-29  9:00   ` Markus Elfring
  1 sibling, 0 replies; 4+ messages in thread
From: Markus Elfring @ 2020-05-29  9:00 UTC (permalink / raw)
  To: Huazhong Tan, netdev
  Cc: linux-kernel, linuxarm, David S. Miller, Jakub Kicinski,
	Salil Mehta, Yisen Zhuang

>> Would you like to add the tag “Fixes” to the commit message?
>
> Since it seems not a very urgent issue, so i send it to the -next

I suggest to take another look at the prioritisation for another
completion of the exception handling.


> and make it as a code optimization.

I propose to reconsider also such a view.

Regards,
Markus

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2020-05-29  9:00 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-05-28 18:42 [PATCH 02/12] net: hns3: Destroy a mutex after initialisation failure in hclge_init_ad_dev() Markus Elfring
2020-05-29  1:56 ` tanhuazhong
2020-05-29  5:04   ` [02/12] net: hns3: Destroy a mutex after initialisation failure in hclge_init_ae_dev() Markus Elfring
2020-05-29  9:00   ` Markus Elfring

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).