From cb77e4273c11a2c96846cd29066e0621d460c6c7 Mon Sep 17 00:00:00 2001 From: Daniele Lacamera Date: Fri, 11 Oct 2024 09:19:46 +0200 Subject: [PATCH] Fix potential integer overflow in shifts (cppcheck) --- hal/sama5d3.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/hal/sama5d3.c b/hal/sama5d3.c index 2f4a8f0e8..8c79916a5 100644 --- a/hal/sama5d3.c +++ b/hal/sama5d3.c @@ -705,11 +705,11 @@ static void dbgu_init(void) { PMC_CLOCK_EN(GPIOB_PMCID); /* Disable Pull */ - GPIO_PPUDR(DBGU_GPIO) = (1 << DBGU_PIN_TX) | (1 << DBGU_PIN_RX); - GPIO_PPDDR(DBGU_GPIO) = (1 << DBGU_PIN_TX) | (1 << DBGU_PIN_RX); + GPIO_PPUDR(DBGU_GPIO) = (1U << DBGU_PIN_TX) | (1U << DBGU_PIN_RX); + GPIO_PPDDR(DBGU_GPIO) = (1U << DBGU_PIN_TX) | (1U << DBGU_PIN_RX); /* Set "Peripheral A" */ - GPIO_ASR(DBGU_GPIO) = (1 << DBGU_PIN_TX) | (1 << DBGU_PIN_RX); + GPIO_ASR(DBGU_GPIO) = (1U << DBGU_PIN_TX) | (1U << DBGU_PIN_RX); /* Enable the peripheral clock for the DBGU */ PMC_CLOCK_EN(DBGU_PMCID);