[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20180910095209.GK14465@lahna.fi.intel.com>
Date: Mon, 10 Sep 2018 12:52:09 +0300
From: Mika Westerberg <mika.westerberg@...ux.intel.com>
To: Lukas Wunner <lukas@...ner.de>
Cc: Andreas Noever <andreas.noever@...il.com>,
Michael Jamet <michael.jamet@...el.com>,
Yehezkel Bernat <YehezkelShB@...il.com>,
Stephen Hemminger <stephen@...workplumber.org>,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH 2/5] thunderbolt: Obtain PCI slot number from DROM
On Sun, Sep 09, 2018 at 11:42:01PM +0200, Lukas Wunner wrote:
> +struct tb_drom_entry_pci {
> + /* BYTES 0-1 */
> + struct tb_drom_entry_header header;
> + /* BYTE 2 */
> + u8 unknown:5;
> + u8 slot:3;
> + /* BYTES 3-10 are only present on PCIe upstream ports */
> +} __packed;
No need for __packed unless you absolutely are certain the compiler does
not do the right thing. When I submitted the network driver, David
Miller explained this to me and I ended up dropping those.
Also use of bitfields is something we should avoid when touching
hardware/firmware records because compiler here can do all sorts of
tricks.
I know the driver is currently using quite many of them but I think it
is good for the new code not to include them anymore.
Powered by blists - more mailing lists