mirror of
https://github.com/linux-can/can-utils.git
synced 2026-09-22 16:09:52 +02:00
clang-tidy: do not use else after return
Found with readability-else-after-return Signed-off-by: Rosen Penev <rosenp@gmail.com>
This commit is contained in:
+20
-22
@@ -181,20 +181,18 @@ static int send_frame(struct can_frame *frame)
|
||||
|
||||
while ((ret = send(sockfd, frame, sizeof(*frame), 0))
|
||||
!= sizeof(*frame)) {
|
||||
if (ret < 0) {
|
||||
if (errno != ENOBUFS) {
|
||||
perror("send failed");
|
||||
return -1;
|
||||
} else {
|
||||
if (verbose) {
|
||||
printf("N");
|
||||
fflush(stdout);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if (ret >= 0) {
|
||||
fprintf(stderr, "send returned %d", ret);
|
||||
return -1;
|
||||
}
|
||||
if (errno != ENOBUFS) {
|
||||
perror("send failed");
|
||||
return -1;
|
||||
}
|
||||
if (verbose) {
|
||||
printf("N");
|
||||
fflush(stdout);
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
@@ -332,19 +330,19 @@ static int can_echo_gen(void)
|
||||
if (recv_tx_pos == inflight_count)
|
||||
recv_tx_pos = 0;
|
||||
continue;
|
||||
} else {
|
||||
if (!recv_tx[recv_rx_pos]) {
|
||||
printf("RX before TX!\n");
|
||||
print_frame(&rx_frame, 0);
|
||||
running = 0;
|
||||
}
|
||||
/* compare with expected */
|
||||
compare_frame(&tx_frames[recv_rx_pos], &rx_frame, 1);
|
||||
recv_rx_pos++;
|
||||
if (recv_rx_pos == inflight_count)
|
||||
recv_rx_pos = 0;
|
||||
}
|
||||
|
||||
if (!recv_tx[recv_rx_pos]) {
|
||||
printf("RX before TX!\n");
|
||||
print_frame(&rx_frame, 0);
|
||||
running = 0;
|
||||
}
|
||||
/* compare with expected */
|
||||
compare_frame(&tx_frames[recv_rx_pos], &rx_frame, 1);
|
||||
recv_rx_pos++;
|
||||
if (recv_rx_pos == inflight_count)
|
||||
recv_rx_pos = 0;
|
||||
|
||||
loops++;
|
||||
if (test_loops && loops >= test_loops)
|
||||
break;
|
||||
|
||||
Reference in New Issue
Block a user