Skip to contentSkip to conversation

ASoC: Intel: mrfld: return error codes when an error occurs

PATCH In review Colin King 5 participants 5 messages Feb 8, 2020 – Feb 11, 2020

Subsystems (4)
lore
Share & tools
lore

Colin King

author
#0 lore raw

PATCH 1/1 ASoC: Intel: mrfld: return error codes when an error occurs

From: Colin Ian King <[email protected]>

Currently function sst_platform_get_resources always returns zero and error return codes set by the function are never returned. Fix this by returning the error return code in variable ret rather than the hard coded zero.

Addresses-Coverity: ("Unused value")

Fixes f533a035e4da ("ASoC: Intel: mrfld - create separate module for pci part")
---
 sound/soc/intel/atom/sst/sst_pci.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
sound/soc/intel/atom/sst/sst_pci.c +1 -1
index d952719bc098..5862fe968083 100644
@@ -99,7 +99,7 @@ static int sst_platform_get_resources(struct intel_sst_drv *ctx)
 	dev_dbg(ctx->dev, "DRAM Ptr %p\n", ctx->dram);
 do_release_regions:
 	pci_release_regions(pci);
-	return 0;
+	return ret;
 }
 
 /*
Signature · 1 line
2.25.0
maintainer Acked-by on v1 1/1
#1 lore raw
Quoted 20 lines · Colin King

From: Colin Ian King <[email protected]>

Currently function sst_platform_get_resources always returns zero and error return codes set by the function are never returned. Fix this by returning the error return code in variable ret rather than the hard coded zero.

Addresses-Coverity: ("Unused value")

Fixes f533a035e4da ("ASoC: Intel: mrfld - create separate module for pci part")
---
  sound/soc/intel/atom/sst/sst_pci.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
sound/soc/intel/atom/sst/sst_pci.c +0 -0
index d952719bc098..5862fe968083 100644

sound/soc/intel/atom/sst/sst_pci.c static int sst_platform_get_resources(struct intel_sst_drv *ctx) · line 105

Quoted 8 lines
sound/soc/intel/atom/sst/sst_pci.c +1 -1
@@ -99,7 +99,7 @@ static int sst_platform_get_resources(struct intel_sst_drv *ctx)
  	dev_dbg(ctx->dev, "DRAM Ptr %p\n", ctx->dram);
  do_release_regions:
  	pci_release_regions(pci);
-	return 0;
+	return ret;
  }
 
  /*

Thank you for the fix.

#2 lore raw
In reply to Colin King
Quoted 19 lines · Colin King

From: Colin Ian King <[email protected]>

Currently function sst_platform_get_resources always returns zero and error return codes set by the function are never returned. Fix this by returning the error return code in variable ret rather than the hard coded zero.

Addresses-Coverity: ("Unused value")

Fixes f533a035e4da ("ASoC: Intel: mrfld - create separate module for pci part")
---
 sound/soc/intel/atom/sst/sst_pci.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
sound/soc/intel/atom/sst/sst_pci.c +0 -0
index d952719bc098..5862fe968083 100644

sound/soc/intel/atom/sst/sst_pci.c static int sst_platform_get_resources(struct intel_sst_drv *ctx) · line 101

Quoted 3 lines
sound/soc/intel/atom/sst/sst_pci.c +0 -0
@@ -99,7 +99,7 @@ static int sst_platform_get_resources(struct intel_sst_drv *ctx)
 	dev_dbg(ctx->dev, "DRAM Ptr %p\n", ctx->dram);
 do_release_regions:
 	pci_release_regions(pci);

It's weird that we release the regions on the success path.

regards,
dan carpenter

Quoted 3 lines
sound/soc/intel/atom/sst/sst_pci.c +1 -1
-	return 0;
+	return ret;
 }
Acked-by on v1 1/1
#3 lore raw
In reply to Colin King
Quoted 10 lines · Colin King

From: Colin Ian King <[email protected]>

Currently function sst_platform_get_resources always returns zero and error return codes set by the function are never returned. Fix this by returning the error return code in variable ret rather than the hard coded zero.

Addresses-Coverity: ("Unused value")

Fixes f533a035e4da ("ASoC: Intel: mrfld - create separate module for pci part")

Yes, it's clearly bad.

I don't think this impacts anyone though, the code can only be used for Merrifield/Tangier.

Quoted 18 lines
---
  sound/soc/intel/atom/sst/sst_pci.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
sound/soc/intel/atom/sst/sst_pci.c +1 -1
index d952719bc098..5862fe968083 100644
@@ -99,7 +99,7 @@ static int sst_platform_get_resources(struct intel_sst_drv *ctx)
  	dev_dbg(ctx->dev, "DRAM Ptr %p\n", ctx->dram);
  do_release_regions:
  	pci_release_regions(pci);
-	return 0;
+	return ret;
  }
 
  /*
maintainer
#4 lore raw

[alsa-devel] Applied "ASoC: Intel: mrfld: return error codes when an error occurs" to the asoc tree

In reply to Colin King

The patch

ASoC: Intel: mrfld: return error codes when an error occurs

has been applied to the asoc tree at

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

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 3025571edd9df653e1ad649f0638368a39d1bbb5 Mon Sep 17 00:00:00 2001
From: Colin Ian King <[email protected]>
Date: Sat, 8 Feb 2020 22:07:20 +0000
Subject: [PATCH] ASoC: Intel: mrfld: return error codes when an error occurs

Currently function sst_platform_get_resources always returns zero and error return codes set by the function are never returned. Fix this by returning the error return code in variable ret rather than the hard coded zero.

Addresses-Coverity: ("Unused value")

Fixes f533a035e4da ("ASoC: Intel: mrfld - create separate module for pci part")
---
 sound/soc/intel/atom/sst/sst_pci.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
sound/soc/intel/atom/sst/sst_pci.c +1 -1
index d952719bc098..5862fe968083 100644
@@ -99,7 +99,7 @@ static int sst_platform_get_resources(struct intel_sst_drv *ctx)
 	dev_dbg(ctx->dev, "DRAM Ptr %p\n", ctx->dram);
 do_release_regions:
 	pci_release_regions(pci);
-	return 0;
+	return ret;
 }
 
 /*
Signature · 6 lines
2.20.1

_______________________________________________
Alsa-devel mailing list
[email protected]
https://mailman.alsa-project.org/mailman/listinfo/alsa-devel