[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20220425100229.GU38351@ediswmail.ad.cirrus.com>
Date: Mon, 25 Apr 2022 10:02:29 +0000
From: Charles Keepax <ckeepax@...nsource.cirrus.com>
To: Richard Fitzgerald <rf@...nsource.cirrus.com>
CC: <broonie@...nel.org>, <alsa-devel@...a-project.org>,
<linux-kernel@...r.kernel.org>, <patches@...nsource.cirrus.com>
Subject: Re: [PATCH] firmware: cirrus: cs_dsp: Avoid padding bytes in
cs_dsp_coeff_ctl
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@...nsource.cirrus.com>
> ---
Reviewed-by: Charles Keepax <ckeepax@...nsource.cirrus.com>
Thanks,
Charles
Powered by blists - more mailing lists