Skip to content

Commit e8f50c4

Browse files
kangtegongMartin KaFai Lau
authored andcommitted
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: Kang Minchul <tegongkang@gmail.com> Acked-by: Randy Dunlap <rdunlap@infradead.org> Acked-by: Björn Töpel <bjorn@kernel.org> Link: https://lore.kernel.org/r/20221105183656.86077-1-tegongkang@gmail.com Signed-off-by: Martin KaFai Lau <martin.lau@kernel.org>
1 parent 2590609 commit e8f50c4

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

tools/testing/selftests/bpf/xskxceiver.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1006,7 +1006,8 @@ static int __send_pkts(struct ifobject *ifobject, u32 *pkt_nb, struct pollfd *fd
10061006
{
10071007
struct xsk_socket_info *xsk = ifobject->xsk;
10081008
bool use_poll = ifobject->use_poll;
1009-
u32 i, idx = 0, ret, valid_pkts = 0;
1009+
u32 i, idx = 0, valid_pkts = 0;
1010+
int ret;
10101011

10111012
while (xsk_ring_prod__reserve(&xsk->tx, BATCH_SIZE, &idx) < BATCH_SIZE) {
10121013
if (use_poll) {

0 commit comments

Comments
 (0)