* [PATCH] ASoC: cs-amp-lib: Simplify overcomplicated error return
@ 2026-05-28 14:46 Richard Fitzgerald
2026-05-28 15:35 ` Mark Brown
0 siblings, 1 reply; 2+ messages in thread
From: Richard Fitzgerald @ 2026-05-28 14:46 UTC (permalink / raw)
To: broonie; +Cc: linux-sound, linux-kernel, patches
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.
Signed-off-by: Richard Fitzgerald <rf@opensource.cirrus.com>
---
sound/soc/codecs/cs-amp-lib.c | 5 +----
1 file changed, 1 insertion(+), 4 deletions(-)
diff --git a/sound/soc/codecs/cs-amp-lib.c b/sound/soc/codecs/cs-amp-lib.c
index fb5b950e584c8..371e99205b58e 100644
--- a/sound/soc/codecs/cs-amp-lib.c
+++ b/sound/soc/codecs/cs-amp-lib.c
@@ -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;
/*
--
2.47.3
^ permalink raw reply related [flat|nested] 2+ messages in thread
end of thread, other threads:[~2026-05-29 14:42 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-05-28 14:46 [PATCH] ASoC: cs-amp-lib: Simplify overcomplicated error return Richard Fitzgerald
2026-05-28 15:35 ` Mark Brown
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox