linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Viresh Kumar <viresh.kumar@linaro.org>
To: Geert Uytterhoeven <geert@linux-m68k.org>
Cc: "Andy Shevchenko" <andy.shevchenko@gmail.com>,
	"Arnd Bergmann" <arnd@kernel.org>,
	"Linus Walleij" <linus.walleij@linaro.org>,
	"Bartosz Golaszewski" <bgolaszewski@baylibre.com>,
	"Bartosz Golaszewski" <brgl@bgdev.pl>,
	"Enrico Weigelt, metux IT consult" <info@metux.net>,
	"Viresh Kumar" <vireshk@kernel.org>,
	"Michael S. Tsirkin" <mst@redhat.com>,
	"Jason Wang" <jasowang@redhat.com>,
	"Vincent Guittot" <vincent.guittot@linaro.org>,
	"Jean-Philippe Brucker" <jean-philippe@linaro.org>,
	"Bill Mills" <bill.mills@linaro.org>,
	"Alex Bennée" <alex.bennee@linaro.org>,
	"Cornelia Huck" <cohuck@redhat.com>,
	"stratos-dev@op-lists.linaro.org"
	<stratos-dev@op-lists.linaro.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"Marc Zyngier" <maz@kernel.org>,
	"linux-gpio@vger.kernel.org" <linux-gpio@vger.kernel.org>,
	"virtualization@lists.linux-foundation.org"
	<virtualization@lists.linux-foundation.org>
Subject: Re: [PATCH V6] gpio: virtio: Add IRQ support
Date: Thu, 21 Oct 2021 16:19:50 +0530	[thread overview]
Message-ID: <20211021104950.nhvify5lo7y5fdfh@vireshk-i7> (raw)
In-Reply-To: <CAMuHMdWDRGmxt55vvRTnyu5SwXCDtkcOLmKA87cd4SSa8S+Z=Q@mail.gmail.com>

On 21-10-21, 12:07, Geert Uytterhoeven wrote:
> On Thu, Oct 21, 2021 at 11:52 AM Viresh Kumar <viresh.kumar@linaro.org> wrote:
> > The structure will get aligned to the size of largest element and each
> > element will be aligned to itself. I don't see how this will break
> > even in case of 32/64 bit communication.
> 
> Structures are not aligned to the size of the largest element, but
> to the largest alignment needed for each member.

Right, I was talking in terms of the structures we have here for GPIO.
The biggest member here (for any structure) is 32bits long, and
compiler shouldn't add extra padding here.

> This can be smaller than the size of the largest element.
> E.g. alignof(long long) might be 4, not 8. 

Right.

> And m68k aligns to two bytes at most.

Interesting, I assumed that it will be 4bytes for 32 bit systems. So
in case of m68k, we will see something like this ?

struct foo {
    u8 a;       // aligned to 2 bytes

                // padding of 1 byte

    u32 b;      // aligned to 2 bytes
}

-- 
viresh

  reply	other threads:[~2021-10-21 10:49 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-10-20 10:05 [PATCH V6] gpio: virtio: Add IRQ support Viresh Kumar
     [not found] ` <CAHp75Vctj-v8W+LgdVpYgRVL3fLdcFnOFRFg74LeCc=xLD+w4w@mail.gmail.com>
2021-10-21  4:34   ` Viresh Kumar
2021-10-21  9:42     ` Andy Shevchenko
2021-10-21  9:52       ` Viresh Kumar
2021-10-21  9:58         ` Andy Shevchenko
2021-10-21 10:02           ` Viresh Kumar
2021-10-21 10:47           ` Arnd Bergmann
2021-10-21 10:07         ` Geert Uytterhoeven
2021-10-21 10:49           ` Viresh Kumar [this message]
2021-10-21 11:02             ` Geert Uytterhoeven
2021-10-21 11:04               ` Viresh Kumar

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=20211021104950.nhvify5lo7y5fdfh@vireshk-i7 \
    --to=viresh.kumar@linaro.org \
    --cc=alex.bennee@linaro.org \
    --cc=andy.shevchenko@gmail.com \
    --cc=arnd@kernel.org \
    --cc=bgolaszewski@baylibre.com \
    --cc=bill.mills@linaro.org \
    --cc=brgl@bgdev.pl \
    --cc=cohuck@redhat.com \
    --cc=geert@linux-m68k.org \
    --cc=info@metux.net \
    --cc=jasowang@redhat.com \
    --cc=jean-philippe@linaro.org \
    --cc=linus.walleij@linaro.org \
    --cc=linux-gpio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=maz@kernel.org \
    --cc=mst@redhat.com \
    --cc=stratos-dev@op-lists.linaro.org \
    --cc=vincent.guittot@linaro.org \
    --cc=vireshk@kernel.org \
    --cc=virtualization@lists.linux-foundation.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;
as well as URLs for NNTP newsgroup(s).