All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2 -next] intel: iwlwifi: use DEFINE_MUTEX() for mutex lock
@ 2020-12-24 13:25 Zheng Yongjun
  2021-03-23  9:19 ` Coelho, Luciano
  0 siblings, 1 reply; 2+ messages in thread
From: Zheng Yongjun @ 2020-12-24 13:25 UTC (permalink / raw)
  To: kvalo, davem, kuba, linux-wireless, netdev, linux-kernel
  Cc: luciano.coelho, Zheng Yongjun

mutex lock can be initialized automatically with DEFINE_MUTEX()
rather than explicitly calling mutex_init().

Signed-off-by: Zheng Yongjun <zhengyongjun3@huawei.com>
---
 drivers/net/wireless/intel/iwlwifi/iwl-drv.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/drivers/net/wireless/intel/iwlwifi/iwl-drv.c b/drivers/net/wireless/intel/iwlwifi/iwl-drv.c
index 9dcd2e990c9c..71119044382f 100644
--- a/drivers/net/wireless/intel/iwlwifi/iwl-drv.c
+++ b/drivers/net/wireless/intel/iwlwifi/iwl-drv.c
@@ -133,7 +133,7 @@ enum {
 };
 
 /* Protects the table contents, i.e. the ops pointer & drv list */
-static struct mutex iwlwifi_opmode_table_mtx;
+static DEFINE_MUTEX(iwlwifi_opmode_table_mtx);
 static struct iwlwifi_opmode_table {
 	const char *name;			/* name: iwldvm, iwlmvm, etc */
 	const struct iwl_op_mode_ops *ops;	/* pointer to op_mode ops */
@@ -1786,8 +1786,6 @@ static int __init iwl_drv_init(void)
 {
 	int i, err;
 
-	mutex_init(&iwlwifi_opmode_table_mtx);
-
 	for (i = 0; i < ARRAY_SIZE(iwlwifi_opmode_table); i++)
 		INIT_LIST_HEAD(&iwlwifi_opmode_table[i].drv);
 
-- 
2.22.0


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

* Re: [PATCH v2 -next] intel: iwlwifi: use DEFINE_MUTEX() for mutex lock
  2020-12-24 13:25 [PATCH v2 -next] intel: iwlwifi: use DEFINE_MUTEX() for mutex lock Zheng Yongjun
@ 2021-03-23  9:19 ` Coelho, Luciano
  0 siblings, 0 replies; 2+ messages in thread
From: Coelho, Luciano @ 2021-03-23  9:19 UTC (permalink / raw)
  To: zhengyongjun3, linux-wireless, netdev, kvalo, davem, linux-kernel, kuba

On Thu, 2020-12-24 at 21:25 +0800, Zheng Yongjun wrote:
> mutex lock can be initialized automatically with DEFINE_MUTEX()
> rather than explicitly calling mutex_init().
> 
> Signed-off-by: Zheng Yongjun <zhengyongjun3@huawei.com>
> ---

Thanks! I have now applied this internally and it will reach the
mainline following our usual process.

--
Cheers,
Luca.

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

end of thread, other threads:[~2021-03-23  9:20 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-12-24 13:25 [PATCH v2 -next] intel: iwlwifi: use DEFINE_MUTEX() for mutex lock Zheng Yongjun
2021-03-23  9:19 ` Coelho, Luciano

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.