linux-mips.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH -next] MIPS: Alchemy: Use DEFINE_SPINLOCK() for spinlock
@ 2021-03-27  9:52 Chen Lifu
  2021-04-12 15:07 ` Thomas Bogendoerfer
  0 siblings, 1 reply; 2+ messages in thread
From: Chen Lifu @ 2021-03-27  9:52 UTC (permalink / raw)
  To: chenlifu, Thomas Bogendoerfer, Zhang Qilong
  Cc: heying24, yuehaibing, weiyongjun1, johnny.chenyi,
	linux-arm-kernel, linux-kernel, linux-mips, kernel-janitors

From: Lifu Chen <chenlifu@huawei.com>

spinlock can be initialized automatically with DEFINE_SPINLOCK()
rather than explicitly calling spin_lock_init().

Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: Lifu Chen <chenlifu@huawei.com>
---
 arch/mips/alchemy/common/clock.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/arch/mips/alchemy/common/clock.c b/arch/mips/alchemy/common/clock.c
index f0c830337104..c01be8c45271 100644
--- a/arch/mips/alchemy/common/clock.c
+++ b/arch/mips/alchemy/common/clock.c
@@ -111,7 +111,7 @@ static struct clk_aliastable {
 /* access locks to SYS_FREQCTRL0/1 and SYS_CLKSRC registers */
 static spinlock_t alchemy_clk_fg0_lock;
 static spinlock_t alchemy_clk_fg1_lock;
-static spinlock_t alchemy_clk_csrc_lock;
+static DEFINE_SPINLOCK(alchemy_clk_csrc_lock);
 
 /* CPU Core clock *****************************************************/
 
@@ -996,7 +996,6 @@ static int __init alchemy_clk_setup_imux(int ctype)
 	if (!a)
 		return -ENOMEM;
 
-	spin_lock_init(&alchemy_clk_csrc_lock);
 	ret = 0;
 
 	for (i = 0; i < 6; i++) {


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

* Re: [PATCH -next] MIPS: Alchemy: Use DEFINE_SPINLOCK() for spinlock
  2021-03-27  9:52 [PATCH -next] MIPS: Alchemy: Use DEFINE_SPINLOCK() for spinlock Chen Lifu
@ 2021-04-12 15:07 ` Thomas Bogendoerfer
  0 siblings, 0 replies; 2+ messages in thread
From: Thomas Bogendoerfer @ 2021-04-12 15:07 UTC (permalink / raw)
  To: Chen Lifu
  Cc: Zhang Qilong, heying24, yuehaibing, weiyongjun1, johnny.chenyi,
	linux-arm-kernel, linux-kernel, linux-mips, kernel-janitors

On Sat, Mar 27, 2021 at 05:52:25PM +0800, Chen Lifu wrote:
> From: Lifu Chen <chenlifu@huawei.com>
> 
> spinlock can be initialized automatically with DEFINE_SPINLOCK()
> rather than explicitly calling spin_lock_init().
> 
> Reported-by: Hulk Robot <hulkci@huawei.com>
> Signed-off-by: Lifu Chen <chenlifu@huawei.com>
> ---
>  arch/mips/alchemy/common/clock.c | 3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)

applied to mips-next.

Thomas.

-- 
Crap can work. Given enough thrust pigs will fly, but it's not necessarily a
good idea.                                                [ RFC1925, 2.3 ]

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

end of thread, other threads:[~2021-04-12 15:16 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-03-27  9:52 [PATCH -next] MIPS: Alchemy: Use DEFINE_SPINLOCK() for spinlock Chen Lifu
2021-04-12 15:07 ` Thomas Bogendoerfer

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