All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] Fix snprintf format warnings during 'alsa' kselftest compilation
@ 2023-02-23 14:32 Ivan Orlov
  2023-02-23 15:05   ` Mark Brown
  0 siblings, 1 reply; 7+ messages in thread
From: Ivan Orlov @ 2023-02-23 14:32 UTC (permalink / raw)
  To: broonie, perex, tiwai, shuah
  Cc: Ivan Orlov, alsa-devel, linux-kselftest, linux-kernel, skhan

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(-)

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


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

end of thread, other threads:[~2023-02-27 14:13 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-02-23 14:32 [PATCH] Fix snprintf format warnings during 'alsa' kselftest compilation Ivan Orlov
2023-02-23 15:05 ` Mark Brown
2023-02-23 15:05   ` Mark Brown
2023-02-23 20:14   ` Ivan Orlov
2023-02-23 20:14     ` Ivan Orlov
2023-02-27 14:12     ` Mark Brown
2023-02-27 14:12       ` Mark Brown

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.