public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Johan Hovold <johan@kernel.org>
To: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Johan Hovold <johan@kernel.org>,
	"Gustavo A. R. Silva" <gustavoars@kernel.org>,
	Alex Elder <elder@kernel.org>,
	greybus-dev@lists.linaro.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] staging: greybus: Replace zero-length array with flexible-array
Date: Wed, 13 May 2020 17:48:07 +0200	[thread overview]
Message-ID: <20200513154807.GA25962@localhost> (raw)
In-Reply-To: <20200513153918.GA1360420@kroah.com>

On Wed, May 13, 2020 at 05:39:18PM +0200, Greg Kroah-Hartman wrote:
> On Wed, May 13, 2020 at 05:03:43PM +0200, Johan Hovold wrote:
> > On Thu, May 07, 2020 at 01:53:18PM -0500, Gustavo A. R. Silva wrote:
> > > The current codebase makes use of the zero-length array language
> > > extension to the C90 standard, but the preferred mechanism to declare
> > > variable-length types such as these ones is a flexible array member[1][2],
> > > introduced in C99:
> > > 
> > > struct foo {
> > >         int stuff;
> > >         struct boo array[];
> > > };

> > >  drivers/greybus/arpc.h                    |    2 -
> > >  include/linux/greybus/greybus_protocols.h |   44 +++++++++++++++---------------
> > 
> > I noticed Greg just applied this one to his -testing branch, but do we
> > really want this in greybus_protocols.h, which is meant to be shared
> > with the firmware side? Perhaps not an issue, just figured I'd point
> > this out.
> 
> Why not, it should be the same thing, right?  No logic has changed that
> I see.

Yes, the structure's the same, but the firmware toolchain may not
expect flexible arrays. I believe we're holding back on these changes
for uapi headers as well for that reason?

Again, perhaps not an issue. We can just mandate fw toolchains that
support C99 if you want to use an unmodified header, I guess.

Johan

  reply	other threads:[~2020-05-13 15:48 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-05-07 18:53 [PATCH] staging: greybus: Replace zero-length array with flexible-array Gustavo A. R. Silva
2020-05-13 15:03 ` Johan Hovold
2020-05-13 15:39   ` Greg Kroah-Hartman
2020-05-13 15:48     ` Johan Hovold [this message]
2020-05-13 16:07       ` Greg Kroah-Hartman

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=20200513154807.GA25962@localhost \
    --to=johan@kernel.org \
    --cc=elder@kernel.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=greybus-dev@lists.linaro.org \
    --cc=gustavoars@kernel.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox