diff mbox series

selftests/alsa: make dump_config_tree() as void function

Message ID 20240506075419.301780-1-perex@perex.cz (mailing list archive)
State Accepted
Commit b9112b17950c955071abfd4331d4daa162d6ec4d
Headers show
Series selftests/alsa: make dump_config_tree() as void function | expand

Commit Message

Jaroslav Kysela May 6, 2024, 7:54 a.m. UTC
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

Suggested-by: John Hubbard <jhubbard@nvidia.com>
Cc: Mark Brown <broonie@kernel.org>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
---
 tools/testing/selftests/alsa/conf.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Mark Brown May 6, 2024, 2:45 p.m. UTC | #1
On Mon, May 06, 2024 at 09:54:19AM +0200, Jaroslav Kysela 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>
Takashi Iwai May 6, 2024, 4:15 p.m. UTC | #2
On Mon, 06 May 2024 09:54:19 +0200,
Jaroslav Kysela 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
> 
> Suggested-by: John Hubbard <jhubbard@nvidia.com>
> Cc: Mark Brown <broonie@kernel.org>
> Signed-off-by: Jaroslav Kysela <perex@perex.cz>

Applied now.  Thanks.


Takashi
John Hubbard May 6, 2024, 5:39 p.m. UTC | #3
On 5/6/24 12:54 AM, Jaroslav Kysela 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
> 
> Suggested-by: John Hubbard <jhubbard@nvidia.com>
> Cc: Mark Brown <broonie@kernel.org>
> Signed-off-by: Jaroslav Kysela <perex@perex.cz>
> ---
>   tools/testing/selftests/alsa/conf.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/tools/testing/selftests/alsa/conf.c b/tools/testing/selftests/alsa/conf.c
> index 89e3656a042d..e2b3a5810f47 100644
> --- a/tools/testing/selftests/alsa/conf.c
> +++ b/tools/testing/selftests/alsa/conf.c
> @@ -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. :)

>   {
>   	snd_output_t *out;
>   	int err;

thanks,
diff mbox series

Patch

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