[i-g-t] tests/kms_rotation_crc: static before const

Submitted by Daniel Vetter on Dec. 4, 2018, 12:22 p.m.

Details

Message ID 20181204122215.8635-1-daniel.vetter@ffwll.ch
State New
Series "tests/kms_rotation_crc: static before const"
Headers show

Commit Message

Daniel Vetter Dec. 4, 2018, 12:22 p.m.
My gcc is unhappy otherwise:

[191/829] Compiling C object 'tests/te...otation_crc@exe/kms_rotation_crc.c.o'.
../tests/kms_rotation_crc.c: In function ‘test_multi_plane_rotation’:
../tests/kms_rotation_crc.c:497:2: warning: ‘static’ is not at beginning of declaration [-Wold-style-declaration]
  const static struct {
  ^~~~~
../tests/kms_rotation_crc.c:524:2: warning: ‘static’ is not at beginning of declaration [-Wold-style-declaration]
  const static uint32_t  formatlist[] = {DRM_FORMAT_RGB565,
  ^~~~~

Fixes

commit 14c1b132c8f829637c55fb071a9a2e5ce00e7ed8
Author: Juha-Pekka Heikkila <juhapekka.heikkila@gmail.com>
Date:   Fri Nov 30 15:34:36 2018 +0200

    tests/kms_rotation_crc: Add multi plane tests

Cc: Juha-Pekka Heikkila <juhapekka.heikkila@gmail.com
Cc: Ankit Nautiyal <ankit.k.nautiyal@intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
---
 tests/kms_rotation_crc.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Patch hide | download patch | download mbox

diff --git a/tests/kms_rotation_crc.c b/tests/kms_rotation_crc.c
index 369936f94528..05349dab5f79 100644
--- a/tests/kms_rotation_crc.c
+++ b/tests/kms_rotation_crc.c
@@ -494,7 +494,7 @@  static void test_multi_plane_rotation(data_t *data, enum pipe pipe)
 	struct p_struct *oldplanes;
 	drmModeModeInfo *mode;
 
-	const static struct {
+	static const struct {
 		igt_rotation_t rotation;
 		float_t width;
 		float_t height;
@@ -521,7 +521,7 @@  static void test_multi_plane_rotation(data_t *data, enum pipe pipe)
 	* TODO:
 	* Built support for NV12 here.
 	*/
-	const static uint32_t  formatlist[] = {DRM_FORMAT_RGB565,
+	static const uint32_t  formatlist[] = {DRM_FORMAT_RGB565,
 					       DRM_FORMAT_XRGB8888};
 
 	for_each_valid_output_on_pipe(display, pipe, output) {

Comments

Petri Latvala Dec. 4, 2018, 12:51 p.m.
On Tue, Dec 04, 2018 at 01:22:15PM +0100, Daniel Vetter wrote:
> My gcc is unhappy otherwise:
> 
> [191/829] Compiling C object 'tests/te...otation_crc@exe/kms_rotation_crc.c.o'.
> ../tests/kms_rotation_crc.c: In function ‘test_multi_plane_rotation’:
> ../tests/kms_rotation_crc.c:497:2: warning: ‘static’ is not at beginning of declaration [-Wold-style-declaration]
>   const static struct {
>   ^~~~~
> ../tests/kms_rotation_crc.c:524:2: warning: ‘static’ is not at beginning of declaration [-Wold-style-declaration]
>   const static uint32_t  formatlist[] = {DRM_FORMAT_RGB565,
>   ^~~~~
> 
> Fixes
> 
> commit 14c1b132c8f829637c55fb071a9a2e5ce00e7ed8
> Author: Juha-Pekka Heikkila <juhapekka.heikkila@gmail.com>
> Date:   Fri Nov 30 15:34:36 2018 +0200
> 
>     tests/kms_rotation_crc: Add multi plane tests
> 
> Cc: Juha-Pekka Heikkila <juhapekka.heikkila@gmail.com
> Cc: Ankit Nautiyal <ankit.k.nautiyal@intel.com>
> Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
> ---
>  tests/kms_rotation_crc.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/tests/kms_rotation_crc.c b/tests/kms_rotation_crc.c
> index 369936f94528..05349dab5f79 100644
> --- a/tests/kms_rotation_crc.c
> +++ b/tests/kms_rotation_crc.c
> @@ -494,7 +494,7 @@ static void test_multi_plane_rotation(data_t *data, enum pipe pipe)
>  	struct p_struct *oldplanes;
>  	drmModeModeInfo *mode;
>  
> -	const static struct {
> +	static const struct {
>  		igt_rotation_t rotation;
>  		float_t width;
>  		float_t height;
> @@ -521,7 +521,7 @@ static void test_multi_plane_rotation(data_t *data, enum pipe pipe)
>  	* TODO:
>  	* Built support for NV12 here.
>  	*/
> -	const static uint32_t  formatlist[] = {DRM_FORMAT_RGB565,
> +	static const uint32_t  formatlist[] = {DRM_FORMAT_RGB565,
>  					       DRM_FORMAT_XRGB8888};

                             ^
Trim this extra space while at it too.



Reviewed-by: Petri Latvala <petri.latvala@intel.com>
Daniel Vetter Dec. 4, 2018, 1:43 p.m.
On Tue, Dec 04, 2018 at 02:51:45PM +0200, Petri Latvala wrote:
> On Tue, Dec 04, 2018 at 01:22:15PM +0100, Daniel Vetter wrote:
> > My gcc is unhappy otherwise:
> > 
> > [191/829] Compiling C object 'tests/te...otation_crc@exe/kms_rotation_crc.c.o'.
> > ../tests/kms_rotation_crc.c: In function ‘test_multi_plane_rotation’:
> > ../tests/kms_rotation_crc.c:497:2: warning: ‘static’ is not at beginning of declaration [-Wold-style-declaration]
> >   const static struct {
> >   ^~~~~
> > ../tests/kms_rotation_crc.c:524:2: warning: ‘static’ is not at beginning of declaration [-Wold-style-declaration]
> >   const static uint32_t  formatlist[] = {DRM_FORMAT_RGB565,
> >   ^~~~~
> > 
> > Fixes
> > 
> > commit 14c1b132c8f829637c55fb071a9a2e5ce00e7ed8
> > Author: Juha-Pekka Heikkila <juhapekka.heikkila@gmail.com>
> > Date:   Fri Nov 30 15:34:36 2018 +0200
> > 
> >     tests/kms_rotation_crc: Add multi plane tests
> > 
> > Cc: Juha-Pekka Heikkila <juhapekka.heikkila@gmail.com
> > Cc: Ankit Nautiyal <ankit.k.nautiyal@intel.com>
> > Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
> > ---
> >  tests/kms_rotation_crc.c | 4 ++--
> >  1 file changed, 2 insertions(+), 2 deletions(-)
> > 
> > diff --git a/tests/kms_rotation_crc.c b/tests/kms_rotation_crc.c
> > index 369936f94528..05349dab5f79 100644
> > --- a/tests/kms_rotation_crc.c
> > +++ b/tests/kms_rotation_crc.c
> > @@ -494,7 +494,7 @@ static void test_multi_plane_rotation(data_t *data, enum pipe pipe)
> >  	struct p_struct *oldplanes;
> >  	drmModeModeInfo *mode;
> >  
> > -	const static struct {
> > +	static const struct {
> >  		igt_rotation_t rotation;
> >  		float_t width;
> >  		float_t height;
> > @@ -521,7 +521,7 @@ static void test_multi_plane_rotation(data_t *data, enum pipe pipe)
> >  	* TODO:
> >  	* Built support for NV12 here.
> >  	*/
> > -	const static uint32_t  formatlist[] = {DRM_FORMAT_RGB565,
> > +	static const uint32_t  formatlist[] = {DRM_FORMAT_RGB565,
> >  					       DRM_FORMAT_XRGB8888};
> 
>                              ^
> Trim this extra space while at it too.

Trimmed and pushed, thanks for your review.
-Daniel

> 
> 
> 
> Reviewed-by: Petri Latvala <petri.latvala@intel.com>
Juha-Pekka Heikkila Dec. 5, 2018, 12:28 p.m.
On 4.12.2018 14.22, Daniel Vetter wrote:
> My gcc is unhappy otherwise:
> 
> [191/829] Compiling C object 'tests/te...otation_crc@exe/kms_rotation_crc.c.o'.
> ../tests/kms_rotation_crc.c: In function ‘test_multi_plane_rotation’:
> ../tests/kms_rotation_crc.c:497:2: warning: ‘static’ is not at beginning of declaration [-Wold-style-declaration]
>    const static struct {
>    ^~~~~
> ../tests/kms_rotation_crc.c:524:2: warning: ‘static’ is not at beginning of declaration [-Wold-style-declaration]
>    const static uint32_t  formatlist[] = {DRM_FORMAT_RGB565,
>    ^~~~~
> 
> Fixes

Look like autotools didn't use same flags for gcc as to those meson 
does. At least for me autotools build doesn't give any warnings but now 
saw those from meson.

Thanks for fixing it for me.

> 
> commit 14c1b132c8f829637c55fb071a9a2e5ce00e7ed8
> Author: Juha-Pekka Heikkila <juhapekka.heikkila@gmail.com>
> Date:   Fri Nov 30 15:34:36 2018 +0200
> 
>      tests/kms_rotation_crc: Add multi plane tests
> 
> Cc: Juha-Pekka Heikkila <juhapekka.heikkila@gmail.com
> Cc: Ankit Nautiyal <ankit.k.nautiyal@intel.com>
> Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
> ---
>   tests/kms_rotation_crc.c | 4 ++--
>   1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/tests/kms_rotation_crc.c b/tests/kms_rotation_crc.c
> index 369936f94528..05349dab5f79 100644
> --- a/tests/kms_rotation_crc.c
> +++ b/tests/kms_rotation_crc.c
> @@ -494,7 +494,7 @@ static void test_multi_plane_rotation(data_t *data, enum pipe pipe)
>   	struct p_struct *oldplanes;
>   	drmModeModeInfo *mode;
>   
> -	const static struct {
> +	static const struct {
>   		igt_rotation_t rotation;
>   		float_t width;
>   		float_t height;
> @@ -521,7 +521,7 @@ static void test_multi_plane_rotation(data_t *data, enum pipe pipe)
>   	* TODO:
>   	* Built support for NV12 here.
>   	*/
> -	const static uint32_t  formatlist[] = {DRM_FORMAT_RGB565,
> +	static const uint32_t  formatlist[] = {DRM_FORMAT_RGB565,
>   					       DRM_FORMAT_XRGB8888};
>   
>   	for_each_valid_output_on_pipe(display, pipe, output) {
>