All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/4] ASoC: SOF: cleanups for 5.10
@ 2020-09-30 15:20 Kai Vehmanen
  2020-09-30 15:20 ` [PATCH 1/4] ASoC: SOF: control: remove const in sizeof() Kai Vehmanen
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: Kai Vehmanen @ 2020-09-30 15:20 UTC (permalink / raw)
  To: alsa-devel, broonie
  Cc: lgirdwood, daniel.baluta, pierre-louis.bossart, kai.vehmanen,
	ranjani.sridharan

Series with multiple code cleanups, plus one fix to remove
unnecessary kernel warnings related to firmware loading.

Bard Liao (1):
  ASoC: SOF: loader: handle all SOF_IPC_EXT types

Pierre-Louis Bossart (3):
  ASoC: SOF: control: remove const in sizeof()
  ASoC: SOF: topology: remove const in sizeof()
  ASoC: SOF: sof-audio: remove goto used for force-nocodec support

 sound/soc/sof/control.c   | 20 ++++++++++----------
 sound/soc/sof/loader.c    |  5 +++++
 sound/soc/sof/sof-audio.c | 10 +++-------
 sound/soc/sof/topology.c  |  2 +-
 4 files changed, 19 insertions(+), 18 deletions(-)

-- 
2.27.0


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

* [PATCH 1/4] ASoC: SOF: control: remove const in sizeof()
  2020-09-30 15:20 [PATCH 0/4] ASoC: SOF: cleanups for 5.10 Kai Vehmanen
@ 2020-09-30 15:20 ` Kai Vehmanen
  2020-09-30 15:20 ` [PATCH 2/4] ASoC: SOF: topology: " Kai Vehmanen
                   ` (4 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: Kai Vehmanen @ 2020-09-30 15:20 UTC (permalink / raw)
  To: alsa-devel, broonie
  Cc: Guennadi Liakhovetski, kai.vehmanen, lgirdwood,
	pierre-louis.bossart, ranjani.sridharan, daniel.baluta

From: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>

We should only use the type, the const attribute makes no sense in
sizeof().

Reported-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.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>
Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
---
 sound/soc/sof/control.c | 20 ++++++++++----------
 1 file changed, 10 insertions(+), 10 deletions(-)

diff --git a/sound/soc/sof/control.c b/sound/soc/sof/control.c
index 0352d2b61358..056c86ad5a47 100644
--- a/sound/soc/sof/control.c
+++ b/sound/soc/sof/control.c
@@ -309,7 +309,7 @@ int snd_sof_bytes_ext_put(struct snd_kcontrol *kcontrol,
 	 * the length (as bytes) is needed to know the correct copy
 	 * length of data from tlvd->tlv.
 	 */
-	if (copy_from_user(&header, tlvd, sizeof(const struct snd_ctl_tlv)))
+	if (copy_from_user(&header, tlvd, sizeof(struct snd_ctl_tlv)))
 		return -EFAULT;
 
 	/* make sure TLV info is consistent */
@@ -351,7 +351,7 @@ int snd_sof_bytes_ext_put(struct snd_kcontrol *kcontrol,
 	}
 
 	/* be->max has been verified to be >= sizeof(struct sof_abi_hdr) */
-	if (cdata->data->size > be->max - sizeof(const struct sof_abi_hdr)) {
+	if (cdata->data->size > be->max - sizeof(struct sof_abi_hdr)) {
 		dev_err_ratelimited(scomp->dev, "error: Mismatch in ABI data size (truncated?).\n");
 		return -EINVAL;
 	}
@@ -405,15 +405,15 @@ int snd_sof_bytes_ext_volatile_get(struct snd_kcontrol *kcontrol, unsigned int _
 		goto out;
 
 	/* check data size doesn't exceed max coming from topology */
-	if (cdata->data->size > be->max - sizeof(const struct sof_abi_hdr)) {
+	if (cdata->data->size > be->max - sizeof(struct sof_abi_hdr)) {
 		dev_err_ratelimited(scomp->dev, "error: user data size %d exceeds max size %zu.\n",
 				    cdata->data->size,
-				    be->max - sizeof(const struct sof_abi_hdr));
+				    be->max - sizeof(struct sof_abi_hdr));
 		ret = -EINVAL;
 		goto out;
 	}
 
-	data_size = cdata->data->size + sizeof(const struct sof_abi_hdr);
+	data_size = cdata->data->size + sizeof(struct sof_abi_hdr);
 
 	/* make sure we don't exceed size provided by user space for data */
 	if (data_size > size) {
@@ -423,7 +423,7 @@ int snd_sof_bytes_ext_volatile_get(struct snd_kcontrol *kcontrol, unsigned int _
 
 	header.numid = scontrol->cmd;
 	header.length = data_size;
-	if (copy_to_user(tlvd, &header, sizeof(const struct snd_ctl_tlv))) {
+	if (copy_to_user(tlvd, &header, sizeof(struct snd_ctl_tlv))) {
 		ret = -EFAULT;
 		goto out;
 	}
@@ -466,14 +466,14 @@ int snd_sof_bytes_ext_get(struct snd_kcontrol *kcontrol,
 	cdata->data->abi = SOF_ABI_VERSION;
 
 	/* check data size doesn't exceed max coming from topology */
-	if (cdata->data->size > be->max - sizeof(const struct sof_abi_hdr)) {
+	if (cdata->data->size > be->max - sizeof(struct sof_abi_hdr)) {
 		dev_err_ratelimited(scomp->dev, "error: user data size %d exceeds max size %zu.\n",
 				    cdata->data->size,
-				    be->max - sizeof(const struct sof_abi_hdr));
+				    be->max - sizeof(struct sof_abi_hdr));
 		return -EINVAL;
 	}
 
-	data_size = cdata->data->size + sizeof(const struct sof_abi_hdr);
+	data_size = cdata->data->size + sizeof(struct sof_abi_hdr);
 
 	/* make sure we don't exceed size provided by user space for data */
 	if (data_size > size)
@@ -481,7 +481,7 @@ int snd_sof_bytes_ext_get(struct snd_kcontrol *kcontrol,
 
 	header.numid = scontrol->cmd;
 	header.length = data_size;
-	if (copy_to_user(tlvd, &header, sizeof(const struct snd_ctl_tlv)))
+	if (copy_to_user(tlvd, &header, sizeof(struct snd_ctl_tlv)))
 		return -EFAULT;
 
 	if (copy_to_user(tlvd->tlv, cdata->data, data_size))
-- 
2.27.0


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

* [PATCH 2/4] ASoC: SOF: topology: remove const in sizeof()
  2020-09-30 15:20 [PATCH 0/4] ASoC: SOF: cleanups for 5.10 Kai Vehmanen
  2020-09-30 15:20 ` [PATCH 1/4] ASoC: SOF: control: remove const in sizeof() Kai Vehmanen
@ 2020-09-30 15:20 ` Kai Vehmanen
  2020-09-30 15:20 ` [PATCH 3/4] ASoC: SOF: sof-audio: remove goto used for force-nocodec support Kai Vehmanen
                   ` (3 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: Kai Vehmanen @ 2020-09-30 15:20 UTC (permalink / raw)
  To: alsa-devel, broonie
  Cc: Guennadi Liakhovetski, kai.vehmanen, lgirdwood,
	pierre-louis.bossart, ranjani.sridharan, daniel.baluta

From: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>

We should only use the type, the const attribute makes no sense in
sizeof().

Reported-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.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>
Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
---
 sound/soc/sof/topology.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/sound/soc/sof/topology.c b/sound/soc/sof/topology.c
index 69313fbdb636..523a386fce4b 100644
--- a/sound/soc/sof/topology.c
+++ b/sound/soc/sof/topology.c
@@ -1201,7 +1201,7 @@ static int sof_control_load_bytes(struct snd_soc_component *scomp,
 			ret = -EINVAL;
 			goto out_free;
 		}
-		if (cdata->data->size + sizeof(const struct sof_abi_hdr) !=
+		if (cdata->data->size + sizeof(struct sof_abi_hdr) !=
 		    le32_to_cpu(control->priv.size)) {
 			dev_err(scomp->dev,
 				"error: Conflict in bytes vs. priv size.\n");
-- 
2.27.0


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

* [PATCH 3/4] ASoC: SOF: sof-audio: remove goto used for force-nocodec support
  2020-09-30 15:20 [PATCH 0/4] ASoC: SOF: cleanups for 5.10 Kai Vehmanen
  2020-09-30 15:20 ` [PATCH 1/4] ASoC: SOF: control: remove const in sizeof() Kai Vehmanen
  2020-09-30 15:20 ` [PATCH 2/4] ASoC: SOF: topology: " Kai Vehmanen
@ 2020-09-30 15:20 ` Kai Vehmanen
  2020-09-30 15:20 ` [PATCH 4/4] ASoC: SOF: loader: handle all SOF_IPC_EXT types Kai Vehmanen
                   ` (2 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: Kai Vehmanen @ 2020-09-30 15:20 UTC (permalink / raw)
  To: alsa-devel, broonie
  Cc: Guennadi Liakhovetski, kernel test robot, kai.vehmanen,
	Bard Liao, lgirdwood, pierre-louis.bossart, ranjani.sridharan,
	daniel.baluta

From: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>

Address smatch warnings:
sound/soc/sof/sof-audio.c:375 sof_machine_check() warn: inconsistent indenting
sound/soc/sof/sof-audio.c:380 sof_machine_check() warn: ignoring unreachable code.

No functionality change.

Reported-by: kernel test robot <lkp@intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Reviewed-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
---
 sound/soc/sof/sof-audio.c | 10 +++-------
 1 file changed, 3 insertions(+), 7 deletions(-)

diff --git a/sound/soc/sof/sof-audio.c b/sound/soc/sof/sof-audio.c
index afe7e503bf66..9a8ce25a8fc8 100644
--- a/sound/soc/sof/sof-audio.c
+++ b/sound/soc/sof/sof-audio.c
@@ -443,11 +443,7 @@ int sof_machine_check(struct snd_sof_dev *sdev)
 	struct snd_soc_acpi_mach *mach;
 	int ret;
 
-	/* force nocodec mode */
-#if IS_ENABLED(CONFIG_SND_SOC_SOF_FORCE_NOCODEC_MODE)
-		dev_warn(sdev->dev, "Force to use nocodec mode\n");
-		goto nocodec;
-#endif
+#if !IS_ENABLED(CONFIG_SND_SOC_SOF_FORCE_NOCODEC_MODE)
 
 	/* find machine */
 	snd_sof_machine_select(sdev);
@@ -460,8 +456,8 @@ int sof_machine_check(struct snd_sof_dev *sdev)
 	dev_err(sdev->dev, "error: no matching ASoC machine driver found - aborting probe\n");
 	return -ENODEV;
 #endif
-#if IS_ENABLED(CONFIG_SND_SOC_SOF_FORCE_NOCODEC_MODE)
-nocodec:
+#else
+	dev_warn(sdev->dev, "Force to use nocodec mode\n");
 #endif
 	/* select nocodec mode */
 	dev_warn(sdev->dev, "Using nocodec machine driver\n");
-- 
2.27.0


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

* [PATCH 4/4] ASoC: SOF: loader: handle all SOF_IPC_EXT types
  2020-09-30 15:20 [PATCH 0/4] ASoC: SOF: cleanups for 5.10 Kai Vehmanen
                   ` (2 preceding siblings ...)
  2020-09-30 15:20 ` [PATCH 3/4] ASoC: SOF: sof-audio: remove goto used for force-nocodec support Kai Vehmanen
@ 2020-09-30 15:20 ` Kai Vehmanen
  2020-10-06  7:51 ` [PATCH 0/4] ASoC: SOF: cleanups for 5.10 Jaroslav Kysela
  2020-10-24  0:28 ` Mark Brown
  5 siblings, 0 replies; 7+ messages in thread
From: Kai Vehmanen @ 2020-09-30 15:20 UTC (permalink / raw)
  To: alsa-devel, broonie
  Cc: Guennadi Liakhovetski, kai.vehmanen, daniel.baluta, lgirdwood,
	pierre-louis.bossart, ranjani.sridharan, Bard Liao

From: Bard Liao <yung-chuan.liao@linux.intel.com>

Do not emit a warning for extended firmware header fields that are
not used by kernel. This creates unnecessary noise to kernel logs like:

sof-audio-pci 0000:00:1f.3: warning: unknown ext header type 3 size 0x1c
sof-audio-pci 0000:00:1f.3: warning: unknown ext header type 4 size 0x10

Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Reviewed-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>
Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
---
 sound/soc/sof/loader.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/sound/soc/sof/loader.c b/sound/soc/sof/loader.c
index 68ed454f7ddf..ba9ed66f98bc 100644
--- a/sound/soc/sof/loader.c
+++ b/sound/soc/sof/loader.c
@@ -118,6 +118,11 @@ int snd_sof_fw_parse_ext_data(struct snd_sof_dev *sdev, u32 bar, u32 offset)
 		case SOF_IPC_EXT_CC_INFO:
 			ret = get_cc_info(sdev, ext_hdr);
 			break;
+		case SOF_IPC_EXT_UNUSED:
+		case SOF_IPC_EXT_PROBE_INFO:
+		case SOF_IPC_EXT_USER_ABI_INFO:
+			/* They are supported but we don't do anything here */
+			break;
 		default:
 			dev_warn(sdev->dev, "warning: unknown ext header type %d size 0x%x\n",
 				 ext_hdr->type, ext_hdr->hdr.size);
-- 
2.27.0


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

* Re: [PATCH 0/4] ASoC: SOF: cleanups for 5.10
  2020-09-30 15:20 [PATCH 0/4] ASoC: SOF: cleanups for 5.10 Kai Vehmanen
                   ` (3 preceding siblings ...)
  2020-09-30 15:20 ` [PATCH 4/4] ASoC: SOF: loader: handle all SOF_IPC_EXT types Kai Vehmanen
@ 2020-10-06  7:51 ` Jaroslav Kysela
  2020-10-24  0:28 ` Mark Brown
  5 siblings, 0 replies; 7+ messages in thread
From: Jaroslav Kysela @ 2020-10-06  7:51 UTC (permalink / raw)
  To: Kai Vehmanen, alsa-devel, broonie
  Cc: ranjani.sridharan, daniel.baluta, lgirdwood, pierre-louis.bossart

Dne 30. 09. 20 v 17:20 Kai Vehmanen napsal(a):
> Series with multiple code cleanups, plus one fix to remove
> unnecessary kernel warnings related to firmware loading.
> 
> Bard Liao (1):
>   ASoC: SOF: loader: handle all SOF_IPC_EXT types
> 
> Pierre-Louis Bossart (3):
>   ASoC: SOF: control: remove const in sizeof()
>   ASoC: SOF: topology: remove const in sizeof()
>   ASoC: SOF: sof-audio: remove goto used for force-nocodec support
> 
>  sound/soc/sof/control.c   | 20 ++++++++++----------
>  sound/soc/sof/loader.c    |  5 +++++
>  sound/soc/sof/sof-audio.c | 10 +++-------
>  sound/soc/sof/topology.c  |  2 +-
>  4 files changed, 19 insertions(+), 18 deletions(-)
> 

Acked-by: Jaroslav Kysela <perex@perex.cz>
Tested-by: Jaroslav Kysela <perex@perex.cz>

Mark, apply, please.

					Jaroslav

-- 
Jaroslav Kysela <perex@perex.cz>
Linux Sound Maintainer; ALSA Project; Red Hat, Inc.

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

* Re: [PATCH 0/4] ASoC: SOF: cleanups for 5.10
  2020-09-30 15:20 [PATCH 0/4] ASoC: SOF: cleanups for 5.10 Kai Vehmanen
                   ` (4 preceding siblings ...)
  2020-10-06  7:51 ` [PATCH 0/4] ASoC: SOF: cleanups for 5.10 Jaroslav Kysela
@ 2020-10-24  0:28 ` Mark Brown
  5 siblings, 0 replies; 7+ messages in thread
From: Mark Brown @ 2020-10-24  0:28 UTC (permalink / raw)
  To: Kai Vehmanen, alsa-devel
  Cc: pierre-louis.bossart, daniel.baluta, lgirdwood, ranjani.sridharan

On Wed, 30 Sep 2020 18:20:22 +0300, Kai Vehmanen wrote:
> Series with multiple code cleanups, plus one fix to remove
> unnecessary kernel warnings related to firmware loading.
> 
> Bard Liao (1):
>   ASoC: SOF: loader: handle all SOF_IPC_EXT types
> 
> Pierre-Louis Bossart (3):
>   ASoC: SOF: control: remove const in sizeof()
>   ASoC: SOF: topology: remove const in sizeof()
>   ASoC: SOF: sof-audio: remove goto used for force-nocodec support
> 
> [...]

Applied to

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

Thanks!

[1/4] ASoC: SOF: control: remove const in sizeof()
      (no commit info)
[2/4] ASoC: SOF: topology: remove const in sizeof()
      (no commit info)
[3/4] ASoC: SOF: sof-audio: remove goto used for force-nocodec support
      (no commit info)
[4/4] ASoC: SOF: loader: handle all SOF_IPC_EXT types
      commit: 6e5329c6e6032cd997400b43b8299f607a61883e

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

end of thread, other threads:[~2020-10-24  0:30 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-09-30 15:20 [PATCH 0/4] ASoC: SOF: cleanups for 5.10 Kai Vehmanen
2020-09-30 15:20 ` [PATCH 1/4] ASoC: SOF: control: remove const in sizeof() Kai Vehmanen
2020-09-30 15:20 ` [PATCH 2/4] ASoC: SOF: topology: " Kai Vehmanen
2020-09-30 15:20 ` [PATCH 3/4] ASoC: SOF: sof-audio: remove goto used for force-nocodec support Kai Vehmanen
2020-09-30 15:20 ` [PATCH 4/4] ASoC: SOF: loader: handle all SOF_IPC_EXT types Kai Vehmanen
2020-10-06  7:51 ` [PATCH 0/4] ASoC: SOF: cleanups for 5.10 Jaroslav Kysela
2020-10-24  0:28 ` 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.