[PATCH 1/2] ASoC: SOF: mediatek: add mt8188 audio support

Mark Brown broonie at kernel.org
Mon May 15 08:05:34 PDT 2023


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.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 488 bytes
Desc: not available
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20230516/6beabd85/attachment.sig>


More information about the linux-arm-kernel mailing list