From: Charles Keepax <ckeepax@opensource.cirrus.com>
To: Richard Fitzgerald <rf@opensource.cirrus.com>
Cc: <broonie@kernel.org>, <alsa-devel@alsa-project.org>,
<linux-kernel@vger.kernel.org>, <patches@opensource.cirrus.com>
Subject: Re: [PATCH] firmware: cirrus: cs_dsp: Avoid padding bytes in cs_dsp_coeff_ctl
Date: Mon, 25 Apr 2022 10:02:29 +0000 [thread overview]
Message-ID: <20220425100229.GU38351@ediswmail.ad.cirrus.com> (raw)
In-Reply-To: <20220425095159.3044527-1-rf@opensource.cirrus.com>
On Mon, Apr 25, 2022 at 10:51:59AM +0100, Richard Fitzgerald wrote:
> Change the order of members in struct cs_dsp_coeff_ctl to avoid
> the compiler having to insert alignment padding bytes. On a x86_64
> build this saves 16 bytes per control.
>
> - Pointers are collected to the top of the struct (with the exception of
> priv, as noted below), so that they are inherently aligned.
> - The set and enable bitflags are placed together so they can be merged.
> - priv is placed at the end of the struct - it is for use by the
> client so it is helpful to make it stand out, and since the compiler
> will always pad the struct size to an alignment multiple putting a
> pointer last won't introduce any more padding.
> - struct cs_dsp_alg_region is placed at the end, right before priv, for
> the same reasoning as priv.
>
> Signed-off-by: Richard Fitzgerald <rf@opensource.cirrus.com>
> ---
Reviewed-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Thanks,
Charles
next prev parent reply other threads:[~2022-04-25 10:03 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-04-25 9:51 Richard Fitzgerald
2022-04-25 10:02 ` Charles Keepax [this message]
2022-04-25 17:24 ` Mark Brown
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=20220425100229.GU38351@ediswmail.ad.cirrus.com \
--to=ckeepax@opensource.cirrus.com \
--cc=alsa-devel@alsa-project.org \
--cc=broonie@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=patches@opensource.cirrus.com \
--cc=rf@opensource.cirrus.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®