All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Paul E. McKenney" <paulmck@kernel.org>
To: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Dave Airlie <airlied@linux.ie>,
	LKML <linux-kernel@vger.kernel.org>,
	Maling list - DRI developers <dri-devel@lists.freedesktop.org>
Subject: Re: drm_dp_mst_topology.c and old compilers
Date: Thu, 20 Feb 2020 10:36:21 -0800	[thread overview]
Message-ID: <20200220183621.GW2935@paulmck-ThinkPad-P72> (raw)
In-Reply-To: <158218553821.8112.10047864129562395990@skylake-alporthouse-com>

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 <paulmck@kernel.org> 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 <paulmck@kernel.org>
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 <chris@chris-wilson.co.uk>
    Suggested-by: Joe Perches <joe@perches.com>
    Suggested-by: Christoph Hellwig <hch@infradead.org>
    Signed-off-by: Paul E. McKenney <paulmck@kernel.org>

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;
 
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

WARNING: multiple messages have this Message-ID (diff)
From: "Paul E. McKenney" <paulmck@kernel.org>
To: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Alex Deucher <alexdeucher@gmail.com>,
	Dave Airlie <airlied@linux.ie>,
	LKML <linux-kernel@vger.kernel.org>,
	Maling list - DRI developers  <dri-devel@lists.freedesktop.org>
Subject: Re: drm_dp_mst_topology.c and old compilers
Date: Thu, 20 Feb 2020 10:36:21 -0800	[thread overview]
Message-ID: <20200220183621.GW2935@paulmck-ThinkPad-P72> (raw)
In-Reply-To: <158218553821.8112.10047864129562395990@skylake-alporthouse-com>

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 <paulmck@kernel.org> 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 <paulmck@kernel.org>
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 <chris@chris-wilson.co.uk>
    Suggested-by: Joe Perches <joe@perches.com>
    Suggested-by: Christoph Hellwig <hch@infradead.org>
    Signed-off-by: Paul E. McKenney <paulmck@kernel.org>

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;
 

  reply	other threads:[~2020-02-20 18:36 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-02-20  0:42 drm_dp_mst_topology.c and old compilers Paul E. McKenney
2020-02-20  0:42 ` Paul E. McKenney
2020-02-20  2:52 ` Alex Deucher
2020-02-20  2:52   ` Alex Deucher
2020-02-20  7:58   ` Chris Wilson
2020-02-20  7:58     ` Chris Wilson
2020-02-20 18:36     ` Paul E. McKenney [this message]
2020-02-20 18:36       ` Paul E. McKenney
2020-02-20 11:59 ` Joe Perches
2020-02-20 11:59   ` Joe Perches
2020-02-20 15:07 ` Christoph Hellwig

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200220183621.GW2935@paulmck-ThinkPad-P72 \
    --to=paulmck@kernel.org \
    --cc=airlied@linux.ie \
    --cc=chris@chris-wilson.co.uk \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.