Skip to contentSkip to conversation

drm/omap: Use {} to zero initialize the mode

PATCH In review Ville Syrjala 3 participants 5 messages Jul 24, 2020

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

PATCH 1/1 drm/omap: Use {} to zero initialize the mode

From: Ville Syrjälä <[email protected]>

The first member of drm_display_mode is no longer a structure, but the code is still using {{0}} to zero initialize it. Make that just {} so it works regardless of what lies inside.

Cc Dave Airlie <[email protected]>
Cc Laurent Pinchart <[email protected]>
Cc Tomi Valkeinen <[email protected]>
Fixes 42acb06b01b1 ("drm: pahole struct drm_display_mode")
---
 drivers/gpu/drm/omapdrm/omap_connector.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/omapdrm/omap_connector.c +1 -1
index 528764566b17..de95dc1b861c 100644
@@ -89,7 +89,7 @@ static enum drm_mode_status omap_connector_mode_valid(struct drm_connector *conn
 				 struct drm_display_mode *mode)
 {
 	struct omap_connector *omap_connector = to_omap_connector(connector);
-	struct drm_display_mode new_mode = { { 0 } };
+	struct drm_display_mode new_mode = {};
 	enum drm_mode_status status;
 
 	status = omap_connector_mode_fixup(omap_connector->output, mode,
Signature · 6 lines
2.26.2

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

From: Ville Syrjälä <[email protected]>

The first member of drm_display_mode is no longer a structure, but the code is still using {{0}} to zero initialize it. Make that just {} so it works regardless of what lies inside.

Quoted 5 lines
Cc Dave Airlie <[email protected]>
Cc Laurent Pinchart <[email protected]>
Cc Tomi Valkeinen <[email protected]>
Fixes 42acb06b01b1 ("drm: pahole struct drm_display_mode")

This needs to go into drm-misc-next-fixes, looks like Maarten has already forward it so you can push it there.
-Daniel

Quoted 24 lines
---
 drivers/gpu/drm/omapdrm/omap_connector.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/omapdrm/omap_connector.c +1 -2
index 528764566b17..de95dc1b861c 100644
@@ -89,7 +89,7 @@ static enum drm_mode_status omap_connector_mode_valid(struct drm_connector *conn
                                 struct drm_display_mode *mode)
 {
        struct omap_connector *omap_connector = to_omap_connector(connector);
-       struct drm_display_mode new_mode = { { 0 } };
+       struct drm_display_mode new_mode = {};
        enum drm_mode_status status;
 
        status = omap_connector_mode_fixup(omap_connector->output, mode,
--

2.26.2

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel

Signature · 7 lines
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
#2 lore raw
Quoted 15 lines · Daniel Vetter
Quoted 7 lines · Ville Syrjala

From: Ville Syrjälä <[email protected]>

The first member of drm_display_mode is no longer a structure, but the code is still using {{0}} to zero initialize it. Make that just {} so it works regardless of what lies inside.

Quoted 5 lines
Cc Dave Airlie <[email protected]>
Cc Laurent Pinchart <[email protected]>
Cc Tomi Valkeinen <[email protected]>
Fixes 42acb06b01b1 ("drm: pahole struct drm_display_mode")
Quoted 4 lines

This needs to go into drm-misc-next-fixes, looks like Maarten has already forward it so you can push it there.

Thanks for the review. Pushed.

-> vacation

Signature · 6 lines
Ville Syrjälä
Intel
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
#3 lore raw
Quoted 17 lines · Ville Syrjälä
Quoted 15 lines · Daniel Vetter
Quoted 12 lines · Ville Syrjala

From: Ville Syrjälä <[email protected]>

The first member of drm_display_mode is no longer a structure, but the code is still using {{0}} to zero initialize it. Make that just {} so it works regardless of what lies inside.

Cc Dave Airlie <[email protected]>
Cc Laurent Pinchart <[email protected]>
Cc Tomi Valkeinen <[email protected]>
Fixes 42acb06b01b1 ("drm: pahole struct drm_display_mode")
Quoted 8 lines
Quoted 4 lines

This needs to go into drm-misc-next-fixes, looks like Maarten has already forward it so you can push it there.

Thanks for the review. Pushed.

-> vacation

Enjoy!

Cheers, Daniel

Signature · 7 lines
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
Reviewed-by on v1 1/1
#4 lore raw
In reply to Ville Syrjala

Hi Ville,

Thank you for the patch, and sorry for having let this issue slip through the cracks :-S

Quoted 11 lines · Ville Syrjala

From: Ville Syrjälä <[email protected]>

The first member of drm_display_mode is no longer a structure, but the code is still using {{0}} to zero initialize it. Make that just {} so it works regardless of what lies inside.

Cc Dave Airlie <[email protected]>
Cc Laurent Pinchart <[email protected]>
Cc Tomi Valkeinen <[email protected]>
Fixes 42acb06b01b1 ("drm: pahole struct drm_display_mode")
Quoted 17 lines
---
 drivers/gpu/drm/omapdrm/omap_connector.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/omapdrm/omap_connector.c +1 -1
index 528764566b17..de95dc1b861c 100644
@@ -89,7 +89,7 @@ static enum drm_mode_status omap_connector_mode_valid(struct drm_connector *conn
 				 struct drm_display_mode *mode)
 {
 	struct omap_connector *omap_connector = to_omap_connector(connector);
-	struct drm_display_mode new_mode = { { 0 } };
+	struct drm_display_mode new_mode = {};
 	enum drm_mode_status status;
 
 	status = omap_connector_mode_fixup(omap_connector->output, mode,
Signature · 7 lines
Regards,

Laurent Pinchart
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel