All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jakub Kicinski <kuba@kernel.org>
To: Ahmad Fatoum <a.fatoum@pengutronix.de>
Cc: Marc Kleine-Budde <mkl@pengutronix.de>,
	netdev@vger.kernel.org, linux-can@vger.kernel.org,
	Dan Murphy <dmurphy@ti.com>,
	kernel@pengutronix.de, Sean Nyekjaer <sean@geanix.com>,
	davem@davemloft.net
Subject: Re: [net-next 15/19] can: tcan4x5x: rework SPI access
Date: Fri, 8 Jan 2021 08:32:29 -0800	[thread overview]
Message-ID: <20210108083229.6f42479b@kicinski-fedora-pc1c0hjn.dhcp.thefacebook.com> (raw)
In-Reply-To: <8185f3e1-d0b1-0ea4-ac45-f2ea0b63ced9@pengutronix.de>

On Fri, 8 Jan 2021 11:07:26 +0100 Ahmad Fatoum wrote:
> >>> +struct __packed tcan4x5x_map_buf { 
> >>> +	struct tcan4x5x_buf_cmd cmd; 
> >>> +	u8 data[256 * sizeof(u32)]; 
> >>> +} ____cacheline_aligned;     
> >>
> >> Due to the packing of the struct tcan4x5x_buf_cmd it should have a length of 4
> >> bytes. Without __packed, will the "u8 data" come directly after the cmd?  
> > 
> > Yup, u8 with no alignment attribute will follow the previous
> > field with no holes.  
> 
> __packed has a documentation benefit though. It documents that the author
> considers the current layout to be the only correct one. (and thus extra
> care should be taken when modifying it).

____cacheline_aligned adds a big architecture dependent padding at the
end of this struct, so the size of this structure is architecture
dependent. Besides using packed forced the compiler to use byte by byte
loads on architectures without unaligned access, so __packed is not
free.

  reply	other threads:[~2021-01-08 16:33 UTC|newest]

Thread overview: 48+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-01-07  9:48 pull-request: can-next 2021-01-06 Marc Kleine-Budde
2021-01-07  9:48 ` [net-next 01/19] can: tcan4x5x: replace DEVICE_NAME by KBUILD_MODNAME Marc Kleine-Budde
2021-01-07  9:48 ` [net-next 02/19] can: tcan4x5x: beautify indention of tcan4x5x_of_match and tcan4x5x_id_table Marc Kleine-Budde
2021-01-07  9:48 ` [net-next 03/19] can: tcan4x5x: rename tcan4x5x.c -> tcan4x5x-core.c Marc Kleine-Budde
2021-01-07  9:48 ` [net-next 04/19] can: tcan4x5x: move regmap code into seperate file Marc Kleine-Budde
2021-01-07  9:48 ` [net-next 05/19] can: tcan4x5x: mark struct regmap_bus tcan4x5x_bus as constant Marc Kleine-Budde
2021-01-07  9:48 ` [net-next 06/19] can: tcan4x5x: tcan4x5x_bus: remove not needed read_flag_mask Marc Kleine-Budde
2021-01-07  9:48 ` [net-next 07/19] can: tcan4x5x: remove regmap async support Marc Kleine-Budde
2021-01-07  9:48 ` [net-next 08/19] can: tcan4x5x: rename regmap_spi_gather_write() -> tcan4x5x_regmap_gather_write() Marc Kleine-Budde
2021-01-07  9:48 ` [net-next 09/19] can: tcan4x5x: tcan4x5x_regmap_write(): remove not needed casts and replace 4 by sizeof Marc Kleine-Budde
2021-01-07  9:48 ` [net-next 10/19] can: tcan4x5x: tcan4x5x_regmap_init(): use spi as context pointer Marc Kleine-Budde
2021-01-07  9:48 ` [net-next 11/19] can: tcan4x5x: fix max register value Marc Kleine-Budde
2021-01-07  9:48 ` [net-next 12/19] can: tcan4x5x: tcan4x5x_regmap: set reg_stride to 4 Marc Kleine-Budde
2021-01-07  9:48 ` [net-next 13/19] can: tcan4x5x: add max_raw_{read,write} of 256 Marc Kleine-Budde
2021-01-07  9:48 ` [net-next 14/19] can: tcan4x5x: add {wr,rd}_table Marc Kleine-Budde
2021-01-07  9:48 ` [net-next 15/19] can: tcan4x5x: rework SPI access Marc Kleine-Budde
2021-01-07 19:00   ` Jakub Kicinski
2021-01-07 19:06     ` Jakub Kicinski
2021-01-07 21:17       ` Marc Kleine-Budde
2021-01-07 22:38         ` Jakub Kicinski
2021-01-08 10:07           ` Ahmad Fatoum
2021-01-08 16:32             ` Jakub Kicinski [this message]
2021-01-11 15:35               ` Ahmad Fatoum
2021-01-11 18:03                 ` Jakub Kicinski
2021-01-12 15:25           ` Marc Kleine-Budde
2021-01-08 21:53         ` David Laight
2021-01-12 15:36           ` Marc Kleine-Budde
2021-01-07 21:19     ` Marc Kleine-Budde
2021-01-07  9:48 ` [net-next 16/19] can: tcan4x5x: add support for half-duplex controllers Marc Kleine-Budde
2021-01-07  9:48 ` [net-next 17/19] can: raw: return -ERANGE when filterset does not fit into user space buffer Marc Kleine-Budde
2021-01-07  9:48 ` [net-next 18/19] dt-bindings: can: fsl,flexcan: add fsl,scu-index property to indicate a resource Marc Kleine-Budde
2021-01-07  9:49 ` [net-next 19/19] can: flexcan: add CAN wakeup function for i.MX8QM Marc Kleine-Budde
2021-01-07 13:56   ` kernel test robot
2021-01-07 14:26     ` Marc Kleine-Budde
2021-01-07 14:26       ` Marc Kleine-Budde
2021-01-07 14:47       ` Marc Kleine-Budde
2021-01-07 14:47         ` Marc Kleine-Budde
2021-01-07 15:06   ` kernel test robot
2021-01-07 15:17     ` Marc Kleine-Budde
2021-01-07 15:17       ` Marc Kleine-Budde
2021-01-07 20:07   ` kernel test robot
2021-01-07 21:22     ` Marc Kleine-Budde
2021-01-07 21:22       ` Marc Kleine-Budde
2021-01-08  7:07       ` [kbuild-all] " Rong Chen
2021-01-08  7:07         ` Rong Chen
2021-01-08  8:01         ` [kbuild-all] " Marc Kleine-Budde
2021-01-08  8:01           ` Marc Kleine-Budde
2021-01-07 19:07 ` pull-request: can-next 2021-01-06 Jakub Kicinski

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=20210108083229.6f42479b@kicinski-fedora-pc1c0hjn.dhcp.thefacebook.com \
    --to=kuba@kernel.org \
    --cc=a.fatoum@pengutronix.de \
    --cc=davem@davemloft.net \
    --cc=dmurphy@ti.com \
    --cc=kernel@pengutronix.de \
    --cc=linux-can@vger.kernel.org \
    --cc=mkl@pengutronix.de \
    --cc=netdev@vger.kernel.org \
    --cc=sean@geanix.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.