public inbox for linux-mmc@vger.kernel.org
 help / color / mirror / Atom feed
From: Jon Hunter <jonathanh@nvidia.com>
To: Grant Grundler <grundler@google.com>
Cc: Arnd Bergmann <arnd@arndb.de>,
	Ulf Hansson <ulf.hansson@linaro.org>,
	Olof Johansson <olofj@chromium.org>,
	Seshagiri Holi <sholi@nvidia.com>,
	"linux-mmc@vger.kernel.org" <linux-mmc@vger.kernel.org>,
	LKML <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] mmc: block: Add new ioctl to send multi commands
Date: Thu, 10 Sep 2015 19:20:54 +0100	[thread overview]
Message-ID: <55F1CA06.3020904@nvidia.com> (raw)
In-Reply-To: <CANEJEGsMM8c4fmSaZDzL59re99aNJk_qjo-10_UoD7josA6MDg@mail.gmail.com>


On 10/09/15 18:10, Grant Grundler wrote:
> On Thu, Sep 10, 2015 at 1:24 AM, Jon Hunter <jonathanh@nvidia.com> wrote:
> ...
>>> - you have some implicit padding after the structure and should replace that
>>>   with explictit pad bytes to extend the structure to a multiple of its
>>>   alignment (8 bytes).
>>
>> Would padding with __u32 at the end be sufficient here? I assume the
>> __u32 would be 32-bit aligned. However, was not sure if this would
>> always be the case.
> 
> Is there something wrong with implicit padding?
> Only one copy of the structure is passed to the kernel for any given call.
> 
>>>>> struct mmc_ioc_multi_cmd {
>>>>>     __u64 num_of_cmds;
>>>>>     struct mmc_ioc_cmd cmds[0];
>>>>> };
> 
> I think this would work just as well. But doesn't "pointer to an
> array" require 32-bit ioctl compat handling?
> We were trying to avoid a 32-bit user space compatibility handler.

I think that this is fine as it is a zero length array [0] and not a
pointer.

Cheers
Jon

[0] https://gcc.gnu.org/onlinedocs/gcc/Zero-Length.html

  reply	other threads:[~2015-09-10 18:21 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-09-09 15:06 [PATCH] mmc: block: Add new ioctl to send multi commands Jon Hunter
2015-09-09 15:56 ` Arnd Bergmann
2015-09-09 16:44   ` Jon Hunter
2015-09-09 20:22     ` Arnd Bergmann
2015-09-10  8:24       ` Jon Hunter
2015-09-10  8:38         ` Arnd Bergmann
2015-09-10 17:10         ` Grant Grundler
2015-09-10 18:20           ` Jon Hunter [this message]
2015-09-10 20:26             ` Grant Grundler

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=55F1CA06.3020904@nvidia.com \
    --to=jonathanh@nvidia.com \
    --cc=arnd@arndb.de \
    --cc=grundler@google.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mmc@vger.kernel.org \
    --cc=olofj@chromium.org \
    --cc=sholi@nvidia.com \
    --cc=ulf.hansson@linaro.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