* [PATCH] drm/msm/mdp5: Fix compilation warnings
@ 2017-06-29 9:19 Viresh Kumar
[not found] ` <627f428ee808c68e28d9f97a88191fbbe3ed389f.1498727804.git.viresh.kumar-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
2017-07-19 12:13 ` Chris Wilson
0 siblings, 2 replies; 5+ messages in thread
From: Viresh Kumar @ 2017-06-29 9:19 UTC (permalink / raw)
To: Rob Clark
Cc: Viresh Kumar, Vincent Guittot, linux-arm-msm, dri-devel, freedreno
Following compilation warnings were observed for these files:
CC [M] drivers/gpu/drm/msm/mdp/mdp5/mdp5_mdss.o
drivers/gpu/drm/msm/mdp/mdp5/mdp5_crtc.c: In function 'blend_setup':
drivers/gpu/drm/msm/mdp/mdp5/mdp5_crtc.c:223:7: warning: missing braces around initializer [-Wmissing-braces]
enum mdp5_pipe stage[STAGE_MAX + 1][MAX_PIPE_STAGE] = { SSPP_NONE };
^
drivers/gpu/drm/msm/mdp/mdp5/mdp5_crtc.c:223:7: warning: (near initialization for 'stage[0]') [-Wmissing-braces]
drivers/gpu/drm/msm/mdp/mdp5/mdp5_crtc.c:224:7: warning: missing braces around initializer [-Wmissing-braces]
enum mdp5_pipe r_stage[STAGE_MAX + 1][MAX_PIPE_STAGE] = { SSPP_NONE };
^
drivers/gpu/drm/msm/mdp/mdp5/mdp5_crtc.c:224:7: warning: (near initialization for 'r_stage[0]') [-Wmissing-braces]
drivers/gpu/drm/msm/mdp/mdp5/mdp5_plane.c: In function 'mdp5_plane_mode_set':
drivers/gpu/drm/msm/mdp/mdp5/mdp5_plane.c:892:9: warning: missing braces around initializer [-Wmissing-braces]
struct phase_step step = { 0 };
^
drivers/gpu/drm/msm/mdp/mdp5/mdp5_plane.c:892:9: warning: (near initialization for 'step.x') [-Wmissing-braces]
drivers/gpu/drm/msm/mdp/mdp5/mdp5_plane.c:893:9: warning: missing braces around initializer [-Wmissing-braces]
struct pixel_ext pe = { 0 };
^
drivers/gpu/drm/msm/mdp/mdp5/mdp5_plane.c:893:9: warning: (near initialization for 'pe.left') [-Wmissing-braces]
This happens because in the first case we were initializing a two
dimensional array with {0} and in the second case we were initializing a
struct containing two arrays with {0}.
Fix them by adding another pair of {}.
Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
---
drivers/gpu/drm/msm/mdp/mdp5/mdp5_crtc.c | 4 ++--
drivers/gpu/drm/msm/mdp/mdp5/mdp5_plane.c | 4 ++--
2 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/drivers/gpu/drm/msm/mdp/mdp5/mdp5_crtc.c b/drivers/gpu/drm/msm/mdp/mdp5/mdp5_crtc.c
index 9217e0d6e93e..b2c68072a805 100644
--- a/drivers/gpu/drm/msm/mdp/mdp5/mdp5_crtc.c
+++ b/drivers/gpu/drm/msm/mdp/mdp5/mdp5_crtc.c
@@ -220,8 +220,8 @@ static void blend_setup(struct drm_crtc *crtc)
struct mdp5_ctl *ctl = mdp5_cstate->ctl;
uint32_t blend_op, fg_alpha, bg_alpha, ctl_blend_flags = 0;
unsigned long flags;
- enum mdp5_pipe stage[STAGE_MAX + 1][MAX_PIPE_STAGE] = { SSPP_NONE };
- enum mdp5_pipe r_stage[STAGE_MAX + 1][MAX_PIPE_STAGE] = { SSPP_NONE };
+ enum mdp5_pipe stage[STAGE_MAX + 1][MAX_PIPE_STAGE] = { { SSPP_NONE } };
+ enum mdp5_pipe r_stage[STAGE_MAX + 1][MAX_PIPE_STAGE] = { { SSPP_NONE } };
int i, plane_cnt = 0;
bool bg_alpha_enabled = false;
u32 mixer_op_mode = 0;
diff --git a/drivers/gpu/drm/msm/mdp/mdp5/mdp5_plane.c b/drivers/gpu/drm/msm/mdp/mdp5/mdp5_plane.c
index 7d3741215387..0ee9bd0041cd 100644
--- a/drivers/gpu/drm/msm/mdp/mdp5/mdp5_plane.c
+++ b/drivers/gpu/drm/msm/mdp/mdp5/mdp5_plane.c
@@ -889,8 +889,8 @@ static int mdp5_plane_mode_set(struct drm_plane *plane,
struct mdp5_hw_pipe *right_hwpipe;
const struct mdp_format *format;
uint32_t nplanes, config = 0;
- struct phase_step step = { 0 };
- struct pixel_ext pe = { 0 };
+ struct phase_step step = { { 0 } };
+ struct pixel_ext pe = { { 0 } };
uint32_t hdecm = 0, vdecm = 0;
uint32_t pix_format;
unsigned int rotation;
--
2.13.0.71.gd7076ec9c9cb
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH] drm/msm/mdp5: Fix compilation warnings
[not found] ` <627f428ee808c68e28d9f97a88191fbbe3ed389f.1498727804.git.viresh.kumar-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
@ 2017-07-18 6:34 ` Viresh Kumar
2017-07-18 9:41 ` Rob Clark
0 siblings, 1 reply; 5+ messages in thread
From: Viresh Kumar @ 2017-07-18 6:34 UTC (permalink / raw)
To: Rob Clark
Cc: linux-arm-msm-u79uwXL29TY76Z2rM5mHXA,
freedreno-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW, Vincent Guittot,
dri-devel-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW
On 29-06-17, 14:49, Viresh Kumar wrote:
> Following compilation warnings were observed for these files:
>
> CC [M] drivers/gpu/drm/msm/mdp/mdp5/mdp5_mdss.o
> drivers/gpu/drm/msm/mdp/mdp5/mdp5_crtc.c: In function 'blend_setup':
> drivers/gpu/drm/msm/mdp/mdp5/mdp5_crtc.c:223:7: warning: missing braces around initializer [-Wmissing-braces]
> enum mdp5_pipe stage[STAGE_MAX + 1][MAX_PIPE_STAGE] = { SSPP_NONE };
> ^
> drivers/gpu/drm/msm/mdp/mdp5/mdp5_crtc.c:223:7: warning: (near initialization for 'stage[0]') [-Wmissing-braces]
> drivers/gpu/drm/msm/mdp/mdp5/mdp5_crtc.c:224:7: warning: missing braces around initializer [-Wmissing-braces]
> enum mdp5_pipe r_stage[STAGE_MAX + 1][MAX_PIPE_STAGE] = { SSPP_NONE };
> ^
> drivers/gpu/drm/msm/mdp/mdp5/mdp5_crtc.c:224:7: warning: (near initialization for 'r_stage[0]') [-Wmissing-braces]
>
> drivers/gpu/drm/msm/mdp/mdp5/mdp5_plane.c: In function 'mdp5_plane_mode_set':
> drivers/gpu/drm/msm/mdp/mdp5/mdp5_plane.c:892:9: warning: missing braces around initializer [-Wmissing-braces]
> struct phase_step step = { 0 };
> ^
> drivers/gpu/drm/msm/mdp/mdp5/mdp5_plane.c:892:9: warning: (near initialization for 'step.x') [-Wmissing-braces]
> drivers/gpu/drm/msm/mdp/mdp5/mdp5_plane.c:893:9: warning: missing braces around initializer [-Wmissing-braces]
> struct pixel_ext pe = { 0 };
> ^
> drivers/gpu/drm/msm/mdp/mdp5/mdp5_plane.c:893:9: warning: (near initialization for 'pe.left') [-Wmissing-braces]
>
> This happens because in the first case we were initializing a two
> dimensional array with {0} and in the second case we were initializing a
> struct containing two arrays with {0}.
>
> Fix them by adding another pair of {}.
>
> Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
> ---
> drivers/gpu/drm/msm/mdp/mdp5/mdp5_crtc.c | 4 ++--
> drivers/gpu/drm/msm/mdp/mdp5/mdp5_plane.c | 4 ++--
> 2 files changed, 4 insertions(+), 4 deletions(-)
Ping.
--
viresh
_______________________________________________
Freedreno mailing list
Freedreno@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/freedreno
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] drm/msm/mdp5: Fix compilation warnings
2017-07-18 6:34 ` Viresh Kumar
@ 2017-07-18 9:41 ` Rob Clark
0 siblings, 0 replies; 5+ messages in thread
From: Rob Clark @ 2017-07-18 9:41 UTC (permalink / raw)
To: Viresh Kumar; +Cc: linux-arm-msm, freedreno, Vincent Guittot, dri-devel
2017-07-18 2:34 GMT-04:00 Viresh Kumar <viresh.kumar@linaro.org>:
> On 29-06-17, 14:49, Viresh Kumar wrote:
>> Following compilation warnings were observed for these files:
>>
>> CC [M] drivers/gpu/drm/msm/mdp/mdp5/mdp5_mdss.o
>> drivers/gpu/drm/msm/mdp/mdp5/mdp5_crtc.c: In function 'blend_setup':
>> drivers/gpu/drm/msm/mdp/mdp5/mdp5_crtc.c:223:7: warning: missing braces around initializer [-Wmissing-braces]
>> enum mdp5_pipe stage[STAGE_MAX + 1][MAX_PIPE_STAGE] = { SSPP_NONE };
>> ^
>> drivers/gpu/drm/msm/mdp/mdp5/mdp5_crtc.c:223:7: warning: (near initialization for 'stage[0]') [-Wmissing-braces]
>> drivers/gpu/drm/msm/mdp/mdp5/mdp5_crtc.c:224:7: warning: missing braces around initializer [-Wmissing-braces]
>> enum mdp5_pipe r_stage[STAGE_MAX + 1][MAX_PIPE_STAGE] = { SSPP_NONE };
>> ^
>> drivers/gpu/drm/msm/mdp/mdp5/mdp5_crtc.c:224:7: warning: (near initialization for 'r_stage[0]') [-Wmissing-braces]
>>
>> drivers/gpu/drm/msm/mdp/mdp5/mdp5_plane.c: In function 'mdp5_plane_mode_set':
>> drivers/gpu/drm/msm/mdp/mdp5/mdp5_plane.c:892:9: warning: missing braces around initializer [-Wmissing-braces]
>> struct phase_step step = { 0 };
>> ^
>> drivers/gpu/drm/msm/mdp/mdp5/mdp5_plane.c:892:9: warning: (near initialization for 'step.x') [-Wmissing-braces]
>> drivers/gpu/drm/msm/mdp/mdp5/mdp5_plane.c:893:9: warning: missing braces around initializer [-Wmissing-braces]
>> struct pixel_ext pe = { 0 };
>> ^
>> drivers/gpu/drm/msm/mdp/mdp5/mdp5_plane.c:893:9: warning: (near initialization for 'pe.left') [-Wmissing-braces]
>>
>> This happens because in the first case we were initializing a two
>> dimensional array with {0} and in the second case we were initializing a
>> struct containing two arrays with {0}.
>>
>> Fix them by adding another pair of {}.
>>
>> Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
>> ---
>> drivers/gpu/drm/msm/mdp/mdp5/mdp5_crtc.c | 4 ++--
>> drivers/gpu/drm/msm/mdp/mdp5/mdp5_plane.c | 4 ++--
>> 2 files changed, 4 insertions(+), 4 deletions(-)
>
> Ping.
>
thanks.. I'm planning to pick this up when I put together -fixes for
4.13, but just haven't had time for that yet
BR,
-R
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] drm/msm/mdp5: Fix compilation warnings
2017-06-29 9:19 [PATCH] drm/msm/mdp5: Fix compilation warnings Viresh Kumar
[not found] ` <627f428ee808c68e28d9f97a88191fbbe3ed389f.1498727804.git.viresh.kumar-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
@ 2017-07-19 12:13 ` Chris Wilson
2017-07-19 12:56 ` Viresh Kumar
1 sibling, 1 reply; 5+ messages in thread
From: Chris Wilson @ 2017-07-19 12:13 UTC (permalink / raw)
To: Rob Clark
Cc: Viresh Kumar, freedreno, Vincent Guittot, dri-devel, linux-arm-msm
Quoting Viresh Kumar (2017-06-29 10:19:59)
> Following compilation warnings were observed for these files:
>
> CC [M] drivers/gpu/drm/msm/mdp/mdp5/mdp5_mdss.o
> drivers/gpu/drm/msm/mdp/mdp5/mdp5_crtc.c: In function 'blend_setup':
> drivers/gpu/drm/msm/mdp/mdp5/mdp5_crtc.c:223:7: warning: missing braces around initializer [-Wmissing-braces]
> enum mdp5_pipe stage[STAGE_MAX + 1][MAX_PIPE_STAGE] = { SSPP_NONE };
> ^
> drivers/gpu/drm/msm/mdp/mdp5/mdp5_crtc.c:223:7: warning: (near initialization for 'stage[0]') [-Wmissing-braces]
> drivers/gpu/drm/msm/mdp/mdp5/mdp5_crtc.c:224:7: warning: missing braces around initializer [-Wmissing-braces]
> enum mdp5_pipe r_stage[STAGE_MAX + 1][MAX_PIPE_STAGE] = { SSPP_NONE };
> ^
> drivers/gpu/drm/msm/mdp/mdp5/mdp5_crtc.c:224:7: warning: (near initialization for 'r_stage[0]') [-Wmissing-braces]
>
> drivers/gpu/drm/msm/mdp/mdp5/mdp5_plane.c: In function 'mdp5_plane_mode_set':
> drivers/gpu/drm/msm/mdp/mdp5/mdp5_plane.c:892:9: warning: missing braces around initializer [-Wmissing-braces]
> struct phase_step step = { 0 };
> ^
> drivers/gpu/drm/msm/mdp/mdp5/mdp5_plane.c:892:9: warning: (near initialization for 'step.x') [-Wmissing-braces]
> drivers/gpu/drm/msm/mdp/mdp5/mdp5_plane.c:893:9: warning: missing braces around initializer [-Wmissing-braces]
> struct pixel_ext pe = { 0 };
> ^
> drivers/gpu/drm/msm/mdp/mdp5/mdp5_plane.c:893:9: warning: (near initialization for 'pe.left') [-Wmissing-braces]
>
> This happens because in the first case we were initializing a two
> dimensional array with {0} and in the second case we were initializing a
> struct containing two arrays with {0}.
>
> Fix them by adding another pair of {}.
>
> Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
> ---
> drivers/gpu/drm/msm/mdp/mdp5/mdp5_crtc.c | 4 ++--
> drivers/gpu/drm/msm/mdp/mdp5/mdp5_plane.c | 4 ++--
> 2 files changed, 4 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/gpu/drm/msm/mdp/mdp5/mdp5_crtc.c b/drivers/gpu/drm/msm/mdp/mdp5/mdp5_crtc.c
> index 9217e0d6e93e..b2c68072a805 100644
> --- a/drivers/gpu/drm/msm/mdp/mdp5/mdp5_crtc.c
> +++ b/drivers/gpu/drm/msm/mdp/mdp5/mdp5_crtc.c
> @@ -220,8 +220,8 @@ static void blend_setup(struct drm_crtc *crtc)
> struct mdp5_ctl *ctl = mdp5_cstate->ctl;
> uint32_t blend_op, fg_alpha, bg_alpha, ctl_blend_flags = 0;
> unsigned long flags;
> - enum mdp5_pipe stage[STAGE_MAX + 1][MAX_PIPE_STAGE] = { SSPP_NONE };
> - enum mdp5_pipe r_stage[STAGE_MAX + 1][MAX_PIPE_STAGE] = { SSPP_NONE };
> + enum mdp5_pipe stage[STAGE_MAX + 1][MAX_PIPE_STAGE] = { { SSPP_NONE } };
> + enum mdp5_pipe r_stage[STAGE_MAX + 1][MAX_PIPE_STAGE] = { { SSPP_NONE } };
> int i, plane_cnt = 0;
> bool bg_alpha_enabled = false;
> u32 mixer_op_mode = 0;
> diff --git a/drivers/gpu/drm/msm/mdp/mdp5/mdp5_plane.c b/drivers/gpu/drm/msm/mdp/mdp5/mdp5_plane.c
> index 7d3741215387..0ee9bd0041cd 100644
> --- a/drivers/gpu/drm/msm/mdp/mdp5/mdp5_plane.c
> +++ b/drivers/gpu/drm/msm/mdp/mdp5/mdp5_plane.c
> @@ -889,8 +889,8 @@ static int mdp5_plane_mode_set(struct drm_plane *plane,
> struct mdp5_hw_pipe *right_hwpipe;
> const struct mdp_format *format;
> uint32_t nplanes, config = 0;
> - struct phase_step step = { 0 };
> - struct pixel_ext pe = { 0 };
> + struct phase_step step = { { 0 } };
> + struct pixel_ext pe = { { 0 } };
> uint32_t hdecm = 0, vdecm = 0;
> uint32_t pix_format;
> unsigned int rotation;
Or just use {} to initialise to zero whatever the struct layout?
-Chris
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] drm/msm/mdp5: Fix compilation warnings
2017-07-19 12:13 ` Chris Wilson
@ 2017-07-19 12:56 ` Viresh Kumar
0 siblings, 0 replies; 5+ messages in thread
From: Viresh Kumar @ 2017-07-19 12:56 UTC (permalink / raw)
To: Chris Wilson
Cc: Rob Clark, freedreno, Vincent Guittot, dri-devel, linux-arm-msm
On 19-07-17, 13:13, Chris Wilson wrote:
> Quoting Viresh Kumar (2017-06-29 10:19:59)
> > diff --git a/drivers/gpu/drm/msm/mdp/mdp5/mdp5_plane.c b/drivers/gpu/drm/msm/mdp/mdp5/mdp5_plane.c
> > index 7d3741215387..0ee9bd0041cd 100644
> > --- a/drivers/gpu/drm/msm/mdp/mdp5/mdp5_plane.c
> > +++ b/drivers/gpu/drm/msm/mdp/mdp5/mdp5_plane.c
> > @@ -889,8 +889,8 @@ static int mdp5_plane_mode_set(struct drm_plane *plane,
> > struct mdp5_hw_pipe *right_hwpipe;
> > const struct mdp_format *format;
> > uint32_t nplanes, config = 0;
> > - struct phase_step step = { 0 };
> > - struct pixel_ext pe = { 0 };
> > + struct phase_step step = { { 0 } };
> > + struct pixel_ext pe = { { 0 } };
> > uint32_t hdecm = 0, vdecm = 0;
> > uint32_t pix_format;
> > unsigned int rotation;
>
> Or just use {} to initialise to zero whatever the struct layout?
Maybe, as GNU C allows that but ANSI C doesn't.
--
viresh
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2017-07-19 12:56 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-06-29 9:19 [PATCH] drm/msm/mdp5: Fix compilation warnings Viresh Kumar
[not found] ` <627f428ee808c68e28d9f97a88191fbbe3ed389f.1498727804.git.viresh.kumar-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
2017-07-18 6:34 ` Viresh Kumar
2017-07-18 9:41 ` Rob Clark
2017-07-19 12:13 ` Chris Wilson
2017-07-19 12:56 ` Viresh Kumar
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.