diff options
author | Dawid Niedzwiecki <dn@semihalf.com> | 2020-10-07 12:13:52 +0200 |
---|---|---|
committer | Commit Bot <commit-bot@chromium.org> | 2020-10-27 09:35:49 +0000 |
commit | a05f7b9f469e7c171f4a737968ab5cbd11ba1253 (patch) | |
tree | ab128a89ce9206ca967ad104e307d6c0b4c33a52 /chip/stm32/usart_rx_interrupt-stm32l.c | |
parent | 3cba51e9e807e7015d81c2891c47ea4c59587a1c (diff) | |
download | chrome-ec-a05f7b9f469e7c171f4a737968ab5cbd11ba1253.tar.gz |
tree: Use new atomic_* implementation
It is done as a part of porting to Zephyr.
Since the implementation of atomic functions is done for all architectures
use atomic_* instead of deprecated_atomic_*.
Sometimes there was a compilation error "discards 'volatile' qualifier"
due to dropping "volatile" in the argument of the functions, thus
some pointers casts need to be made. It shouldn't cause any issues,
because we are sure about generated asm (store operation will be
performed).
BUG=b:169151160
BRANCH=none
TEST=buildall
Signed-off-by: Dawid Niedzwiecki <dn@semihalf.com>
Change-Id: I98f590c323c3af52035e62825e8acfa358e0805a
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2478949
Tested-by: Jett Rink <jettrink@chromium.org>
Reviewed-by: Jett Rink <jettrink@chromium.org>
Reviewed-by: Tom Hughes <tomhughes@chromium.org>
Diffstat (limited to 'chip/stm32/usart_rx_interrupt-stm32l.c')
-rw-r--r-- | chip/stm32/usart_rx_interrupt-stm32l.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/chip/stm32/usart_rx_interrupt-stm32l.c b/chip/stm32/usart_rx_interrupt-stm32l.c index c0cd03d8c9..24ca7a0487 100644 --- a/chip/stm32/usart_rx_interrupt-stm32l.c +++ b/chip/stm32/usart_rx_interrupt-stm32l.c @@ -39,14 +39,14 @@ static void usart_rx_interrupt_handler(struct usart_config const *config) if (!(status & STM32_USART_SR_RXNE)) (void)STM32_USART_RDR(config->hw->base); - deprecated_atomic_add(&config->state->rx_overrun, 1); + atomic_add((uint32_t *)&(config->state->rx_overrun), 1); } if (status & STM32_USART_SR_RXNE) { uint8_t byte = STM32_USART_RDR(base); if (!queue_add_unit(config->producer.queue, &byte)) - deprecated_atomic_add(&config->state->rx_dropped, 1); + atomic_add((uint32_t *)&(config->state->rx_dropped), 1); } } |