Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

selftests: iou-zcrx: Clean up build warnings for error format

Clean up two build warnings:

[1]

iou-zcrx.c: In function ‘process_recvzc’:
iou-zcrx.c:263:37: warning: too many arguments for format [-Wformat-extra-args]
263 | error(1, 0, "payload mismatch at ", i);
| ^~~~~~~~~~~~~~~~~~~~~~

[2] Use "%zd" for ssize_t type as better

iou-zcrx.c: In function ‘run_client’:
iou-zcrx.c:357:47: warning: format ‘%d’ expects argument of type ‘int’, but argument 4 has type ‘ssize_t’ {aka ‘long int’} [-Wformat=]
357 | error(1, 0, "send(): %d", sent);
| ~^ ~~~~
| | |
| int ssize_t {aka long int}
| %ld

Signed-off-by: Haiyue Wang <haiyuewa@163.com>
Reviewed-by: David Wei <dw@davidwei.uk>
Link: https://patch.msgid.link/20250502175136.1122-1-haiyuewa@163.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>

authored by

Haiyue Wang and committed by
Jakub Kicinski
953d9480 d8b1a33a

+2 -2
+2 -2
tools/testing/selftests/drivers/net/hw/iou-zcrx.c
··· 260 260 261 261 for (i = 0; i < n; i++) { 262 262 if (*(data + i) != payload[(received + i)]) 263 - error(1, 0, "payload mismatch at ", i); 263 + error(1, 0, "payload mismatch at %d", i); 264 264 } 265 265 received += n; 266 266 ··· 354 354 chunk = min_t(ssize_t, cfg_payload_len, to_send); 355 355 res = send(fd, src, chunk, 0); 356 356 if (res < 0) 357 - error(1, 0, "send(): %d", sent); 357 + error(1, 0, "send(): %zd", sent); 358 358 sent += res; 359 359 to_send -= res; 360 360 }