2020-11-16 17:46:23

by Lee Jones

[permalink] [raw]
Subject: [PATCH 42/42] include/drm/drm_atomic: Make use of 'new_crtc_state'

In the macro for_each_oldnew_crtc_in_state() 'crtc_state' is provided
as a container for state->crtcs[i].new_state, but is not utilised in
some use-cases, so we fake-use it instead.

Fixes the following W=1 kernel build warning(s):

drivers/gpu/drm/imx/ipuv3-plane.c: In function ‘ipu_planes_assign_pre’:
drivers/gpu/drm/imx/ipuv3-plane.c:746:42: warning: variable ‘crtc_state’ set but not used [-Wunused-but-set-variable]

Cc: Philipp Zabel <[email protected]>
Cc: David Airlie <[email protected]>
Cc: Daniel Vetter <[email protected]>
Cc: Shawn Guo <[email protected]>
Cc: Sascha Hauer <[email protected]>
Cc: Pengutronix Kernel Team <[email protected]>
Cc: Fabio Estevam <[email protected]>
Cc: NXP Linux Team <[email protected]>
Cc: [email protected]
Signed-off-by: Lee Jones <[email protected]>
---
include/drm/drm_atomic.h | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/include/drm/drm_atomic.h b/include/drm/drm_atomic.h
index dc5e0fbecc04e..54e051a957dfc 100644
--- a/include/drm/drm_atomic.h
+++ b/include/drm/drm_atomic.h
@@ -783,7 +783,8 @@ void drm_state_dump(struct drm_device *dev, struct drm_printer *p);
(void)(crtc) /* Only to avoid unused-but-set-variable warning */, \
(old_crtc_state) = (__state)->crtcs[__i].old_state, \
(void)(old_crtc_state) /* Only to avoid unused-but-set-variable warning */, \
- (new_crtc_state) = (__state)->crtcs[__i].new_state, 1))
+ (new_crtc_state) = (__state)->crtcs[__i].new_state, \
+ (void)(new_crtc_state) /* Only to avoid unused-but-set-variable warning */, 1))

/**
* for_each_old_crtc_in_state - iterate over all CRTCs in an atomic update
--
2.25.1


2020-11-17 19:47:38

by Daniel Vetter

[permalink] [raw]
Subject: Re: [PATCH 42/42] include/drm/drm_atomic: Make use of 'new_crtc_state'

On Mon, Nov 16, 2020 at 05:41:12PM +0000, Lee Jones wrote:
> In the macro for_each_oldnew_crtc_in_state() 'crtc_state' is provided
> as a container for state->crtcs[i].new_state, but is not utilised in
> some use-cases, so we fake-use it instead.
>
> Fixes the following W=1 kernel build warning(s):
>
> drivers/gpu/drm/imx/ipuv3-plane.c: In function ‘ipu_planes_assign_pre’:
> drivers/gpu/drm/imx/ipuv3-plane.c:746:42: warning: variable ‘crtc_state’ set but not used [-Wunused-but-set-variable]
>
> Cc: Philipp Zabel <[email protected]>
> Cc: David Airlie <[email protected]>
> Cc: Daniel Vetter <[email protected]>
> Cc: Shawn Guo <[email protected]>
> Cc: Sascha Hauer <[email protected]>
> Cc: Pengutronix Kernel Team <[email protected]>
> Cc: Fabio Estevam <[email protected]>
> Cc: NXP Linux Team <[email protected]>
> Cc: [email protected]
> Signed-off-by: Lee Jones <[email protected]>

Ok I merged them all except:
- drm/amd and drm/imx, should be picked up already by respective
maintainers
- drm/msm, Rob promised to take care

Thanks a lot for your patches.
-Daniel

> ---
> include/drm/drm_atomic.h | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/include/drm/drm_atomic.h b/include/drm/drm_atomic.h
> index dc5e0fbecc04e..54e051a957dfc 100644
> --- a/include/drm/drm_atomic.h
> +++ b/include/drm/drm_atomic.h
> @@ -783,7 +783,8 @@ void drm_state_dump(struct drm_device *dev, struct drm_printer *p);
> (void)(crtc) /* Only to avoid unused-but-set-variable warning */, \
> (old_crtc_state) = (__state)->crtcs[__i].old_state, \
> (void)(old_crtc_state) /* Only to avoid unused-but-set-variable warning */, \
> - (new_crtc_state) = (__state)->crtcs[__i].new_state, 1))
> + (new_crtc_state) = (__state)->crtcs[__i].new_state, \
> + (void)(new_crtc_state) /* Only to avoid unused-but-set-variable warning */, 1))
>
> /**
> * for_each_old_crtc_in_state - iterate over all CRTCs in an atomic update
> --
> 2.25.1
>

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

2020-11-18 08:48:06

by Lee Jones

[permalink] [raw]
Subject: Re: [PATCH 42/42] include/drm/drm_atomic: Make use of 'new_crtc_state'

On Tue, 17 Nov 2020, Daniel Vetter wrote:

> On Mon, Nov 16, 2020 at 05:41:12PM +0000, Lee Jones wrote:
> > In the macro for_each_oldnew_crtc_in_state() 'crtc_state' is provided
> > as a container for state->crtcs[i].new_state, but is not utilised in
> > some use-cases, so we fake-use it instead.
> >
> > Fixes the following W=1 kernel build warning(s):
> >
> > drivers/gpu/drm/imx/ipuv3-plane.c: In function ‘ipu_planes_assign_pre’:
> > drivers/gpu/drm/imx/ipuv3-plane.c:746:42: warning: variable ‘crtc_state’ set but not used [-Wunused-but-set-variable]
> >
> > Cc: Philipp Zabel <[email protected]>
> > Cc: David Airlie <[email protected]>
> > Cc: Daniel Vetter <[email protected]>
> > Cc: Shawn Guo <[email protected]>
> > Cc: Sascha Hauer <[email protected]>
> > Cc: Pengutronix Kernel Team <[email protected]>
> > Cc: Fabio Estevam <[email protected]>
> > Cc: NXP Linux Team <[email protected]>
> > Cc: [email protected]
> > Signed-off-by: Lee Jones <[email protected]>
>
> Ok I merged them all except:
> - drm/amd and drm/imx, should be picked up already by respective
> maintainers
> - drm/msm, Rob promised to take care
>
> Thanks a lot for your patches.

Perfect. Thank you for reviewing/merging them.

> > ---
> > include/drm/drm_atomic.h | 3 ++-
> > 1 file changed, 2 insertions(+), 1 deletion(-)
> >
> > diff --git a/include/drm/drm_atomic.h b/include/drm/drm_atomic.h
> > index dc5e0fbecc04e..54e051a957dfc 100644
> > --- a/include/drm/drm_atomic.h
> > +++ b/include/drm/drm_atomic.h
> > @@ -783,7 +783,8 @@ void drm_state_dump(struct drm_device *dev, struct drm_printer *p);
> > (void)(crtc) /* Only to avoid unused-but-set-variable warning */, \
> > (old_crtc_state) = (__state)->crtcs[__i].old_state, \
> > (void)(old_crtc_state) /* Only to avoid unused-but-set-variable warning */, \
> > - (new_crtc_state) = (__state)->crtcs[__i].new_state, 1))
> > + (new_crtc_state) = (__state)->crtcs[__i].new_state, \
> > + (void)(new_crtc_state) /* Only to avoid unused-but-set-variable warning */, 1))
> >
> > /**
> > * for_each_old_crtc_in_state - iterate over all CRTCs in an atomic update
>

--
Lee Jones [李琼斯]
Senior Technical Lead - Developer Services
Linaro.org │ Open source software for Arm SoCs
Follow Linaro: Facebook | Twitter | Blog