linux-pwm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Thierry Reding <thierry.reding@gmail.com>
To: Brian Norris <briannorris@chromium.org>
Cc: linux-kernel@vger.kernel.org,
	Brian Norris <computersforpeace@gmail.com>,
	linux-pwm@vger.kernel.org,
	Javier Martinez Canillas <javier@osg.samsung.com>,
	Enric Balletbo <enric.balletbo@collabora.co.uk>,
	Dmitry Torokhov <dmitry.torokhov@gmail.com>,
	Gwendal Grignou <gwendal@chromium.org>,
	Guenter Roeck <linux@roeck-us.net>
Subject: Re: [PATCH] pwm: cros_ec: add __packed to prevent padding
Date: Mon, 5 Sep 2016 08:44:41 +0200	[thread overview]
Message-ID: <20160905064441.GD3532@ulmo.ba.sec> (raw)
In-Reply-To: <1469557333-9497-1-git-send-email-briannorris@chromium.org>

[-- Attachment #1: Type: text/plain, Size: 988 bytes --]

On Tue, Jul 26, 2016 at 11:22:13AM -0700, Brian Norris wrote:
> While the particular usage in question is likely safe (struct
> cros_ec_command is 32-bit aligned, followed by <=32-bit fields), it's
> been suggested this is not a great pattern to follow for the general
> case -- for example, if we follow a 'struct cros_ec_command' (which is
> 32-bit- but not 64-bit-aligned) with a struct that starts with a 64-bit
> type (e.g., u64), the compiler may add padding.
> 
> Let's add __packed, to inform the compiler of our true intention -- to
> have no padding between these struct elements -- and to future proof for
> any refactorings that might occur.
> 
> Signed-off-by: Brian Norris <briannorris@chromium.org>
> ---
> Hi Thierry,
> 
> I don't know of any bugs directly resolved by this patch, so take it for
> v4.8/v4.9 at your discretion.
> 
>  drivers/pwm/pwm-cros-ec.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)

Applied, thanks.

Thierry

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 801 bytes --]

      parent reply	other threads:[~2016-09-05  6:44 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-07-26 18:22 [PATCH] pwm: cros_ec: add __packed to prevent padding Brian Norris
2016-07-26 19:03 ` Dmitry Torokhov
2016-07-26 20:15 ` Guenter Roeck
2016-09-05  6:44 ` Thierry Reding [this message]

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=20160905064441.GD3532@ulmo.ba.sec \
    --to=thierry.reding@gmail.com \
    --cc=briannorris@chromium.org \
    --cc=computersforpeace@gmail.com \
    --cc=dmitry.torokhov@gmail.com \
    --cc=enric.balletbo@collabora.co.uk \
    --cc=gwendal@chromium.org \
    --cc=javier@osg.samsung.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pwm@vger.kernel.org \
    --cc=linux@roeck-us.net \
    /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).