All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] drm/radeon: Make use of the helper macro SET_RUNTIME_PM_OPS()
@ 2021-08-28  8:50 Cai Huoqing
  2021-08-30 12:21 ` Alex Deucher
  2021-08-30 12:51 ` Christian König
  0 siblings, 2 replies; 4+ messages in thread
From: Cai Huoqing @ 2021-08-28  8:50 UTC (permalink / raw)
  To: alexander.deucher, christian.koenig, Xinhui.Pan, airlied, daniel
  Cc: amd-gfx, dri-devel, Cai Huoqing

Use the helper macro SET_RUNTIME_PM_OPS() instead of the verbose
operators ".runtime_suspend/.runtime_resume/.runtime_idle", because
the SET_RUNTIME_PM_OPS() is a nice helper macro that could be brought
in to make code a little clearer, a little more concise.

Signed-off-by: Cai Huoqing <caihuoqing@baidu.com>
---
 drivers/gpu/drm/radeon/radeon_drv.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/drivers/gpu/drm/radeon/radeon_drv.c b/drivers/gpu/drm/radeon/radeon_drv.c
index b74cebca1f89..c2eb725e87f6 100644
--- a/drivers/gpu/drm/radeon/radeon_drv.c
+++ b/drivers/gpu/drm/radeon/radeon_drv.c
@@ -529,15 +529,14 @@ static long radeon_kms_compat_ioctl(struct file *filp, unsigned int cmd, unsigne
 #endif
 
 static const struct dev_pm_ops radeon_pm_ops = {
+	SET_RUNTIME_PM_OPS(radeon_pmops_runtime_suspend,
+			   radeon_pmops_runtime_resume, radeon_pmops_runtime_idle)
 	.suspend = radeon_pmops_suspend,
 	.resume = radeon_pmops_resume,
 	.freeze = radeon_pmops_freeze,
 	.thaw = radeon_pmops_thaw,
 	.poweroff = radeon_pmops_freeze,
 	.restore = radeon_pmops_resume,
-	.runtime_suspend = radeon_pmops_runtime_suspend,
-	.runtime_resume = radeon_pmops_runtime_resume,
-	.runtime_idle = radeon_pmops_runtime_idle,
 };
 
 static const struct file_operations radeon_driver_kms_fops = {
-- 
2.25.1


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

* Re: [PATCH] drm/radeon: Make use of the helper macro SET_RUNTIME_PM_OPS()
  2021-08-28  8:50 [PATCH] drm/radeon: Make use of the helper macro SET_RUNTIME_PM_OPS() Cai Huoqing
@ 2021-08-30 12:21 ` Alex Deucher
  2021-08-30 12:44   ` Cai Huoqing
  2021-08-30 12:51 ` Christian König
  1 sibling, 1 reply; 4+ messages in thread
From: Alex Deucher @ 2021-08-30 12:21 UTC (permalink / raw)
  To: Cai Huoqing
  Cc: Deucher, Alexander, Christian Koenig, xinhui pan, Dave Airlie,
	Daniel Vetter, amd-gfx list, Maling list - DRI developers

On Sat, Aug 28, 2021 at 4:51 AM Cai Huoqing <caihuoqing@baidu.com> wrote:
>
> Use the helper macro SET_RUNTIME_PM_OPS() instead of the verbose
> operators ".runtime_suspend/.runtime_resume/.runtime_idle", because
> the SET_RUNTIME_PM_OPS() is a nice helper macro that could be brought
> in to make code a little clearer, a little more concise.

I don't personally think it really helps readability.  Just seems to
be code churn.

Alex


>
> Signed-off-by: Cai Huoqing <caihuoqing@baidu.com>
> ---
>  drivers/gpu/drm/radeon/radeon_drv.c | 5 ++---
>  1 file changed, 2 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/gpu/drm/radeon/radeon_drv.c b/drivers/gpu/drm/radeon/radeon_drv.c
> index b74cebca1f89..c2eb725e87f6 100644
> --- a/drivers/gpu/drm/radeon/radeon_drv.c
> +++ b/drivers/gpu/drm/radeon/radeon_drv.c
> @@ -529,15 +529,14 @@ static long radeon_kms_compat_ioctl(struct file *filp, unsigned int cmd, unsigne
>  #endif
>
>  static const struct dev_pm_ops radeon_pm_ops = {
> +       SET_RUNTIME_PM_OPS(radeon_pmops_runtime_suspend,
> +                          radeon_pmops_runtime_resume, radeon_pmops_runtime_idle)
>         .suspend = radeon_pmops_suspend,
>         .resume = radeon_pmops_resume,
>         .freeze = radeon_pmops_freeze,
>         .thaw = radeon_pmops_thaw,
>         .poweroff = radeon_pmops_freeze,
>         .restore = radeon_pmops_resume,
> -       .runtime_suspend = radeon_pmops_runtime_suspend,
> -       .runtime_resume = radeon_pmops_runtime_resume,
> -       .runtime_idle = radeon_pmops_runtime_idle,
>  };
>
>  static const struct file_operations radeon_driver_kms_fops = {
> --
> 2.25.1
>

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

* Re: [PATCH] drm/radeon: Make use of the helper macro SET_RUNTIME_PM_OPS()
  2021-08-30 12:21 ` Alex Deucher
@ 2021-08-30 12:44   ` Cai Huoqing
  0 siblings, 0 replies; 4+ messages in thread
From: Cai Huoqing @ 2021-08-30 12:44 UTC (permalink / raw)
  To: Alex Deucher
  Cc: alexander.deucher, christian.koenig, Xinhui.Pan, airlied, daniel,
	amd-gfx, dri-devel

On 30 Aug 21 08:21:52, Alex Deucher wrote:
> On Sat, Aug 28, 2021 at 4:51 AM Cai Huoqing <caihuoqing@baidu.com> wrote:
> >
> > Use the helper macro SET_RUNTIME_PM_OPS() instead of the verbose
> > operators ".runtime_suspend/.runtime_resume/.runtime_idle", because
> > the SET_RUNTIME_PM_OPS() is a nice helper macro that could be brought
> > in to make code a little clearer, a little more concise.
> 
> I don't personally think it really helps readability.  Just seems to
> be code churn.
> 
> Alex
>
agree, just code churn, the macro seems to do it.

Cai
> 
> >
> > Signed-off-by: Cai Huoqing <caihuoqing@baidu.com>
> > ---
> >  drivers/gpu/drm/radeon/radeon_drv.c | 5 ++---
> >  1 file changed, 2 insertions(+), 3 deletions(-)
> >
> > diff --git a/drivers/gpu/drm/radeon/radeon_drv.c b/drivers/gpu/drm/radeon/radeon_drv.c
> > index b74cebca1f89..c2eb725e87f6 100644
> > --- a/drivers/gpu/drm/radeon/radeon_drv.c
> > +++ b/drivers/gpu/drm/radeon/radeon_drv.c
> > @@ -529,15 +529,14 @@ static long radeon_kms_compat_ioctl(struct file *filp, unsigned int cmd, unsigne
> >  #endif
> >
> >  static const struct dev_pm_ops radeon_pm_ops = {
> > +       SET_RUNTIME_PM_OPS(radeon_pmops_runtime_suspend,
> > +                          radeon_pmops_runtime_resume, radeon_pmops_runtime_idle)
> >         .suspend = radeon_pmops_suspend,
> >         .resume = radeon_pmops_resume,
> >         .freeze = radeon_pmops_freeze,
> >         .thaw = radeon_pmops_thaw,
> >         .poweroff = radeon_pmops_freeze,
> >         .restore = radeon_pmops_resume,
> > -       .runtime_suspend = radeon_pmops_runtime_suspend,
> > -       .runtime_resume = radeon_pmops_runtime_resume,
> > -       .runtime_idle = radeon_pmops_runtime_idle,
> >  };
> >
> >  static const struct file_operations radeon_driver_kms_fops = {
> > --
> > 2.25.1
> >

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

* Re: [PATCH] drm/radeon: Make use of the helper macro SET_RUNTIME_PM_OPS()
  2021-08-28  8:50 [PATCH] drm/radeon: Make use of the helper macro SET_RUNTIME_PM_OPS() Cai Huoqing
  2021-08-30 12:21 ` Alex Deucher
@ 2021-08-30 12:51 ` Christian König
  1 sibling, 0 replies; 4+ messages in thread
From: Christian König @ 2021-08-30 12:51 UTC (permalink / raw)
  To: Cai Huoqing, alexander.deucher, Xinhui.Pan, airlied, daniel
  Cc: amd-gfx, dri-devel

Am 28.08.21 um 10:50 schrieb Cai Huoqing:
> Use the helper macro SET_RUNTIME_PM_OPS() instead of the verbose
> operators ".runtime_suspend/.runtime_resume/.runtime_idle", because
> the SET_RUNTIME_PM_OPS() is a nice helper macro that could be brought
> in to make code a little clearer, a little more concise.

To be honest I don't think that this is cleaner at all.

Christian.

>
> Signed-off-by: Cai Huoqing <caihuoqing@baidu.com>
> ---
>   drivers/gpu/drm/radeon/radeon_drv.c | 5 ++---
>   1 file changed, 2 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/gpu/drm/radeon/radeon_drv.c b/drivers/gpu/drm/radeon/radeon_drv.c
> index b74cebca1f89..c2eb725e87f6 100644
> --- a/drivers/gpu/drm/radeon/radeon_drv.c
> +++ b/drivers/gpu/drm/radeon/radeon_drv.c
> @@ -529,15 +529,14 @@ static long radeon_kms_compat_ioctl(struct file *filp, unsigned int cmd, unsigne
>   #endif
>   
>   static const struct dev_pm_ops radeon_pm_ops = {
> +	SET_RUNTIME_PM_OPS(radeon_pmops_runtime_suspend,
> +			   radeon_pmops_runtime_resume, radeon_pmops_runtime_idle)
>   	.suspend = radeon_pmops_suspend,
>   	.resume = radeon_pmops_resume,
>   	.freeze = radeon_pmops_freeze,
>   	.thaw = radeon_pmops_thaw,
>   	.poweroff = radeon_pmops_freeze,
>   	.restore = radeon_pmops_resume,
> -	.runtime_suspend = radeon_pmops_runtime_suspend,
> -	.runtime_resume = radeon_pmops_runtime_resume,
> -	.runtime_idle = radeon_pmops_runtime_idle,
>   };
>   
>   static const struct file_operations radeon_driver_kms_fops = {


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

end of thread, other threads:[~2021-08-30 12:51 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-08-28  8:50 [PATCH] drm/radeon: Make use of the helper macro SET_RUNTIME_PM_OPS() Cai Huoqing
2021-08-30 12:21 ` Alex Deucher
2021-08-30 12:44   ` Cai Huoqing
2021-08-30 12:51 ` Christian König

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.