lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <3dd728e8ca50e54b475afec1b70569548f2bee94.camel@mediatek.com>
Date:   Tue, 16 May 2023 03:34:55 +0000
From:   Trevor Wu (吳文良) <Trevor.Wu@...iatek.com>
To:     "pierre-louis.bossart@...ux.intel.com" 
        <pierre-louis.bossart@...ux.intel.com>,
        "broonie@...nel.org" <broonie@...nel.org>,
        "angelogioacchino.delregno@...labora.com" 
        <angelogioacchino.delregno@...labora.com>
CC:     "linux-mediatek@...ts.infradead.org" 
        <linux-mediatek@...ts.infradead.org>,
        "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
        YC Hung (洪堯俊) <yc.hung@...iatek.com>,
        "kai.vehmanen@...ux.intel.com" <kai.vehmanen@...ux.intel.com>,
        "tiwai@...e.com" <tiwai@...e.com>,
        "ranjani.sridharan@...ux.intel.com" 
        <ranjani.sridharan@...ux.intel.com>,
        "lgirdwood@...il.com" <lgirdwood@...il.com>,
        "linux-arm-kernel@...ts.infradead.org" 
        <linux-arm-kernel@...ts.infradead.org>,
        "yung-chuan.liao@...ux.intel.com" <yung-chuan.liao@...ux.intel.com>,
        "daniel.baluta@....com" <daniel.baluta@....com>,
        "peter.ujfalusi@...ux.intel.com" <peter.ujfalusi@...ux.intel.com>,
        "perex@...ex.cz" <perex@...ex.cz>,
        "matthias.bgg@...il.com" <matthias.bgg@...il.com>,
        TingHan Shen (沈廷翰) 
        <TingHan.Shen@...iatek.com>,
        "sound-open-firmware@...a-project.org" 
        <sound-open-firmware@...a-project.org>,
        "alsa-devel@...a-project.org" <alsa-devel@...a-project.org>
Subject: Re: [PATCH 1/2] ASoC: SOF: mediatek: add mt8188 audio support

On Mon, 2023-05-15 at 10:28 -0500, Pierre-Louis Bossart wrote:
> External email : Please do not click links or open attachments until
> you have verified the sender or the content.
> 
> 
> On 5/15/23 10:05, Mark Brown wrote:
> > 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.

OK, I will use sizeof(sof_mt8188_ops) instead.

> > > 
> > > 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.
> 
> We do the same for Intel devices, we have a common structure which is
> copied and only the members that differ in specific SOCs are updated.
> You're right that it's not constant, but it avoids copy-paste of a
> rather large structure just to change a couple of lines.

Currently, I prefer to follow the same implementation as Intel devices.
It's easier to see a different ops exists for mt8188 in
sof_of_mt8188_desc and it really avoids copy-paste of a large
structure.


Additionally, I found a typo in the next line.

sof_mt8186_ops.num_drv = ARRAY_SIZE(mt8188_dai);
	^
This should be sof_mt8188_ops. I will correct it in V2.

Thanks,
Trevor

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ