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:
+13
-12
@@ -223,19 +223,21 @@ int main(int argc, char **argv)
|
||||
ret = nbytes;
|
||||
running = 0;
|
||||
continue;
|
||||
} else if (nbytes != CAN_MTU && nbytes != CANFD_MTU) {
|
||||
}
|
||||
if (nbytes != CAN_MTU && nbytes != CANFD_MTU) {
|
||||
fprintf(stderr, "read: incomplete CAN frame %zu %d\n", sizeof(frame), nbytes);
|
||||
ret = nbytes;
|
||||
running = 0;
|
||||
continue;
|
||||
} else {
|
||||
if (rcvlen) {
|
||||
/* make sure to process only the detected PDU CAN frame type */
|
||||
if (canfd_on && (nbytes != CANFD_MTU))
|
||||
continue;
|
||||
if (!canfd_on && (nbytes != CAN_MTU))
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
if (rcvlen) {
|
||||
/* make sure to process only the detected PDU CAN frame type */
|
||||
if (canfd_on && (nbytes != CANFD_MTU))
|
||||
continue;
|
||||
if (!canfd_on && (nbytes != CAN_MTU))
|
||||
continue;
|
||||
}
|
||||
|
||||
/* check extended address if provided */
|
||||
if (ext && extaddr != frame.data[0])
|
||||
@@ -255,7 +257,7 @@ int main(int argc, char **argv)
|
||||
} else
|
||||
continue;
|
||||
}
|
||||
|
||||
|
||||
/* data content starts and index datidx */
|
||||
datidx = 0;
|
||||
|
||||
@@ -355,7 +357,7 @@ int main(int argc, char **argv)
|
||||
if (rcvlen) {
|
||||
if (rcvlen > fflen)
|
||||
rcvlen = fflen;
|
||||
|
||||
|
||||
percent = (rcvlen * 100 / fflen);
|
||||
printf("\r %3lu%% ", percent);
|
||||
|
||||
@@ -408,7 +410,6 @@ int main(int argc, char **argv)
|
||||
fflen = rcvlen = 0;
|
||||
}
|
||||
fflush(stdout);
|
||||
}
|
||||
}
|
||||
|
||||
close(s);
|
||||
|
||||
Reference in New Issue
Block a user