diff options
author | Oliver Hartkopp <socketcan@hartkopp.net> | 2020-11-20 13:04:44 +0300 |
---|---|---|
committer | Marc Kleine-Budde <mkl@pengutronix.de> | 2020-11-20 14:04:12 +0300 |
commit | c7b74967799b1af52b3045d69d4c26836b2d41de (patch) | |
tree | 8ea93c983077794b4ea8825facfd35c3208da9cb /drivers/net/can/usb/mcba_usb.c | |
parent | cd1124e76d740327be5d8f9ce3785ce1119daf4b (diff) | |
download | linux-c7b74967799b1af52b3045d69d4c26836b2d41de.tar.xz |
can: replace can_dlc as variable/element for payload length
The naming of can_dlc as element of struct can_frame and also as variable
name is misleading as it claims to be a 'data length CODE' but in reality
it always was a plain data length.
With the indroduction of a new 'len' element in struct can_frame we can now
remove can_dlc as name and make clear which of the former uses was a plain
length (-> 'len') or a data length code (-> 'dlc') value.
Signed-off-by: Oliver Hartkopp <socketcan@hartkopp.net>
Link: https://lore.kernel.org/r/20201120100444.3199-1-socketcan@hartkopp.net
[mkl: gs_usb: keep struct gs_host_frame::can_dlc as is]
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
Diffstat (limited to 'drivers/net/can/usb/mcba_usb.c')
-rw-r--r-- | drivers/net/can/usb/mcba_usb.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/drivers/net/can/usb/mcba_usb.c b/drivers/net/can/usb/mcba_usb.c index 295886c6b565..df54eb7d4b36 100644 --- a/drivers/net/can/usb/mcba_usb.c +++ b/drivers/net/can/usb/mcba_usb.c @@ -184,7 +184,7 @@ static inline struct mcba_usb_ctx *mcba_usb_get_free_ctx(struct mcba_priv *priv, if (cf) { ctx->can = true; - ctx->dlc = cf->can_dlc; + ctx->dlc = cf->len; } else { ctx->can = false; ctx->dlc = 0; @@ -348,7 +348,7 @@ static netdev_tx_t mcba_usb_start_xmit(struct sk_buff *skb, usb_msg.eid = 0; } - usb_msg.dlc = cf->can_dlc; + usb_msg.dlc = cf->len; memcpy(usb_msg.data, cf->data, usb_msg.dlc); @@ -451,12 +451,12 @@ static void mcba_usb_process_can(struct mcba_priv *priv, if (msg->dlc & MCBA_DLC_RTR_MASK) cf->can_id |= CAN_RTR_FLAG; - cf->can_dlc = can_cc_dlc2len(msg->dlc & MCBA_DLC_MASK); + cf->len = can_cc_dlc2len(msg->dlc & MCBA_DLC_MASK); - memcpy(cf->data, msg->data, cf->can_dlc); + memcpy(cf->data, msg->data, cf->len); stats->rx_packets++; - stats->rx_bytes += cf->can_dlc; + stats->rx_bytes += cf->len; can_led_event(priv->netdev, CAN_LED_EVENT_RX); netif_rx(skb); |