From f45dd04c6797e71a9c1db79d8d414a44d8b028c1 Mon Sep 17 00:00:00 2001 From: Riccardo Date: Mon, 8 Jul 2019 17:16:15 -0700 Subject: [PATCH] cppcheck: ignore redundantAssignment and selfAssignment for registers in llcan.h --- board/drivers/llcan.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/board/drivers/llcan.h b/board/drivers/llcan.h index 488945cff15057..41f01762e0063d 100644 --- a/board/drivers/llcan.h +++ b/board/drivers/llcan.h @@ -29,6 +29,7 @@ bool llcan_set_speed(CAN_TypeDef *CAN_obj, uint32_t speed, bool loopback, bool s } // reset + // cppcheck-suppress redundantAssignment ; it's a register CAN_obj->MCR = CAN_MCR_TTCM | CAN_MCR_ABOM; #define CAN_TIMEOUT 1000000 @@ -80,6 +81,7 @@ void llcan_init(CAN_TypeDef *CAN_obj) { void llcan_clear_send(CAN_TypeDef *CAN_obj) { CAN_obj->TSR |= CAN_TSR_ABRQ0; CAN_obj->MSR &= ~(CAN_MSR_ERRI); + // cppcheck-suppress selfAssignment ; needed to clear the register CAN_obj->MSR = CAN_obj->MSR; }