Skip to contentSkip to conversation

selftests/alsa: missing a return value in unused dump_config_tree()

PATCH Applied John Hubbard 4 participants 7 messages May 5, 2024 – May 6, 2024

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 selftests/alsa: missing a return value in unused dump_config_tree()

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

Furthermore, Mark Brown noticed that dump_config_tree() isn't even used anymore, so just delete the entire function.

---
 tools/testing/selftests/alsa/conf.c | 13 -------------
 1 file changed, 13 deletions(-)
tools/testing/selftests/alsa/conf.c +0 -13
index 89e3656a042d..357561c1759b 100644
@@ -105,19 +105,6 @@ static struct card_cfg_data *conf_data_by_card(int card, bool msg)
 	return NULL;
 }
 
-static int dump_config_tree(snd_config_t *top)
-{
-	snd_output_t *out;
-	int err;
-
-	err = snd_output_stdio_attach(&out, stdout, 0);
-	if (err < 0)
-		ksft_exit_fail_msg("stdout attach\n");
-	if (snd_config_save(top, out))
-		ksft_exit_fail_msg("config save\n");
-	snd_output_close(out);
-}
-
 snd_config_t *conf_load_from_file(const char *filename)
 {
 	snd_config_t *dst;

base-commit: f462ae0edd3703edd6f22fe41d336369c38b884b
prerequisite-patch-id: b901ece2a5b78503e2fb5480f20e304d36a0ea27

Signature · 1 line
2.45.0
maintainer Reviewed-by on v2 1/1
#1 lore raw
Quoted 3 lines · John Hubbard

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:

Applied
#2 lore raw
In reply to John Hubbard
Quoted 5 lines · John Hubbard

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:

Quoted 7 lines

make LLVM=1 -C tools/testing/selftests

Furthermore, Mark Brown noticed that dump_config_tree() isn't even used anymore, so just delete the entire function.

Thanks, applied now.

Takashi

maintainer
#3 lore raw
Quoted 9 lines · Takashi Iwai
Quoted 7 lines · John Hubbard

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

Quoted 7 lines
Quoted 5 lines

Furthermore, Mark Brown noticed that dump_config_tree() isn't even used anymore, so just delete the entire function.

Thanks, applied now.

This function is nice for debugging. I'd prefer to keep it with the fix.

Jaroslav

Signature · 2 lines
Jaroslav Kysela <[email protected]>
Linux Sound Maintainer; ALSA Project; Red Hat, Inc.
#4 lore raw
Quoted 14 lines · Jaroslav Kysela
Quoted 12 lines · Takashi Iwai
Quoted 10 lines · John Hubbard

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

Furthermore, Mark Brown noticed that dump_config_tree() isn't even used anymore, so just delete the entire function.

Quoted 6 lines
Quoted 4 lines
Quoted 2 lines

Thanks, applied now.

This function is nice for debugging. I'd prefer to keep it with the fix.

I'm find in either way; just submit a fix patch, then.

thanks,

Takashi

maintainer
#5 lore raw
Quoted 5 lines · Takashi Iwai
Quoted 1 line · Jaroslav Kysela

This function is nice for debugging. I'd prefer to keep it with the fix.

I'm find in either way; just submit a fix patch, then.

The fix was already submitted as v1, I noticed that the function was unused in review.

#6 lore raw
Quoted 9 lines · Mark Brown
Quoted 5 lines · Takashi Iwai
Quoted 1 line · Jaroslav Kysela

This function is nice for debugging. I'd prefer to keep it with the fix.

I'm find in either way; just submit a fix patch, then.

The fix was already submitted as v1, I noticed that the function was unused in review.

It's generally considered a best practice to delete unused code. If there is something you especially like for upcoming code, you still have git history, and even a lore.kernel.org link, to bookmark it.

So I'd recommend going with v2, but of course it's your call! :)

thanks,

Signature · 2 lines
John Hubbard
NVIDIA