All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] ASoC: SOF: Intel: Do not (wrongly) assume positive return value in IMR path
@ 2022-04-27 11:51 Peter Ujfalusi
  2022-04-27 22:02 ` Mark Brown
  0 siblings, 1 reply; 2+ messages in thread
From: Peter Ujfalusi @ 2022-04-27 11:51 UTC (permalink / raw)
  To: lgirdwood, broonie, pierre-louis.bossart, dan.carpenter
  Cc: alsa-devel, ranjani.sridharan, kai.vehmanen

The cl_dsp_init() returns 0 on success or negative errno on error.
Replace the 'if (ret >= 0)' checks with correct 'if (!ret)` to check for
success.

Fixes: 2a68ff846164 ("ASoC: SOF: Intel: hda: Revisit IMR boot sequence")
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
---
 sound/soc/sof/intel/hda-loader.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/sound/soc/sof/intel/hda-loader.c b/sound/soc/sof/intel/hda-loader.c
index 7d4436f079c6..64290125d7cd 100644
--- a/sound/soc/sof/intel/hda-loader.c
+++ b/sound/soc/sof/intel/hda-loader.c
@@ -372,7 +372,7 @@ static int hda_dsp_boot_imr(struct snd_sof_dev *sdev)
 	int ret;
 
 	ret = cl_dsp_init(sdev, 0, true);
-	if (ret >= 0)
+	if (!ret)
 		hda_sdw_process_wakeen(sdev);
 
 	return ret;
@@ -393,8 +393,8 @@ int hda_dsp_cl_boot_firmware(struct snd_sof_dev *sdev)
 		dev_dbg(sdev->dev, "IMR restore supported, booting from IMR directly\n");
 		hda->boot_iteration = 0;
 		ret = hda_dsp_boot_imr(sdev);
-		if (ret >= 0)
-			return ret;
+		if (!ret)
+			return 0;
 
 		dev_warn(sdev->dev, "IMR restore failed, trying to cold boot\n");
 	}
-- 
2.36.0


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

* Re: [PATCH] ASoC: SOF: Intel: Do not (wrongly) assume positive return value in IMR path
  2022-04-27 11:51 [PATCH] ASoC: SOF: Intel: Do not (wrongly) assume positive return value in IMR path Peter Ujfalusi
@ 2022-04-27 22:02 ` Mark Brown
  0 siblings, 0 replies; 2+ messages in thread
From: Mark Brown @ 2022-04-27 22:02 UTC (permalink / raw)
  To: lgirdwood, dan.carpenter, peter.ujfalusi, pierre-louis.bossart
  Cc: alsa-devel, ranjani.sridharan, kai.vehmanen

On Wed, 27 Apr 2022 14:51:59 +0300, Peter Ujfalusi wrote:
> The cl_dsp_init() returns 0 on success or negative errno on error.
> Replace the 'if (ret >= 0)' checks with correct 'if (!ret)` to check for
> success.
> 
> 

Applied to

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

Thanks!

[1/1] ASoC: SOF: Intel: Do not (wrongly) assume positive return value in IMR path
      commit: fd2cea169c4bc01f88bca84e4f01df48901c4339

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] 2+ messages in thread

end of thread, other threads:[~2022-04-27 22:05 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-04-27 11:51 [PATCH] ASoC: SOF: Intel: Do not (wrongly) assume positive return value in IMR path Peter Ujfalusi
2022-04-27 22:02 ` 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.