linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Re: [PATCH] ALSA: au88x0: remove some dead code
  2020-04-17  9:22 [PATCH] ALSA: au88x0: remove some dead code Jason Yan
@ 2020-04-17  9:05 ` Takashi Iwai
  2020-04-17  9:23   ` Jason Yan
  0 siblings, 1 reply; 3+ messages in thread
From: Takashi Iwai @ 2020-04-17  9:05 UTC (permalink / raw)
  To: Jason Yan
  Cc: perex, tiwai, hariprasad.kelam, alsa-devel, linux-kernel, Hulk Robot

On Fri, 17 Apr 2020 11:22:32 +0200,
Jason Yan wrote:
> 
> Fix the following gcc warning:
> 
> sound/pci/au88x0/au88x0_a3ddata.c:62:25: warning: ‘A3dHrirDImpulse’
> defined but not used [-Wunused-const-variable=]
>  static const a3d_Hrtf_t A3dHrirDImpulse = {
>                          ^~~~~~~~~~~~~~~
> sound/pci/au88x0/au88x0_a3ddata.c:50:25: warning: ‘A3dHrirSatTest’
> defined but not used [-Wunused-const-variable=]
>  static const a3d_Hrtf_t A3dHrirSatTest = {
>                          ^~~~~~~~~~~~~~
> sound/pci/au88x0/au88x0_a3ddata.c:33:25: warning: ‘A3dHrirOnes’ defined
> but not used [-Wunused-const-variable=]
>  static const a3d_Hrtf_t A3dHrirOnes = {
>                          ^~~~~~~~~~~
> 
> Reported-by: Hulk Robot <hulkci@huawei.com>
> Signed-off-by: Jason Yan <yanaijie@huawei.com>

I'd rather keep them but disable with #if 0, if it's only about the
minor compiler warnings.

The whole code is a result of reverse engineering and those dead code
are simply there just because of lack of testing.  Removing makes it
impossible for retesting (if any).


thanks,

Takashi

> ---
>  sound/pci/au88x0/au88x0_a3d.c     | 23 -------------------
>  sound/pci/au88x0/au88x0_a3ddata.c | 38 -------------------------------
>  2 files changed, 61 deletions(-)
> 
> diff --git a/sound/pci/au88x0/au88x0_a3d.c b/sound/pci/au88x0/au88x0_a3d.c
> index 2db183f8826a..4d3b79a34c69 100644
> --- a/sound/pci/au88x0/au88x0_a3d.c
> +++ b/sound/pci/au88x0/au88x0_a3d.c
> @@ -512,31 +512,8 @@ static void a3dsrc_ProgramPipe(a3dsrc_t * a)
>  	/* Single spike leads to identity transfer function. */
>  	a3dsrc_SetHrtfCurrent(a, A3dHrirImpulse, A3dHrirImpulse);
>  	a3dsrc_SetHrtfTarget(a, A3dHrirImpulse, A3dHrirImpulse);
> -
> -	/* Test: Sounds saturated. */
> -	//a3dsrc_SetHrtfCurrent(a, A3dHrirSatTest, A3dHrirSatTest);
> -	//a3dsrc_SetHrtfTarget(a, A3dHrirSatTest, A3dHrirSatTest);      
>  }
>  
> -/* VDB = Vortex audio Dataflow Bus */
> -#if 0
> -static void a3dsrc_ClearVDBData(a3dsrc_t * a, unsigned long aa)
> -{
> -	vortex_t *vortex = (vortex_t *) (a->vortex);
> -
> -	// ((aa >> 2) << 8) - (aa >> 2)
> -	hwwrite(vortex->mmio,
> -		a3d_addrS(a->slice, A3D_SLICE_VDBDest) + (a->source << 2), 0);
> -	hwwrite(vortex->mmio,
> -		a3d_addrS(a->slice,
> -			  A3D_SLICE_VDBDest + 4) + (a->source << 2), 0);
> -	/*
> -	   hwwrite(vortex->mmio, 0x19c00 + (((aa>>2)*255*4)+aa)*8, 0);
> -	   hwwrite(vortex->mmio, 0x19c04 + (((aa>>2)*255*4)+aa)*8, 0);
> -	 */
> -}
> -#endif
> -
>  /* A3D HwSource stuff. */
>  
>  static void vortex_A3dSourceHw_Initialize(vortex_t * v, int source, int slice)
> diff --git a/sound/pci/au88x0/au88x0_a3ddata.c b/sound/pci/au88x0/au88x0_a3ddata.c
> index 18623cb6bc52..cc41ea67a6d3 100644
> --- a/sound/pci/au88x0/au88x0_a3ddata.c
> +++ b/sound/pci/au88x0/au88x0_a3ddata.c
> @@ -30,44 +30,6 @@ static const a3d_Hrtf_t A3dHrirImpulse = {
>  	0, 0, 0
>  };
>  
> -static const a3d_Hrtf_t A3dHrirOnes = {
> -	0x7fff, 0x7fff, 0x7fff, 0x7fff, 0x7fff, 0x7fff, 0x7fff, 0x7fff,
> -	0x7fff,
> -	0x7fff,
> -	0x7fff, 0x7fff, 0x7fff, 0x7fff, 0x7fff, 0x7fff, 0x7fff, 0x7fff,
> -	0x7fff,
> -	0x7fff,
> -	0x7fff, 0x7fff, 0x7fff, 0x7fff, 0x7fff, 0x7fff, 0x7fff, 0x7fff,
> -	0x7fff, 0x7fff, 0x7fff, 0x7fff, 0x7fff, 0x7fff, 0x7fff, 0x7fff,
> -	0x7fff,
> -	0x7fff,
> -	0x7fff, 0x7fff, 0x7fff, 0x7fff, 0x7fff, 0x7fff, 0x7fff, 0x7fff,
> -	0x7fff,
> -	0x7fff,
> -	0x7fff, 0x7fff, 0x7fff, 0x7fff, 0x7fff, 0x7fff, 0x7fff, 0x7fff
> -};
> -
> -static const a3d_Hrtf_t A3dHrirSatTest = {
> -	0x7fff, 0x7fff, 0x7fff, 0x7fff, 0x7fff, 0x7fff, 0x7fff, 0x7fff,
> -	0x7fff,
> -	0x7fff,
> -	0x8001, 0x8001, 0x8001, 0x8001, 0x8001, 0x8001, 0x8001, 0x8001,
> -	0x8001,
> -	0x8001,
> -	0x7fff, 0x0000, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
> -	0, 0, 0,
> -	0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
> -};
> -
> -static const a3d_Hrtf_t A3dHrirDImpulse = {
> -	0, 0x7fff, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
> -	0, 0, 0,
> -	0, 0, 0, 0,
> -	0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
> -	0, 0, 0,
> -	0, 0, 0
> -};
> -
>  static const a3d_ItdDline_t A3dItdDlineZeros = {
>  	0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
>  	0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
> -- 
> 2.21.1
> 

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

* [PATCH] ALSA: au88x0: remove some dead code
@ 2020-04-17  9:22 Jason Yan
  2020-04-17  9:05 ` Takashi Iwai
  0 siblings, 1 reply; 3+ messages in thread
From: Jason Yan @ 2020-04-17  9:22 UTC (permalink / raw)
  To: perex, tiwai, hariprasad.kelam, yanaijie, alsa-devel, linux-kernel
  Cc: Hulk Robot

Fix the following gcc warning:

sound/pci/au88x0/au88x0_a3ddata.c:62:25: warning: ‘A3dHrirDImpulse’
defined but not used [-Wunused-const-variable=]
 static const a3d_Hrtf_t A3dHrirDImpulse = {
                         ^~~~~~~~~~~~~~~
sound/pci/au88x0/au88x0_a3ddata.c:50:25: warning: ‘A3dHrirSatTest’
defined but not used [-Wunused-const-variable=]
 static const a3d_Hrtf_t A3dHrirSatTest = {
                         ^~~~~~~~~~~~~~
sound/pci/au88x0/au88x0_a3ddata.c:33:25: warning: ‘A3dHrirOnes’ defined
but not used [-Wunused-const-variable=]
 static const a3d_Hrtf_t A3dHrirOnes = {
                         ^~~~~~~~~~~

Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: Jason Yan <yanaijie@huawei.com>
---
 sound/pci/au88x0/au88x0_a3d.c     | 23 -------------------
 sound/pci/au88x0/au88x0_a3ddata.c | 38 -------------------------------
 2 files changed, 61 deletions(-)

diff --git a/sound/pci/au88x0/au88x0_a3d.c b/sound/pci/au88x0/au88x0_a3d.c
index 2db183f8826a..4d3b79a34c69 100644
--- a/sound/pci/au88x0/au88x0_a3d.c
+++ b/sound/pci/au88x0/au88x0_a3d.c
@@ -512,31 +512,8 @@ static void a3dsrc_ProgramPipe(a3dsrc_t * a)
 	/* Single spike leads to identity transfer function. */
 	a3dsrc_SetHrtfCurrent(a, A3dHrirImpulse, A3dHrirImpulse);
 	a3dsrc_SetHrtfTarget(a, A3dHrirImpulse, A3dHrirImpulse);
-
-	/* Test: Sounds saturated. */
-	//a3dsrc_SetHrtfCurrent(a, A3dHrirSatTest, A3dHrirSatTest);
-	//a3dsrc_SetHrtfTarget(a, A3dHrirSatTest, A3dHrirSatTest);      
 }
 
-/* VDB = Vortex audio Dataflow Bus */
-#if 0
-static void a3dsrc_ClearVDBData(a3dsrc_t * a, unsigned long aa)
-{
-	vortex_t *vortex = (vortex_t *) (a->vortex);
-
-	// ((aa >> 2) << 8) - (aa >> 2)
-	hwwrite(vortex->mmio,
-		a3d_addrS(a->slice, A3D_SLICE_VDBDest) + (a->source << 2), 0);
-	hwwrite(vortex->mmio,
-		a3d_addrS(a->slice,
-			  A3D_SLICE_VDBDest + 4) + (a->source << 2), 0);
-	/*
-	   hwwrite(vortex->mmio, 0x19c00 + (((aa>>2)*255*4)+aa)*8, 0);
-	   hwwrite(vortex->mmio, 0x19c04 + (((aa>>2)*255*4)+aa)*8, 0);
-	 */
-}
-#endif
-
 /* A3D HwSource stuff. */
 
 static void vortex_A3dSourceHw_Initialize(vortex_t * v, int source, int slice)
diff --git a/sound/pci/au88x0/au88x0_a3ddata.c b/sound/pci/au88x0/au88x0_a3ddata.c
index 18623cb6bc52..cc41ea67a6d3 100644
--- a/sound/pci/au88x0/au88x0_a3ddata.c
+++ b/sound/pci/au88x0/au88x0_a3ddata.c
@@ -30,44 +30,6 @@ static const a3d_Hrtf_t A3dHrirImpulse = {
 	0, 0, 0
 };
 
-static const a3d_Hrtf_t A3dHrirOnes = {
-	0x7fff, 0x7fff, 0x7fff, 0x7fff, 0x7fff, 0x7fff, 0x7fff, 0x7fff,
-	0x7fff,
-	0x7fff,
-	0x7fff, 0x7fff, 0x7fff, 0x7fff, 0x7fff, 0x7fff, 0x7fff, 0x7fff,
-	0x7fff,
-	0x7fff,
-	0x7fff, 0x7fff, 0x7fff, 0x7fff, 0x7fff, 0x7fff, 0x7fff, 0x7fff,
-	0x7fff, 0x7fff, 0x7fff, 0x7fff, 0x7fff, 0x7fff, 0x7fff, 0x7fff,
-	0x7fff,
-	0x7fff,
-	0x7fff, 0x7fff, 0x7fff, 0x7fff, 0x7fff, 0x7fff, 0x7fff, 0x7fff,
-	0x7fff,
-	0x7fff,
-	0x7fff, 0x7fff, 0x7fff, 0x7fff, 0x7fff, 0x7fff, 0x7fff, 0x7fff
-};
-
-static const a3d_Hrtf_t A3dHrirSatTest = {
-	0x7fff, 0x7fff, 0x7fff, 0x7fff, 0x7fff, 0x7fff, 0x7fff, 0x7fff,
-	0x7fff,
-	0x7fff,
-	0x8001, 0x8001, 0x8001, 0x8001, 0x8001, 0x8001, 0x8001, 0x8001,
-	0x8001,
-	0x8001,
-	0x7fff, 0x0000, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-	0, 0, 0,
-	0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
-};
-
-static const a3d_Hrtf_t A3dHrirDImpulse = {
-	0, 0x7fff, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-	0, 0, 0,
-	0, 0, 0, 0,
-	0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-	0, 0, 0,
-	0, 0, 0
-};
-
 static const a3d_ItdDline_t A3dItdDlineZeros = {
 	0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
 	0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
-- 
2.21.1


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

* Re: [PATCH] ALSA: au88x0: remove some dead code
  2020-04-17  9:05 ` Takashi Iwai
@ 2020-04-17  9:23   ` Jason Yan
  0 siblings, 0 replies; 3+ messages in thread
From: Jason Yan @ 2020-04-17  9:23 UTC (permalink / raw)
  To: Takashi Iwai
  Cc: perex, tiwai, hariprasad.kelam, alsa-devel, linux-kernel, Hulk Robot



在 2020/4/17 17:05, Takashi Iwai 写道:
> On Fri, 17 Apr 2020 11:22:32 +0200,
> Jason Yan wrote:
>>
>> Fix the following gcc warning:
>>
>> sound/pci/au88x0/au88x0_a3ddata.c:62:25: warning: ‘A3dHrirDImpulse’
>> defined but not used [-Wunused-const-variable=]
>>   static const a3d_Hrtf_t A3dHrirDImpulse = {
>>                           ^~~~~~~~~~~~~~~
>> sound/pci/au88x0/au88x0_a3ddata.c:50:25: warning: ‘A3dHrirSatTest’
>> defined but not used [-Wunused-const-variable=]
>>   static const a3d_Hrtf_t A3dHrirSatTest = {
>>                           ^~~~~~~~~~~~~~
>> sound/pci/au88x0/au88x0_a3ddata.c:33:25: warning: ‘A3dHrirOnes’ defined
>> but not used [-Wunused-const-variable=]
>>   static const a3d_Hrtf_t A3dHrirOnes = {
>>                           ^~~~~~~~~~~
>>
>> Reported-by: Hulk Robot <hulkci@huawei.com>
>> Signed-off-by: Jason Yan <yanaijie@huawei.com>
> 
> I'd rather keep them but disable with #if 0, if it's only about the
> minor compiler warnings.
> 
> The whole code is a result of reverse engineering and those dead code
> are simply there just because of lack of testing.  Removing makes it
> impossible for retesting (if any).
> 

Actually you can easily recover the code from git history.

Anyway, it's all your choice.

Thanks,

Jason

> 
> thanks,
> 
> Takashi
> 
>> ---
>>   sound/pci/au88x0/au88x0_a3d.c     | 23 -------------------
>>   sound/pci/au88x0/au88x0_a3ddata.c | 38 -------------------------------
>>   2 files changed, 61 deletions(-)
>>
>> diff --git a/sound/pci/au88x0/au88x0_a3d.c b/sound/pci/au88x0/au88x0_a3d.c
>> index 2db183f8826a..4d3b79a34c69 100644
>> --- a/sound/pci/au88x0/au88x0_a3d.c
>> +++ b/sound/pci/au88x0/au88x0_a3d.c
>> @@ -512,31 +512,8 @@ static void a3dsrc_ProgramPipe(a3dsrc_t * a)
>>   	/* Single spike leads to identity transfer function. */
>>   	a3dsrc_SetHrtfCurrent(a, A3dHrirImpulse, A3dHrirImpulse);
>>   	a3dsrc_SetHrtfTarget(a, A3dHrirImpulse, A3dHrirImpulse);
>> -
>> -	/* Test: Sounds saturated. */
>> -	//a3dsrc_SetHrtfCurrent(a, A3dHrirSatTest, A3dHrirSatTest);
>> -	//a3dsrc_SetHrtfTarget(a, A3dHrirSatTest, A3dHrirSatTest);
>>   }
>>   
>> -/* VDB = Vortex audio Dataflow Bus */
>> -#if 0
>> -static void a3dsrc_ClearVDBData(a3dsrc_t * a, unsigned long aa)
>> -{
>> -	vortex_t *vortex = (vortex_t *) (a->vortex);
>> -
>> -	// ((aa >> 2) << 8) - (aa >> 2)
>> -	hwwrite(vortex->mmio,
>> -		a3d_addrS(a->slice, A3D_SLICE_VDBDest) + (a->source << 2), 0);
>> -	hwwrite(vortex->mmio,
>> -		a3d_addrS(a->slice,
>> -			  A3D_SLICE_VDBDest + 4) + (a->source << 2), 0);
>> -	/*
>> -	   hwwrite(vortex->mmio, 0x19c00 + (((aa>>2)*255*4)+aa)*8, 0);
>> -	   hwwrite(vortex->mmio, 0x19c04 + (((aa>>2)*255*4)+aa)*8, 0);
>> -	 */
>> -}
>> -#endif
>> -
>>   /* A3D HwSource stuff. */
>>   
>>   static void vortex_A3dSourceHw_Initialize(vortex_t * v, int source, int slice)
>> diff --git a/sound/pci/au88x0/au88x0_a3ddata.c b/sound/pci/au88x0/au88x0_a3ddata.c
>> index 18623cb6bc52..cc41ea67a6d3 100644
>> --- a/sound/pci/au88x0/au88x0_a3ddata.c
>> +++ b/sound/pci/au88x0/au88x0_a3ddata.c
>> @@ -30,44 +30,6 @@ static const a3d_Hrtf_t A3dHrirImpulse = {
>>   	0, 0, 0
>>   };
>>   
>> -static const a3d_Hrtf_t A3dHrirOnes = {
>> -	0x7fff, 0x7fff, 0x7fff, 0x7fff, 0x7fff, 0x7fff, 0x7fff, 0x7fff,
>> -	0x7fff,
>> -	0x7fff,
>> -	0x7fff, 0x7fff, 0x7fff, 0x7fff, 0x7fff, 0x7fff, 0x7fff, 0x7fff,
>> -	0x7fff,
>> -	0x7fff,
>> -	0x7fff, 0x7fff, 0x7fff, 0x7fff, 0x7fff, 0x7fff, 0x7fff, 0x7fff,
>> -	0x7fff, 0x7fff, 0x7fff, 0x7fff, 0x7fff, 0x7fff, 0x7fff, 0x7fff,
>> -	0x7fff,
>> -	0x7fff,
>> -	0x7fff, 0x7fff, 0x7fff, 0x7fff, 0x7fff, 0x7fff, 0x7fff, 0x7fff,
>> -	0x7fff,
>> -	0x7fff,
>> -	0x7fff, 0x7fff, 0x7fff, 0x7fff, 0x7fff, 0x7fff, 0x7fff, 0x7fff
>> -};
>> -
>> -static const a3d_Hrtf_t A3dHrirSatTest = {
>> -	0x7fff, 0x7fff, 0x7fff, 0x7fff, 0x7fff, 0x7fff, 0x7fff, 0x7fff,
>> -	0x7fff,
>> -	0x7fff,
>> -	0x8001, 0x8001, 0x8001, 0x8001, 0x8001, 0x8001, 0x8001, 0x8001,
>> -	0x8001,
>> -	0x8001,
>> -	0x7fff, 0x0000, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
>> -	0, 0, 0,
>> -	0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
>> -};
>> -
>> -static const a3d_Hrtf_t A3dHrirDImpulse = {
>> -	0, 0x7fff, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
>> -	0, 0, 0,
>> -	0, 0, 0, 0,
>> -	0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
>> -	0, 0, 0,
>> -	0, 0, 0
>> -};
>> -
>>   static const a3d_ItdDline_t A3dItdDlineZeros = {
>>   	0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
>>   	0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
>> -- 
>> 2.21.1
>>
> 
> .
> 


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

end of thread, other threads:[~2020-04-17  9:23 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-04-17  9:22 [PATCH] ALSA: au88x0: remove some dead code Jason Yan
2020-04-17  9:05 ` Takashi Iwai
2020-04-17  9:23   ` Jason Yan

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).