From 0bafb10a690de4165114e53d60d616dc64952d8e Mon Sep 17 00:00:00 2001 From: Matteo Concas Date: Wed, 5 Feb 2025 10:04:23 +0100 Subject: [PATCH] grlib/grcanfd: Use signed integer to account for errors --- bsps/shared/grlib/can/grcanfd.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/bsps/shared/grlib/can/grcanfd.c b/bsps/shared/grlib/can/grcanfd.c index e50280c41c..e95df0f853 100644 --- a/bsps/shared/grlib/can/grcanfd.c +++ b/bsps/shared/grlib/can/grcanfd.c @@ -94,7 +94,7 @@ static uint8_t len2fddlc[14] = { }; /* Convert length in bytes to descriptor length field */ -static inline uint8_t grcan_len2dlc(int len) +static inline int8_t grcan_len2dlc(int len) { if (len <= 8) return len; @@ -313,7 +313,7 @@ static int grcan_hw_write_try_fd( unsigned int tmp; int i, bds; uint64_t *dp; - uint8_t dlc; + int8_t dlc; SPIN_IRQFLAGS(oldLevel); DBGC(DBG_TX, "\n");