2020-09-11 01:46:49

by Wangshaobo (bobo)

[permalink] [raw]
Subject: [PATCH -next] drm/imx: fix unused but set variable warnings

Fix unused but set variable warning building with `make W=1`:

drivers/gpu/drm/imx/dcss/dcss-plane.c:270:6: warning:
variable ‘pixel_format’ set but not used [-Wunused-but-set-variable]
u32 pixel_format;
^~~~~~~~~~~~

Fixes: 9021c317b770 ("drm/imx: Add initial support for DCSS on iMX8MQ")
Reported-by: Hulk Robot <[email protected]>
Signed-off-by: Wang ShaoBo <[email protected]>
---
drivers/gpu/drm/imx/dcss/dcss-plane.c | 2 --
1 file changed, 2 deletions(-)

diff --git a/drivers/gpu/drm/imx/dcss/dcss-plane.c b/drivers/gpu/drm/imx/dcss/dcss-plane.c
index 961d671f171b..e13652e3a115 100644
--- a/drivers/gpu/drm/imx/dcss/dcss-plane.c
+++ b/drivers/gpu/drm/imx/dcss/dcss-plane.c
@@ -267,7 +267,6 @@ static void dcss_plane_atomic_update(struct drm_plane *plane,
struct dcss_plane *dcss_plane = to_dcss_plane(plane);
struct dcss_dev *dcss = plane->dev->dev_private;
struct drm_framebuffer *fb = state->fb;
- u32 pixel_format;
struct drm_crtc_state *crtc_state;
bool modifiers_present;
u32 src_w, src_h, dst_w, dst_h;
@@ -277,7 +276,6 @@ static void dcss_plane_atomic_update(struct drm_plane *plane,
if (!fb || !state->crtc || !state->visible)
return;

- pixel_format = state->fb->format->format;
crtc_state = state->crtc->state;
modifiers_present = !!(fb->flags & DRM_MODE_FB_MODIFIERS);

--
2.17.1


2020-09-11 06:45:56

by Laurentiu Palcu

[permalink] [raw]
Subject: Re: [PATCH -next] drm/imx: fix unused but set variable warnings

On Fri, Sep 11, 2020 at 09:44:14AM +0800, Wang ShaoBo wrote:
> Fix unused but set variable warning building with `make W=1`:
>
> drivers/gpu/drm/imx/dcss/dcss-plane.c:270:6: warning:
> variable ‘pixel_format’ set but not used [-Wunused-but-set-variable]
> u32 pixel_format;
> ^~~~~~~~~~~~
>
> Fixes: 9021c317b770 ("drm/imx: Add initial support for DCSS on iMX8MQ")
> Reported-by: Hulk Robot <[email protected]>
> Signed-off-by: Wang ShaoBo <[email protected]>

pixel_format will be used in the next patches that will follow the
initial one and I probably forgot to remove it when I split the patches.
But, I guess, we could remove it for now to make the bots happy.

Reviewed-by: Laurentiu Palcu <[email protected]>

> ---
> drivers/gpu/drm/imx/dcss/dcss-plane.c | 2 --
> 1 file changed, 2 deletions(-)
>
> diff --git a/drivers/gpu/drm/imx/dcss/dcss-plane.c b/drivers/gpu/drm/imx/dcss/dcss-plane.c
> index 961d671f171b..e13652e3a115 100644
> --- a/drivers/gpu/drm/imx/dcss/dcss-plane.c
> +++ b/drivers/gpu/drm/imx/dcss/dcss-plane.c
> @@ -267,7 +267,6 @@ static void dcss_plane_atomic_update(struct drm_plane *plane,
> struct dcss_plane *dcss_plane = to_dcss_plane(plane);
> struct dcss_dev *dcss = plane->dev->dev_private;
> struct drm_framebuffer *fb = state->fb;
> - u32 pixel_format;
> struct drm_crtc_state *crtc_state;
> bool modifiers_present;
> u32 src_w, src_h, dst_w, dst_h;
> @@ -277,7 +276,6 @@ static void dcss_plane_atomic_update(struct drm_plane *plane,
> if (!fb || !state->crtc || !state->visible)
> return;
>
> - pixel_format = state->fb->format->format;
> crtc_state = state->crtc->state;
> modifiers_present = !!(fb->flags & DRM_MODE_FB_MODIFIERS);
>
> --
> 2.17.1
>