linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH -next] gma500: Use DEFINE_SPINLOCK() for spinlock
@ 2021-04-06 11:55 Huang Guobin
  2021-04-08 11:20 ` Daniel Vetter
  0 siblings, 1 reply; 2+ messages in thread
From: Huang Guobin @ 2021-04-06 11:55 UTC (permalink / raw)
  To: huangguobin4, Patrik Jakobsson, David Airlie, Daniel Vetter
  Cc: dri-devel, linux-kernel, kernel-janitors

From: Guobin Huang <huangguobin4@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: Guobin Huang <huangguobin4@huawei.com>
---
 drivers/gpu/drm/gma500/power.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/gma500/power.c b/drivers/gpu/drm/gma500/power.c
index 56ef88237ef6..f07641dfa5a4 100644
--- a/drivers/gpu/drm/gma500/power.c
+++ b/drivers/gpu/drm/gma500/power.c
@@ -36,7 +36,7 @@
 #include <linux/pm_runtime.h>
 
 static struct mutex power_mutex;	/* Serialize power ops */
-static spinlock_t power_ctrl_lock;	/* Serialize power claim */
+static DEFINE_SPINLOCK(power_ctrl_lock);	/* Serialize power claim */
 
 /**
  *	gma_power_init		-	initialise power manager
@@ -55,7 +55,6 @@ void gma_power_init(struct drm_device *dev)
 	dev_priv->display_power = true;	/* We start active */
 	dev_priv->display_count = 0;	/* Currently no users */
 	dev_priv->suspended = false;	/* And not suspended */
-	spin_lock_init(&power_ctrl_lock);
 	mutex_init(&power_mutex);
 
 	if (dev_priv->ops->init_pm)


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

* Re: [PATCH -next] gma500: Use DEFINE_SPINLOCK() for spinlock
  2021-04-06 11:55 [PATCH -next] gma500: Use DEFINE_SPINLOCK() for spinlock Huang Guobin
@ 2021-04-08 11:20 ` Daniel Vetter
  0 siblings, 0 replies; 2+ messages in thread
From: Daniel Vetter @ 2021-04-08 11:20 UTC (permalink / raw)
  To: Huang Guobin
  Cc: Patrik Jakobsson, David Airlie, Daniel Vetter, dri-devel,
	linux-kernel, kernel-janitors

On Tue, Apr 06, 2021 at 07:55:14PM +0800, Huang Guobin wrote:
> From: Guobin Huang <huangguobin4@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: Guobin Huang <huangguobin4@huawei.com>

Applied to drm-misc-next, thanks for your patch.
-Daniel

> ---
>  drivers/gpu/drm/gma500/power.c | 3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)
> 
> diff --git a/drivers/gpu/drm/gma500/power.c b/drivers/gpu/drm/gma500/power.c
> index 56ef88237ef6..f07641dfa5a4 100644
> --- a/drivers/gpu/drm/gma500/power.c
> +++ b/drivers/gpu/drm/gma500/power.c
> @@ -36,7 +36,7 @@
>  #include <linux/pm_runtime.h>
>  
>  static struct mutex power_mutex;	/* Serialize power ops */
> -static spinlock_t power_ctrl_lock;	/* Serialize power claim */
> +static DEFINE_SPINLOCK(power_ctrl_lock);	/* Serialize power claim */
>  
>  /**
>   *	gma_power_init		-	initialise power manager
> @@ -55,7 +55,6 @@ void gma_power_init(struct drm_device *dev)
>  	dev_priv->display_power = true;	/* We start active */
>  	dev_priv->display_count = 0;	/* Currently no users */
>  	dev_priv->suspended = false;	/* And not suspended */
> -	spin_lock_init(&power_ctrl_lock);
>  	mutex_init(&power_mutex);
>  
>  	if (dev_priv->ops->init_pm)
> 

-- 
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch

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

end of thread, other threads:[~2021-04-08 11:20 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-04-06 11:55 [PATCH -next] gma500: Use DEFINE_SPINLOCK() for spinlock Huang Guobin
2021-04-08 11:20 ` Daniel Vetter

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