warning in omap_connector

Alex Deucher alexdeucher at gmail.com
Tue Jun 30 14:19:23 UTC 2020


On Tue, Jun 30, 2020 at 10:15 AM Ville Syrjälä
<ville.syrjala at linux.intel.com> wrote:
>
> On Tue, Jun 30, 2020 at 04:33:37PM +1000, Dave Airlie wrote:
> > Hey Laurent,
> >
> > I merged drm-misc-next and noticed this, I'm not sure if it's
> > collateral damage from something else changing or I've just missed it
> > previously. 32-bit arm build.
> >
> >
> > /home/airlied/devel/kernel/dim/src/drivers/gpu/drm/omapdrm/omap_connector.c:
> > In function ‘omap_connector_mode_valid’:
> > /home/airlied/devel/kernel/dim/src/drivers/gpu/drm/omapdrm/omap_connector.c:92:9:
> > warning: braces around scalar initializer
> >   struct drm_display_mode new_mode = { { 0 } };
>
> Probably fallout from my drm_display_mode shrinkage.
>
> Going to repeat my usual "just use {} when zero initializing
> structs" recommendation. Avoids these stupid warnings, and IMO
> also conveys the meaning better since there's no ambiguity
> between zero initializing the whole struct vs. zero initializing
> just the first member.

IIRC, LLVM and GCC treat these slightly differently.  We've generally
just moved to using memset to avoid different compiler complaints when
using these.

Alex

>
> >          ^~~~~~~~~~~~~~~~
> > /home/airlied/devel/kernel/dim/src/drivers/gpu/drm/omapdrm/omap_connector.c:92:9:
> > note: (near initialization for ‘new_mode.clock’)
> >
> > Dave.
> > _______________________________________________
> > dri-devel mailing list
> > dri-devel at lists.freedesktop.org
> > https://lists.freedesktop.org/mailman/listinfo/dri-devel
>
> --
> Ville Syrjälä
> Intel
> _______________________________________________
> dri-devel mailing list
> dri-devel at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/dri-devel


More information about the dri-devel mailing list