summaryrefslogtreecommitdiffstats
path: root/drivers/net/can/xilinx_can.c
diff options
context:
space:
mode:
authorOliver Hartkopp <socketcan@hartkopp.net>2020-11-10 11:18:49 +0100
committerMarc Kleine-Budde <mkl@pengutronix.de>2020-11-20 12:05:14 +0100
commit3ab4ce0d6fa8c93d41df4a74ec8d2c9198be2109 (patch)
tree9d05569f468555c916dfde7e19f0eb73ef8e0582 /drivers/net/can/xilinx_can.c
parentcan: replace can_dlc as variable/element for payload length (diff)
downloadlinux-3ab4ce0d6fa8c93d41df4a74ec8d2c9198be2109.tar.xz
linux-3ab4ce0d6fa8c93d41df4a74ec8d2c9198be2109.zip
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. To fit the introduced can_cc_dlc2len for Classical CAN we rename: 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> Link: https://lore.kernel.org/r/20201110101852.1973-6-socketcan@hartkopp.net Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
Diffstat (limited to 'drivers/net/can/xilinx_can.c')
-rw-r--r--drivers/net/can/xilinx_can.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/net/can/xilinx_can.c b/drivers/net/can/xilinx_can.c
index 88831ce0f2f8..3f54edee92eb 100644
--- a/drivers/net/can/xilinx_can.c
+++ b/drivers/net/can/xilinx_can.c
@@ -583,7 +583,7 @@ static void xcan_write_frame(struct net_device *ndev, struct sk_buff *skb,
id |= XCAN_IDR_SRR_MASK;
}
- dlc = can_len2dlc(cf->len) << XCAN_DLCR_DLC_SHIFT;
+ dlc = can_fd_len2dlc(cf->len) << XCAN_DLCR_DLC_SHIFT;
if (can_is_canfd_skb(skb)) {
if (cf->flags & CANFD_BRS)
dlc |= XCAN_DLCR_BRS_MASK;
@@ -832,7 +832,7 @@ static int xcanfd_rx(struct net_device *ndev, int frame_base)
* format
*/
if (dlc & XCAN_DLCR_EDL_MASK)
- cf->len = can_dlc2len((dlc & XCAN_DLCR_DLC_MASK) >>
+ cf->len = can_fd_dlc2len((dlc & XCAN_DLCR_DLC_MASK) >>
XCAN_DLCR_DLC_SHIFT);
else
cf->len = can_cc_dlc2len((dlc & XCAN_DLCR_DLC_MASK) >>