@@ -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;
}
}
Fix 'alsa' kselftest compilation warnings by making snprintf format correspond the actual parameters types. Signed-off-by: Ivan Orlov <ivan.orlov0322@gmail.com> --- tools/testing/selftests/alsa/pcm-test.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-)