alsa-devel.alsa-project.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/2] ASoC: SOF: trivial code cleanups
@ 2020-04-09 18:48 Pierre-Louis Bossart
  2020-04-09 18:48 ` [PATCH 1/2] ASoC: SOF: remove unneeded variables Pierre-Louis Bossart
  2020-04-09 18:48 ` [PATCH 2/2] ASoC: SOF: Intel: hda: remove unnecessary parentheses Pierre-Louis Bossart
  0 siblings, 2 replies; 5+ messages in thread
From: Pierre-Louis Bossart @ 2020-04-09 18:48 UTC (permalink / raw)
  To: alsa-devel; +Cc: tiwai, broonie, Pierre-Louis Bossart

Fix warnings reported by tools - no functionality change.

Payal Kshirsagar (2):
  ASoC: SOF: remove unneeded variables
  ASoC: SOF: Intel: hda: remove unnecessary parentheses

 sound/soc/sof/intel/hda-codec.c | 5 +----
 sound/soc/sof/intel/hda-dsp.c   | 8 ++++----
 sound/soc/sof/nocodec.c         | 6 ++----
 3 files changed, 7 insertions(+), 12 deletions(-)


base-commit: dd8e871d4e560eeb8d22af82dde91457ad835a63
-- 
2.20.1


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

* [PATCH 1/2] ASoC: SOF: remove unneeded variables
  2020-04-09 18:48 [PATCH 0/2] ASoC: SOF: trivial code cleanups Pierre-Louis Bossart
@ 2020-04-09 18:48 ` Pierre-Louis Bossart
  2020-04-14 14:49   ` Applied "ASoC: SOF: remove unneeded variables" to the asoc tree Mark Brown
  2020-04-09 18:48 ` [PATCH 2/2] ASoC: SOF: Intel: hda: remove unnecessary parentheses Pierre-Louis Bossart
  1 sibling, 1 reply; 5+ messages in thread
From: Pierre-Louis Bossart @ 2020-04-09 18:48 UTC (permalink / raw)
  To: alsa-devel
  Cc: tiwai, broonie, Ranjani Sridharan, Payal Kshirsagar,
	Pierre-Louis Bossart

From: Payal Kshirsagar <payalskshirsagar1234@gmail.com>

Remove unneeded temporary local variables and their declarations.
Change suggested by coccinelle.

Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Signed-off-by: Payal Kshirsagar <payalskshirsagar1234@gmail.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
---
 sound/soc/sof/intel/hda-codec.c | 5 +----
 sound/soc/sof/nocodec.c         | 6 ++----
 2 files changed, 3 insertions(+), 8 deletions(-)

diff --git a/sound/soc/sof/intel/hda-codec.c b/sound/soc/sof/intel/hda-codec.c
index 3041fbbb010a..7e7e296a3953 100644
--- a/sound/soc/sof/intel/hda-codec.c
+++ b/sound/soc/sof/intel/hda-codec.c
@@ -207,7 +207,6 @@ EXPORT_SYMBOL_NS(hda_codec_i915_init, SND_SOC_SOF_HDA_AUDIO_CODEC_I915);
 int hda_codec_i915_exit(struct snd_sof_dev *sdev)
 {
 	struct hdac_bus *bus = sof_to_bus(sdev);
-	int ret;
 
 	if (!bus->audio_component)
 		return 0;
@@ -215,9 +214,7 @@ int hda_codec_i915_exit(struct snd_sof_dev *sdev)
 	/* power down unconditionally */
 	snd_hdac_display_power(bus, HDA_CODEC_IDX_CONTROLLER, false);
 
-	ret = snd_hdac_i915_exit(bus);
-
-	return ret;
+	return snd_hdac_i915_exit(bus);
 }
 EXPORT_SYMBOL_NS(hda_codec_i915_exit, SND_SOC_SOF_HDA_AUDIO_CODEC_I915);
 
diff --git a/sound/soc/sof/nocodec.c b/sound/soc/sof/nocodec.c
index 2233146386cc..5bf67b2aa4e7 100644
--- a/sound/soc/sof/nocodec.c
+++ b/sound/soc/sof/nocodec.c
@@ -66,7 +66,6 @@ int sof_nocodec_setup(struct device *dev,
 		      const struct snd_sof_dsp_ops *ops)
 {
 	struct snd_soc_dai_link *links;
-	int ret;
 
 	/* create dummy BE dai_links */
 	links = devm_kzalloc(dev, sizeof(struct snd_soc_dai_link) *
@@ -74,9 +73,8 @@ int sof_nocodec_setup(struct device *dev,
 	if (!links)
 		return -ENOMEM;
 
-	ret = sof_nocodec_bes_setup(dev, ops, links, ops->num_drv,
-				    &sof_nocodec_card);
-	return ret;
+	return sof_nocodec_bes_setup(dev, ops, links, ops->num_drv,
+				     &sof_nocodec_card);
 }
 EXPORT_SYMBOL(sof_nocodec_setup);
 
-- 
2.20.1


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

* [PATCH 2/2] ASoC: SOF: Intel: hda: remove unnecessary parentheses
  2020-04-09 18:48 [PATCH 0/2] ASoC: SOF: trivial code cleanups Pierre-Louis Bossart
  2020-04-09 18:48 ` [PATCH 1/2] ASoC: SOF: remove unneeded variables Pierre-Louis Bossart
@ 2020-04-09 18:48 ` Pierre-Louis Bossart
  2020-04-14 14:49   ` Applied "ASoC: SOF: Intel: hda: remove unnecessary parentheses" to the asoc tree Mark Brown
  1 sibling, 1 reply; 5+ messages in thread
From: Pierre-Louis Bossart @ 2020-04-09 18:48 UTC (permalink / raw)
  To: alsa-devel
  Cc: Guennadi Liakhovetski, Kai Vehmanen, tiwai, Ranjani Sridharan,
	Pierre-Louis Bossart, broonie, Payal Kshirsagar

From: Payal Kshirsagar <payalskshirsagar1234@gmail.com>

Remove unnecessary parentheses around the right hand side of an assignment
and align the code.

Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
Reviewed-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Signed-off-by: Payal Kshirsagar <payalskshirsagar1234@gmail.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
---
 sound/soc/sof/intel/hda-dsp.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/sound/soc/sof/intel/hda-dsp.c b/sound/soc/sof/intel/hda-dsp.c
index 99087b6afb67..c780e1e6f895 100644
--- a/sound/soc/sof/intel/hda-dsp.c
+++ b/sound/soc/sof/intel/hda-dsp.c
@@ -226,10 +226,10 @@ bool hda_dsp_core_is_enabled(struct snd_sof_dev *sdev,
 
 	val = snd_sof_dsp_read(sdev, HDA_DSP_BAR, HDA_DSP_REG_ADSPCS);
 
-	is_enable = ((val & HDA_DSP_ADSPCS_CPA_MASK(core_mask)) &&
-			(val & HDA_DSP_ADSPCS_SPA_MASK(core_mask)) &&
-			!(val & HDA_DSP_ADSPCS_CRST_MASK(core_mask)) &&
-			!(val & HDA_DSP_ADSPCS_CSTALL_MASK(core_mask)));
+	is_enable = (val & HDA_DSP_ADSPCS_CPA_MASK(core_mask)) &&
+		    (val & HDA_DSP_ADSPCS_SPA_MASK(core_mask)) &&
+		    !(val & HDA_DSP_ADSPCS_CRST_MASK(core_mask)) &&
+		    !(val & HDA_DSP_ADSPCS_CSTALL_MASK(core_mask));
 
 	dev_dbg(sdev->dev, "DSP core(s) enabled? %d : core_mask %x\n",
 		is_enable, core_mask);
-- 
2.20.1


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

* Applied "ASoC: SOF: Intel: hda: remove unnecessary parentheses" to the asoc tree
  2020-04-09 18:48 ` [PATCH 2/2] ASoC: SOF: Intel: hda: remove unnecessary parentheses Pierre-Louis Bossart
@ 2020-04-14 14:49   ` Mark Brown
  0 siblings, 0 replies; 5+ messages in thread
From: Mark Brown @ 2020-04-14 14:49 UTC (permalink / raw)
  To: Payal Kshirsagar
  Cc: Guennadi Liakhovetski, alsa-devel, Kai Vehmanen, tiwai,
	Pierre-Louis Bossart, Ranjani Sridharan, Mark Brown

The patch

   ASoC: SOF: Intel: hda: remove unnecessary parentheses

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 805a23de2657c10c2ca96588a309a42df947bb36 Mon Sep 17 00:00:00 2001
From: Payal Kshirsagar <payalskshirsagar1234@gmail.com>
Date: Thu, 9 Apr 2020 13:48:53 -0500
Subject: [PATCH] ASoC: SOF: Intel: hda: remove unnecessary parentheses

Remove unnecessary parentheses around the right hand side of an assignment
and align the code.

Signed-off-by: Payal Kshirsagar <payalskshirsagar1234@gmail.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
Reviewed-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Link: https://lore.kernel.org/r/20200409184853.15896-3-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
---
 sound/soc/sof/intel/hda-dsp.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/sound/soc/sof/intel/hda-dsp.c b/sound/soc/sof/intel/hda-dsp.c
index 99087b6afb67..c780e1e6f895 100644
--- a/sound/soc/sof/intel/hda-dsp.c
+++ b/sound/soc/sof/intel/hda-dsp.c
@@ -226,10 +226,10 @@ bool hda_dsp_core_is_enabled(struct snd_sof_dev *sdev,
 
 	val = snd_sof_dsp_read(sdev, HDA_DSP_BAR, HDA_DSP_REG_ADSPCS);
 
-	is_enable = ((val & HDA_DSP_ADSPCS_CPA_MASK(core_mask)) &&
-			(val & HDA_DSP_ADSPCS_SPA_MASK(core_mask)) &&
-			!(val & HDA_DSP_ADSPCS_CRST_MASK(core_mask)) &&
-			!(val & HDA_DSP_ADSPCS_CSTALL_MASK(core_mask)));
+	is_enable = (val & HDA_DSP_ADSPCS_CPA_MASK(core_mask)) &&
+		    (val & HDA_DSP_ADSPCS_SPA_MASK(core_mask)) &&
+		    !(val & HDA_DSP_ADSPCS_CRST_MASK(core_mask)) &&
+		    !(val & HDA_DSP_ADSPCS_CSTALL_MASK(core_mask));
 
 	dev_dbg(sdev->dev, "DSP core(s) enabled? %d : core_mask %x\n",
 		is_enable, core_mask);
-- 
2.20.1


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

* Applied "ASoC: SOF: remove unneeded variables" to the asoc tree
  2020-04-09 18:48 ` [PATCH 1/2] ASoC: SOF: remove unneeded variables Pierre-Louis Bossart
@ 2020-04-14 14:49   ` Mark Brown
  0 siblings, 0 replies; 5+ messages in thread
From: Mark Brown @ 2020-04-14 14:49 UTC (permalink / raw)
  To: Payal Kshirsagar
  Cc: tiwai, alsa-devel, Mark Brown, Pierre-Louis Bossart, Ranjani Sridharan

The patch

   ASoC: SOF: remove unneeded variables

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 1d03c19e970e7457b755d736a81e9e8601e1a407 Mon Sep 17 00:00:00 2001
From: Payal Kshirsagar <payalskshirsagar1234@gmail.com>
Date: Thu, 9 Apr 2020 13:48:52 -0500
Subject: [PATCH] ASoC: SOF: remove unneeded variables

Remove unneeded temporary local variables and their declarations.
Change suggested by coccinelle.

Signed-off-by: Payal Kshirsagar <payalskshirsagar1234@gmail.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Link: https://lore.kernel.org/r/20200409184853.15896-2-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
---
 sound/soc/sof/intel/hda-codec.c | 5 +----
 sound/soc/sof/nocodec.c         | 6 ++----
 2 files changed, 3 insertions(+), 8 deletions(-)

diff --git a/sound/soc/sof/intel/hda-codec.c b/sound/soc/sof/intel/hda-codec.c
index 3041fbbb010a..7e7e296a3953 100644
--- a/sound/soc/sof/intel/hda-codec.c
+++ b/sound/soc/sof/intel/hda-codec.c
@@ -207,7 +207,6 @@ EXPORT_SYMBOL_NS(hda_codec_i915_init, SND_SOC_SOF_HDA_AUDIO_CODEC_I915);
 int hda_codec_i915_exit(struct snd_sof_dev *sdev)
 {
 	struct hdac_bus *bus = sof_to_bus(sdev);
-	int ret;
 
 	if (!bus->audio_component)
 		return 0;
@@ -215,9 +214,7 @@ int hda_codec_i915_exit(struct snd_sof_dev *sdev)
 	/* power down unconditionally */
 	snd_hdac_display_power(bus, HDA_CODEC_IDX_CONTROLLER, false);
 
-	ret = snd_hdac_i915_exit(bus);
-
-	return ret;
+	return snd_hdac_i915_exit(bus);
 }
 EXPORT_SYMBOL_NS(hda_codec_i915_exit, SND_SOC_SOF_HDA_AUDIO_CODEC_I915);
 
diff --git a/sound/soc/sof/nocodec.c b/sound/soc/sof/nocodec.c
index 2233146386cc..5bf67b2aa4e7 100644
--- a/sound/soc/sof/nocodec.c
+++ b/sound/soc/sof/nocodec.c
@@ -66,7 +66,6 @@ int sof_nocodec_setup(struct device *dev,
 		      const struct snd_sof_dsp_ops *ops)
 {
 	struct snd_soc_dai_link *links;
-	int ret;
 
 	/* create dummy BE dai_links */
 	links = devm_kzalloc(dev, sizeof(struct snd_soc_dai_link) *
@@ -74,9 +73,8 @@ int sof_nocodec_setup(struct device *dev,
 	if (!links)
 		return -ENOMEM;
 
-	ret = sof_nocodec_bes_setup(dev, ops, links, ops->num_drv,
-				    &sof_nocodec_card);
-	return ret;
+	return sof_nocodec_bes_setup(dev, ops, links, ops->num_drv,
+				     &sof_nocodec_card);
 }
 EXPORT_SYMBOL(sof_nocodec_setup);
 
-- 
2.20.1


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

end of thread, other threads:[~2020-04-14 15:10 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-04-09 18:48 [PATCH 0/2] ASoC: SOF: trivial code cleanups Pierre-Louis Bossart
2020-04-09 18:48 ` [PATCH 1/2] ASoC: SOF: remove unneeded variables Pierre-Louis Bossart
2020-04-14 14:49   ` Applied "ASoC: SOF: remove unneeded variables" to the asoc tree Mark Brown
2020-04-09 18:48 ` [PATCH 2/2] ASoC: SOF: Intel: hda: remove unnecessary parentheses Pierre-Louis Bossart
2020-04-14 14:49   ` Applied "ASoC: SOF: Intel: hda: remove unnecessary parentheses" to the asoc tree 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).