Netdev List
 help / color / mirror / Atom feed
* [PATCH] selftests/xsk: Fix unsigned comparison with less than zero
@ 2022-11-05 11:04 YueHaibing
  2022-11-05 11:07 ` YueHaibing
  0 siblings, 1 reply; 2+ messages in thread
From: YueHaibing @ 2022-11-05 11:04 UTC (permalink / raw)
  To: bjorn, magnus.karlsson, maciej.fijalkowski, jonathan.lemon, ast,
	daniel, andrii, martin.lau, song, yhs, john.fastabend, kpsingh,
	sdf, haoluo, jolsa, mykolal, shuah, shibin.koikkara.reeny
  Cc: netdev, bpf, linux-kselftest, linux-kernel, YueHaibing

poll() may return negative on error, 'ret' should be int.

Fixes: 3143d10b0945 ("selftests/xsk: Update poll test cases")
Signed-off-by: YueHaibing <yuehaibing@huawei.com>
---
 tools/testing/selftests/bpf/xskxceiver.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/tools/testing/selftests/bpf/xskxceiver.c b/tools/testing/selftests/bpf/xskxceiver.c
index 681a5db80dae..162d3a516f2c 100644
--- a/tools/testing/selftests/bpf/xskxceiver.c
+++ b/tools/testing/selftests/bpf/xskxceiver.c
@@ -1006,7 +1006,8 @@ static int __send_pkts(struct ifobject *ifobject, u32 *pkt_nb, struct pollfd *fd
 {
 	struct xsk_socket_info *xsk = ifobject->xsk;
 	bool use_poll = ifobject->use_poll;
-	u32 i, idx = 0, ret, valid_pkts = 0;
+	u32 i, idx = 0, valid_pkts = 0;
+	int ret;
 
 	while (xsk_ring_prod__reserve(&xsk->tx, BATCH_SIZE, &idx) < BATCH_SIZE) {
 		if (use_poll) {
-- 
2.17.1


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

* Re: [PATCH] selftests/xsk: Fix unsigned comparison with less than zero
  2022-11-05 11:04 [PATCH] selftests/xsk: Fix unsigned comparison with less than zero YueHaibing
@ 2022-11-05 11:07 ` YueHaibing
  0 siblings, 0 replies; 2+ messages in thread
From: YueHaibing @ 2022-11-05 11:07 UTC (permalink / raw)
  To: bjorn, magnus.karlsson, maciej.fijalkowski, jonathan.lemon, ast,
	daniel, andrii, martin.lau, song, yhs, john.fastabend, kpsingh,
	sdf, haoluo, jolsa, mykolal, shuah, shibin.koikkara.reeny
  Cc: netdev, bpf, linux-kselftest, linux-kernel

someone has post a fix, pls ignore this.

On 2022/11/5 19:04, YueHaibing wrote:
> poll() may return negative on error, 'ret' should be int.
>
> Fixes: 3143d10b0945 ("selftests/xsk: Update poll test cases")
> Signed-off-by: YueHaibing <yuehaibing@huawei.com>
> ---
>  tools/testing/selftests/bpf/xskxceiver.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/tools/testing/selftests/bpf/xskxceiver.c b/tools/testing/selftests/bpf/xskxceiver.c
> index 681a5db80dae..162d3a516f2c 100644
> --- a/tools/testing/selftests/bpf/xskxceiver.c
> +++ b/tools/testing/selftests/bpf/xskxceiver.c
> @@ -1006,7 +1006,8 @@ static int __send_pkts(struct ifobject *ifobject, u32 *pkt_nb, struct pollfd *fd
>  {
>  	struct xsk_socket_info *xsk = ifobject->xsk;
>  	bool use_poll = ifobject->use_poll;
> -	u32 i, idx = 0, ret, valid_pkts = 0;
> +	u32 i, idx = 0, valid_pkts = 0;
> +	int ret;
>  
>  	while (xsk_ring_prod__reserve(&xsk->tx, BATCH_SIZE, &idx) < BATCH_SIZE) {
>  		if (use_poll) {

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

end of thread, other threads:[~2022-11-05 11:07 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-11-05 11:04 [PATCH] selftests/xsk: Fix unsigned comparison with less than zero YueHaibing
2022-11-05 11:07 ` YueHaibing

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox