Commit e8f50c4f authored by Kang Minchul's avatar Kang Minchul Committed by Martin KaFai Lau

selftests/bpf: Fix u32 variable compared with less than zero

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: default avatarKang Minchul <tegongkang@gmail.com>
Acked-by: default avatarRandy Dunlap <rdunlap@infradead.org>
Acked-by: default avatarBjörn Töpel <bjorn@kernel.org>
Link: https://lore.kernel.org/r/20221105183656.86077-1-tegongkang@gmail.comSigned-off-by: default avatarMartin KaFai Lau <martin.lau@kernel.org>
parent 25906092
......@@ -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) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment