Skip to contentSkip to conversation

sun6i: dsi: fix gcc-4.8

PATCH Applied Arnd Bergmann 3 participants 3 messages Apr 28, 2020 – May 4, 2020

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 sun6i: dsi: fix gcc-4.8

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")
---
 drivers/gpu/drm/sun4i/sun6i_mipi_dsi.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/sun4i/sun6i_mipi_dsi.c +1 -1
index f6c67dd87a05..aa67cb037e9d 100644
@@ -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;
Signature · 6 lines
2.26.0

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
Reviewed-by on v1 1/1
#1 lore raw

Hi,

Quoted 10 lines · Arnd Bergmann

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:

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

Cheers,

Paul

Quoted 22 lines
Fixes bb3b6fcb6849 ("sun6i: dsi: Convert to generic phy handling")
---
 drivers/gpu/drm/sun4i/sun6i_mipi_dsi.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/sun4i/sun6i_mipi_dsi.c +1 -1
index f6c67dd87a05..aa67cb037e9d 100644
@@ -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;
Signature · 1 line
2.26.0
Signature · 3 lines
Paul Kocialkowski, Bootlin
Embedded Linux and kernel engineering
https://bootlin.com
#2 lore raw
In reply to Arnd Bergmann
Quoted 5 lines · Arnd Bergmann

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]

Quoted 8 lines
  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")

Applied, thanks!
Maxime