* [PATCH v1] ASoc: tas2781: Rename dai_driver name to unify the name between TAS2563 and TAS2781 @ 2024-08-03 3:27 Shenghao Ding 2024-08-05 12:48 ` Mark Brown 2024-08-12 15:51 ` Andy Shevchenko 0 siblings, 2 replies; 7+ messages in thread From: Shenghao Ding @ 2024-08-03 3:27 UTC (permalink / raw) To: broonie Cc: andriy.shevchenko, lgirdwood, perex, pierre-louis.bossart, 13916275206, zhourui, alsa-devel, i-salazar, linux-kernel, j-chadha, liam.r.girdwood, jaden-yue, yung-chuan.liao, dipa, yuhsuan, henry.lo, tiwai, baojun.xu, soyer, Baojun.Xu, judyhsiao, navada, cujomalainey, aanya, nayeem.mahmud, savyasanchi.shukla, flaviopr, jesse-ji, darren.ye, antheas.dk, Jerry2.Huang, Shenghao Ding Rename dai_driver name to unify the name between TAS2563 and TAS2781, remove unnecessary line feed, strscpy replace scnprintf. Signed-off-by: Shenghao Ding <shenghao-ding@ti.com> --- v1: - Use strscpy to replace scnprintf. - rename dai_driver name from "tas2781_codec" to "tasdev_codec", in case of misunderstanding whether tas2781 or tas2563. - Remove unnecessary line feed for tasdevice_dsp_create_ctrls --- sound/soc/codecs/tas2781-i2c.c | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/sound/soc/codecs/tas2781-i2c.c b/sound/soc/codecs/tas2781-i2c.c index 8a57c045afdd..6631254d4985 100644 --- a/sound/soc/codecs/tas2781-i2c.c +++ b/sound/soc/codecs/tas2781-i2c.c @@ -353,7 +353,7 @@ static int tasdevice_create_control(struct tasdevice_priv *tas_priv) ret = -ENOMEM; goto out; } - scnprintf(name, SNDRV_CTL_ELEM_ID_NAME_MAXLEN, "Speaker Profile Id"); + strscpy(name, "Speaker Profile Id", SNDRV_CTL_ELEM_ID_NAME_MAXLEN); prof_ctrls[mix_index].name = name; prof_ctrls[mix_index].iface = SNDRV_CTL_ELEM_IFACE_MIXER; prof_ctrls[mix_index].info = tasdevice_info_profile; @@ -424,8 +424,7 @@ static int tasdevice_configuration_put( return ret; } -static int tasdevice_dsp_create_ctrls( - struct tasdevice_priv *tas_priv) +static int tasdevice_dsp_create_ctrls(struct tasdevice_priv *tas_priv) { struct snd_kcontrol_new *dsp_ctrls; char *prog_name, *conf_name; @@ -453,8 +452,8 @@ static int tasdevice_dsp_create_ctrls( goto out; } - scnprintf(prog_name, SNDRV_CTL_ELEM_ID_NAME_MAXLEN, - "Speaker Program Id"); + strscpy(prog_name, "Speaker Program Id", + SNDRV_CTL_ELEM_ID_NAME_MAXLEN); dsp_ctrls[mix_index].name = prog_name; dsp_ctrls[mix_index].iface = SNDRV_CTL_ELEM_IFACE_MIXER; dsp_ctrls[mix_index].info = tasdevice_info_programs; @@ -462,8 +461,7 @@ static int tasdevice_dsp_create_ctrls( dsp_ctrls[mix_index].put = tasdevice_program_put; mix_index++; - scnprintf(conf_name, SNDRV_CTL_ELEM_ID_NAME_MAXLEN, - "Speaker Config Id"); + strscpy(conf_name, "Speaker Config Id", SNDRV_CTL_ELEM_ID_NAME_MAXLEN); dsp_ctrls[mix_index].name = conf_name; dsp_ctrls[mix_index].iface = SNDRV_CTL_ELEM_IFACE_MIXER; dsp_ctrls[mix_index].info = tasdevice_info_configurations; @@ -673,7 +671,7 @@ static const struct snd_soc_dai_ops tasdevice_dai_ops = { static struct snd_soc_dai_driver tasdevice_dai_driver[] = { { - .name = "tas2781_codec", + .name = "tasdev_codec", .id = 0, .playback = { .stream_name = "Playback", -- 2.34.1 ^ permalink raw reply related [flat|nested] 7+ messages in thread
* Re: [PATCH v1] ASoc: tas2781: Rename dai_driver name to unify the name between TAS2563 and TAS2781 2024-08-03 3:27 [PATCH v1] ASoc: tas2781: Rename dai_driver name to unify the name between TAS2563 and TAS2781 Shenghao Ding @ 2024-08-05 12:48 ` Mark Brown 2024-08-12 15:51 ` Andy Shevchenko 1 sibling, 0 replies; 7+ messages in thread From: Mark Brown @ 2024-08-05 12:48 UTC (permalink / raw) To: Shenghao Ding Cc: andriy.shevchenko, lgirdwood, perex, pierre-louis.bossart, 13916275206, zhourui, alsa-devel, i-salazar, linux-kernel, j-chadha, liam.r.girdwood, jaden-yue, yung-chuan.liao, dipa, yuhsuan, henry.lo, tiwai, baojun.xu, soyer, Baojun.Xu, judyhsiao, navada, cujomalainey, aanya, nayeem.mahmud, savyasanchi.shukla, flaviopr, jesse-ji, darren.ye, antheas.dk, Jerry2.Huang [-- Attachment #1: Type: text/plain, Size: 456 bytes --] On Sat, Aug 03, 2024 at 11:27:14AM +0800, Shenghao Ding wrote: > Rename dai_driver name to unify the name between TAS2563 and > TAS2781, remove unnecessary line feed, strscpy replace scnprintf. As people have previously said and is covered in submitting-patches.rst you should be submitting one patch per change, not combining multiple patches into a single change. Each of the tree things you describe in the changelog here should be a separate patch. [-- Attachment #2: signature.asc --] [-- Type: application/pgp-signature, Size: 488 bytes --] ^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH v1] ASoc: tas2781: Rename dai_driver name to unify the name between TAS2563 and TAS2781 2024-08-03 3:27 [PATCH v1] ASoc: tas2781: Rename dai_driver name to unify the name between TAS2563 and TAS2781 Shenghao Ding 2024-08-05 12:48 ` Mark Brown @ 2024-08-12 15:51 ` Andy Shevchenko 2024-08-15 3:02 ` [EXTERNAL] " Ding, Shenghao 1 sibling, 1 reply; 7+ messages in thread From: Andy Shevchenko @ 2024-08-12 15:51 UTC (permalink / raw) To: Shenghao Ding Cc: broonie, lgirdwood, perex, pierre-louis.bossart, 13916275206, zhourui, alsa-devel, i-salazar, linux-kernel, j-chadha, liam.r.girdwood, jaden-yue, yung-chuan.liao, dipa, yuhsuan, henry.lo, tiwai, baojun.xu, soyer, Baojun.Xu, judyhsiao, navada, cujomalainey, aanya, nayeem.mahmud, savyasanchi.shukla, flaviopr, jesse-ji, darren.ye, antheas.dk, Jerry2.Huang On Sat, Aug 03, 2024 at 11:27:14AM +0800, Shenghao Ding wrote: > Rename dai_driver name to unify the name between TAS2563 and > TAS2781, remove unnecessary line feed, strscpy replace scnprintf. ... > + strscpy(name, "Speaker Profile Id", SNDRV_CTL_ELEM_ID_NAME_MAXLEN); > + strscpy(prog_name, "Speaker Program Id", > + SNDRV_CTL_ELEM_ID_NAME_MAXLEN); > + strscpy(conf_name, "Speaker Config Id", SNDRV_CTL_ELEM_ID_NAME_MAXLEN); Why not 2-parameter strscpy()? -- With Best Regards, Andy Shevchenko ^ permalink raw reply [flat|nested] 7+ messages in thread
* RE: [EXTERNAL] Re: [PATCH v1] ASoc: tas2781: Rename dai_driver name to unify the name between TAS2563 and TAS2781 2024-08-12 15:51 ` Andy Shevchenko @ 2024-08-15 3:02 ` Ding, Shenghao 2024-08-15 12:04 ` Andy Shevchenko 0 siblings, 1 reply; 7+ messages in thread From: Ding, Shenghao @ 2024-08-15 3:02 UTC (permalink / raw) To: Andy Shevchenko Cc: broonie@kernel.org, lgirdwood@gmail.com, perex@perex.cz, pierre-louis.bossart@linux.intel.com, 13916275206@139.com, zhourui@huaqin.com, alsa-devel@alsa-project.org, Salazar, Ivan, linux-kernel@vger.kernel.org, Chadha, Jasjot Singh, liam.r.girdwood@intel.com, Yue, Jaden, yung-chuan.liao@linux.intel.com, Rao, Dipa, yuhsuan@google.com, Lo, Henry, tiwai@suse.de, Xu, Baojun, soyer@irl.hu, Baojun.Xu@fpt.com, judyhsiao@google.com, Navada Kanyana, Mukund, cujomalainey@google.com, Kutty, Aanya, Mahmud, Nayeem, savyasanchi.shukla@netradyne.com, flaviopr@microsoft.com, Ji, Jesse, darren.ye@mediatek.com, antheas.dk@gmail.com, Jerry2.Huang@lcfuturecenter.com Hi Andy > -----Original Message----- > From: Andy Shevchenko <andriy.shevchenko@linux.intel.com> > Sent: Monday, August 12, 2024 11:52 PM > To: Ding, Shenghao <shenghao-ding@ti.com> > Cc: broonie@kernel.org; lgirdwood@gmail.com; perex@perex.cz; pierre- > louis.bossart@linux.intel.com; 13916275206@139.com; zhourui@huaqin.com; > alsa-devel@alsa-project.org; Salazar, Ivan <i-salazar@ti.com>; linux- > kernel@vger.kernel.org; Chadha, Jasjot Singh <j-chadha@ti.com>; > liam.r.girdwood@intel.com; Yue, Jaden <jaden-yue@ti.com>; yung- > chuan.liao@linux.intel.com; Rao, Dipa <dipa@ti.com>; yuhsuan@google.com; > Lo, Henry <henry.lo@ti.com>; tiwai@suse.de; Xu, Baojun <baojun.xu@ti.com>; > soyer@irl.hu; Baojun.Xu@fpt.com; judyhsiao@google.com; Navada Kanyana, > Mukund <navada@ti.com>; cujomalainey@google.com; Kutty, Aanya > <aanya@ti.com>; Mahmud, Nayeem <nayeem.mahmud@ti.com>; > savyasanchi.shukla@netradyne.com; flaviopr@microsoft.com; Ji, Jesse <jesse- > ji@ti.com>; darren.ye@mediatek.com; antheas.dk@gmail.com; > Jerry2.Huang@lcfuturecenter.com > Subject: [EXTERNAL] Re: [PATCH v1] ASoc: tas2781: Rename dai_driver name > to unify the name between TAS2563 and TAS2781 > > On Sat, Aug 03, 2024 at 11: 27: 14AM +0800, Shenghao Ding wrote: > Rename > dai_driver name to unify the name between TAS2563 and > TAS2781, remove > unnecessary line feed, strscpy replace scnprintf. .. . > + strscpy(name, "Speaker > Profile ZjQcmQRYFpfptBannerStart This message was sent from outside of > Texas Instruments. > Do not click links or open attachments unless you recognize the source of this > email and know the content is safe. > <https://us-phishalarm- > ewt.proofpoint.com/EWT/v1/G3vK!uBdnVVxnvcFVRgmk1Nnj19hgRvdKBLGzO0 > fOFtIPHgaMy7sMNbJz9Iq6JNvpJGah386MvWqQ0VSy_XxhVlo$> > Report Suspicious > > ZjQcmQRYFpfptBannerEnd > On Sat, Aug 03, 2024 at 11:27:14AM +0800, Shenghao Ding wrote: > > Rename dai_driver name to unify the name between TAS2563 and TAS2781, > > remove unnecessary line feed, strscpy replace scnprintf. > > ... > > > + strscpy(name, "Speaker Profile Id", > SNDRV_CTL_ELEM_ID_NAME_MAXLEN); > > > + strscpy(prog_name, "Speaker Program Id", > > + SNDRV_CTL_ELEM_ID_NAME_MAXLEN); > > > + strscpy(conf_name, "Speaker Config Id", > > +SNDRV_CTL_ELEM_ID_NAME_MAXLEN); > > Why not 2-parameter strscpy()? strscpy seemed not support 2 params. Do you mean strcpy? > > -- > With Best Regards, > Andy Shevchenko > ^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [EXTERNAL] Re: [PATCH v1] ASoc: tas2781: Rename dai_driver name to unify the name between TAS2563 and TAS2781 2024-08-15 3:02 ` [EXTERNAL] " Ding, Shenghao @ 2024-08-15 12:04 ` Andy Shevchenko 2024-08-16 13:41 ` Ding, Shenghao 0 siblings, 1 reply; 7+ messages in thread From: Andy Shevchenko @ 2024-08-15 12:04 UTC (permalink / raw) To: Ding, Shenghao Cc: broonie@kernel.org, lgirdwood@gmail.com, perex@perex.cz, pierre-louis.bossart@linux.intel.com, 13916275206@139.com, zhourui@huaqin.com, alsa-devel@alsa-project.org, Salazar, Ivan, linux-kernel@vger.kernel.org, Chadha, Jasjot Singh, liam.r.girdwood@intel.com, Yue, Jaden, yung-chuan.liao@linux.intel.com, Rao, Dipa, yuhsuan@google.com, Lo, Henry, tiwai@suse.de, Xu, Baojun, soyer@irl.hu, Baojun.Xu@fpt.com, judyhsiao@google.com, Navada Kanyana, Mukund, cujomalainey@google.com, Kutty, Aanya, Mahmud, Nayeem, savyasanchi.shukla@netradyne.com, flaviopr@microsoft.com, Ji, Jesse, darren.ye@mediatek.com, antheas.dk@gmail.com, Jerry2.Huang@lcfuturecenter.com On Thu, Aug 15, 2024 at 03:02:01AM +0000, Ding, Shenghao wrote: > > From: Andy Shevchenko <andriy.shevchenko@linux.intel.com> > > Sent: Monday, August 12, 2024 11:52 PM > > On Sat, Aug 03, 2024 at 11:27:14AM +0800, Shenghao Ding wrote: ... > > > + strscpy(name, "Speaker Profile Id", > > SNDRV_CTL_ELEM_ID_NAME_MAXLEN); > > > > > + strscpy(prog_name, "Speaker Program Id", > > > + SNDRV_CTL_ELEM_ID_NAME_MAXLEN); > > > > > + strscpy(conf_name, "Speaker Config Id", > > > +SNDRV_CTL_ELEM_ID_NAME_MAXLEN); > > > > Why not 2-parameter strscpy()? > strscpy seemed not support 2 params. Do you mean strcpy? 1. It does. 2. No, I meant strscpy(). -- With Best Regards, Andy Shevchenko ^ permalink raw reply [flat|nested] 7+ messages in thread
* RE: [EXTERNAL] Re: [PATCH v1] ASoc: tas2781: Rename dai_driver name to unify the name between TAS2563 and TAS2781 2024-08-15 12:04 ` Andy Shevchenko @ 2024-08-16 13:41 ` Ding, Shenghao 2024-08-16 14:51 ` Andy Shevchenko 0 siblings, 1 reply; 7+ messages in thread From: Ding, Shenghao @ 2024-08-16 13:41 UTC (permalink / raw) To: Andy Shevchenko Cc: broonie@kernel.org, lgirdwood@gmail.com, perex@perex.cz, pierre-louis.bossart@linux.intel.com, 13916275206@139.com, zhourui@huaqin.com, alsa-devel@alsa-project.org, Salazar, Ivan, linux-kernel@vger.kernel.org, Chadha, Jasjot Singh, liam.r.girdwood@intel.com, Yue, Jaden, yung-chuan.liao@linux.intel.com, Rao, Dipa, yuhsuan@google.com, Lo, Henry, tiwai@suse.de, Xu, Baojun, Baojun.Xu@fpt.com, judyhsiao@google.com, Navada Kanyana, Mukund, cujomalainey@google.com, Kutty, Aanya, Mahmud, Nayeem, savyasanchi.shukla@netradyne.com, flaviopr@microsoft.com, Ji, Jesse, darren.ye@mediatek.com, antheas.dk@gmail.com, Jerry2.Huang@lcfuturecenter.com Hi Andy > -----Original Message----- > From: Andy Shevchenko <andriy.shevchenko@linux.intel.com> > Sent: Thursday, August 15, 2024 8:04 PM > To: Ding, Shenghao <shenghao-ding@ti.com> > Cc: broonie@kernel.org; lgirdwood@gmail.com; perex@perex.cz; pierre- > louis.bossart@linux.intel.com; 13916275206@139.com; zhourui@huaqin.com; > alsa-devel@alsa-project.org; Salazar, Ivan <i-salazar@ti.com>; linux- > kernel@vger.kernel.org; Chadha, Jasjot Singh <j-chadha@ti.com>; > liam.r.girdwood@intel.com; Yue, Jaden <jaden-yue@ti.com>; yung- > chuan.liao@linux.intel.com; Rao, Dipa <dipa@ti.com>; yuhsuan@google.com; > Lo, Henry <henry.lo@ti.com>; tiwai@suse.de; Xu, Baojun <baojun.xu@ti.com>; > soyer@irl.hu; Baojun.Xu@fpt.com; judyhsiao@google.com; Navada Kanyana, > Mukund <navada@ti.com>; cujomalainey@google.com; Kutty, Aanya > <aanya@ti.com>; Mahmud, Nayeem <nayeem.mahmud@ti.com>; > savyasanchi.shukla@netradyne.com; flaviopr@microsoft.com; Ji, Jesse <jesse- > ji@ti.com>; darren.ye@mediatek.com; antheas.dk@gmail.com; > Jerry2.Huang@lcfuturecenter.com > Subject: Re: [EXTERNAL] Re: [PATCH v1] ASoc: tas2781: Rename dai_driver > name to unify the name between TAS2563 and TAS2781 > > On Thu, Aug 15, 2024 at 03: 02: 01AM +0000, Ding, Shenghao wrote: > > From: > Andy Shevchenko <andriy. shevchenko@ linux. intel. com> > > Sent: Monday, > August 12, 2024 11: 52 PM > > On Sat, Aug 03, 2024 at 11: 27: 14AM +0800, > Shenghao ZjQcmQRYFpfptBannerStart This message was sent from outside of > Texas Instruments. > Do not click links or open attachments unless you recognize the source of this > email and know the content is safe. > <https://us-phishalarm- > ewt.proofpoint.com/EWT/v1/G3vK!uBdnVVfn3ofU5Y7otlzPNHz8qK- > 2IJyfkpc722d3LxLdT3TGK8e6EW9B1-j1y1PtAwEKJhr-ue39zDQ-QZA$> > Report Suspicious > > ZjQcmQRYFpfptBannerEnd > On Thu, Aug 15, 2024 at 03:02:01AM +0000, Ding, Shenghao wrote: > > > From: Andy Shevchenko <andriy.shevchenko@linux.intel.com> > > > Sent: Monday, August 12, 2024 11:52 PM On Sat, Aug 03, 2024 at > > > 11:27:14AM +0800, Shenghao Ding wrote: > > ... > > > > > + strscpy(name, "Speaker Profile Id", > > > SNDRV_CTL_ELEM_ID_NAME_MAXLEN); > > > > > > > + strscpy(prog_name, "Speaker Program Id", > > > > + SNDRV_CTL_ELEM_ID_NAME_MAXLEN); > > > > > > > + strscpy(conf_name, "Speaker Config Id", > > > > +SNDRV_CTL_ELEM_ID_NAME_MAXLEN); > > > > > > Why not 2-parameter strscpy()? > > strscpy seemed not support 2 params. Do you mean strcpy? > > 1. It does. > 2. No, I meant strscpy(). I have tried 2-parameter strscpy(), and occurred compiling issue. The first parameter of strscpy, *dst, must be array, but in this code prog_name and conf_name are points to the memories applied by devm_kcalloc. > > -- > With Best Regards, > Andy Shevchenko > ^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [EXTERNAL] Re: [PATCH v1] ASoc: tas2781: Rename dai_driver name to unify the name between TAS2563 and TAS2781 2024-08-16 13:41 ` Ding, Shenghao @ 2024-08-16 14:51 ` Andy Shevchenko 0 siblings, 0 replies; 7+ messages in thread From: Andy Shevchenko @ 2024-08-16 14:51 UTC (permalink / raw) To: Ding, Shenghao Cc: broonie@kernel.org, lgirdwood@gmail.com, perex@perex.cz, pierre-louis.bossart@linux.intel.com, 13916275206@139.com, zhourui@huaqin.com, alsa-devel@alsa-project.org, Salazar, Ivan, linux-kernel@vger.kernel.org, Chadha, Jasjot Singh, liam.r.girdwood@intel.com, Yue, Jaden, yung-chuan.liao@linux.intel.com, Rao, Dipa, yuhsuan@google.com, Lo, Henry, tiwai@suse.de, Xu, Baojun, Baojun.Xu@fpt.com, judyhsiao@google.com, Navada Kanyana, Mukund, cujomalainey@google.com, Kutty, Aanya, Mahmud, Nayeem, savyasanchi.shukla@netradyne.com, flaviopr@microsoft.com, Ji, Jesse, darren.ye@mediatek.com, antheas.dk@gmail.com, Jerry2.Huang@lcfuturecenter.com On Fri, Aug 16, 2024 at 01:41:46PM +0000, Ding, Shenghao wrote: > > From: Andy Shevchenko <andriy.shevchenko@linux.intel.com> > > Sent: Thursday, August 15, 2024 8:04 PM > > To: Ding, Shenghao <shenghao-ding@ti.com> > > On Thu, Aug 15, 2024 at 03:02:01AM +0000, Ding, Shenghao wrote: > > > > From: Andy Shevchenko <andriy.shevchenko@linux.intel.com> > > > > Sent: Monday, August 12, 2024 11:52 PM On Sat, Aug 03, 2024 at > > > > 11:27:14AM +0800, Shenghao Ding wrote: ... > > > > > + strscpy(name, "Speaker Profile Id", > > > > SNDRV_CTL_ELEM_ID_NAME_MAXLEN); > > > > > > > > > + strscpy(prog_name, "Speaker Program Id", > > > > > + SNDRV_CTL_ELEM_ID_NAME_MAXLEN); > > > > > > > > > + strscpy(conf_name, "Speaker Config Id", > > > > > +SNDRV_CTL_ELEM_ID_NAME_MAXLEN); > > > > > > > > Why not 2-parameter strscpy()? > > > strscpy seemed not support 2 params. Do you mean strcpy? > > > > 1. It does. > > 2. No, I meant strscpy(). > I have tried 2-parameter strscpy(), and occurred compiling issue. > The first parameter of strscpy, *dst, must be array, but in this code > prog_name and conf_name are points to the memories applied by > devm_kcalloc. Okay, I'm not sure why devm_kasprintf() is not used for these cases. -- With Best Regards, Andy Shevchenko ^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2024-08-16 14:51 UTC | newest] Thread overview: 7+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2024-08-03 3:27 [PATCH v1] ASoc: tas2781: Rename dai_driver name to unify the name between TAS2563 and TAS2781 Shenghao Ding 2024-08-05 12:48 ` Mark Brown 2024-08-12 15:51 ` Andy Shevchenko 2024-08-15 3:02 ` [EXTERNAL] " Ding, Shenghao 2024-08-15 12:04 ` Andy Shevchenko 2024-08-16 13:41 ` Ding, Shenghao 2024-08-16 14:51 ` Andy Shevchenko
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox