lkml.org 
[lkml]   [2020]   [Apr]   [29]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRe: [PATCH] [v2] amdgpu: fix gcc-4.8 build warnings
On Wed, Apr 29, 2020 at 3:42 PM Kazlauskas, Nicholas
<nicholas.kazlauskas@amd.com> wrote:
>
> On 2020-04-29 5:20 a.m., Arnd Bergmann wrote:
> > Older compilers warn about initializers with incorrect curly
> > braces:
> >
> > drivers/gpu/drm/drm_dp_mst_topology.c: In function 'drm_dp_mst_dsc_aux_for_port':
> > drivers/gpu/drm/drm_dp_mst_topology.c:5497:9: error: missing braces around initializer [-Werror=missing-braces]
> > struct drm_dp_desc desc = { 0 };
> > ^
> >
> > Change all instances in the amd gpu driver to using the GNU empty
> > initializer extension.
>
> These should actually be memset - instead of GCC complaining, it'll be
> clang instead.

I'm not sure what you mean, clang certainly supports most GNU extensions,
and this one is used all over the kernel.

There is a good reason for using memset instead of ={}, e.g. when you want
to be sure that all padding fields get initialized before copying
stack variables
to user space, but I find it a little harder to read.

Arnd

\
 
 \ /
  Last update: 2020-04-29 22:16    [W:0.064 / U:0.812 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site