netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net-next v2] selftests: iou-zcrx: Clean up build warnings for error format
@ 2025-05-02 17:50 Haiyue Wang
  2025-05-03  3:24 ` David Wei
  2025-05-06  1:00 ` patchwork-bot+netdevbpf
  0 siblings, 2 replies; 4+ messages in thread
From: Haiyue Wang @ 2025-05-02 17:50 UTC (permalink / raw)
  To: netdev
  Cc: Haiyue Wang, Andrew Lunn, David S. Miller, Eric Dumazet,
	Jakub Kicinski, Paolo Abeni, Shuah Khan, David Wei, Jens Axboe,
	Simon Horman, open list:KERNEL SELFTEST FRAMEWORK, open list

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>
---
v2:
  - Dont't wrap the build warning message to make scripts/checkpatch.pl happy,
    keep it as for readability.
  - Change the format for ssize_t from "%ld" to "%zd" as Simon suggested.
  - Change the target to net-next tree.
v1: https://lore.kernel.org/netdev/20250502042240.17371-1-haiyuewa@163.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 8aa426014c87..62456df947bc 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(): %zd", sent);
 		sent += res;
 		to_send -= res;
 	}
-- 
2.49.0


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

* Re: [PATCH net-next v2] selftests: iou-zcrx: Clean up build warnings for error format
  2025-05-02 17:50 [PATCH net-next v2] selftests: iou-zcrx: Clean up build warnings for error format Haiyue Wang
@ 2025-05-03  3:24 ` David Wei
  2025-05-03  8:29   ` Haiyue Wang
  2025-05-06  1:00 ` patchwork-bot+netdevbpf
  1 sibling, 1 reply; 4+ messages in thread
From: David Wei @ 2025-05-03  3:24 UTC (permalink / raw)
  To: Haiyue Wang, netdev
  Cc: Andrew Lunn, David S. Miller, Eric Dumazet, Jakub Kicinski,
	Paolo Abeni, Shuah Khan, Jens Axboe, Simon Horman,
	open list:KERNEL SELFTEST FRAMEWORK, open list

On 5/2/25 10:50, Haiyue Wang wrote:
> 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>

> ---
> v2:
>    - Dont't wrap the build warning message to make scripts/checkpatch.pl happy,
>      keep it as for readability.
>    - Change the format for ssize_t from "%ld" to "%zd" as Simon suggested.
>    - Change the target to net-next tree.
> v1: https://lore.kernel.org/netdev/20250502042240.17371-1-haiyuewa@163.com/

Thanks for the cleanups. But next time please note that there is a 24h
cooldown on respins in netdev.

Reviewed-by: David Wei <dw@davidwei.uk>

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

* Re: [PATCH net-next v2] selftests: iou-zcrx: Clean up build warnings for error format
  2025-05-03  3:24 ` David Wei
@ 2025-05-03  8:29   ` Haiyue Wang
  0 siblings, 0 replies; 4+ messages in thread
From: Haiyue Wang @ 2025-05-03  8:29 UTC (permalink / raw)
  To: David Wei, netdev
  Cc: Andrew Lunn, David S. Miller, Eric Dumazet, Jakub Kicinski,
	Paolo Abeni, Shuah Khan, Jens Axboe, Simon Horman,
	open list:KERNEL SELFTEST FRAMEWORK, open list

On 2025/5/3 11:24, David Wei wrote:
> On 5/2/25 10:50, Haiyue Wang wrote:
>> 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>
> 
>> ---
>> v2:
>>    - Dont't wrap the build warning message to make scripts/ 
>> checkpatch.pl happy,
>>      keep it as for readability.
>>    - Change the format for ssize_t from "%ld" to "%zd" as Simon 
>> suggested.
>>    - Change the target to net-next tree.
>> v1: https://lore.kernel.org/netdev/20250502042240.17371-1- 
>> haiyuewa@163.com/
> 
> Thanks for the cleanups. But next time please note that there is a 24h
> cooldown on respins in netdev.

Will take care next time. Thanks, David.

> 
> Reviewed-by: David Wei <dw@davidwei.uk>


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

* Re: [PATCH net-next v2] selftests: iou-zcrx: Clean up build warnings for error format
  2025-05-02 17:50 [PATCH net-next v2] selftests: iou-zcrx: Clean up build warnings for error format Haiyue Wang
  2025-05-03  3:24 ` David Wei
@ 2025-05-06  1:00 ` patchwork-bot+netdevbpf
  1 sibling, 0 replies; 4+ messages in thread
From: patchwork-bot+netdevbpf @ 2025-05-06  1:00 UTC (permalink / raw)
  To: Haiyue Wang
  Cc: netdev, andrew+netdev, davem, edumazet, kuba, pabeni, shuah, dw,
	axboe, horms, linux-kselftest, linux-kernel

Hello:

This patch was applied to netdev/net-next.git (main)
by Jakub Kicinski <kuba@kernel.org>:

On Sat,  3 May 2025 01:50:25 +0800 you wrote:
> 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);
>       |                                     ^~~~~~~~~~~~~~~~~~~~~~
> 
> [...]

Here is the summary with links:
  - [net-next,v2] selftests: iou-zcrx: Clean up build warnings for error format
    https://git.kernel.org/netdev/net-next/c/953d9480f7d1

You are awesome, thank you!
-- 
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html



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

end of thread, other threads:[~2025-05-06  0:59 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-05-02 17:50 [PATCH net-next v2] selftests: iou-zcrx: Clean up build warnings for error format Haiyue Wang
2025-05-03  3:24 ` David Wei
2025-05-03  8:29   ` Haiyue Wang
2025-05-06  1:00 ` patchwork-bot+netdevbpf

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).