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