lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <20250502042240.17371-1-haiyuewa@163.com>
Date: Fri,  2 May 2025 12:22:20 +0800
From: Haiyue Wang <haiyuewa@....com>
To: netdev@...r.kernel.org
Cc: Haiyue Wang <haiyuewa@....com>,
	Andrew Lunn <andrew+netdev@...n.ch>,
	"David S. Miller" <davem@...emloft.net>,
	Eric Dumazet <edumazet@...gle.com>,
	Jakub Kicinski <kuba@...nel.org>,
	Paolo Abeni <pabeni@...hat.com>,
	Shuah Khan <shuah@...nel.org>,
	Jens Axboe <axboe@...nel.dk>,
	David Wei <dw@...idwei.uk>,
	linux-kselftest@...r.kernel.org (open list:KERNEL SELFTEST FRAMEWORK),
	linux-kernel@...r.kernel.org (open list)
Subject: [PATCH net v1] 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]:
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@....com>
---
 tools/testing/selftests/drivers/net/hw/iou-zcrx.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/tools/testing/selftests/drivers/net/hw/iou-zcrx.c b/tools/testing/selftests/drivers/net/hw/iou-zcrx.c
index c26b4180eddd..19e1ff45deb4 100644
--- a/tools/testing/selftests/drivers/net/hw/iou-zcrx.c
+++ b/tools/testing/selftests/drivers/net/hw/iou-zcrx.c
@@ -260,7 +260,7 @@ static void process_recvzc(struct io_uring *ring, struct io_uring_cqe *cqe)
 
 	for (i = 0; i < n; i++) {
 		if (*(data + i) != payload[(received + i)])
-			error(1, 0, "payload mismatch at ", i);
+			error(1, 0, "payload mismatch at %d", i);
 	}
 	received += n;
 
@@ -354,7 +354,7 @@ static void run_client(void)
 		chunk = min_t(ssize_t, cfg_payload_len, to_send);
 		res = send(fd, src, chunk, 0);
 		if (res < 0)
-			error(1, 0, "send(): %d", sent);
+			error(1, 0, "send(): %ld", sent);
 		sent += res;
 		to_send -= res;
 	}
-- 
2.49.0


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ