All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v1] ASoC: tas2781: mark const variables tas2563_dvc_table as __maybe_unused
@ 2024-08-22  6:32 Shenghao Ding
  2024-08-22 13:36 ` Andy Shevchenko
  2024-08-22 16:17 ` Mark Brown
  0 siblings, 2 replies; 7+ messages in thread
From: Shenghao Ding @ 2024-08-22  6:32 UTC (permalink / raw)
  To: broonie
  Cc: andriy.shevchenko, lgirdwood, perex, pierre-louis.bossart,
	13916275206, zhourui, alsa-devel, i-salazar, liam.r.girdwood,
	jaden-yue, yung-chuan.liao, dipa, yuhsuan, henry.lo, tiwai,
	baojun.xu, Baojun.Xu, judyhsiao, navada, cujomalainey, aanya,
	nayeem.mahmud, savyasanchi.shukla, flaviopr, jesse-ji, darren.ye,
	antheas.dk, Jerry2.Huang, jim.shil, Shenghao Ding

In case of tas2781, tas2563_dvc_table will be unused,
so mark it as __maybe_unused.

Signed-off-by: Shenghao Ding <shenghao-ding@ti.com>
---
 include/sound/tas2563-tlv.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/include/sound/tas2563-tlv.h b/include/sound/tas2563-tlv.h
index faa3e194f73b..bb269b21f460 100644
--- a/include/sound/tas2563-tlv.h
+++ b/include/sound/tas2563-tlv.h
@@ -18,7 +18,7 @@
 static const __maybe_unused DECLARE_TLV_DB_SCALE(tas2563_dvc_tlv, -12150, 50, 1);
 
 /* pow(10, db/20) * pow(2,30) */
-static const unsigned char tas2563_dvc_table[][4] = {
+static const __maybe_unused unsigned char tas2563_dvc_table[][4] = {
 	{ 0X00, 0X00, 0X00, 0X00 }, /* -121.5db */
 	{ 0X00, 0X00, 0X03, 0XBC }, /* -121.0db */
 	{ 0X00, 0X00, 0X03, 0XF5 }, /* -120.5db */
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* Re: [PATCH v1] ASoC: tas2781: mark const variables tas2563_dvc_table as __maybe_unused
  2024-08-22  6:32 [PATCH v1] ASoC: tas2781: mark const variables tas2563_dvc_table as __maybe_unused Shenghao Ding
@ 2024-08-22 13:36 ` Andy Shevchenko
  2024-08-23  2:24   ` [EXTERNAL] " Ding, Shenghao
  2024-08-22 16:17 ` Mark Brown
  1 sibling, 1 reply; 7+ messages in thread
From: Andy Shevchenko @ 2024-08-22 13:36 UTC (permalink / raw)
  To: Shenghao Ding
  Cc: broonie, lgirdwood, perex, pierre-louis.bossart, 13916275206,
	zhourui, alsa-devel, i-salazar, liam.r.girdwood, jaden-yue,
	yung-chuan.liao, dipa, yuhsuan, henry.lo, tiwai, baojun.xu,
	Baojun.Xu, judyhsiao, navada, cujomalainey, aanya, nayeem.mahmud,
	savyasanchi.shukla, flaviopr, jesse-ji, darren.ye, antheas.dk,
	Jerry2.Huang, jim.shil

On Thu, Aug 22, 2024 at 02:32:02PM +0800, Shenghao Ding wrote:
> In case of tas2781, tas2563_dvc_table will be unused,
> so mark it as __maybe_unused.

...

>  /* pow(10, db/20) * pow(2,30) */
> -static const unsigned char tas2563_dvc_table[][4] = {
> +static const __maybe_unused unsigned char tas2563_dvc_table[][4] = {
>  	{ 0X00, 0X00, 0X00, 0X00 }, /* -121.5db */
>  	{ 0X00, 0X00, 0X03, 0XBC }, /* -121.0db */
>  	{ 0X00, 0X00, 0X03, 0XF5 }, /* -120.5db */

As far as I can see in the latest Linux Next the above mentioned table is used
solely in sound/soc/codecs/tas2781-i2c.c. Why not moving it to the C file
instead?

-- 
With Best Regards,
Andy Shevchenko



^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH v1] ASoC: tas2781: mark const variables tas2563_dvc_table as __maybe_unused
  2024-08-22  6:32 [PATCH v1] ASoC: tas2781: mark const variables tas2563_dvc_table as __maybe_unused Shenghao Ding
  2024-08-22 13:36 ` Andy Shevchenko
@ 2024-08-22 16:17 ` Mark Brown
  1 sibling, 0 replies; 7+ messages in thread
From: Mark Brown @ 2024-08-22 16:17 UTC (permalink / raw)
  To: Shenghao Ding
  Cc: andriy.shevchenko, lgirdwood, perex, pierre-louis.bossart,
	13916275206, zhourui, alsa-devel, i-salazar, liam.r.girdwood,
	jaden-yue, yung-chuan.liao, dipa, yuhsuan, henry.lo, tiwai,
	baojun.xu, Baojun.Xu, judyhsiao, navada, cujomalainey, aanya,
	nayeem.mahmud, savyasanchi.shukla, flaviopr, jesse-ji, darren.ye,
	antheas.dk, Jerry2.Huang, jim.shil

On Thu, 22 Aug 2024 14:32:02 +0800, Shenghao Ding wrote:
> In case of tas2781, tas2563_dvc_table will be unused,
> so mark it as __maybe_unused.
> 
> 

Applied to

   https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git for-next

Thanks!

[1/1] ASoC: tas2781: mark const variables tas2563_dvc_table as __maybe_unused
      commit: 1a9e3b0af301413210319e6946fb4b0b1ad71ccc

All being well this means that it will be integrated into the linux-next
tree (usually sometime in the next 24 hours) and sent to Linus during
the next merge window (or sooner if it is a bug fix), however if
problems are discovered then the patch may be dropped or reverted.

You may get further e-mails resulting from automated or manual testing
and review of the tree, please engage with people reporting problems and
send followup patches addressing any issues that are reported if needed.

If any updates are required or you are submitting further changes they
should be sent as incremental updates against current git, existing
patches will not be replaced.

Please add any relevant lists and maintainers to the CCs when replying
to this mail.

Thanks,
Mark


^ permalink raw reply	[flat|nested] 7+ messages in thread

* RE: [EXTERNAL] Re: [PATCH v1] ASoC: tas2781: mark const variables tas2563_dvc_table as __maybe_unused
  2024-08-22 13:36 ` Andy Shevchenko
@ 2024-08-23  2:24   ` Ding, Shenghao
  2024-08-23 13:34     ` Andy Shevchenko
  0 siblings, 1 reply; 7+ messages in thread
From: Ding, Shenghao @ 2024-08-23  2:24 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,
	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, jim.shil@goertek.com

Hi Andy

> -----Original Message-----
> From: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
> Sent: Thursday, August 22, 2024 9:37 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>;
> 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>;
> 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; jim.shil@goertek.com
> Subject: [EXTERNAL] Re: [PATCH v1] ASoC: tas2781: mark const variables
> tas2563_dvc_table as __maybe_unused
> 
> On Thu, Aug 22, 2024 at 02: 32: 02PM +0800, Shenghao Ding wrote: > In case
> of tas2781, tas2563_dvc_table will be unused, > so mark it as
> __maybe_unused. .. . > /* pow(10, db/20) * pow(2,30) */ > -static const
> unsigned char tas2563_dvc_table[][4] 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!uBdnVX3s10EX4c1lMjuP1KAZd1FtZu8IE3w
> e26la-l_qE1qOQYSYSYJP5KwPFaP8DA2Q7tdwFqW-YXqzA5Y$>
> Report Suspicious
> 
> ZjQcmQRYFpfptBannerEnd
> On Thu, Aug 22, 2024 at 02:32:02PM +0800, Shenghao Ding wrote:
> > In case of tas2781, tas2563_dvc_table will be unused, so mark it as
> > __maybe_unused.
> 
> ...
> 
> >  /* pow(10, db/20) * pow(2,30) */
> > -static const unsigned char tas2563_dvc_table[][4] = {
> > +static const __maybe_unused unsigned char tas2563_dvc_table[][4] = {
> >  	{ 0X00, 0X00, 0X00, 0X00 }, /* -121.5db */
> >  	{ 0X00, 0X00, 0X03, 0XBC }, /* -121.0db */
> >  	{ 0X00, 0X00, 0X03, 0XF5 }, /* -120.5db */
> 
> As far as I can see in the latest Linux Next the above mentioned table is used
> solely in sound/soc/codecs/tas2781-i2c.c. Why not moving it to the C file
> instead?
We have a big plan to implement the digital gain for tas2563 in the side codec driver too, 
so abstracted this table into a separated header file.
> 
> --
> With Best Regards,
> Andy Shevchenko
> 


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [EXTERNAL] Re: [PATCH v1] ASoC: tas2781: mark const variables tas2563_dvc_table as __maybe_unused
  2024-08-23  2:24   ` [EXTERNAL] " Ding, Shenghao
@ 2024-08-23 13:34     ` Andy Shevchenko
  2024-08-24  6:33       ` Ding, Shenghao
  0 siblings, 1 reply; 7+ messages in thread
From: Andy Shevchenko @ 2024-08-23 13:34 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,
	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, jim.shil@goertek.com

On Fri, Aug 23, 2024 at 02:24:17AM +0000, Ding, Shenghao wrote:
> > From: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
> > Sent: Thursday, August 22, 2024 9:37 PM
> > To: Ding, Shenghao <shenghao-ding@ti.com>
> > On Thu, Aug 22, 2024 at 02:32:02PM +0800, Shenghao Ding wrote:

...

> > >  /* pow(10, db/20) * pow(2,30) */
> > > -static const unsigned char tas2563_dvc_table[][4] = {
> > > +static const __maybe_unused unsigned char tas2563_dvc_table[][4] = {
> > >  	{ 0X00, 0X00, 0X00, 0X00 }, /* -121.5db */
> > >  	{ 0X00, 0X00, 0X03, 0XBC }, /* -121.0db */
> > >  	{ 0X00, 0X00, 0X03, 0XF5 }, /* -120.5db */
> > 
> > As far as I can see in the latest Linux Next the above mentioned table is used
> > solely in sound/soc/codecs/tas2781-i2c.c. Why not moving it to the C file
> > instead?
> We have a big plan to implement the digital gain for tas2563 in the side
> codec driver too, so abstracted this table into a separated header file.

So, this __maybe_unused is a temporary stub, correct? Just don't forget to
remove it when the mentioned functionality will be ready.

Thanks for the explanation.

-- 
With Best Regards,
Andy Shevchenko



^ permalink raw reply	[flat|nested] 7+ messages in thread

* RE: [EXTERNAL] Re: [PATCH v1] ASoC: tas2781: mark const variables tas2563_dvc_table as __maybe_unused
  2024-08-23 13:34     ` Andy Shevchenko
@ 2024-08-24  6:33       ` Ding, Shenghao
  2024-08-26 10:02         ` Andy Shevchenko
  0 siblings, 1 reply; 7+ messages in thread
From: Ding, Shenghao @ 2024-08-24  6:33 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,
	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, jim.shil@goertek.com

Hi Andy
Glad to answer your question.

> -----Original Message-----
> From: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
> Sent: Friday, August 23, 2024 9:34 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>;
> 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>;
> 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; jim.shil@goertek.com
> Subject: Re: [EXTERNAL] Re: [PATCH v1] ASoC: tas2781: mark const variables
> tas2563_dvc_table as __maybe_unused
> 
> On Fri, Aug 23, 2024 at 02: 24: 17AM +0000, Ding, Shenghao wrote: > > From:
> Andy Shevchenko <andriy. shevchenko@ linux. intel. com> > > Sent: Thursday,
> August 22, 2024 9: 37 PM > > To: Ding, Shenghao <shenghao-ding@ ti. com>
> 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!uBdnVXyjfyERgskkNHnsf5Dc4Bsz5NHYOuS
> CAlM-ECmPvE_-JJDdyUZvDKmnC7E4RAAbEbIHMFCFDpmf6-o$>
> Report Suspicious
> 
> ZjQcmQRYFpfptBannerEnd
> On Fri, Aug 23, 2024 at 02:24:17AM +0000, Ding, Shenghao wrote:
> > > From: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
> > > Sent: Thursday, August 22, 2024 9:37 PM
> > > To: Ding, Shenghao <shenghao-ding@ti.com> On Thu, Aug 22, 2024 at
> > > 02:32:02PM +0800, Shenghao Ding wrote:
> 
> ...
> 
> > > >  /* pow(10, db/20) * pow(2,30) */
> > > > -static const unsigned char tas2563_dvc_table[][4] = {
> > > > +static const __maybe_unused unsigned char tas2563_dvc_table[][4]
> > > > += {
> > > >  	{ 0X00, 0X00, 0X00, 0X00 }, /* -121.5db */
> > > >  	{ 0X00, 0X00, 0X03, 0XBC }, /* -121.0db */
> > > >  	{ 0X00, 0X00, 0X03, 0XF5 }, /* -120.5db */
> > >
> > > As far as I can see in the latest Linux Next the above mentioned
> > > table is used solely in sound/soc/codecs/tas2781-i2c.c. Why not
> > > moving it to the C file instead?
> > We have a big plan to implement the digital gain for tas2563 in the
> > side codec driver too, so abstracted this table into a separated header file.
> 
> So, this __maybe_unused is a temporary stub, correct? Just don't forget to
> remove it when the mentioned functionality will be ready.
> 
> Thanks for the explanation.
To add __maybe_unused is not temporary, because this driver support both 
tas2563 and tas2781, if the hardware only contains tas2781 chips, 
tas2563_dvc_table is obviously useless, so marked it as __maybe_unused.
> 
> --
> With Best Regards,
> Andy Shevchenko
> 


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [EXTERNAL] Re: [PATCH v1] ASoC: tas2781: mark const variables tas2563_dvc_table as __maybe_unused
  2024-08-24  6:33       ` Ding, Shenghao
@ 2024-08-26 10:02         ` Andy Shevchenko
  0 siblings, 0 replies; 7+ messages in thread
From: Andy Shevchenko @ 2024-08-26 10:02 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,
	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, jim.shil@goertek.com

On Sat, Aug 24, 2024 at 06:33:41AM +0000, Ding, Shenghao wrote:
> > From: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
> > Sent: Friday, August 23, 2024 9:34 PM
> > On Fri, Aug 23, 2024 at 02:24:17AM +0000, Ding, Shenghao wrote:
> > > > From: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
> > > > Sent: Thursday, August 22, 2024 9:37 PM
> > > > To: Ding, Shenghao <shenghao-ding@ti.com> On Thu, Aug 22, 2024 at
> > > > 02:32:02PM +0800, Shenghao Ding wrote:

...

> > > > >  /* pow(10, db/20) * pow(2,30) */
> > > > > -static const unsigned char tas2563_dvc_table[][4] = {
> > > > > +static const __maybe_unused unsigned char tas2563_dvc_table[][4]
> > > > > += {
> > > > >  	{ 0X00, 0X00, 0X00, 0X00 }, /* -121.5db */
> > > > >  	{ 0X00, 0X00, 0X03, 0XBC }, /* -121.0db */
> > > > >  	{ 0X00, 0X00, 0X03, 0XF5 }, /* -120.5db */
> > > >
> > > > As far as I can see in the latest Linux Next the above mentioned
> > > > table is used solely in sound/soc/codecs/tas2781-i2c.c. Why not
> > > > moving it to the C file instead?
> > > We have a big plan to implement the digital gain for tas2563 in the
> > > side codec driver too, so abstracted this table into a separated header file.
> > 
> > So, this __maybe_unused is a temporary stub, correct? Just don't forget to
> > remove it when the mentioned functionality will be ready.
> > 
> > Thanks for the explanation.
> To add __maybe_unused is not temporary, because this driver support both 
> tas2563 and tas2781, if the hardware only contains tas2781 chips, 
> tas2563_dvc_table is obviously useless, so marked it as __maybe_unused.

You got me confused.

__maybe_unused is a compile-time (okay, link-time) attribute. If what you are
telling is true, why do you need it and can't use respective #ifdef?

Otherwise, why is it in the _header_ file and not in the C-file?

-- 
With Best Regards,
Andy Shevchenko



^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2024-08-26 12:23 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-08-22  6:32 [PATCH v1] ASoC: tas2781: mark const variables tas2563_dvc_table as __maybe_unused Shenghao Ding
2024-08-22 13:36 ` Andy Shevchenko
2024-08-23  2:24   ` [EXTERNAL] " Ding, Shenghao
2024-08-23 13:34     ` Andy Shevchenko
2024-08-24  6:33       ` Ding, Shenghao
2024-08-26 10:02         ` Andy Shevchenko
2024-08-22 16:17 ` Mark Brown

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.