Re: [PATCH] drm/dp_mst: Fix drm_dp_mst_topology.c selftest compilation warning

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Jani:

On 2020/4/14 19:08, Jani Nikula wrote:
On Mon, 13 Apr 2020, Alex Deucher <alexdeucher@xxxxxxxxx> wrote:
On Mon, Apr 13, 2020 at 5:29 AM Tang Bin <tangbin@xxxxxxxxxxxxxxxxxxxx> wrote:
The struct drm_dp_desc contains struct drm_dp_dpcd_ident, and the struct
drm_dp_dpcd_ident contains the array, so zero-initialization requires a
more couple of braces. In the ARM compiler environment, the compile
warning pointing it out:
    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:5494:9: warning: missing braces around initializer [-Wmissing-braces]
      struct drm_dp_desc desc = { 0 };

This seems to vary based on compilers.  Maybe a memset would be better.
= {}; will do the trick.

Yes, I had already confirmed this on the hardware before I mentioned the patch: '{}' or '{{{0}}}' are the same result in this file.But someone may query '{}' could not initialize all members, that's why I brought '{{{0}}}' up. Both initializations are validated on the hardware.

My environment:

  PC : Ubuntu 16.04

  Hardware : I.MX6ULL

  Tool Chain : arm-linux-gnueabihf-gcc (Linaro GCC 4.9-2017.01) 4.9.4


Thanks

Tang Bin


    

    
_______________________________________________
dri-devel mailing list
dri-devel@xxxxxxxxxxxxxxxxxxxxx
https://lists.freedesktop.org/mailman/listinfo/dri-devel

[Index of Archives]     [Linux DRI Users]     [Linux Intel Graphics]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux