Re: [PATCH v3] can: mcan: Add support for handling DLEC error on CAN FD

From: Marc Kleine-Budde
Date: Fri Oct 14 2022 - 09:02:51 EST


On 14.10.2022 17:16:13, Vivek Yadav wrote:
> When a frame in CAN FD format has reached the data phase, the next
> CAN event (error or valid frame) will be shown in DLEC.
>
> Utilizes the dedicated flag (Data Phase Last Error Code: DLEC flag) to
> determine the type of last error that occurred in the data phase
> of a CAN FD frame and handle the bus errors.

Can you please test your code before sending it.

| drivers/net/can/m_can/m_can.c: In function ‘m_can_handle_bus_errors’:
| include/linux/build_bug.h:16:51: error: negative width in bit-field ‘<anonymous>’
| 16 | #define BUILD_BUG_ON_ZERO(e) ((int)(sizeof(struct { int:(-!!(e)); })))
[...]
| drivers/net/can/m_can/m_can.c:883:17: warning: ISO C90 forbids mixed declarations and code [-Wdeclaration-after-statement]
| 883 | u8 dlec = FIELD_GET(PSR_DLEC_MASK, psr);
| | ^~

regards,
Marc

--
Pengutronix e.K. | Marc Kleine-Budde |
Embedded Linux | https://www.pengutronix.de |
Vertretung West/Dortmund | Phone: +49-231-2826-924 |
Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 |

Attachment: signature.asc
Description: PGP signature