Skip to contentSkip to conversation

ASoC: cs-amp-lib: Simplify overcomplicated error return

PATCH In review Richard Fitzgerald 2 participants 2 messages May 28 – May 29

Subsystems (3)
lore
Share & tools
lore

Richard Fitzgerald

author maintainer
#0 lore raw

PATCH 1/1 ASoC: cs-amp-lib: Simplify overcomplicated error return

In cs_amp_devm_get_dell_ssidex() remove an unnecessary special case check on -ENOENT that just returned -ENOENT. The other branch of the if() statement returned the error, which would of course return -ENOENT if the error was -ENOENT and so do exactly the same as the first branch.

The whole if statement is identical to just returning the original pointer if it is an error value.

---
 sound/soc/codecs/cs-amp-lib.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)
sound/soc/codecs/cs-amp-lib.c +1 -4
index fb5b950e584c8..371e99205b58e 100644
@@ -748,10 +748,7 @@ static const char *cs_amp_devm_get_dell_ssidex(struct device *dev,
 	char *ssidex_buf __free(kfree) = cs_amp_alloc_get_efi_variable(DELL_SSIDEXV2_EFI_NAME,
 								       &DELL_SSIDEXV2_EFI_GUID,
 								       NULL);
-	ret = PTR_ERR_OR_ZERO(ssidex_buf);
-	if (ret == -ENOENT)
-		return ERR_PTR(-ENOENT);
-	else if (ret < 0)
+	if (IS_ERR(ssidex_buf))
 		return ssidex_buf;
 
 	/*
Signature · 1 line
2.47.3
maintainer
#1 lore raw
Quoted 1 line · Richard Fitzgerald

ASoC: cs-amp-lib: Simplify overcomplicated error return

Applied to

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

Thanks!

[1/1] ASoC: cs-amp-lib: Simplify overcomplicated error return

      https://git.kernel.org/broonie/sound/c/3b28b14b794c

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