From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Lin, Mengdong" Subject: Re: [PATCH v6 01/11] ASoC: topology: Make manifest backward compatible from ABI v4 Date: Tue, 1 Nov 2016 13:49:46 +0000 Message-ID: References: <39acbd6c55ca9ac0855001d5a67d7d96fddd0c7b.1476166990.git.mengdong.lin@linux.intel.com> <20161028184721.ttqte2jot5crlz2y@sirena.org.uk> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) by alsa0.perex.cz (Postfix) with ESMTP id 539ED261560 for ; Tue, 1 Nov 2016 14:49:52 +0100 (CET) In-Reply-To: <20161028184721.ttqte2jot5crlz2y@sirena.org.uk> Content-Language: en-US List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: alsa-devel-bounces@alsa-project.org To: Mark Brown , "mengdong.lin@linux.intel.com" Cc: "alsa-devel@alsa-project.org" , "tiwai@suse.de" , "Shah, Hardik T" , "Singh, Guneshwor O" , "liam.r.girdwood@linux.intel.com" , "Koul, Vinod" , "Ughreja, Rakesh A" List-Id: alsa-devel@alsa-project.org > -----Original Message----- > From: Mark Brown [mailto:broonie@kernel.org] > Sent: Saturday, October 29, 2016 2:47 AM > To: mengdong.lin@linux.intel.com > Cc: alsa-devel@alsa-project.org; tiwai@suse.de; > liam.r.girdwood@linux.intel.com; Shah, Hardik T ; > Singh, Guneshwor O ; Koul, Vinod > ; Ughreja, Rakesh A ; > Lin, Mengdong > Subject: Re: [PATCH v6 01/11] ASoC: topology: Make manifest backward > compatible from ABI v4 > > On Tue, Oct 11, 2016 at 02:36:42PM +0800, mengdong.lin@linux.intel.com > wrote: > > > +static int manifest_new_ver(struct soc_tplg *tplg, > > + struct snd_soc_tplg_manifest *src, > > + struct snd_soc_tplg_manifest **manifest) { > > + struct snd_soc_tplg_manifest *dest; > > + struct snd_soc_tplg_manifest_v4 *src_v4; > > + > > + *manifest = NULL; > > + > > + if (src->size != sizeof(*src_v4)) { > > + dev_err(tplg->dev, "ASoC: invalid manifest size\n"); > > + return -EINVAL; > > + } > > + > > + dev_warn(tplg->dev, "ASoC: old version of manifest\n"); > > The way this function is written it's not going to scale to any future ABI > churn, it's not set up to handle multiple versions at all. If future ABI change affects this manifest struct, we'll extend this function to map all old versions to the latest one. Since we already add some reserved fields in the manifest, so we can use those reserved fields to assure backward compatibility and there could be no change on this function. Thanks Mengdong