[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20230223143214.16564-1-ivan.orlov0322@gmail.com>
Date: Thu, 23 Feb 2023 17:32:14 +0300
From: Ivan Orlov <ivan.orlov0322@...il.com>
To: broonie@...nel.org, perex@...ex.cz, tiwai@...e.com,
shuah@...nel.org
Cc: Ivan Orlov <ivan.orlov0322@...il.com>, alsa-devel@...a-project.org,
linux-kselftest@...r.kernel.org, linux-kernel@...r.kernel.org,
skhan@...uxfoundation.org
Subject: [PATCH] Fix snprintf format warnings during 'alsa' kselftest compilation
Fix 'alsa' kselftest compilation warnings by making snprintf
format correspond the actual parameters types.
Signed-off-by: Ivan Orlov <ivan.orlov0322@...il.com>
---
tools/testing/selftests/alsa/pcm-test.c | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/tools/testing/selftests/alsa/pcm-test.c b/tools/testing/selftests/alsa/pcm-test.c
index f293c7d81009..52b109a162c6 100644
--- a/tools/testing/selftests/alsa/pcm-test.c
+++ b/tools/testing/selftests/alsa/pcm-test.c
@@ -318,7 +318,7 @@ static void test_pcm_time1(struct pcm_data *data,
goto __close;
}
if (rchannels != channels) {
- snprintf(msg, sizeof(msg), "channels unsupported %ld != %ld", channels, rchannels);
+ snprintf(msg, sizeof(msg), "channels unsupported %ld != %u", channels, rchannels);
skip = true;
goto __close;
}
@@ -329,7 +329,7 @@ static void test_pcm_time1(struct pcm_data *data,
goto __close;
}
if (rrate != rate) {
- snprintf(msg, sizeof(msg), "rate unsupported %ld != %ld", rate, rrate);
+ snprintf(msg, sizeof(msg), "rate unsupported %ld != %u", rate, rrate);
skip = true;
goto __close;
}
@@ -393,24 +393,24 @@ static void test_pcm_time1(struct pcm_data *data,
frames = snd_pcm_writei(handle, samples, rate);
if (frames < 0) {
snprintf(msg, sizeof(msg),
- "Write failed: expected %d, wrote %li", rate, frames);
+ "Write failed: expected %ld, wrote %li", rate, frames);
goto __close;
}
if (frames < rate) {
snprintf(msg, sizeof(msg),
- "expected %d, wrote %li", rate, frames);
+ "expected %ld, wrote %li", rate, frames);
goto __close;
}
} else {
frames = snd_pcm_readi(handle, samples, rate);
if (frames < 0) {
snprintf(msg, sizeof(msg),
- "expected %d, wrote %li", rate, frames);
+ "expected %ld, wrote %li", rate, frames);
goto __close;
}
if (frames < rate) {
snprintf(msg, sizeof(msg),
- "expected %d, wrote %li", rate, frames);
+ "expected %ld, wrote %li", rate, frames);
goto __close;
}
}
--
2.34.1
Powered by blists - more mailing lists