sun6i: dsi: fix gcc-4.8

Message ID 20200428215105.3928459-1-arnd@arndb.de
State Accepted
Commit 3a3a71f97c30983f1627c2c550d43566e9b634d2
Headers show
Series
  • sun6i: dsi: fix gcc-4.8
Related show

Commit Message

Arnd Bergmann April 28, 2020, 9:50 p.m.
Older compilers warn about initializers with incorrect curly
braces:

drivers/gpu/drm/sun4i/sun6i_mipi_dsi.c: In function 'sun6i_dsi_encoder_enable':
drivers/gpu/drm/sun4i/sun6i_mipi_dsi.c:720:8: error: missing braces around initializer [-Werror=missing-braces]
  union phy_configure_opts opts = { 0 };
        ^
drivers/gpu/drm/sun4i/sun6i_mipi_dsi.c:720:8: error: (near initialization for 'opts.mipi_dphy') [-Werror=missing-braces]

Use the GNU empty initializer extension to avoid this.

Fixes: bb3b6fcb6849 ("sun6i: dsi: Convert to generic phy handling")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>

---
 drivers/gpu/drm/sun4i/sun6i_mipi_dsi.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

-- 
2.26.0

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

Comments

Paul Kocialkowski April 29, 2020, 1:13 p.m. | #1
Hi,

On Tue 28 Apr 20, 23:50, Arnd Bergmann wrote:
> Older compilers warn about initializers with incorrect curly

> braces:

> 

> drivers/gpu/drm/sun4i/sun6i_mipi_dsi.c: In function 'sun6i_dsi_encoder_enable':

> drivers/gpu/drm/sun4i/sun6i_mipi_dsi.c:720:8: error: missing braces around initializer [-Werror=missing-braces]

>   union phy_configure_opts opts = { 0 };

>         ^

> drivers/gpu/drm/sun4i/sun6i_mipi_dsi.c:720:8: error: (near initialization for 'opts.mipi_dphy') [-Werror=missing-braces]

> 

> Use the GNU empty initializer extension to avoid this.


Looks good to me:
Reviewed-by: Paul Kocialkowski <paul.kocialkowski@bootlin.com>


But maybe use the drm/sun4i: dsi: prefix instead (granted, it wasn't used in
the commit being fixed).

Cheers,

Paul

> Fixes: bb3b6fcb6849 ("sun6i: dsi: Convert to generic phy handling")

> Signed-off-by: Arnd Bergmann <arnd@arndb.de>

> ---

>  drivers/gpu/drm/sun4i/sun6i_mipi_dsi.c | 2 +-

>  1 file changed, 1 insertion(+), 1 deletion(-)

> 

> diff --git a/drivers/gpu/drm/sun4i/sun6i_mipi_dsi.c b/drivers/gpu/drm/sun4i/sun6i_mipi_dsi.c

> index f6c67dd87a05..aa67cb037e9d 100644

> --- a/drivers/gpu/drm/sun4i/sun6i_mipi_dsi.c

> +++ b/drivers/gpu/drm/sun4i/sun6i_mipi_dsi.c

> @@ -718,7 +718,7 @@ static void sun6i_dsi_encoder_enable(struct drm_encoder *encoder)

>  	struct drm_display_mode *mode = &encoder->crtc->state->adjusted_mode;

>  	struct sun6i_dsi *dsi = encoder_to_sun6i_dsi(encoder);

>  	struct mipi_dsi_device *device = dsi->device;

> -	union phy_configure_opts opts = { 0 };

> +	union phy_configure_opts opts = { };

>  	struct phy_configure_opts_mipi_dphy *cfg = &opts.mipi_dphy;

>  	u16 delay;

>  	int err;

> -- 

> 2.26.0

> 


-- 
Paul Kocialkowski, Bootlin
Embedded Linux and kernel engineering
https://bootlin.com
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel
Maxime Ripard May 4, 2020, 11:49 a.m. | #2
On Tue, Apr 28, 2020 at 11:50:51PM +0200, Arnd Bergmann wrote:
> Older compilers warn about initializers with incorrect curly

> braces:

> 

> drivers/gpu/drm/sun4i/sun6i_mipi_dsi.c: In function 'sun6i_dsi_encoder_enable':

> drivers/gpu/drm/sun4i/sun6i_mipi_dsi.c:720:8: error: missing braces around initializer [-Werror=missing-braces]

>   union phy_configure_opts opts = { 0 };

>         ^

> drivers/gpu/drm/sun4i/sun6i_mipi_dsi.c:720:8: error: (near initialization for 'opts.mipi_dphy') [-Werror=missing-braces]

> 

> Use the GNU empty initializer extension to avoid this.

> 

> Fixes: bb3b6fcb6849 ("sun6i: dsi: Convert to generic phy handling")

> Signed-off-by: Arnd Bergmann <arnd@arndb.de>


Applied, thanks!
Maxime
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

Patch

diff --git a/drivers/gpu/drm/sun4i/sun6i_mipi_dsi.c b/drivers/gpu/drm/sun4i/sun6i_mipi_dsi.c
index f6c67dd87a05..aa67cb037e9d 100644
--- a/drivers/gpu/drm/sun4i/sun6i_mipi_dsi.c
+++ b/drivers/gpu/drm/sun4i/sun6i_mipi_dsi.c
@@ -718,7 +718,7 @@  static void sun6i_dsi_encoder_enable(struct drm_encoder *encoder)
 	struct drm_display_mode *mode = &encoder->crtc->state->adjusted_mode;
 	struct sun6i_dsi *dsi = encoder_to_sun6i_dsi(encoder);
 	struct mipi_dsi_device *device = dsi->device;
-	union phy_configure_opts opts = { 0 };
+	union phy_configure_opts opts = { };
 	struct phy_configure_opts_mipi_dphy *cfg = &opts.mipi_dphy;
 	u16 delay;
 	int err;