All of lore.kernel.org
 help / color / mirror / Atom feed
From: Christoph Hellwig <hch@infradead.org>
To: Lukas Wunner <lukas@wunner.de>
Cc: Christoph Hellwig <hch@infradead.org>,
	Mariusz Tkaczyk <mariusz.tkaczyk@linux.intel.com>,
	linux-pci@vger.kernel.org, Arnd Bergmann <arnd@arndb.de>,
	Bjorn Helgaas <bhelgaas@google.com>,
	Dan Williams <dan.j.williams@intel.com>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	Ilpo Jarvinen <ilpo.jarvinen@linux.intel.com>,
	Keith Busch <kbusch@kernel.org>, Marek Behun <marek.behun@nic.cz>,
	Pavel Machek <pavel@ucw.cz>, Randy Dunlap <rdunlap@infradead.org>,
	Andy Shevchenko <andriy.shevchenko@linux.intel.com>,
	Stuart Hayes <stuart.w.hayes@gmail.com>
Subject: Re: [PATCH v3 3/3] PCI/NPEM: Add _DSM PCIe SSD status LED management
Date: Mon, 8 Jul 2024 03:14:44 -0700	[thread overview]
Message-ID: <Zou8FJLJ-3H7CInO@infradead.org> (raw)
In-Reply-To: <Zof-P7jNmoLvJTF-@wunner.de>

On Fri, Jul 05, 2024 at 04:07:59PM +0200, Lukas Wunner wrote:
> On Fri, Jul 05, 2024 at 06:04:39AM -0700, Christoph Hellwig wrote:
> > > +struct dsm_output {
> > > +	u16 status;
> > > +	u8 function_specific_err;
> > > +	u8 vendor_specific_err;
> > > +	u32 state;
> > > +} __packed;
> > 
> > This structure is naturally aligned, so no need for the __packed.
> 
> Isn't the compiler free to insert padding wherever it sees fit?

In terms of the standard: yes.  It could even reorder members.  In
terms of not breaking the Linux kernel (or other low-level software)
left, right and center: no.

> structs passed to ACPI firmware would no longer comply with the
> spec-prescribed layout then and declaring them __packed seems to be
> the only way to ensure that doesn't happen.

Take a look at just about any driver, file system or network protocol.


  reply	other threads:[~2024-07-08 10:14 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-07-05 12:54 [PATCH v3 0/3] PCIe Enclosure LED Management Mariusz Tkaczyk
2024-07-05 12:54 ` [PATCH v3 1/3] leds: Init leds class earlier Mariusz Tkaczyk
2024-07-05 12:58   ` Christoph Hellwig
2024-07-05 12:54 ` [PATCH v3 2/3] PCI/NPEM: Add Native PCIe Enclosure Management support Mariusz Tkaczyk
2024-07-05 13:02   ` Christoph Hellwig
2024-07-05 13:22     ` Mariusz Tkaczyk
2024-07-05 13:29       ` Christoph Hellwig
2024-07-06  4:11   ` kernel test robot
2024-07-08 11:33   ` Ilpo Järvinen
2024-07-08 14:24     ` Mariusz Tkaczyk
2024-07-08 16:13       ` Ilpo Järvinen
2024-07-08 14:27     ` Lukas Wunner
2024-07-05 12:54 ` [PATCH v3 3/3] PCI/NPEM: Add _DSM PCIe SSD status LED management Mariusz Tkaczyk
2024-07-05 13:04   ` Christoph Hellwig
2024-07-05 14:07     ` Lukas Wunner
2024-07-08 10:14       ` Christoph Hellwig [this message]
2024-07-08 11:39   ` Ilpo Järvinen
2024-07-05 19:11 ` [PATCH v3 0/3] PCIe Enclosure LED Management stuart hayes

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=Zou8FJLJ-3H7CInO@infradead.org \
    --to=hch@infradead.org \
    --cc=andriy.shevchenko@linux.intel.com \
    --cc=arnd@arndb.de \
    --cc=bhelgaas@google.com \
    --cc=dan.j.williams@intel.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=ilpo.jarvinen@linux.intel.com \
    --cc=kbusch@kernel.org \
    --cc=linux-pci@vger.kernel.org \
    --cc=lukas@wunner.de \
    --cc=marek.behun@nic.cz \
    --cc=mariusz.tkaczyk@linux.intel.com \
    --cc=pavel@ucw.cz \
    --cc=rdunlap@infradead.org \
    --cc=stuart.w.hayes@gmail.com \
    /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.