Skip to content

Commit b901562

Browse files
committed
Fix potential integer overflow in shifts (cppcheck)
1 parent 43c3e6f commit b901562

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

hal/sama5d3.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -705,11 +705,11 @@ static void dbgu_init(void) {
705705
PMC_CLOCK_EN(GPIOB_PMCID);
706706

707707
/* Disable Pull */
708-
GPIO_PPUDR(DBGU_GPIO) = (1 << DBGU_PIN_TX) | (1 << DBGU_PIN_RX);
709-
GPIO_PPDDR(DBGU_GPIO) = (1 << DBGU_PIN_TX) | (1 << DBGU_PIN_RX);
708+
GPIO_PPUDR(DBGU_GPIO) = (1U << DBGU_PIN_TX) | (1U << DBGU_PIN_RX);
709+
GPIO_PPDDR(DBGU_GPIO) = (1U << DBGU_PIN_TX) | (1U << DBGU_PIN_RX);
710710

711711
/* Set "Peripheral A" */
712-
GPIO_ASR(DBGU_GPIO) = (1 << DBGU_PIN_TX) | (1 << DBGU_PIN_RX);
712+
GPIO_ASR(DBGU_GPIO) = (1U << DBGU_PIN_TX) | (1U << DBGU_PIN_RX);
713713

714714
/* Enable the peripheral clock for the DBGU */
715715
PMC_CLOCK_EN(DBGU_PMCID);

0 commit comments

Comments
 (0)