drm/omap: Remove aggregate initialization of new_mode in omap_connector_mode_valid
Subsystems (3)
PATCH 1/1 drm/omap: Remove aggregate initialization of new_mode in omap_connector_mode_valid
After commit 42acb06b01b1 ("drm: pahole struct drm_display_mode"), clang warns:
drivers/gpu/drm/omapdrm/omap_connector.c:92:39: warning: braces around scalar initializer [-Wbraced-scalar-init]
struct drm_display_mode new_mode = { { 0 } };
^~~~~~1 warning generated.
After the struct was shuffled, the second set of braces is no longer needed because we are not initializing a structure (struct list_head) but a regular integer (int clock).
However, looking into it further, this initialization is pointless because new_mode is used as the destination of drm_mode_copy, where the members of new_mode will just be completely overwritten with the members of mode. Just remove the initialization of new_mode so that there is no more warning and we don't need to worry about updating the initialization if the structure ever get shuffled again.
--- drivers/gpu/drm/omapdrm/omap_connector.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/omapdrm/omap_connector.c +1 -1
@@ -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,
base-commit: 27f11fea33608cbd321a97cbecfa2ef97dcc1821
Signature · 1 line
2.27.0