From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=0.8 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, HTML_MESSAGE,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 42066C2BA2B for ; Wed, 15 Apr 2020 07:18:47 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 8304B206F9 for ; Wed, 15 Apr 2020 07:18:46 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 8304B206F9 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=cmss.chinamobile.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id EF0FB6E86B; Wed, 15 Apr 2020 07:17:58 +0000 (UTC) Received: from cmccmta1.chinamobile.com (cmccmta1.chinamobile.com [221.176.66.79]) by gabe.freedesktop.org (Postfix) with ESMTP id E02B789BC0 for ; Tue, 14 Apr 2020 12:37:38 +0000 (UTC) Received: from spf.mail.chinamobile.com (unknown[172.16.121.13]) by rmmx-syy-dmz-app03-12003 (RichMail) with SMTP id 2ee35e95ae7ef07-541ba; Tue, 14 Apr 2020 20:37:22 +0800 (CST) X-RM-TRANSID: 2ee35e95ae7ef07-541ba X-RM-TagInfo: emlType=0 X-RM-SPAM-FLAG: 00000000 Received: from [192.168.0.102] (unknown[112.3.208.246]) by rmsmtp-syy-appsvr07-12007 (RichMail) with SMTP id 2ee75e95ae80772-e8ef5; Tue, 14 Apr 2020 20:37:22 +0800 (CST) X-RM-TRANSID: 2ee75e95ae80772-e8ef5 Subject: Re: [PATCH] drm/dp_mst: Fix drm_dp_mst_topology.c selftest compilation warning To: Jani Nikula , Alex Deucher References: <20200411141740.14584-1-tangbin@cmss.chinamobile.com> <87imi2miin.fsf@intel.com> From: Tang Bin Message-ID: Date: Tue, 14 Apr 2020 20:39:14 +0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:68.0) Gecko/20100101 Thunderbird/68.7.0 MIME-Version: 1.0 In-Reply-To: <87imi2miin.fsf@intel.com> Content-Language: en-US X-Mailman-Approved-At: Wed, 15 Apr 2020 07:17:53 +0000 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Dave Airlie , LKML , Maling list - DRI developers Content-Type: multipart/mixed; boundary="===============0431624816==" Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" This is a multi-part message in MIME format. --===============0431624816== Content-Type: multipart/alternative; boundary="------------DC925C4A3BC7418B3461611D" Content-Language: en-US This is a multi-part message in MIME format. --------------DC925C4A3BC7418B3461611D Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Hi Jani: On 2020/4/14 19:08, Jani Nikula wrote: > On Mon, 13 Apr 2020, Alex Deucher wrote: >> On Mon, Apr 13, 2020 at 5:29 AM Tang Bin 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 --------------DC925C4A3BC7418B3461611D Content-Type: text/html; charset=utf-8 Content-Transfer-Encoding: 8bit

Hi Jani:

On 2020/4/14 19:08, Jani Nikula wrote:
On Mon, 13 Apr 2020, Alex Deucher <alexdeucher@gmail.com> wrote:
On Mon, Apr 13, 2020 at 5:29 AM Tang Bin <tangbin@cmss.chinamobile.com> 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


    

    
--------------DC925C4A3BC7418B3461611D-- --===============0431624816== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel --===============0431624816==--