Skip to contentSkip to conversation

selftests/alsa: make dump_config_tree() as void function

PATCH In review Jaroslav Kysela 4 participants 4 messages May 6, 2024

Subsystems (3)
lore
Share & tools
lore

Jaroslav Kysela

author maintainer
#0 lore raw

PATCH 1/1 selftests/alsa: make dump_config_tree() as void function

dump_config_tree() is declared to return an int, but the compiler cannot prove that it always returns any value at all. This leads to a clang warning, when building via:

make LLVM=1 -C tools/testing/selftests

---
 tools/testing/selftests/alsa/conf.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
tools/testing/selftests/alsa/conf.c +1 -1
index 89e3656a042d..e2b3a5810f47 100644
@@ -105,7 +105,7 @@ static struct card_cfg_data *conf_data_by_card(int card, bool msg)
 	return NULL;
 }
 
-static int dump_config_tree(snd_config_t *top)
+static void dump_config_tree(snd_config_t *top)
 {
 	snd_output_t *out;
 	int err;
Signature · 1 line
2.43.0
maintainer Reviewed-by on v1 1/1
#1 lore raw
Quoted 3 lines · Jaroslav Kysela

dump_config_tree() is declared to return an int, but the compiler cannot prove that it always returns any value at all. This leads to a clang warning, when building via:

#3 lore raw
In reply to Jaroslav Kysela
Quoted 18 lines · Jaroslav Kysela

dump_config_tree() is declared to return an int, but the compiler cannot prove that it always returns any value at all. This leads to a clang warning, when building via:

make LLVM=1 -C tools/testing/selftests

---
  tools/testing/selftests/alsa/conf.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
tools/testing/selftests/alsa/conf.c +0 -0
index 89e3656a042d..e2b3a5810f47 100644

tools/testing/selftests/alsa/conf.c static struct card_cfg_data *conf_data_by_card(int card, bool msg) · line 108

Quoted 5 lines
tools/testing/selftests/alsa/conf.c +1 -1
@@ -105,7 +105,7 @@ static struct card_cfg_data *conf_data_by_card(int card, bool msg)
  	return NULL;
  }
 
-static int dump_config_tree(snd_config_t *top)
+static void dump_config_tree(snd_config_t *top)

OK, looks good. :)

tools/testing/selftests/alsa/conf.c static struct card_cfg_data *conf_data_by_card(int card, bool msg) · line 111

Quoted 3 lines
tools/testing/selftests/alsa/conf.c +0 -0
  {
  	snd_output_t *out;
  	int err;

thanks,

Signature · 2 lines
John Hubbard
NVIDIA