On 28.10.20 12:03, Marc Kleine-Budde wrote:
On 10/28/20 12:00 PM, Oliver Hartkopp wrote:
The macro was always used together with can_dlc2len() which sanitizes the
given dlc value on its own.
Signed-off-by: Oliver Hartkopp <socketcan@xxxxxxxxxxxx>
---
drivers/net/can/flexcan.c | 2 +-
drivers/net/can/peak_canfd/peak_canfd.c | 2 +-
drivers/net/can/spi/mcp251xfd/mcp251xfd-core.c | 2 +-
drivers/net/can/usb/kvaser_usb/kvaser_usb_hydra.c | 2 +-
drivers/net/can/usb/peak_usb/pcan_usb_fd.c | 2 +-
include/linux/can/dev.h | 1 -
include/linux/can/dev/peak_canfd.h | 2 +-
7 files changed, 6 insertions(+), 7 deletions(-)
diff --git a/drivers/net/can/flexcan.c b/drivers/net/can/flexcan.c
index b30e3171cbd0..137f46705814 100644
--- a/drivers/net/can/flexcan.c
+++ b/drivers/net/can/flexcan.c
@@ -996,11 +996,11 @@ static struct sk_buff *flexcan_mailbox_read(struct can_rx_offload *offload,
cfd->can_id = ((reg_id >> 0) & CAN_EFF_MASK) | CAN_EFF_FLAG;
else
cfd->can_id = (reg_id >> 18) & CAN_SFF_MASK;
if (reg_ctrl & FLEXCAN_MB_CNT_EDL) {
- cfd->len = can_dlc2len(get_canfd_dlc((reg_ctrl >> 16) & 0xf));
+ cfd->len = can_dlc2len((u8)((reg_ctrl >> 16) & 0xf));
^^^^
where does this come from?
can_dlc2len(u8 dlc) needs an u8 and reg_ctrl is u32.
All other users of can_dlc2can already provide an u8 value to can_dlc2len().
Best,
Oliver