Received: by 2002:a25:1506:0:0:0:0:0 with SMTP id 6csp973026ybv; Thu, 20 Feb 2020 10:37:47 -0800 (PST) X-Google-Smtp-Source: APXvYqwyJA2VJqUalNJbgoEhT41NFH8JGu/hilVkeVcUIqzQBYjhWNHJQo8YgCtwAd4gJerVxSJh X-Received: by 2002:a9d:7dc9:: with SMTP id k9mr24478826otn.117.1582223867762; Thu, 20 Feb 2020 10:37:47 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1582223867; cv=none; d=google.com; s=arc-20160816; b=BOKuIkh3/pXVjIKUQIhKM7WLmEgHu4E9Nm3CCZgWOjbtKbcjuizfL+wUhsXoty6Loa szdyBLLAoIyBuXuIztNkynwOxbaJPb7LaqOQkYw+l0rRbWPBDMlUiyiLUQcldNaHX2/V wf6zQkuOqd7beJqEqeId3Iy43dE3yc8edjeGSJ1M5QuQ/exl7JEx1xNY477wk5qRUcA7 92gElStHZzHsh6WS5Ubi2CP9YBJwk1reYMEvAdbgmKUuAc6qMOd4WBItRy1NO3rRCWQc 6Z1ZpO6EVVSvz2lql02gvn3+OHbLQtRgl7zktBEVc4DRlM8AhFKKUduzkXFNeSh4qyzq Jrdg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:reply-to:message-id :subject:cc:to:from:date:dkim-signature; bh=48sSWEflk/gI/Of186PHizXyGwkBvC3dhfjIj947Aa4=; b=SxOE5LUAP1GHGWUwMym8NFwsXe6z9YqbrrNdF3GEDMehVPPMmt1gH66/2PselpZR7v yiHcEbMX7xlcM13MXQ2SzorAnmH0HdMowvCClaHbxMRG0plp5DdlBcWfwKzdaQyjcLnN d+1o0qSxHiqzisMG/VJqEREnxjhZT4YkZtrHO0KNzcshEIHhzIiHO9fpnW8sN5c8L3X0 QPjQrWLhT0ila8wY2MQaxJY5tMiTFPj6JB7kffLvFv6q40tM6mDIRQ/tGjKJmiLaPVyA E+0MgX26fB/lr25p7OXRveuo3y8tpfj02iBmuRbWTVNbd3jqRlyUKVFYXTdA+l2LsTVt Cr0Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=aZOo1UB7; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id i15si39805oik.46.2020.02.20.10.37.35; Thu, 20 Feb 2020 10:37:47 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=aZOo1UB7; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728596AbgBTSgW (ORCPT + 99 others); Thu, 20 Feb 2020 13:36:22 -0500 Received: from mail.kernel.org ([198.145.29.99]:55410 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728217AbgBTSgW (ORCPT ); Thu, 20 Feb 2020 13:36:22 -0500 Received: from paulmck-ThinkPad-P72.home (50-39-105-78.bvtn.or.frontiernet.net [50.39.105.78]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 67C332465D; Thu, 20 Feb 2020 18:36:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1582223781; bh=vrlr8Yaqzkj9ziXbvSzTa5UcFiN65AQ7Ci7jczR5isA=; h=Date:From:To:Cc:Subject:Reply-To:References:In-Reply-To:From; b=aZOo1UB7NpW8BSawzs7dZGEoVH4N1bUITwekfRWZjJY7ZPihXzJCYpbpEAAffrQ4n y6kiFKN9rO73DEQ+s12+otJ8e/X7pIK7Lk0RfWa9Ws8rmC7I75n5N+PlJQY+lojkC7 xMjRiSrcprMWCzDMv87T9zb4dcqn7L2QAwix5ow8= Received: by paulmck-ThinkPad-P72.home (Postfix, from userid 1000) id 314ED352034E; Thu, 20 Feb 2020 10:36:21 -0800 (PST) Date: Thu, 20 Feb 2020 10:36:21 -0800 From: "Paul E. McKenney" To: Chris Wilson Cc: Alex Deucher , Dave Airlie , LKML , Maling list - DRI developers Subject: Re: drm_dp_mst_topology.c and old compilers Message-ID: <20200220183621.GW2935@paulmck-ThinkPad-P72> Reply-To: paulmck@kernel.org References: <20200220004232.GA28048@paulmck-ThinkPad-P72> <158218553821.8112.10047864129562395990@skylake-alporthouse-com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <158218553821.8112.10047864129562395990@skylake-alporthouse-com> User-Agent: Mutt/1.9.4 (2018-02-28) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Feb 20, 2020 at 07:58:58AM +0000, Chris Wilson wrote: > Quoting Alex Deucher (2020-02-20 02:52:32) > > On Wed, Feb 19, 2020 at 7:42 PM Paul E. McKenney wrote: > > > > > > Hello! > > > > > > A box with GCC 4.8.3 compiler didn't like drm_dp_mst_topology.c. The > > > following (lightly tested) patch makes it happy and seems OK for newer > > > compilers as well. > > > > > > Is this of interest? > > > > How about a memset instead? That should be consistent across compilers. > > The kernel has adopted the gccism: struct drm_dp_desc desc = {}; > git grep '= {}' | wc -l: 2046 > git grep '= { }' | wc -l: 694 > -Chris And this works well, a big "thank you!" to all three of you! Please see below for the updated patch. Thanx, Paul ------------------------------------------------------------------------ commit 78c0e53a98a9772a99e46806f8fcbe1140d667a4 Author: Paul E. McKenney Date: Wed Feb 19 16:42:47 2020 -0800 EXP drm: Make drm_dp_mst_dsc_aux_for_port() safe for old compilers Older compilers either want two extra pairs of curly braces around the initializer for local variable desc, or they want a single pair of curly braces with nothing inside. Current Linux-kernel practice favors the latter, so this commit makes it so. Suggested-by: Chris Wilson Suggested-by: Joe Perches Suggested-by: Christoph Hellwig Signed-off-by: Paul E. McKenney diff --git a/drivers/gpu/drm/drm_dp_mst_topology.c b/drivers/gpu/drm/drm_dp_mst_topology.c index 20cdaf3..b123f60 100644 --- a/drivers/gpu/drm/drm_dp_mst_topology.c +++ b/drivers/gpu/drm/drm_dp_mst_topology.c @@ -5396,7 +5396,7 @@ struct drm_dp_aux *drm_dp_mst_dsc_aux_for_port(struct drm_dp_mst_port *port) { struct drm_dp_mst_port *immediate_upstream_port; struct drm_dp_mst_port *fec_port; - struct drm_dp_desc desc = { 0 }; + struct drm_dp_desc desc = { }; u8 endpoint_fec; u8 endpoint_dsc;