[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <bd7b8c9c-7169-6dfb-969b-6e879af8acb6@infradead.org>
Date: Sat, 5 Nov 2022 11:45:44 -0700
From: Randy Dunlap <rdunlap@...radead.org>
To: Kang Minchul <tegongkang@...il.com>,
Björn Töpel <bjorn@...nel.org>,
Magnus Karlsson <magnus.karlsson@...el.com>,
Maciej Fijalkowski <maciej.fijalkowski@...el.com>,
Jonathan Lemon <jonathan.lemon@...il.com>
Cc: Martin KaFai Lau <martin.lau@...ux.dev>,
Song Liu <song@...nel.org>, Yonghong Song <yhs@...com>,
netdev@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH v3] selftests/bpf: Fix u32 variable compared with less
than zero
On 11/5/22 11:36, Kang Minchul wrote:
> Variable ret is compared with less than zero even though it was set as u32.
> So u32 to int conversion is needed.
>
> Signed-off-by: Kang Minchul <tegongkang@...il.com>
Acked-by: Randy Dunlap <rdunlap@...radead.org>
Thanks.
> ---
> 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) {
Powered by blists - more mailing lists