can: rename CAN FD related can_len2dlc and can_dlc2len helpers

The helper functions can_len2dlc and can_dlc2len are only relevant for
CAN FD data length code (DLC) conversion.

Update to latest in-kernel naming scheme:

can_dlc2len -> can_fd_dlc2len to get the payload length from the DLC
can_len2dlc -> can_fd_len2dlc to get the DLC from the payload length

Suggested-by: Vincent Mailhol <mailhol.vincent@wanadoo.fr>
Signed-off-by: Oliver Hartkopp <socketcan@hartkopp.net>
This commit is contained in:
Oliver Hartkopp
2020-11-22 19:54:58 +01:00
parent 6799180bd0
commit 972054446a
6 changed files with 13 additions and 13 deletions
+3 -3
View File
@@ -367,7 +367,7 @@ int main(int argc, char **argv)
}
/* ensure discrete CAN FD length values 0..8, 12, 16, 20, 24, 32, 64 */
frame.len = can_dlc2len(can_len2dlc(frame.len));
frame.len = can_fd_dlc2len(can_fd_len2dlc(frame.len));
} else {
/* sanitize Classical CAN 2.0 frame length */
if (len8_dlc) {
@@ -425,7 +425,7 @@ int main(int argc, char **argv)
if (dlc_mode == MODE_RANDOM) {
if (canfd)
frame.len = can_dlc2len(random() & 0xF);
frame.len = can_fd_dlc2len(random() & 0xF);
else {
frame.len = random() & 0xF;
@@ -519,7 +519,7 @@ resend:
incdlc %= CAN_MAX_RAW_DLC + 1;
if (canfd && !mix)
frame.len = can_dlc2len(incdlc);
frame.len = can_fd_dlc2len(incdlc);
else if (len8_dlc) {
if (incdlc > CAN_MAX_DLEN) {
frame.len = CAN_MAX_DLEN;