linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH -next] ASoC: stm32: sai: remove set but not used variables 'mask, cr1'
@ 2019-02-18 13:48 YueHaibing
  2019-02-18 14:41 ` Dan Carpenter
  2019-02-18 14:50 ` [PATCH v2 " YueHaibing
  0 siblings, 2 replies; 5+ messages in thread
From: YueHaibing @ 2019-02-18 13:48 UTC (permalink / raw)
  To: Olivier Moysan, Arnaud Pouliquen, Liam Girdwood, Mark Brown,
	Jaroslav Kysela, Takashi Iwai, Maxime Coquelin
  Cc: YueHaibing, alsa-devel, linux-stm32, linux-arm-kernel,
	linux-kernel, kernel-janitors

Fixes gcc '-Wunused-but-set-variable' warning:

sound/soc/stm/stm32_sai_sub.c: In function 'stm32_sai_configure_clock':
sound/soc/stm/stm32_sai_sub.c:902:11: warning:
 variable 'mask' set but not used [-Wunused-but-set-variable]
sound/soc/stm/stm32_sai_sub.c:902:6: warning:
 variable 'cr1' set but not used [-Wunused-but-set-variable]

It's not used any more after 8307b2afd386 ("ASoC: stm32: sai: set sai as
mclk clock provider")

Signed-off-by: YueHaibing <yuehaibing@huawei.com>
---
 sound/soc/stm/stm32_sai_sub.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/sound/soc/stm/stm32_sai_sub.c b/sound/soc/stm/stm32_sai_sub.c
index d4825700b63f..a00640f1df06 100644
--- a/sound/soc/stm/stm32_sai_sub.c
+++ b/sound/soc/stm/stm32_sai_sub.c
@@ -898,7 +898,7 @@ static int stm32_sai_configure_clock(struct snd_soc_dai *cpu_dai,
 				     struct snd_pcm_hw_params *params)
 {
 	struct stm32_sai_sub_data *sai = snd_soc_dai_get_drvdata(cpu_dai);
-	int cr1, mask, div = 0;
+	int div = 0;
 	int sai_clk_rate, mclk_ratio, den;
 	unsigned int rate = params_rate(params);
 
@@ -944,8 +944,7 @@ static int stm32_sai_configure_clock(struct snd_soc_dai *cpu_dai,
 			if (sai->mclk_rate) {
 				mclk_ratio = sai->mclk_rate / rate;
 				if (mclk_ratio == 512) {
-					mask = SAI_XCR1_OSR;
-					cr1 = SAI_XCR1_OSR;
+					;
 				} else if (mclk_ratio != 256) {
 					dev_err(cpu_dai->dev,
 						"Wrong mclk ratio %d\n",




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

* Re: [PATCH -next] ASoC: stm32: sai: remove set but not used variables 'mask, cr1'
  2019-02-18 13:48 [PATCH -next] ASoC: stm32: sai: remove set but not used variables 'mask, cr1' YueHaibing
@ 2019-02-18 14:41 ` Dan Carpenter
  2019-02-18 14:50 ` [PATCH v2 " YueHaibing
  1 sibling, 0 replies; 5+ messages in thread
From: Dan Carpenter @ 2019-02-18 14:41 UTC (permalink / raw)
  To: YueHaibing
  Cc: Olivier Moysan, Arnaud Pouliquen, Liam Girdwood, Mark Brown,
	Jaroslav Kysela, Takashi Iwai, Maxime Coquelin, alsa-devel,
	linux-stm32, linux-arm-kernel, linux-kernel, kernel-janitors

On Mon, Feb 18, 2019 at 01:48:36PM +0000, YueHaibing wrote:
> Fixes gcc '-Wunused-but-set-variable' warning:
> 
> sound/soc/stm/stm32_sai_sub.c: In function 'stm32_sai_configure_clock':
> sound/soc/stm/stm32_sai_sub.c:902:11: warning:
>  variable 'mask' set but not used [-Wunused-but-set-variable]
> sound/soc/stm/stm32_sai_sub.c:902:6: warning:
>  variable 'cr1' set but not used [-Wunused-but-set-variable]
> 
> It's not used any more after 8307b2afd386 ("ASoC: stm32: sai: set sai as
> mclk clock provider")
> 
> Signed-off-by: YueHaibing <yuehaibing@huawei.com>
> ---
>  sound/soc/stm/stm32_sai_sub.c | 5 ++---
>  1 file changed, 2 insertions(+), 3 deletions(-)
> 
> diff --git a/sound/soc/stm/stm32_sai_sub.c b/sound/soc/stm/stm32_sai_sub.c
> index d4825700b63f..a00640f1df06 100644
> --- a/sound/soc/stm/stm32_sai_sub.c
> +++ b/sound/soc/stm/stm32_sai_sub.c
> @@ -898,7 +898,7 @@ static int stm32_sai_configure_clock(struct snd_soc_dai *cpu_dai,
>  				     struct snd_pcm_hw_params *params)
>  {
>  	struct stm32_sai_sub_data *sai = snd_soc_dai_get_drvdata(cpu_dai);
> -	int cr1, mask, div = 0;
> +	int div = 0;
>  	int sai_clk_rate, mclk_ratio, den;
>  	unsigned int rate = params_rate(params);
>  
> @@ -944,8 +944,7 @@ static int stm32_sai_configure_clock(struct snd_soc_dai *cpu_dai,
>  			if (sai->mclk_rate) {
>  				mclk_ratio = sai->mclk_rate / rate;
>  				if (mclk_ratio == 512) {
> -					mask = SAI_XCR1_OSR;
> -					cr1 = SAI_XCR1_OSR;
> +					;
>  				} else if (mclk_ratio != 256) {


Please, no...

				if (mclk_ratio != 512 && mclk_ratio != 256) {
					dev_err(...

regards,
dan carpenter


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

* [PATCH v2 -next] ASoC: stm32: sai: remove set but not used variables 'mask, cr1'
  2019-02-18 13:48 [PATCH -next] ASoC: stm32: sai: remove set but not used variables 'mask, cr1' YueHaibing
  2019-02-18 14:41 ` Dan Carpenter
@ 2019-02-18 14:50 ` YueHaibing
  2019-02-18 18:49   ` Applied "ASoC: stm32: sai: remove set but not used variables 'mask, cr1'" to the asoc tree Mark Brown
  2019-02-18 18:52   ` Mark Brown
  1 sibling, 2 replies; 5+ messages in thread
From: YueHaibing @ 2019-02-18 14:50 UTC (permalink / raw)
  To: Olivier Moysan, Arnaud Pouliquen, Liam Girdwood, Mark Brown,
	Jaroslav Kysela, Takashi Iwai, Maxime Coquelin
  Cc: YueHaibing, alsa-devel, linux-stm32, linux-arm-kernel,
	linux-kernel, kernel-janitors

Fixes gcc '-Wunused-but-set-variable' warning:

sound/soc/stm/stm32_sai_sub.c: In function 'stm32_sai_configure_clock':
sound/soc/stm/stm32_sai_sub.c:902:11: warning:
 variable 'mask' set but not used [-Wunused-but-set-variable]
sound/soc/stm/stm32_sai_sub.c:902:6: warning:
 variable 'cr1' set but not used [-Wunused-but-set-variable]

It's not used any more after 8307b2afd386 ("ASoC: stm32: sai: set sai as
mclk clock provider")

Signed-off-by: YueHaibing <yuehaibing@huawei.com>
---
v2: remove unnessesary if branch.
---
 sound/soc/stm/stm32_sai_sub.c | 8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)

diff --git a/sound/soc/stm/stm32_sai_sub.c b/sound/soc/stm/stm32_sai_sub.c
index d4825700b63f..f9297228c41c 100644
--- a/sound/soc/stm/stm32_sai_sub.c
+++ b/sound/soc/stm/stm32_sai_sub.c
@@ -898,7 +898,7 @@ static int stm32_sai_configure_clock(struct snd_soc_dai *cpu_dai,
 				     struct snd_pcm_hw_params *params)
 {
 	struct stm32_sai_sub_data *sai = snd_soc_dai_get_drvdata(cpu_dai);
-	int cr1, mask, div = 0;
+	int div = 0;
 	int sai_clk_rate, mclk_ratio, den;
 	unsigned int rate = params_rate(params);
 
@@ -943,10 +943,8 @@ static int stm32_sai_configure_clock(struct snd_soc_dai *cpu_dai,
 		} else {
 			if (sai->mclk_rate) {
 				mclk_ratio = sai->mclk_rate / rate;
-				if (mclk_ratio == 512) {
-					mask = SAI_XCR1_OSR;
-					cr1 = SAI_XCR1_OSR;
-				} else if (mclk_ratio != 256) {
+				if ((mclk_ratio != 512) &&
+				    (mclk_ratio != 256)) {
 					dev_err(cpu_dai->dev,
 						"Wrong mclk ratio %d\n",
 						mclk_ratio);




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

* Applied "ASoC: stm32: sai: remove set but not used variables 'mask, cr1'" to the asoc tree
  2019-02-18 14:50 ` [PATCH v2 " YueHaibing
@ 2019-02-18 18:49   ` Mark Brown
  2019-02-18 18:52   ` Mark Brown
  1 sibling, 0 replies; 5+ messages in thread
From: Mark Brown @ 2019-02-18 18:49 UTC (permalink / raw)
  To: YueHaibing
  Cc: Mark Brown, Olivier Moysan, Arnaud Pouliquen, Liam Girdwood,
	Mark Brown, Jaroslav Kysela, Takashi Iwai, Maxime Coquelin,
	alsa-devel, kernel-janitors, linux-kernel, linux-stm32,
	linux-arm-kernel, alsa-devel

The patch

   ASoC: stm32: sai: remove set but not used variables 'mask, cr1'

has been applied to the asoc tree at

   https://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 70605450fd42060783b0072a61a30f42a74f2917 Mon Sep 17 00:00:00 2001
From: YueHaibing <yuehaibing@huawei.com>
Date: Mon, 18 Feb 2019 14:50:26 +0000
Subject: [PATCH] ASoC: stm32: sai: remove set but not used variables 'mask,
 cr1'

Fixes gcc '-Wunused-but-set-variable' warning:

sound/soc/stm/stm32_sai_sub.c: In function 'stm32_sai_configure_clock':
sound/soc/stm/stm32_sai_sub.c:902:11: warning:
 variable 'mask' set but not used [-Wunused-but-set-variable]
sound/soc/stm/stm32_sai_sub.c:902:6: warning:
 variable 'cr1' set but not used [-Wunused-but-set-variable]

It's not used any more after 8307b2afd386 ("ASoC: stm32: sai: set sai as
mclk clock provider")

Signed-off-by: YueHaibing <yuehaibing@huawei.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
---
 sound/soc/stm/stm32_sai_sub.c | 8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)

diff --git a/sound/soc/stm/stm32_sai_sub.c b/sound/soc/stm/stm32_sai_sub.c
index d4825700b63f..f9297228c41c 100644
--- a/sound/soc/stm/stm32_sai_sub.c
+++ b/sound/soc/stm/stm32_sai_sub.c
@@ -898,7 +898,7 @@ static int stm32_sai_configure_clock(struct snd_soc_dai *cpu_dai,
 				     struct snd_pcm_hw_params *params)
 {
 	struct stm32_sai_sub_data *sai = snd_soc_dai_get_drvdata(cpu_dai);
-	int cr1, mask, div = 0;
+	int div = 0;
 	int sai_clk_rate, mclk_ratio, den;
 	unsigned int rate = params_rate(params);
 
@@ -943,10 +943,8 @@ static int stm32_sai_configure_clock(struct snd_soc_dai *cpu_dai,
 		} else {
 			if (sai->mclk_rate) {
 				mclk_ratio = sai->mclk_rate / rate;
-				if (mclk_ratio == 512) {
-					mask = SAI_XCR1_OSR;
-					cr1 = SAI_XCR1_OSR;
-				} else if (mclk_ratio != 256) {
+				if ((mclk_ratio != 512) &&
+				    (mclk_ratio != 256)) {
 					dev_err(cpu_dai->dev,
 						"Wrong mclk ratio %d\n",
 						mclk_ratio);
-- 
2.20.1


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

* Applied "ASoC: stm32: sai: remove set but not used variables 'mask, cr1'" to the asoc tree
  2019-02-18 14:50 ` [PATCH v2 " YueHaibing
  2019-02-18 18:49   ` Applied "ASoC: stm32: sai: remove set but not used variables 'mask, cr1'" to the asoc tree Mark Brown
@ 2019-02-18 18:52   ` Mark Brown
  1 sibling, 0 replies; 5+ messages in thread
From: Mark Brown @ 2019-02-18 18:52 UTC (permalink / raw)
  To: YueHaibing
  Cc: Mark Brown, Olivier Moysan, Arnaud Pouliquen, Liam Girdwood,
	Mark Brown, Jaroslav Kysela, Takashi Iwai, Maxime Coquelin,
	alsa-devel, kernel-janitors, linux-kernel, linux-stm32,
	linux-arm-kernel, alsa-devel

The patch

   ASoC: stm32: sai: remove set but not used variables 'mask, cr1'

has been applied to the asoc tree at

   https://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 70605450fd42060783b0072a61a30f42a74f2917 Mon Sep 17 00:00:00 2001
From: YueHaibing <yuehaibing@huawei.com>
Date: Mon, 18 Feb 2019 14:50:26 +0000
Subject: [PATCH] ASoC: stm32: sai: remove set but not used variables 'mask,
 cr1'

Fixes gcc '-Wunused-but-set-variable' warning:

sound/soc/stm/stm32_sai_sub.c: In function 'stm32_sai_configure_clock':
sound/soc/stm/stm32_sai_sub.c:902:11: warning:
 variable 'mask' set but not used [-Wunused-but-set-variable]
sound/soc/stm/stm32_sai_sub.c:902:6: warning:
 variable 'cr1' set but not used [-Wunused-but-set-variable]

It's not used any more after 8307b2afd386 ("ASoC: stm32: sai: set sai as
mclk clock provider")

Signed-off-by: YueHaibing <yuehaibing@huawei.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
---
 sound/soc/stm/stm32_sai_sub.c | 8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)

diff --git a/sound/soc/stm/stm32_sai_sub.c b/sound/soc/stm/stm32_sai_sub.c
index d4825700b63f..f9297228c41c 100644
--- a/sound/soc/stm/stm32_sai_sub.c
+++ b/sound/soc/stm/stm32_sai_sub.c
@@ -898,7 +898,7 @@ static int stm32_sai_configure_clock(struct snd_soc_dai *cpu_dai,
 				     struct snd_pcm_hw_params *params)
 {
 	struct stm32_sai_sub_data *sai = snd_soc_dai_get_drvdata(cpu_dai);
-	int cr1, mask, div = 0;
+	int div = 0;
 	int sai_clk_rate, mclk_ratio, den;
 	unsigned int rate = params_rate(params);
 
@@ -943,10 +943,8 @@ static int stm32_sai_configure_clock(struct snd_soc_dai *cpu_dai,
 		} else {
 			if (sai->mclk_rate) {
 				mclk_ratio = sai->mclk_rate / rate;
-				if (mclk_ratio == 512) {
-					mask = SAI_XCR1_OSR;
-					cr1 = SAI_XCR1_OSR;
-				} else if (mclk_ratio != 256) {
+				if ((mclk_ratio != 512) &&
+				    (mclk_ratio != 256)) {
 					dev_err(cpu_dai->dev,
 						"Wrong mclk ratio %d\n",
 						mclk_ratio);
-- 
2.20.1


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

end of thread, other threads:[~2019-02-18 18:52 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-02-18 13:48 [PATCH -next] ASoC: stm32: sai: remove set but not used variables 'mask, cr1' YueHaibing
2019-02-18 14:41 ` Dan Carpenter
2019-02-18 14:50 ` [PATCH v2 " YueHaibing
2019-02-18 18:49   ` Applied "ASoC: stm32: sai: remove set but not used variables 'mask, cr1'" to the asoc tree Mark Brown
2019-02-18 18:52   ` Mark Brown

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).