Linux Kernel Selftest development
 help / color / mirror / Atom feed
* [PATCH v2] selftests/alsa: missing a return value in unused dump_config_tree()
@ 2024-05-05 21:08 John Hubbard
  2024-05-06  1:04 ` Mark Brown
  2024-05-06  7:19 ` Takashi Iwai
  0 siblings, 2 replies; 7+ messages in thread
From: John Hubbard @ 2024-05-05 21:08 UTC (permalink / raw)
  To: Shuah Khan
  Cc: Mark Brown, Jaroslav Kysela, Takashi Iwai, Ivan Orlov,
	linux-sound, Valentin Obst, linux-kselftest, LKML, llvm,
	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.

Cc: Mark Brown <broonie@kernel.org>
Signed-off-by: John Hubbard <jhubbard@nvidia.com>
---
 tools/testing/selftests/alsa/conf.c | 13 -------------
 1 file changed, 13 deletions(-)

diff --git a/tools/testing/selftests/alsa/conf.c b/tools/testing/selftests/alsa/conf.c
index 89e3656a042d..357561c1759b 100644
--- a/tools/testing/selftests/alsa/conf.c
+++ b/tools/testing/selftests/alsa/conf.c
@@ -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
-- 
2.45.0


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* Re: [PATCH v2] selftests/alsa: missing a return value in unused dump_config_tree()
  2024-05-05 21:08 [PATCH v2] selftests/alsa: missing a return value in unused dump_config_tree() John Hubbard
@ 2024-05-06  1:04 ` Mark Brown
  2024-05-06  7:19 ` Takashi Iwai
  1 sibling, 0 replies; 7+ messages in thread
From: Mark Brown @ 2024-05-06  1:04 UTC (permalink / raw)
  To: John Hubbard
  Cc: Shuah Khan, Jaroslav Kysela, Takashi Iwai, Ivan Orlov,
	linux-sound, Valentin Obst, linux-kselftest, LKML, llvm

[-- Attachment #1: Type: text/plain, Size: 284 bytes --]

On Sun, May 05, 2024 at 02:08:24PM -0700, John Hubbard wrote:
> 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:

Reviewed-by: Mark Brown <broonie@kernel.org>

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH v2] selftests/alsa: missing a return value in unused dump_config_tree()
  2024-05-05 21:08 [PATCH v2] selftests/alsa: missing a return value in unused dump_config_tree() John Hubbard
  2024-05-06  1:04 ` Mark Brown
@ 2024-05-06  7:19 ` Takashi Iwai
  2024-05-06  7:27   ` Jaroslav Kysela
  1 sibling, 1 reply; 7+ messages in thread
From: Takashi Iwai @ 2024-05-06  7:19 UTC (permalink / raw)
  To: John Hubbard
  Cc: Shuah Khan, Mark Brown, Jaroslav Kysela, Takashi Iwai, Ivan Orlov,
	linux-sound, Valentin Obst, linux-kselftest, LKML, llvm

On Sun, 05 May 2024 23:08:24 +0200,
John Hubbard wrote:
> 
> 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.
> 
> Cc: Mark Brown <broonie@kernel.org>
> Signed-off-by: John Hubbard <jhubbard@nvidia.com>

Thanks, applied now.


Takashi

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH v2] selftests/alsa: missing a return value in unused dump_config_tree()
  2024-05-06  7:19 ` Takashi Iwai
@ 2024-05-06  7:27   ` Jaroslav Kysela
  2024-05-06  7:45     ` Takashi Iwai
  0 siblings, 1 reply; 7+ messages in thread
From: Jaroslav Kysela @ 2024-05-06  7:27 UTC (permalink / raw)
  To: Takashi Iwai, John Hubbard
  Cc: Shuah Khan, Mark Brown, Takashi Iwai, Ivan Orlov, linux-sound,
	Valentin Obst, linux-kselftest, LKML, llvm

On 06. 05. 24 9:19, Takashi Iwai wrote:
> On Sun, 05 May 2024 23:08:24 +0200,
> John Hubbard wrote:
>>
>> 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.
>>
>> Cc: Mark Brown <broonie@kernel.org>
>> Signed-off-by: John Hubbard <jhubbard@nvidia.com>
> 
> Thanks, applied now.

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

				Jaroslav

-- 
Jaroslav Kysela <perex@perex.cz>
Linux Sound Maintainer; ALSA Project; Red Hat, Inc.


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH v2] selftests/alsa: missing a return value in unused dump_config_tree()
  2024-05-06  7:27   ` Jaroslav Kysela
@ 2024-05-06  7:45     ` Takashi Iwai
  2024-05-06 14:44       ` Mark Brown
  0 siblings, 1 reply; 7+ messages in thread
From: Takashi Iwai @ 2024-05-06  7:45 UTC (permalink / raw)
  To: Jaroslav Kysela
  Cc: Takashi Iwai, John Hubbard, Shuah Khan, Mark Brown, Takashi Iwai,
	Ivan Orlov, linux-sound, Valentin Obst, linux-kselftest, LKML,
	llvm

On Mon, 06 May 2024 09:27:38 +0200,
Jaroslav Kysela wrote:
> 
> On 06. 05. 24 9:19, Takashi Iwai wrote:
> > On Sun, 05 May 2024 23:08:24 +0200,
> > John Hubbard wrote:
> >> 
> >> 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.
> >> 
> >> Cc: Mark Brown <broonie@kernel.org>
> >> Signed-off-by: John Hubbard <jhubbard@nvidia.com>
> > 
> > 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

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH v2] selftests/alsa: missing a return value in unused dump_config_tree()
  2024-05-06  7:45     ` Takashi Iwai
@ 2024-05-06 14:44       ` Mark Brown
  2024-05-06 17:25         ` John Hubbard
  0 siblings, 1 reply; 7+ messages in thread
From: Mark Brown @ 2024-05-06 14:44 UTC (permalink / raw)
  To: Takashi Iwai
  Cc: Jaroslav Kysela, John Hubbard, Shuah Khan, Takashi Iwai,
	Ivan Orlov, linux-sound, Valentin Obst, linux-kselftest, LKML,
	llvm

[-- Attachment #1: Type: text/plain, Size: 311 bytes --]

On Mon, May 06, 2024 at 09:45:21AM +0200, Takashi Iwai wrote:
> Jaroslav Kysela wrote:

> > 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.

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH v2] selftests/alsa: missing a return value in unused dump_config_tree()
  2024-05-06 14:44       ` Mark Brown
@ 2024-05-06 17:25         ` John Hubbard
  0 siblings, 0 replies; 7+ messages in thread
From: John Hubbard @ 2024-05-06 17:25 UTC (permalink / raw)
  To: Mark Brown, Takashi Iwai
  Cc: Jaroslav Kysela, Shuah Khan, Takashi Iwai, Ivan Orlov,
	linux-sound, Valentin Obst, linux-kselftest, LKML, llvm

On 5/6/24 7:44 AM, Mark Brown wrote:
> On Mon, May 06, 2024 at 09:45:21AM +0200, Takashi Iwai wrote:
>> Jaroslav Kysela wrote:
> 
>>> 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,
-- 
John Hubbard
NVIDIA


^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2024-05-06 17:25 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-05-05 21:08 [PATCH v2] selftests/alsa: missing a return value in unused dump_config_tree() John Hubbard
2024-05-06  1:04 ` Mark Brown
2024-05-06  7:19 ` Takashi Iwai
2024-05-06  7:27   ` Jaroslav Kysela
2024-05-06  7:45     ` Takashi Iwai
2024-05-06 14:44       ` Mark Brown
2024-05-06 17:25         ` John Hubbard

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox