All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] ASoC: pxa: remove incorrect do_div() call
@ 2015-11-20  9:32 ` Arnd Bergmann
  0 siblings, 0 replies; 10+ messages in thread
From: Arnd Bergmann @ 2015-11-20  9:32 UTC (permalink / raw)
  To: alsa-devel, broonie
  Cc: Robert Jarzmik, Haojian Zhuang, Daniel Mack, Liam Girdwood,
	linux-arm-kernel, linux-kernel, Leo Yan, Zhangfei Gao

The new optimized do_div implementation (now in asm-generic/next) exposes a
glitch in the brownstone audio driver by producing a compile-time warning:

sound/soc/pxa/brownstone.c: In function 'brownstone_wm8994_hw_params':
sound/soc/pxa/brownstone.c:67:85: warning: comparison of distinct pointer types lacks a cast
sound/soc/pxa/brownstone.c:67:10125: warning: right shift count >= width of type [-Wshift-count-overflow]
sound/soc/pxa/brownstone.c:67:10254: warning: passing argument 1 of '__div64_32' from incompatible pointer type [-Wincompatible-pointer-types]

The driver just divides two plain integer values, so it should not
use do_div to start with, but has apparently done so ever since the
code was first merged. This replaces do_div with a simple division
operator.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
I think this one is harmless, so we only need it in 4.5 to avoid the warning,
but not backported to earlier kernels.

Found today on ARM allmodconfig

diff --git a/sound/soc/pxa/brownstone.c b/sound/soc/pxa/brownstone.c
index 6147e86e9b0f..416ea646c3b1 100644
--- a/sound/soc/pxa/brownstone.c
+++ b/sound/soc/pxa/brownstone.c
@@ -63,8 +63,7 @@ static int brownstone_wm8994_hw_params(struct snd_pcm_substream *substream,
 		sysclk    = params_rate(params) * 512;
 		sspa_mclk = params_rate(params) * 64;
 	}
-	sspa_div = freq_out;
-	do_div(sspa_div, sspa_mclk);
+	sspa_div = freq_out / sspa_mclk;
 
 	snd_soc_dai_set_sysclk(cpu_dai, MMP_SSPA_CLK_AUDIO, freq_out, 0);
 	snd_soc_dai_set_pll(cpu_dai, MMP_SYSCLK, 0, freq_out, sysclk);


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

* [PATCH] ASoC: pxa: remove incorrect do_div() call
@ 2015-11-20  9:32 ` Arnd Bergmann
  0 siblings, 0 replies; 10+ messages in thread
From: Arnd Bergmann @ 2015-11-20  9:32 UTC (permalink / raw)
  To: alsa-devel, broonie
  Cc: Leo Yan, linux-kernel, Haojian Zhuang, Liam Girdwood,
	Daniel Mack, Zhangfei Gao, Robert Jarzmik, linux-arm-kernel

The new optimized do_div implementation (now in asm-generic/next) exposes a
glitch in the brownstone audio driver by producing a compile-time warning:

sound/soc/pxa/brownstone.c: In function 'brownstone_wm8994_hw_params':
sound/soc/pxa/brownstone.c:67:85: warning: comparison of distinct pointer types lacks a cast
sound/soc/pxa/brownstone.c:67:10125: warning: right shift count >= width of type [-Wshift-count-overflow]
sound/soc/pxa/brownstone.c:67:10254: warning: passing argument 1 of '__div64_32' from incompatible pointer type [-Wincompatible-pointer-types]

The driver just divides two plain integer values, so it should not
use do_div to start with, but has apparently done so ever since the
code was first merged. This replaces do_div with a simple division
operator.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
I think this one is harmless, so we only need it in 4.5 to avoid the warning,
but not backported to earlier kernels.

Found today on ARM allmodconfig

diff --git a/sound/soc/pxa/brownstone.c b/sound/soc/pxa/brownstone.c
index 6147e86e9b0f..416ea646c3b1 100644
--- a/sound/soc/pxa/brownstone.c
+++ b/sound/soc/pxa/brownstone.c
@@ -63,8 +63,7 @@ static int brownstone_wm8994_hw_params(struct snd_pcm_substream *substream,
 		sysclk    = params_rate(params) * 512;
 		sspa_mclk = params_rate(params) * 64;
 	}
-	sspa_div = freq_out;
-	do_div(sspa_div, sspa_mclk);
+	sspa_div = freq_out / sspa_mclk;
 
 	snd_soc_dai_set_sysclk(cpu_dai, MMP_SSPA_CLK_AUDIO, freq_out, 0);
 	snd_soc_dai_set_pll(cpu_dai, MMP_SYSCLK, 0, freq_out, sysclk);

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

* [PATCH] ASoC: pxa: remove incorrect do_div() call
@ 2015-11-20  9:32 ` Arnd Bergmann
  0 siblings, 0 replies; 10+ messages in thread
From: Arnd Bergmann @ 2015-11-20  9:32 UTC (permalink / raw)
  To: linux-arm-kernel

The new optimized do_div implementation (now in asm-generic/next) exposes a
glitch in the brownstone audio driver by producing a compile-time warning:

sound/soc/pxa/brownstone.c: In function 'brownstone_wm8994_hw_params':
sound/soc/pxa/brownstone.c:67:85: warning: comparison of distinct pointer types lacks a cast
sound/soc/pxa/brownstone.c:67:10125: warning: right shift count >= width of type [-Wshift-count-overflow]
sound/soc/pxa/brownstone.c:67:10254: warning: passing argument 1 of '__div64_32' from incompatible pointer type [-Wincompatible-pointer-types]

The driver just divides two plain integer values, so it should not
use do_div to start with, but has apparently done so ever since the
code was first merged. This replaces do_div with a simple division
operator.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
I think this one is harmless, so we only need it in 4.5 to avoid the warning,
but not backported to earlier kernels.

Found today on ARM allmodconfig

diff --git a/sound/soc/pxa/brownstone.c b/sound/soc/pxa/brownstone.c
index 6147e86e9b0f..416ea646c3b1 100644
--- a/sound/soc/pxa/brownstone.c
+++ b/sound/soc/pxa/brownstone.c
@@ -63,8 +63,7 @@ static int brownstone_wm8994_hw_params(struct snd_pcm_substream *substream,
 		sysclk    = params_rate(params) * 512;
 		sspa_mclk = params_rate(params) * 64;
 	}
-	sspa_div = freq_out;
-	do_div(sspa_div, sspa_mclk);
+	sspa_div = freq_out / sspa_mclk;
 
 	snd_soc_dai_set_sysclk(cpu_dai, MMP_SSPA_CLK_AUDIO, freq_out, 0);
 	snd_soc_dai_set_pll(cpu_dai, MMP_SYSCLK, 0, freq_out, sysclk);

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

* Applied "ASoC: pxa: remove incorrect do_div() call" to the asoc tree
  2015-11-20  9:32 ` Arnd Bergmann
  (?)
  (?)
@ 2015-11-20 18:20 ` Mark Brown
  -1 siblings, 0 replies; 10+ messages in thread
From: Mark Brown @ 2015-11-20 18:20 UTC (permalink / raw)
  To: Arnd Bergmann, Mark Brown; +Cc: alsa-devel

The patch

   ASoC: pxa: remove incorrect do_div() call

has been applied to the asoc tree at

   git://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git 

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

>From d1afdf34fc17bd2e1c96dc6196c562fa8906a026 Mon Sep 17 00:00:00 2001
From: Arnd Bergmann <arnd@arndb.de>
Date: Fri, 20 Nov 2015 10:32:44 +0100
Subject: [PATCH] ASoC: pxa: remove incorrect do_div() call

The new optimized do_div implementation (now in asm-generic/next) exposes a
glitch in the brownstone audio driver by producing a compile-time warning:

sound/soc/pxa/brownstone.c: In function 'brownstone_wm8994_hw_params':
sound/soc/pxa/brownstone.c:67:85: warning: comparison of distinct pointer types lacks a cast
sound/soc/pxa/brownstone.c:67:10125: warning: right shift count >= width of type [-Wshift-count-overflow]
sound/soc/pxa/brownstone.c:67:10254: warning: passing argument 1 of '__div64_32' from incompatible pointer type [-Wincompatible-pointer-types]

The driver just divides two plain integer values, so it should not
use do_div to start with, but has apparently done so ever since the
code was first merged. This replaces do_div with a simple division
operator.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Mark Brown <broonie@kernel.org>
---
 sound/soc/pxa/brownstone.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/sound/soc/pxa/brownstone.c b/sound/soc/pxa/brownstone.c
index 6147e86e9b0f..416ea646c3b1 100644
--- a/sound/soc/pxa/brownstone.c
+++ b/sound/soc/pxa/brownstone.c
@@ -63,8 +63,7 @@ static int brownstone_wm8994_hw_params(struct snd_pcm_substream *substream,
 		sysclk    = params_rate(params) * 512;
 		sspa_mclk = params_rate(params) * 64;
 	}
-	sspa_div = freq_out;
-	do_div(sspa_div, sspa_mclk);
+	sspa_div = freq_out / sspa_mclk;
 
 	snd_soc_dai_set_sysclk(cpu_dai, MMP_SSPA_CLK_AUDIO, freq_out, 0);
 	snd_soc_dai_set_pll(cpu_dai, MMP_SYSCLK, 0, freq_out, sysclk);
-- 
2.6.2

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

* Re: [PATCH] ASoC: pxa: remove incorrect do_div() call
  2015-11-20  9:32 ` Arnd Bergmann
@ 2015-11-23  8:10   ` zhangfei
  -1 siblings, 0 replies; 10+ messages in thread
From: zhangfei @ 2015-11-23  8:10 UTC (permalink / raw)
  To: Arnd Bergmann, alsa-devel, broonie
  Cc: Robert Jarzmik, Haojian Zhuang, Daniel Mack, Liam Girdwood,
	linux-arm-kernel, linux-kernel, Leo Yan



On 11/20/2015 05:32 PM, Arnd Bergmann wrote:
> The new optimized do_div implementation (now in asm-generic/next) exposes a
> glitch in the brownstone audio driver by producing a compile-time warning:
>
> sound/soc/pxa/brownstone.c: In function 'brownstone_wm8994_hw_params':
> sound/soc/pxa/brownstone.c:67:85: warning: comparison of distinct pointer types lacks a cast
> sound/soc/pxa/brownstone.c:67:10125: warning: right shift count >= width of type [-Wshift-count-overflow]
> sound/soc/pxa/brownstone.c:67:10254: warning: passing argument 1 of '__div64_32' from incompatible pointer type [-Wincompatible-pointer-types]
>
> The driver just divides two plain integer values, so it should not
> use do_div to start with, but has apparently done so ever since the
> code was first merged. This replaces do_div with a simple division
> operator.
>
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
> ---
> I think this one is harmless, so we only need it in 4.5 to avoid the warning,
> but not backported to earlier kernels.
>
> Found today on ARM allmodconfig
>
> diff --git a/sound/soc/pxa/brownstone.c b/sound/soc/pxa/brownstone.c
> index 6147e86e9b0f..416ea646c3b1 100644
> --- a/sound/soc/pxa/brownstone.c
> +++ b/sound/soc/pxa/brownstone.c
> @@ -63,8 +63,7 @@ static int brownstone_wm8994_hw_params(struct snd_pcm_substream *substream,
>   		sysclk    = params_rate(params) * 512;
>   		sspa_mclk = params_rate(params) * 64;
>   	}
> -	sspa_div = freq_out;
> -	do_div(sspa_div, sspa_mclk);
> +	sspa_div = freq_out / sspa_mclk;
>
>   	snd_soc_dai_set_sysclk(cpu_dai, MMP_SSPA_CLK_AUDIO, freq_out, 0);
>   	snd_soc_dai_set_pll(cpu_dai, MMP_SYSCLK, 0, freq_out, sysclk);
>

Thanks Arnd.

Looks sspa_div is not used at all.
So we can remove sspa_div as well as do_div.

What do you think.

Thanks


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

* [PATCH] ASoC: pxa: remove incorrect do_div() call
@ 2015-11-23  8:10   ` zhangfei
  0 siblings, 0 replies; 10+ messages in thread
From: zhangfei @ 2015-11-23  8:10 UTC (permalink / raw)
  To: linux-arm-kernel



On 11/20/2015 05:32 PM, Arnd Bergmann wrote:
> The new optimized do_div implementation (now in asm-generic/next) exposes a
> glitch in the brownstone audio driver by producing a compile-time warning:
>
> sound/soc/pxa/brownstone.c: In function 'brownstone_wm8994_hw_params':
> sound/soc/pxa/brownstone.c:67:85: warning: comparison of distinct pointer types lacks a cast
> sound/soc/pxa/brownstone.c:67:10125: warning: right shift count >= width of type [-Wshift-count-overflow]
> sound/soc/pxa/brownstone.c:67:10254: warning: passing argument 1 of '__div64_32' from incompatible pointer type [-Wincompatible-pointer-types]
>
> The driver just divides two plain integer values, so it should not
> use do_div to start with, but has apparently done so ever since the
> code was first merged. This replaces do_div with a simple division
> operator.
>
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
> ---
> I think this one is harmless, so we only need it in 4.5 to avoid the warning,
> but not backported to earlier kernels.
>
> Found today on ARM allmodconfig
>
> diff --git a/sound/soc/pxa/brownstone.c b/sound/soc/pxa/brownstone.c
> index 6147e86e9b0f..416ea646c3b1 100644
> --- a/sound/soc/pxa/brownstone.c
> +++ b/sound/soc/pxa/brownstone.c
> @@ -63,8 +63,7 @@ static int brownstone_wm8994_hw_params(struct snd_pcm_substream *substream,
>   		sysclk    = params_rate(params) * 512;
>   		sspa_mclk = params_rate(params) * 64;
>   	}
> -	sspa_div = freq_out;
> -	do_div(sspa_div, sspa_mclk);
> +	sspa_div = freq_out / sspa_mclk;
>
>   	snd_soc_dai_set_sysclk(cpu_dai, MMP_SSPA_CLK_AUDIO, freq_out, 0);
>   	snd_soc_dai_set_pll(cpu_dai, MMP_SYSCLK, 0, freq_out, sysclk);
>

Thanks Arnd.

Looks sspa_div is not used at all.
So we can remove sspa_div as well as do_div.

What do you think.

Thanks

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

* Re: [PATCH] ASoC: pxa: remove incorrect do_div() call
  2015-11-23  8:10   ` zhangfei
  (?)
@ 2015-11-23  8:54     ` Arnd Bergmann
  -1 siblings, 0 replies; 10+ messages in thread
From: Arnd Bergmann @ 2015-11-23  8:54 UTC (permalink / raw)
  To: zhangfei
  Cc: alsa-devel, broonie, Robert Jarzmik, Haojian Zhuang, Daniel Mack,
	Liam Girdwood, linux-arm-kernel, linux-kernel, Leo Yan

On Monday 23 November 2015 16:10:49 zhangfei wrote:
> On 11/20/2015 05:32 PM, Arnd Bergmann wrote:
> > diff --git a/sound/soc/pxa/brownstone.c b/sound/soc/pxa/brownstone.c
> > index 6147e86e9b0f..416ea646c3b1 100644
> > --- a/sound/soc/pxa/brownstone.c
> > +++ b/sound/soc/pxa/brownstone.c
> > @@ -63,8 +63,7 @@ static int brownstone_wm8994_hw_params(struct snd_pcm_substream *substream,
> >               sysclk    = params_rate(params) * 512;
> >               sspa_mclk = params_rate(params) * 64;
> >       }
> > -     sspa_div = freq_out;
> > -     do_div(sspa_div, sspa_mclk);
> > +     sspa_div = freq_out / sspa_mclk;
> >
> >       snd_soc_dai_set_sysclk(cpu_dai, MMP_SSPA_CLK_AUDIO, freq_out, 0);
> >       snd_soc_dai_set_pll(cpu_dai, MMP_SYSCLK, 0, freq_out, sysclk);
> >
> 
> Thanks Arnd.
> 
> Looks sspa_div is not used at all.
> So we can remove sspa_div as well as do_div.
> 
> What do you think.

Good idea. I see that Mark has already applied the original patch, and with
my new version, gcc should be smart enough to completely optimize out the
division and the unused variable. This means the effect of the patch
is very small, but if Mark wants it, he can apply the below.

	Arnd

8<---
Subject: ASoC: remove unused variable

As pointed out by Zhangfei Gao, the sspa_div variable in
brownstone_wm8994_hw_params() is completely unused, so as a cleanup
following a prior patch, this removes both the variable and the division.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>

diff --git a/sound/soc/pxa/brownstone.c b/sound/soc/pxa/brownstone.c
index 416ea646c3b1..ec522e94b0e2 100644
--- a/sound/soc/pxa/brownstone.c
+++ b/sound/soc/pxa/brownstone.c
@@ -52,7 +52,6 @@ static int brownstone_wm8994_hw_params(struct snd_pcm_substream *substream,
 	struct snd_soc_dai *codec_dai = rtd->codec_dai;
 	struct snd_soc_dai *cpu_dai = rtd->cpu_dai;
 	int freq_out, sspa_mclk, sysclk;
-	int sspa_div;
 
 	if (params_rate(params) > 11025) {
 		freq_out  = params_rate(params) * 512;
@@ -63,7 +62,6 @@ static int brownstone_wm8994_hw_params(struct snd_pcm_substream *substream,
 		sysclk    = params_rate(params) * 512;
 		sspa_mclk = params_rate(params) * 64;
 	}
-	sspa_div = freq_out / sspa_mclk;
 
 	snd_soc_dai_set_sysclk(cpu_dai, MMP_SSPA_CLK_AUDIO, freq_out, 0);
 	snd_soc_dai_set_pll(cpu_dai, MMP_SYSCLK, 0, freq_out, sysclk);


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

* Re: [PATCH] ASoC: pxa: remove incorrect do_div() call
@ 2015-11-23  8:54     ` Arnd Bergmann
  0 siblings, 0 replies; 10+ messages in thread
From: Arnd Bergmann @ 2015-11-23  8:54 UTC (permalink / raw)
  To: zhangfei
  Cc: alsa-devel, Leo Yan, Liam Girdwood, Haojian Zhuang, linux-kernel,
	broonie, linux-arm-kernel, Robert Jarzmik, Daniel Mack

On Monday 23 November 2015 16:10:49 zhangfei wrote:
> On 11/20/2015 05:32 PM, Arnd Bergmann wrote:
> > diff --git a/sound/soc/pxa/brownstone.c b/sound/soc/pxa/brownstone.c
> > index 6147e86e9b0f..416ea646c3b1 100644
> > --- a/sound/soc/pxa/brownstone.c
> > +++ b/sound/soc/pxa/brownstone.c
> > @@ -63,8 +63,7 @@ static int brownstone_wm8994_hw_params(struct snd_pcm_substream *substream,
> >               sysclk    = params_rate(params) * 512;
> >               sspa_mclk = params_rate(params) * 64;
> >       }
> > -     sspa_div = freq_out;
> > -     do_div(sspa_div, sspa_mclk);
> > +     sspa_div = freq_out / sspa_mclk;
> >
> >       snd_soc_dai_set_sysclk(cpu_dai, MMP_SSPA_CLK_AUDIO, freq_out, 0);
> >       snd_soc_dai_set_pll(cpu_dai, MMP_SYSCLK, 0, freq_out, sysclk);
> >
> 
> Thanks Arnd.
> 
> Looks sspa_div is not used at all.
> So we can remove sspa_div as well as do_div.
> 
> What do you think.

Good idea. I see that Mark has already applied the original patch, and with
my new version, gcc should be smart enough to completely optimize out the
division and the unused variable. This means the effect of the patch
is very small, but if Mark wants it, he can apply the below.

	Arnd

8<---
Subject: ASoC: remove unused variable

As pointed out by Zhangfei Gao, the sspa_div variable in
brownstone_wm8994_hw_params() is completely unused, so as a cleanup
following a prior patch, this removes both the variable and the division.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>

diff --git a/sound/soc/pxa/brownstone.c b/sound/soc/pxa/brownstone.c
index 416ea646c3b1..ec522e94b0e2 100644
--- a/sound/soc/pxa/brownstone.c
+++ b/sound/soc/pxa/brownstone.c
@@ -52,7 +52,6 @@ static int brownstone_wm8994_hw_params(struct snd_pcm_substream *substream,
 	struct snd_soc_dai *codec_dai = rtd->codec_dai;
 	struct snd_soc_dai *cpu_dai = rtd->cpu_dai;
 	int freq_out, sspa_mclk, sysclk;
-	int sspa_div;
 
 	if (params_rate(params) > 11025) {
 		freq_out  = params_rate(params) * 512;
@@ -63,7 +62,6 @@ static int brownstone_wm8994_hw_params(struct snd_pcm_substream *substream,
 		sysclk    = params_rate(params) * 512;
 		sspa_mclk = params_rate(params) * 64;
 	}
-	sspa_div = freq_out / sspa_mclk;
 
 	snd_soc_dai_set_sysclk(cpu_dai, MMP_SSPA_CLK_AUDIO, freq_out, 0);
 	snd_soc_dai_set_pll(cpu_dai, MMP_SYSCLK, 0, freq_out, sysclk);

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

* [PATCH] ASoC: pxa: remove incorrect do_div() call
@ 2015-11-23  8:54     ` Arnd Bergmann
  0 siblings, 0 replies; 10+ messages in thread
From: Arnd Bergmann @ 2015-11-23  8:54 UTC (permalink / raw)
  To: linux-arm-kernel

On Monday 23 November 2015 16:10:49 zhangfei wrote:
> On 11/20/2015 05:32 PM, Arnd Bergmann wrote:
> > diff --git a/sound/soc/pxa/brownstone.c b/sound/soc/pxa/brownstone.c
> > index 6147e86e9b0f..416ea646c3b1 100644
> > --- a/sound/soc/pxa/brownstone.c
> > +++ b/sound/soc/pxa/brownstone.c
> > @@ -63,8 +63,7 @@ static int brownstone_wm8994_hw_params(struct snd_pcm_substream *substream,
> >               sysclk    = params_rate(params) * 512;
> >               sspa_mclk = params_rate(params) * 64;
> >       }
> > -     sspa_div = freq_out;
> > -     do_div(sspa_div, sspa_mclk);
> > +     sspa_div = freq_out / sspa_mclk;
> >
> >       snd_soc_dai_set_sysclk(cpu_dai, MMP_SSPA_CLK_AUDIO, freq_out, 0);
> >       snd_soc_dai_set_pll(cpu_dai, MMP_SYSCLK, 0, freq_out, sysclk);
> >
> 
> Thanks Arnd.
> 
> Looks sspa_div is not used at all.
> So we can remove sspa_div as well as do_div.
> 
> What do you think.

Good idea. I see that Mark has already applied the original patch, and with
my new version, gcc should be smart enough to completely optimize out the
division and the unused variable. This means the effect of the patch
is very small, but if Mark wants it, he can apply the below.

	Arnd

8<---
Subject: ASoC: remove unused variable

As pointed out by Zhangfei Gao, the sspa_div variable in
brownstone_wm8994_hw_params() is completely unused, so as a cleanup
following a prior patch, this removes both the variable and the division.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>

diff --git a/sound/soc/pxa/brownstone.c b/sound/soc/pxa/brownstone.c
index 416ea646c3b1..ec522e94b0e2 100644
--- a/sound/soc/pxa/brownstone.c
+++ b/sound/soc/pxa/brownstone.c
@@ -52,7 +52,6 @@ static int brownstone_wm8994_hw_params(struct snd_pcm_substream *substream,
 	struct snd_soc_dai *codec_dai = rtd->codec_dai;
 	struct snd_soc_dai *cpu_dai = rtd->cpu_dai;
 	int freq_out, sspa_mclk, sysclk;
-	int sspa_div;
 
 	if (params_rate(params) > 11025) {
 		freq_out  = params_rate(params) * 512;
@@ -63,7 +62,6 @@ static int brownstone_wm8994_hw_params(struct snd_pcm_substream *substream,
 		sysclk    = params_rate(params) * 512;
 		sspa_mclk = params_rate(params) * 64;
 	}
-	sspa_div = freq_out / sspa_mclk;
 
 	snd_soc_dai_set_sysclk(cpu_dai, MMP_SSPA_CLK_AUDIO, freq_out, 0);
 	snd_soc_dai_set_pll(cpu_dai, MMP_SYSCLK, 0, freq_out, sysclk);

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

* Applied "ASoC: pxa: remove unused variable" to the asoc tree
  2015-11-23  8:54     ` Arnd Bergmann
  (?)
  (?)
@ 2016-02-26  2:46     ` Mark Brown
  -1 siblings, 0 replies; 10+ messages in thread
From: Mark Brown @ 2016-02-26  2:46 UTC (permalink / raw)
  To: Arnd Bergmann, Mark Brown; +Cc: alsa-devel

The patch

   ASoC: pxa: remove unused variable

has been applied to the asoc tree at

   git://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git 

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

>From aa3e838869d494c437c693b54d12fe02b96a0aa1 Mon Sep 17 00:00:00 2001
From: Arnd Bergmann <arnd@arndb.de>
Date: Thu, 25 Feb 2016 23:02:04 +0100
Subject: [PATCH] ASoC: pxa: remove unused variable

As pointed out by Zhangfei Gao, the sspa_div variable in
brownstone_wm8994_hw_params() is completely unused, so as a cleanup
following a prior patch, this removes both the variable and the division.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Mark Brown <broonie@kernel.org>
---
 sound/soc/pxa/brownstone.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/sound/soc/pxa/brownstone.c b/sound/soc/pxa/brownstone.c
index 416ea646c3b1..ec522e94b0e2 100644
--- a/sound/soc/pxa/brownstone.c
+++ b/sound/soc/pxa/brownstone.c
@@ -52,7 +52,6 @@ static int brownstone_wm8994_hw_params(struct snd_pcm_substream *substream,
 	struct snd_soc_dai *codec_dai = rtd->codec_dai;
 	struct snd_soc_dai *cpu_dai = rtd->cpu_dai;
 	int freq_out, sspa_mclk, sysclk;
-	int sspa_div;
 
 	if (params_rate(params) > 11025) {
 		freq_out  = params_rate(params) * 512;
@@ -63,7 +62,6 @@ static int brownstone_wm8994_hw_params(struct snd_pcm_substream *substream,
 		sysclk    = params_rate(params) * 512;
 		sspa_mclk = params_rate(params) * 64;
 	}
-	sspa_div = freq_out / sspa_mclk;
 
 	snd_soc_dai_set_sysclk(cpu_dai, MMP_SSPA_CLK_AUDIO, freq_out, 0);
 	snd_soc_dai_set_pll(cpu_dai, MMP_SYSCLK, 0, freq_out, sysclk);
-- 
2.7.0

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

end of thread, other threads:[~2016-02-26  2:47 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-11-20  9:32 [PATCH] ASoC: pxa: remove incorrect do_div() call Arnd Bergmann
2015-11-20  9:32 ` Arnd Bergmann
2015-11-20  9:32 ` Arnd Bergmann
2015-11-20 18:20 ` Applied "ASoC: pxa: remove incorrect do_div() call" to the asoc tree Mark Brown
2015-11-23  8:10 ` [PATCH] ASoC: pxa: remove incorrect do_div() call zhangfei
2015-11-23  8:10   ` zhangfei
2015-11-23  8:54   ` Arnd Bergmann
2015-11-23  8:54     ` Arnd Bergmann
2015-11-23  8:54     ` Arnd Bergmann
2016-02-26  2:46     ` Applied "ASoC: pxa: remove unused variable" to the asoc tree 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.