[PATCH] ASoC: codecs: nau8360: Fix misleading return in nau8360_message_to_dsp()

From: Neo Chang

Date: Mon Sep 14 2026 - 21:55:59 EST


Fix a smatch static analysis warning: "missing error code? 'ret'".

When there are no message parameters (!cmd_info->msg_param), 'ret' is
guaranteed to be 0. Return 0 directly.

Reported-by: kernel test robot <lkp@xxxxxxxxx>
Reported-by: Dan Carpenter <error27@xxxxxxxxx>
Closes: https://lore.kernel.org/r/202609081933.K4tVJnyh-lkp@xxxxxxxxx/
Signed-off-by: Neo Chang <YLCHANG2@xxxxxxxxxxx>
---
sound/soc/codecs/nau8360-dsp.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/sound/soc/codecs/nau8360-dsp.c b/sound/soc/codecs/nau8360-dsp.c
index 2e5b61bfc303..65ffec8b3a39 100644
--- a/sound/soc/codecs/nau8360-dsp.c
+++ b/sound/soc/codecs/nau8360-dsp.c
@@ -211,7 +211,7 @@ static int nau8360_message_to_dsp(struct snd_soc_component *cp,
snd_soc_component_write(cp, dsp_addr, payload);

if (!cmd_info->msg_param)
- return ret;
+ return 0;

/* sending payload + padding */
payload = nau8360_pack_param(param_offset, param_size);
--
2.25.1