public inbox for llvm@lists.linux.dev
 help / color / mirror / Atom feed
From: John Hubbard <jhubbard@nvidia.com>
To: Shuah Khan <shuah@kernel.org>
Cc: Mark Brown <broonie@kernel.org>, Jaroslav Kysela <perex@perex.cz>,
	Takashi Iwai <tiwai@suse.com>,
	Ivan Orlov <ivan.orlov0322@gmail.com>,
	linux-sound@vger.kernel.org,
	Valentin Obst <kernel@valentinobst.de>,
	linux-kselftest@vger.kernel.org,
	LKML <linux-kernel@vger.kernel.org>,
	llvm@lists.linux.dev, John Hubbard <jhubbard@nvidia.com>
Subject: [PATCH] selftests/alsa: fix a build warning: return a value in all cases
Date: Fri,  3 May 2024 19:13:30 -0700	[thread overview]
Message-ID: <20240504021330.33429-1-jhubbard@nvidia.com> (raw)

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

Fix this by unconditionally returning the "err" variable if the code
reaches the end of the function.

Signed-off-by: John Hubbard <jhubbard@nvidia.com>
---
 tools/testing/selftests/alsa/conf.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/tools/testing/selftests/alsa/conf.c b/tools/testing/selftests/alsa/conf.c
index 89e3656a042d..0109fde53e6f 100644
--- a/tools/testing/selftests/alsa/conf.c
+++ b/tools/testing/selftests/alsa/conf.c
@@ -116,6 +116,8 @@ static int dump_config_tree(snd_config_t *top)
 	if (snd_config_save(top, out))
 		ksft_exit_fail_msg("config save\n");
 	snd_output_close(out);
+
+	return err;
 }
 
 snd_config_t *conf_load_from_file(const char *filename)

base-commit: ddb4c3f25b7b95df3d6932db0b379d768a6ebdf7
prerequisite-patch-id: b901ece2a5b78503e2fb5480f20e304d36a0ea27
-- 
2.45.0


             reply	other threads:[~2024-05-04  2:13 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-05-04  2:13 John Hubbard [this message]
2024-05-05 14:52 ` [PATCH] selftests/alsa: fix a build warning: return a value in all cases Mark Brown
2024-05-05 14:53 ` Mark Brown
2024-05-05 20:57   ` John Hubbard

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20240504021330.33429-1-jhubbard@nvidia.com \
    --to=jhubbard@nvidia.com \
    --cc=broonie@kernel.org \
    --cc=ivan.orlov0322@gmail.com \
    --cc=kernel@valentinobst.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-kselftest@vger.kernel.org \
    --cc=linux-sound@vger.kernel.org \
    --cc=llvm@lists.linux.dev \
    --cc=perex@perex.cz \
    --cc=shuah@kernel.org \
    --cc=tiwai@suse.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox