[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <ZGJKPuf1FX4AYLXl@finisterre.sirena.org.uk>
Date: Tue, 16 May 2023 00:05:34 +0900
From: Mark Brown <broonie@...nel.org>
To: AngeloGioacchino Del Regno
<angelogioacchino.delregno@...labora.com>
Cc: Trevor Wu <trevor.wu@...iatek.com>,
pierre-louis.bossart@...ux.intel.com,
peter.ujfalusi@...ux.intel.com, yung-chuan.liao@...ux.intel.com,
ranjani.sridharan@...ux.intel.com, kai.vehmanen@...ux.intel.com,
daniel.baluta@....com, lgirdwood@...il.com, tiwai@...e.com,
perex@...ex.cz, matthias.bgg@...il.com, yc.hung@...iatek.com,
tinghan.shen@...iatek.com, sound-open-firmware@...a-project.org,
alsa-devel@...a-project.org, linux-mediatek@...ts.infradead.org,
linux-arm-kernel@...ts.infradead.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH 1/2] ASoC: SOF: mediatek: add mt8188 audio support
On Mon, May 15, 2023 at 01:25:44PM +0200, AngeloGioacchino Del Regno wrote:
> Il 15/05/23 07:25, Trevor Wu ha scritto:
> > +{
> > + /* common defaults */
> > + memcpy(&sof_mt8188_ops, &sof_mt8186_ops, sizeof(struct snd_sof_dsp_ops));
> Never use sizeof(type), always use destination var size! Anyway, there's more.
>
> I don't think we need to perform this memcpy: we'll never see an instance of
> both mt8186 and mt8188 drivers on the same machine, so you can safely just use
> sof_mt8186_ops for mt8188...
> > + sof_mt8188_ops.drv = mt8188_dai;
> ...which obviously means that this becomes
> sof_mt8186_ops.drv = mt8188_dai;
This does have the issue that it then means the ops struct isn't const
which isn't ideal. It's also not the end of the world though so I don't
have super strong feelings.
Download attachment "signature.asc" of type "application/pgp-signature" (489 bytes)
Powered by blists - more mailing lists